Skip to content

Commit

Permalink
normalize command to downcase and lead/follower looting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Deysh committed Dec 26, 2023
1 parent 9453e4d commit 016906e
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions scripts/bigshot.lic
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
- added option to double cast on fog options when returning from the Rift
- added support for warcry holler buff
- fixed bug in stand method when command is an array
- fixed command to standardize to downcase
- fixed bug in head/tail looting where the leader wasn't waiting for the follower to loot
- removed change log comments before 5.0.0 and updated wiki
v5.2.2 (2023-11-21)
- bugfix causing bs_wander to delay 0.5 seconds longer than needed
Expand Down Expand Up @@ -367,6 +369,10 @@ class Bigshot
return true
end

def set_group_looting_active
@members[@leader.ma_looter].set_looting_active
end

def looter
return @leader.DESIGNATED_LOOTER
end
Expand Down Expand Up @@ -2306,10 +2312,11 @@ class Bigshot

# Condition check passed, drop the conditions from the command and lets do something
command = command =~ /(.*)\((.*?)\)$/ ? $1.strip : command.strip
command = command.downcase

# Change_stance
stand(command) if !standing?
unless (command =~ /^(?:\d+|wait|sleep|wand|berserk|script|hide|nudgeweapon)/)
unless (command =~ /^(?:\d+|wait|sleep|wand|berserk|script|hide|nudgeweapon)/i)
change_stance(@HUNTING_STANCE) if stance_dance
end

Expand Down Expand Up @@ -4781,6 +4788,8 @@ class Bigshot
loot()
else
if Char.name == @followers.leader_name
$looting_inactive = false
@followers.set_group_looting_active
@followers.add_event(:PREP_REST)
@followers.add_event(:LOOT)
end
Expand Down Expand Up @@ -5533,6 +5542,10 @@ class Bigshot
return $looting_inactive
end

def set_looting_active
$looting_inactive = false
end

def final_loot
@DESIGNATED_LOOTER = ma_looter
if Char.name == @DESIGNATED_LOOTER && (Char.name == @followers.leader_name || @followers.leader_name.nil?)
Expand Down Expand Up @@ -5719,10 +5732,6 @@ class Bigshot
sleep(0.5) while (!@followers.all_present?)
end

if @event_stack.any? { |a| a.type == :LOOT }
sleep 0.5 until !@followers.looting_done
end

# Wait for follower to finish looting if needed
while !@followers.looting_done
$looting_inactive = @followers.looting_done
Expand Down Expand Up @@ -6174,6 +6183,12 @@ elsif (Script.current.vars[1] =~ /tail|follow|link/i)
event = bs.event_stack.size == 0 ? nil : bs.grab_event
next if event.nil?

if bs.event_stack.any? { |a| [:LOOT, :FINAL_LOOT].include?(a.type) }
if group.looter == Char.name
$looting_inactive = false
end
end

# kertwang!
if [:FOLLOW_NOW, :ATTACK].include?(event.type)
unless checkpcs.include?(leader)
Expand Down Expand Up @@ -6254,6 +6269,11 @@ elsif (Script.current.vars[1] =~ /tail|follow|link/i)
stop_attack = true
break
end
if bs.event_stack.any? { |a| [:LOOT, :FINAL_LOOT].include?(a.type) }
if group.looter == Char.name
$looting_inactive = false
end
end

target = bs.find_target(nil) if !$bigshot_bandits && @PRIORITY && !bs.priority(target)
bs.attack(target)
Expand Down Expand Up @@ -6301,12 +6321,14 @@ elsif (Script.current.vars[1] =~ /tail|follow|link/i)
if group.looter == Char.name
$looting_inactive = false
bs.loot
sleep 0.5
$looting_inactive = true
end
elsif (event.type == :FINAL_LOOT)
if group.looter == Char.name
$looting_inactive = false
bs.loot_dead
sleep 0.5
$looting_inactive = true
end
elsif (event.type == :HUNTING_SCRIPTS_STOP)
Expand Down

0 comments on commit 016906e

Please sign in to comment.