diff --git a/assets/templates/a3_stash_left.png b/assets/templates/a3_stash_left.png deleted file mode 100644 index f354aa4..0000000 Binary files a/assets/templates/a3_stash_left.png and /dev/null differ diff --git a/assets/templates/a3_stash_right.png b/assets/templates/a3_stash_right.png index a00b65f..a8537b0 100644 Binary files a/assets/templates/a3_stash_right.png and b/assets/templates/a3_stash_right.png differ diff --git a/src/bot.py b/src/bot.py index d25c9a7..c55812f 100644 --- a/src/bot.py +++ b/src/bot.py @@ -68,13 +68,13 @@ class Bot: case "hammerdin" | "paladin": self._char: IChar = Hammerdin(Config().hammerdin, self._pather, self._pickit) #pickit added for diablo case "fohdin": - self._char: IChar = FoHdin(Config().fohdin, self._pather, self._pickit) #pickit added for diablo + self._char: IChar = FoHdin(Config().fohdin, self._pather) case "abyss_lock" | "warlock": - self._char: IChar = AbyssLock(Config().abyss_lock, self._pather, self._pickit) + self._char: IChar = AbyssLock(Config().abyss_lock, self._pather) case "fire_lock": - self._char: IChar = FireLock(Config().fire_lock, self._pather, self._pickit) + self._char: IChar = FireLock(Config().fire_lock, self._pather) case "echo_lock": - self._char: IChar = EchoLock(Config().echo_lock, self._pather, self._pickit) + self._char: IChar = EchoLock(Config().echo_lock, self._pather) case "amazon" | "javazon": self._char: IChar = Javazon(Config().javazon, self._pather) case "trapsin": diff --git a/src/char/warlock/fire_lock.py b/src/char/warlock/fire_lock.py index 1a05d2a..abde8cd 100644 --- a/src/char/warlock/fire_lock.py +++ b/src/char/warlock/fire_lock.py @@ -101,6 +101,25 @@ class FireLock(Warlock): self._pather.traverse_nodes((Location.A5_PINDLE_SAFE_DIST, Location.A5_PINDLE_END), self, timeout=1.0, do_pre_move=False) return True + def kill_eldritch(self) -> bool: + if self.capabilities.can_teleport_natively: + self._pather.traverse_nodes_fixed([(675, 30)], self) + start = time.time() + self._cast_ring_of_fire() + self._cast_deathmark_combo((0,-10)) + while (time.time() - start) < Config().char["atk_len_eldritch"]: + self._cast_chaos_combo((0, -10)) + else: + eldritch_pos_abs = convert_screen_to_abs(Config().path["eldritch_end"][0]) + cast_pos_abs = [eldritch_pos_abs[0] * 0.80, eldritch_pos_abs[1] * 0.80] + start = time.time() + self._cast_deathmark_combo(cast_pos_abs) + while (time.time() - start) < Config().char["atk_len_eldritch"]: + self._cast_chaos_combo(cast_pos_abs) + x_m, y_m = convert_abs_to_monitor([eldritch_pos_abs[0], eldritch_pos_abs[1]]) + self.move((x_m, y_m), force_move=True) + return True + def kill_council(self) -> bool: self._cast_ring_of_fire() self._cast_deathmark_combo((-325, -180)) diff --git a/src/char/warlock/warlock.py b/src/char/warlock/warlock.py index 0b2868d..e3f11f7 100644 --- a/src/char/warlock/warlock.py +++ b/src/char/warlock/warlock.py @@ -10,14 +10,11 @@ from config import Config from utils.misc import wait from screen import convert_abs_to_screen, convert_abs_to_monitor from pather import Pather, Location -#import cv2 #for Diablo -from item.pickit import PickIt #for Diablo class Warlock(IChar): - def __init__(self, skill_hotkeys: dict, pather: Pather, pickit: PickIt): + def __init__(self, skill_hotkeys: dict, pather: Pather): super().__init__(skill_hotkeys) self._pather = pather - self._pickit = pickit self._picked_up_items = False self._last_click_cast = 0 self._action_frame = 9 @@ -36,14 +33,21 @@ class Warlock(IChar): wait(0.04) mouse.click(button="right") wait(casting_delay) + if self._skill_hotkeys["summon_demon_2"]: + keyboard.send(self._skill_hotkeys["summon_demon_2"]) + wait(0.04) + mouse.click(button="right") + wait(self._cast_duration) def cast_town_buffs(self, curr_loc: Location): #Determine where to move mouse for summoning/consume based on location. cast_pos_monitor = None if curr_loc == Location.A3_TOWN_START: - cast_pos_monitor = convert_abs_to_monitor((260,120)) + cast_pos_monitor = convert_abs_to_monitor((500,170)) + elif curr_loc == Location.A4_TOWN_START: + cast_pos_monitor = convert_abs_to_monitor((500,170)) elif curr_loc == Location.A5_TOWN_START: - cast_pos_monitor = convert_abs_to_monitor((-340,-60)) + cast_pos_monitor = convert_abs_to_monitor((-450,-60)) else: Logger.warning(f"Unimplemented town location {curr_loc} and skipping town buffs") return @@ -60,12 +64,7 @@ class Warlock(IChar): wait(0.08) #extra wait to ensure summon is active mouse.click(button="right") wait(self._cast_duration) - if self._skill_hotkeys["summon_demon_2"]: - keyboard.send(self._skill_hotkeys["summon_demon_2"]) - wait(0.04) - mouse.click(button="right") - wait(self._cast_duration) - + def _cast_deathmark(self, cast_pos_abs: tuple[float, float]): if self._skill_hotkeys["deathmark"]: keyboard.send(self._skill_hotkeys["deathmark"]) diff --git a/src/town/a3.py b/src/town/a3.py index bfaf42e..e011618 100644 --- a/src/town/a3.py +++ b/src/town/a3.py @@ -43,14 +43,14 @@ class A3(IAct): found = is_visible(ScreenObjects.GoldBtnInventory, img) found |= is_visible(ScreenObjects.GoldBtnStash, img) return found - if not self._char.select_by_template(["A3_STASH_LEFT","A3_STASH_RIGHT"], stash_is_open_func, timeout=4.0, telekinesis=True): + if not self._char.select_by_template(["A3_STASH","A3_STASH_RIGHT"], stash_is_open_func, timeout=4.0, telekinesis=True): Logger.warning("Failed to find A3 stash. Could be blocked by merc, moving down.") - mon_pos = convert_abs_to_monitor((0,100)) + mon_pos = convert_abs_to_monitor((50,150)) mouse.move(*mon_pos) wait(0.08) mouse.click("left") wait(1) #Wait to move to new position - if not self._char.select_by_template(["A3_STASH_LEFT","A3_STASH_RIGHT"], stash_is_open_func, timeout=4.0, telekinesis=True): + if not self._char.select_by_template(["A3_STASH","A3_STASH_RIGHT"], stash_is_open_func, timeout=4.0, telekinesis=True): Logger.warning("Failed to find A3 stash after move.") return False return Location.A3_STASH_WP