diff --git a/src/char/paladin/hammerdin.py b/src/char/paladin/hammerdin.py index 64c44e1..a9ec1bc 100644 --- a/src/char/paladin/hammerdin.py +++ b/src/char/paladin/hammerdin.py @@ -34,14 +34,27 @@ class Hammerdin(Paladin): aura = "concentration" else: aura = None + + # D2R: hotkey always puts skill on LEFT click. + # Right-clicking with it selected moves it to RIGHT + activates. + # Sequence: press aura (left) -> right-click (moves to right, activates) + # press hammer (left) -> left-click spam. if aura: - keyboard.send(self._skill_hotkeys[aura]) - wait(0.2, 0.3) + keyboard.send(self._skill_hotkeys[aura]) # aura goes to left-click + wait(0.15, 0.2) + mouse.click(button="right") # moves aura to right-click + activates it + wait(0.15, 0.2) + + # Hold stand_still so we don't walk while attacking keyboard.send(Config().char["stand_still"], do_release=False) wait(0.05, 0.1) + + # Set Blessed Hammer on LEFT click if self._skill_hotkeys["blessed_hammer"]: keyboard.send(self._skill_hotkeys["blessed_hammer"]) wait(0.05, 0.1) + + # Spam left-clicks to cast hammers (aura stays active on right-click) start = time.time() while (time.time() - start) < time_in_s: wait(0.06, 0.08) @@ -82,8 +95,6 @@ class Hammerdin(Paladin): if not self._pather.traverse_nodes_fixed("pindle_end", self): return False else: - 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) @@ -95,9 +106,6 @@ class Hammerdin(Paladin): # Custom eld position for teleport that brings us closer to eld self._pather.traverse_nodes_fixed([(675, 30)], self) else: - 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"]) @@ -106,8 +114,6 @@ class Hammerdin(Paladin): return True def kill_shenk(self): - 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"]) @@ -116,8 +122,6 @@ class Hammerdin(Paladin): return True def kill_council(self) -> bool: - 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 @@ -1293,7 +1297,9 @@ class Hammerdin(Paladin): wait(0.1, 0.15) self._cast_hammers(1.2, "redemption") ### LOOT ### - self._picked_up_items |= self._pickit.pick_up_items(self) + # force=True: Diablo is dead; his death animation/lingering effects register + # as targets and the mobs-alive guard would skip his drops entirely. + self._picked_up_items |= self._pickit.pick_up_items(self, force=True) return True def kill_andariel(self) -> bool: diff --git a/src/item/pickit.py b/src/item/pickit.py index e7064c0..fb74f23 100644 --- a/src/item/pickit.py +++ b/src/item/pickit.py @@ -177,17 +177,20 @@ class PickIt: self._prev_item_pickup_attempt = item return self._yoink_item(item, char) - def pick_up_items(self, char: IChar) -> bool: + def pick_up_items(self, char: IChar, force: bool = False) -> bool: """ To be called everytime the bot wants to pick up items Pick up items that with a specified char :param char: The character used to pick up the item + :param force: skip the mobs-alive safety check — use after boss kills, + where lingering death animations register as targets and + would otherwise skip the boss loot entirely TODO :return: return a list of the items that were picked up """ # Safety: skip pickup if mobs are still alive — prevents teleporting into # enemy packs during trash clearing (CS/ROF) which tanks HP to chicken levels. from target_detect import get_visible_targets - if get_visible_targets(): + if not force and get_visible_targets(): return False # Re-detect window position to mitigate 1282x720 vs 1280x720 template drift from screen import find_and_set_window_position