Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Bugfix: Hammerdin and FOHdin small fixes, inappropriate vigor casting…
Browse files Browse the repository at this point in the history
…, etc (#868)

* fixes

* increase timeouts to 3.2...pather is hacky
  • Loading branch information
aliig authored Jun 14, 2022
1 parent 1942119 commit c8e40c8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 49 deletions.
35 changes: 17 additions & 18 deletions src/char/paladin/fohdin.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,31 +97,29 @@ def kill_pindle(self) -> bool:

if self.capabilities.can_teleport_natively or self.capabilities.can_teleport_with_charges:
# Slightly retreating, so the Merc gets charged
if not self._pather.traverse_nodes([102], self, timeout=1.0, do_pre_move=self._do_pre_move, force_move=True,force_tp=False, use_tp_charge=False):
if not self._pather.traverse_nodes([102], self, timeout=1.0, do_pre_move=False, force_move=True,force_tp=False, use_tp_charge=False):
return False
# Doing one Teleport to safe_dist to grab our Merc
Logger.debug("Teleporting backwards to let Pindle charge the MERC. Looks strange, but is intended!") #I would leave this message in, so users dont complain that there is a strange movement pattern.
if not self._pather.traverse_nodes([103], self, timeout=1.0, do_pre_move=self._do_pre_move, force_tp=True, use_tp_charge=True):
if not self._pather.traverse_nodes([103], self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True):
return False
# Slightly retreating, so the Merc gets charged
if not self._pather.traverse_nodes([103], self, timeout=1.0, do_pre_move=self._do_pre_move, force_move=True, force_tp=False, use_tp_charge=False):
if not self._pather.traverse_nodes([103], self, timeout=1.0, do_pre_move=False, force_move=True, force_tp=False, use_tp_charge=False):
return False
else:
if not self._do_pre_move:
keyboard.send(self._skill_hotkeys["conviction"])
wait(0.05, 0.15)
self._pather.traverse_nodes([103], self, timeout=1.0, do_pre_move=self._do_pre_move)
keyboard.send(self._skill_hotkeys["conviction"])
wait(0.15)
self._pather.traverse_nodes([103], self, timeout=1.0, do_pre_move=False)

cast_pos_abs = [pindle_pos_abs[0] * 0.9, pindle_pos_abs[1] * 0.9]
self._generic_foh_attack_sequence(default_target_abs=cast_pos_abs, min_duration=atk_len_dur, max_duration=atk_len_dur*3, default_spray=11)

if self.capabilities.can_teleport_natively:
self._pather.traverse_nodes_fixed("pindle_end", self)
else:
if not self._do_pre_move:
keyboard.send(self._skill_hotkeys["redemption"])
wait(0.05, 0.15)
self._pather.traverse_nodes((Location.A5_PINDLE_SAFE_DIST, Location.A5_PINDLE_END), self, timeout=1.0, do_pre_move=self._do_pre_move)
keyboard.send(self._skill_hotkeys["redemption"])
wait(0.15)
self._pather.traverse_nodes((Location.A5_PINDLE_SAFE_DIST, Location.A5_PINDLE_END), self, timeout=1.0, do_pre_move=False)

# Use target-based attack sequence one more time before pickit
self._generic_foh_attack_sequence(default_target_abs=cast_pos_abs, max_duration=atk_len_dur, default_spray=11)
Expand All @@ -133,15 +131,17 @@ def kill_pindle(self) -> bool:
def kill_council(self) -> bool:
atk_len_dur = float(Config().char["atk_len_trav"])

keyboard.send(self._skill_hotkeys["conviction"])
wait(.15)
# traverse to nodes and attack
nodes = [225, 226, 300]
for node in nodes:
self._pather.traverse_nodes([node], self, timeout=2, force_tp=True)
for i, node in enumerate(nodes):
self._pather.traverse_nodes([node], self, timeout=3.2, do_pre_move = False, force_tp=(self.capabilities.can_teleport_natively or i > 0), use_tp_charge=(self.capabilities.can_teleport_natively or i > 0))
default_target_abs = self._pather.find_abs_node_pos(node, img := grab()) or self._pather.find_abs_node_pos(906, img) or (-50, -50)
self._generic_foh_attack_sequence(default_target_abs=default_target_abs, min_duration=atk_len_dur, max_duration=atk_len_dur*3, default_spray=80)

# return to 226 and prepare for pickit
self._pather.traverse_nodes([226], self, timeout=2, force_tp=True)
self._pather.traverse_nodes([226], self, timeout=3.2, do_pre_move = False, force_tp=True, use_tp_charge=True)
default_target_abs = self._pather.find_abs_node_pos(226, img := grab()) or self._pather.find_abs_node_pos(906, img) or (-50, -50)
self._generic_foh_attack_sequence(default_target_abs=default_target_abs, max_duration=atk_len_dur*3, default_spray=80)

Expand Down Expand Up @@ -172,10 +172,9 @@ def kill_shenk(self):
atk_len_dur = float(Config().char["atk_len_shenk"])

# traverse to shenk
if not self._do_pre_move:
keyboard.send(self._skill_hotkeys["conviction"])
wait(0.05, 0.15)
self._pather.traverse_nodes((Location.A5_SHENK_SAFE_DIST, Location.A5_SHENK_END), self, timeout=1.0, do_pre_move=self._do_pre_move, force_tp=True, use_tp_charge=True)
keyboard.send(self._skill_hotkeys["conviction"])
wait(0.15)
self._pather.traverse_nodes((Location.A5_SHENK_SAFE_DIST, Location.A5_SHENK_END), self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True)
wait(0.05, 0.1)

# bypass mob detect first
Expand Down
38 changes: 14 additions & 24 deletions src/char/paladin/hammerdin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ def pre_buff(self):
mouse.click(button="right")
wait(self._cast_duration, self._cast_duration + 0.06)

def on_capabilities_discovered(self, capabilities: CharacterCapabilities):
# In case we have a running pala, we want to switch to concentration when moving to the boss
# ass most likely we will click on some mobs and already cast hammers
if capabilities.can_teleport_natively:
self._do_pre_move = False

def pre_move(self):
# select teleport if available
super().pre_move()
Expand All @@ -81,10 +75,9 @@ def kill_pindle(self) -> bool:
if not self._pather.traverse_nodes_fixed("pindle_end", self):
return False
else:
if not self._do_pre_move:
keyboard.send(self._skill_hotkeys["concentration"])
wait(0.05, 0.15)
self._pather.traverse_nodes((Location.A5_PINDLE_SAFE_DIST, Location.A5_PINDLE_END), self, timeout=1.0, do_pre_move=self._do_pre_move)
keyboard.send(self._skill_hotkeys["concentration"])
wait(0.15)
self._pather.traverse_nodes((Location.A5_PINDLE_SAFE_DIST, Location.A5_PINDLE_END), self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True)
self._cast_hammers(Config().char["atk_len_pindle"])
wait(0.1, 0.15)
self._cast_hammers(1.6, "redemption")
Expand All @@ -95,42 +88,39 @@ def kill_eldritch(self) -> bool:
# Custom eld position for teleport that brings us closer to eld
self._pather.traverse_nodes_fixed([(675, 30)], self)
else:
if not self._do_pre_move:
keyboard.send(self._skill_hotkeys["concentration"])
wait(0.05, 0.15)
self._pather.traverse_nodes((Location.A5_ELDRITCH_SAFE_DIST, Location.A5_ELDRITCH_END), self, timeout=1.0, do_pre_move=self._do_pre_move, force_tp=True, use_tp_charge=True)
keyboard.send(self._skill_hotkeys["concentration"])
wait(0.15)
# Traverse without pre_move, because we don't want to activate vigor when walking!
self._pather.traverse_nodes((Location.A5_ELDRITCH_SAFE_DIST, Location.A5_ELDRITCH_END), self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True)
wait(0.05, 0.1)
self._cast_hammers(Config().char["atk_len_eldritch"])
wait(0.1, 0.15)
self._cast_hammers(1.6, "redemption")
return True

def kill_shenk(self):
if not self._do_pre_move:
keyboard.send(self._skill_hotkeys["concentration"])
wait(0.05, 0.15)
self._pather.traverse_nodes((Location.A5_SHENK_SAFE_DIST, Location.A5_SHENK_END), self, timeout=1.0, do_pre_move=self._do_pre_move, force_tp=True, use_tp_charge=True)
keyboard.send(self._skill_hotkeys["concentration"])
wait(0.15)
self._pather.traverse_nodes((Location.A5_SHENK_SAFE_DIST, Location.A5_SHENK_END), self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True)
wait(0.05, 0.1)
self._cast_hammers(Config().char["atk_len_shenk"])
wait(0.1, 0.15)
self._cast_hammers(1.6, "redemption")
return True

def kill_council(self) -> bool:
if not self._do_pre_move:
keyboard.send(self._skill_hotkeys["concentration"])
wait(0.05, 0.15)
keyboard.send(self._skill_hotkeys["concentration"])
wait(.15)
# Check out the node screenshot in assets/templates/trav/nodes to see where each node is at
atk_len = Config().char["atk_len_trav"]
# Go inside and hammer a bit
self._pather.traverse_nodes([228, 229], self, timeout=2.5, force_tp=True, use_tp_charge=True)
self._cast_hammers(atk_len)
self._pather.traverse_nodes([228, 229], self, timeout=3.2, do_pre_move=False, force_tp=True, use_tp_charge=True)
# Move a bit back and another round
self._move_and_attack((40, 20), atk_len)
# Here we have two different attack sequences depending if tele is available or not
if self.capabilities.can_teleport_natively or self.capabilities.can_teleport_with_charges:
# Back to center stairs and more hammers
self._pather.traverse_nodes([226], self, timeout=2.5, force_tp=True, use_tp_charge=True)
self._pather.traverse_nodes([226], self, timeout=3.2, do_pre_move=False, force_tp=True, use_tp_charge=True)
self._cast_hammers(atk_len)
# move a bit to the top
self._move_and_attack((65, -30), atk_len)
Expand Down
7 changes: 0 additions & 7 deletions src/char/paladin/paladin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(self, skill_hotkeys: dict, pather: Pather, pickit: PickIt):
Logger.info("Setting up Paladin")
super().__init__(skill_hotkeys)
self._pather = pather
self._do_pre_move = True
self._pickit = pickit #for Diablo
self._picked_up_items = False #for Diablo

Expand All @@ -30,12 +29,6 @@ def pre_buff(self):
mouse.click(button="right")
wait(self._cast_duration, self._cast_duration + 0.06)

def on_capabilities_discovered(self, capabilities: CharacterCapabilities):
# In case we have a running pala, we want to switch to concentration when moving to the boss
# ass most likely we will click on some mobs and already cast hammers
if capabilities.can_teleport_natively:
self._do_pre_move = False

def pre_move(self):
# select teleport if available
super().pre_move()
Expand Down

0 comments on commit c8e40c8

Please sign in to comment.