Skip to content

Commit

Permalink
Merge pull request #1329 from ServerFailure/patch-7
Browse files Browse the repository at this point in the history
[bigshot.lic] v5.2.1 additional cmds
  • Loading branch information
Deysh authored Nov 18, 2023
2 parents c424fed + 9f3ecd5 commit c58feea
Showing 1 changed file with 90 additions and 21 deletions.
111 changes: 90 additions & 21 deletions scripts/bigshot.lic
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
contributors: SpiffyJr, Tillmen, Kalros, Hazado, Tysong, Athias, Falicor, Deysh, Nisugi
game: Gemstone
tags: hunting, bigshot, combat
version: 5.2.0
version: 5.2.1
required: Lich >= 5.5.0, infomon >= 1.18.11
Setup Instructions: https://gswiki.play.net/Script_Bigshot
Expand All @@ -17,6 +17,9 @@
Version Control:
Major_change.feature_addition.bugfix
v5.2.1 (2023-11-15)
- add new efury, caststop, and wield cmd
- redo unravel/barddispel cmd
v5.2.0 (2023-10-02)
- general adjustment to group hunting
- additions to group looting for exclude individuals as well as allowing for changing looter based on encumbrance
Expand Down Expand Up @@ -2337,20 +2340,24 @@ class Bigshot
cmd_unarmed($1, npc, $2)
elsif (command =~ /^smite/i)
cmd_volnsmite(npc)
elsif (command =~ /^caststop (\d+)\s?(.*)?/i)
cmd_caststop(npc, $1.to_i, $2)
elsif (command =~ /^(?:unravel|barddispel)\s?(.*)?/i)
cmd_unravel($1, npc)
elsif (command =~ /^stomp/i)
cmd_stomp()
elsif (command =~ /^unravel/i)
cmd_unravel(npc)
elsif (command =~ /^barddispel\s+(\d+)/i)
cmd_barddispel($1.to_i, npc)
elsif (command =~ /^leech/i)
cmd_leech()
elsif (command =~ /^efury\s?(fire|cold)?/i)
cmd_efury(npc, $1)
elsif (command =~ /^dhurl/i)
cmd_dhurl()
elsif (command =~ /briar\s?(\w+)/i)
cmd_briar($1)
elsif (command =~ /^assume\s?(\w+)?\s?(\w+)?/i)
cmd_assume($1, $2)
elsif (command =~ /^wield (\w+)\s?(left|right)?/i)
cmd_wield($1, $2)
else
return if $ambusher_here
return if $obvious_hiding_player
Expand Down Expand Up @@ -2513,6 +2520,18 @@ class Bigshot
return false
end

def cmd_wield(noun, hand)
echo("cmd_wield(#{noun})") if $bigshot_debug
return if (hand.empty? || hand == 'right') && GameObj.right_hand.noun == "#{noun}"
return if hand == 'left' && GameObj.left_hand.noun == "#{noun}"
if hand.empty? || hand == 'right'
fput('store right')
else
fput('store left')
end
fput("get my #{noun}")
end

def cmd_assault(npc, cmd)
echo "cmd_assault - npc: #{npc} cmd: #{cmd}" if $bigshot_debug

Expand Down Expand Up @@ -2710,28 +2729,54 @@ class Bigshot
}
end

def cmd_unravel(target)
echo "cmd_unravel" if $bigshot_debug
return if target.status =~ /dead|gone/ || !GameObj.targets.any? { |s| s.id == target.id }
return unless Spell[1013].known? and Spell[1013].affordable?
def cmd_caststop(npc, spell, extra)
echo "cmd_caststop - spell(#{spell}) - extra(#{extra})" if $bigshot_debug
return if npc.status.match?(/dead|gone/)
return unless GameObj.targets.any? { |s| s.id == npc.id }
return unless Spell[spell].known? and Spell[spell].affordable?
waitrt?
waitcastrt?
Spell[1013].force_cast("##{target.id}")
fput 'stop 1013'
end
Spell[spell].force_cast("##{npc.id}", "#{extra}")
fput "stop #{spell}"
end

def cmd_unravel(cmd, npc)
echo("cmd_unravel") if $bigshot_debug

return if npc.status.match?(/dead|gone/)
return unless GameObj.targets.any? { |s| s.id == npc.id }
return unless Spell[1013].known? && Spell[1013].affordable?

cast_results = Regexp.union(
/You are already singing that spellsong\./,
/The evanescent shield shrouding .* flares to life and absorbs the essence of the spell, dissipating it harmlessly\./,
/You feel your song resonate around the .*, pulling at the threads of mana within\./,
/The silvery tendril continues to wend its way away from the /,
/You gain \d+ mana!/,
/You feel your song echo around the .* as if it had entered a vast empty chamber\./,
/The serpentine thread stretching between you and the (.*) fades, then disappears\./,
/Your concentration on unravelling the threads of mana is broken\./,
)

def cmd_barddispel(spell, target)
echo "cmd_barddispel" if $bigshot_debug
return unless Spell[1013].known?
time = Time.now
loop do
return if target.status =~ /dead|gone/ || !GameObj.targets.any? { |s| s.id == target.id }
return unless Spell[1013].affordable?
waitrt?
waitcastrt?
result = Spell[1013].force_cast("##{target.id}", "#{spell}", /The air around the (?:.*) swirls and sparkles(?: brightly!|, but quickly returns to normal\.)/)
return if result =~ /The air around the (?:.*) swirls and sparkles(?: brightly!|, but quickly returns to normal\.)/
return if Time.now - time > 15 # 15 seconds max to try to dispel
result = Spell[1013].force_cast("##{npc.id}", "#{cmd || ''}", cast_results)
case result
when /You are already singing that spellsong\./
fput('stop 1013')
when /You feel your song resonate around the .*, pulling at the threads of mana within\.|You gain \d+ mana!/
waitrt?
waitcastrt?
fput("renew 1013 ##{npc.id}") if cmd.empty? && percentmana < 100
waitrt?
fput('stop 1013')
break
when /The silvery tendril continues to wend its way away from the .*\./
fput('stop 1013')
when /Your concentration on unravelling the threads of mana is broken\.|You feel your song echo around the .* as if it had entered a vast empty chamber\./
break
end
end
end

Expand Down Expand Up @@ -3427,6 +3472,30 @@ class Bigshot
end
end

def cmd_efury(npc, extra)
echo "cmd_efury - npc: #{npc}" if $bigshot_debug
return if npc.status =~ /dead|gone/
return unless GameObj.targets.any? { |s| s.id == npc.id }
return unless Spell[917].known? and Spell[917].affordable?

waitrt?
waitcastrt?
time_out = Time.now + 12
Spell[917].force_incant("#{extra}")

loop {
line = get?
break if Time.now > time_out
break if should_flee?
break if npc.status =~ /dead|gone/
break unless GameObj.targets.any? { |s| s.id == npc.id }
break if line =~ /The (?:floor|ground) beneath .* suddenly calms\./
break if line =~ /The evanescent shield shrouding .* flares to life and absorbs the essence of the spell, dissipating it harmlessly\./
stand unless standing?
sleep(0.01)
}
end

def cmd_hide(attempts)
echo "cmd_hide" if $bigshot_debug
tries = 0
Expand Down

0 comments on commit c58feea

Please sign in to comment.