// ===================================================================== // Configurable Sorceress Pindle Script with Randomization var version = "1.01c"; // Last Updated: 2:11 PM 2/4/2003 // Designed for JED // Authors: Avarice and Aennor #include #include #include #include #include #include #include #include #include #include Print(CBrown + "Loading settings for " + COrange + Player.Name + CBrown + "."); // Do not change these var defenses = new Array(); var defensestotal = 0; var skipthese = new Array(); var skiptotal = 0; var eldritch_attack_seq = new Array(); var eldritchattacktotal = 0; var shenk_attack_seq = new Array(); var shenkattacktotal = 0; var pindle_attack_seq = new Array(); var pindleattacktotal = 0; var zombie_attack_seq = new Array(); var zombieattacktotal = 0; //////////////////////////////////////////////////////////////////////// /// Configurable Parameters /// //////////////////////////////////////////////////////////////////////// /// heal_life - Anything below this will go to Malah for healing /// /// heal_mana - Anything below this will go to Malah for healing /// /// rest_mana - After fighting Eldritch or Shenk you will regen /// /// your mana to this number before continuing to make /// /// sure you have enough for teleporting /// /// health_chicken - If you have less life than this you will either/// /// use a potion if you have one, or if not exit /// /// health_bugout - If you have less health than this you will exit /// /// no questions asked /// /// mana_check - If this is set to true you will use a potion or /// /// exit if your mana falls below mana_chicken /// /// mana_chicken - If you have less mana than this you will either /// /// use a potion if you have one, or if not exit /// /// UseEnchantments - If this is set to true you will check the /// /// enchantments on a monster before fighting and /// /// decide whether or not to skip them /// /// SkipEnchantment - These are the enchantments to skip /// /// Example: /// /// SkipEnchantment("enchantment name", skip_without_another); /// /// SkipEnchantment("Lightning Enchanted", 0); /// /// SkipEnchantment("Extra Strong", 1); /// /// SkipEnchantment("Might", 1); /// /// EnchantmentsShow - Set this to true if you want the monsters /// /// enchantments printed to the screen /// /// DefensiveSpell - This is the sequence of spells to cast before /// /// fighting Bosses /// /// Example: /// /// DefensiveSpell("skill name",repetitions,optimum range,delay); /// /// DefensiveSpell("Energy Shield", 1, 0, 700); /// /// PindleAttack - This is the attack sequence to use when /// /// fighting Pindle /// /// Example: /// /// PindleAttack("skill name", repetitions, optimum range, delay), /// /// PindleAttack("Nova", 5, 10, 400) /// /// /// /// pindle_repeat_after - Set this to the number of the attack /// /// seq to repeat after until Pindle is dead /// /// EldritchAttack - This is the attack sequence to use when /// /// fighting Eldritch /// /// Example: See PindleAttack /// /// eldritch_repeat_after - Set this to the number of the attack /// /// seq to repeat after until Eldritch is dead/// /// ShenkAttack - This is the attack sequence to use when fighting /// /// Shenk /// /// Example: See PindleAttack /// /// shenk_repeat_after - Set this to the number of the attack /// /// seq to repeat after until Shenk is dead /// /// ZombieAttack - This is the attack sequence to use when /// /// fighting the zombies in Pindle's courtyard /// /// Example: See PindleAttack /// /// reposition - Set this to true if you want to ensure you are /// /// close enough to hit the monster with your attacks /// /// use_merc - Set this to true if you want to have your merc w/you /// /// merc_heal - Use potions on merc /// /// merc_chicken - If the merc has less life than this you will try/// /// to drop a potion on him/her /// /// potionType - Set this to the full name of the type of potion you/// /// want to fill your belt with if they drop /// /// repair_level - Set this to a decimal value 0 - 1 to set the /// /// percentage of durability at which you will repair/// /// Example: var repair_level = .3 /// /// This means you'd repair items that have <30% durability /// /// UseWeaponSwitch - set this to true/false depending on whether /// /// you want to use MF weapon switching /// /// MFweapon - Set this to the name of the weapon you want to use /// /// as you MF weapon /// /// MYweapon - Set this to the name of the weapon you use normally /// /// WeaponSwitchHealth - Set this to the percentage of health to /// /// switch to your MF weapon /// /// doEldritchRun - Set this to true to kill Eldritch /// /// doShenkRun - Set this to true to kill Shenk /// /// doPindleRun - Set this to true to kill Pindle /// /// doZombieRun - Set this to true to kill the Pindle courtyard /// //////////////////////////////////////////////////////////////////////// var heal_life = 580; var heal_mana = 800; var rest_mana = 75; var health_chicken = 275; var health_bugout = 150; var mana_check = true; var mana_chicken = 5; var UseEnchantments = true; var EnchantmentsShow = true; SkipEnchantment("Fanaticism", 1); SkipEnchantment("Lightning Enchanted", 1); SkipEnchantment("Conviction", 1); DefensiveSpell("Energy Shield", 1, 0, 700); DefensiveSpell("Thunder Storm", 1, 0, 700); EldritchAttack("Static Field", 2, 10, 500); EldritchAttack("Nova", 2, 10, 500); var eldritch_repeat_after = 1; ShenkAttack("Static Field", 2, 10, 500); ShenkAttack("Nova", 8, 10, 500); ShenkAttack("Static Field", 3, 10, 500); ShenkAttack("Nova", 2, 10, 500); var shenk_repeat_after = 2; PindleAttack("Frozen Orb", 2, 10, 750); PindleAttack("Static Field", 2, 10, 500); PindleAttack("Frozen Orb", 1, 10, 750); PindleAttack("Nova", 2, 10, 500); var pindle_repeat_after = 2; ZombAttack("Nova", 21, 10, 800); var reposition = true; var use_merc = true; var merc_heal = true; var merc_chicken = 50; var potionType = "Full Rejuv Potion"; var repair_level = .3; var UseWeaponSwitch = false; var MFweapon = "Blade of Ali Baba"; var MYweapon = "Chromatic Ire"; var WeaponSwitchHealth = 10; var doEldritchRun = false; var doShenkRun = false; var doPindleRun = true; var doZombieRun = false; //////////////////////////////////////////////////////////////////////// /// End Configurable Parameters /// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /// General Parameters /// /// Do not edit anything below here /// //////////////////////////////////////////////////////////////////////// var Pindle = 0; var Eldritch = 0; var Shenk = 0; //////////////////////////////////////////////////////////////////////////////// // Path Coordinates //////////////////////////////////////////////////////////////////////////////// var om_path = new Array(2); // Origin to Malah om_path[0] = new coord(5100, 5020); // Originate om_path[1] = new coord(5074, 5035); // Malah Available var oq_path = new Array(3); // Origin to Qual-Kehk oq_path[0] = new coord(5100, 5020); // Originate oq_path[1] = new coord(5074, 5035); // Malah avail oq_path[2] = new coord(5080, 5080); // Qual Available var ol_path = new Array(3); // Origin to Larzuk/Chest ol_path[0] = new coord(5100, 5020); // Originate ol_path[1] = new coord(5109, 5042); // Steps landing ol_path[2] = new coord(5135, 5045); // Larzuk/Chest Avail var mq_path = new Array(2); // Malah to Qual-Kehk mq_path[0] = new coord(5074, 5035); // Originate (Malah avail) mq_path[1] = new coord(5080, 5080); // Qual Available var lq_path = new Array(3); // Larzuk to Qual-Kehk lq_path[0] = new coord(5135, 5045); // Originate (Larzuk avail) lq_path[1] = new coord(5130, 5090); // Intersection lq_path[2] = new coord(5080, 5080); // Qual Available var ql_path = new Array(3); // Qual-Kehk to Larzuk ql_path[0] = new coord(5080, 5080); // Originate (Qual Available) ql_path[1] = new coord(5130, 5090); // Intersection ql_path[2] = new coord(5135, 5045); // Larzuk avail var oc_path = new Array(3); // Origin to chest oc_path[0] = new coord(5100, 5020); // Origin oc_path[1] = new coord(5104, 5043); // Stairs landing oc_path[2] = new coord(5111, 5062); /// Bottom of stairs, Chest avail var co_path = new Array(3); // Origin to chest co_path[0] = new coord(5111, 5062); // Bottom of stairs, Chest avail co_path[1] = new coord(5104, 5043); // Stairs landing co_path[2] = new coord(5100, 5020); // Origin var qc_path = new Array(3); // Qual to chest qc_path[0] = new coord(5095, 5085); // Starting down path qc_path[1] = new coord(5120, 5080); // On path qc_path[2] = new coord(5120, 5075); // Gold/intersection avail var cq_path = new Array(3); // Qual to chest cq_path[0] = new coord(5120, 5075); // Gold/intersection avail cq_path[1] = new coord(5120, 5080); // On path cq_path[2] = new coord(5095, 5085); // Starting down path var cp_path = new Array(4); // Chest/WP to Portal cp_path[0] = new coord(5118, 5075); // Originate next to WP cp_path[1] = new coord(5124, 5087); // Intersection by flag cp_path[2] = new coord(5130, 5110); // Corner by portal cp_path[3] = new coord(5118, 5122); // Portal and Anya available var lc_path = new Array(3); // Larzuk to chest lc_path[0] = new coord(5135, 5045); lc_path[1] = new coord(5135, 5058); lc_path[2] = new coord(5115, 5062); var cl_path = new Array(3); // Chest/WP to Larzuk cl_path[0] = new coord(5115, 5062); cl_path[1] = new coord(5135, 5058); cl_path[2] = new coord(5135, 5045); eldritch_path = new Array(3); eldritch_path[0] = new coord(3778, 5108); eldritch_path[1] = new coord(3755, 5092); eldritch_path[2] = new coord(3745, 5081); var shenk1_path = new Array(6); shenk1_path[0] = new coord(3778, 5108); shenk1_path[1] = new coord(3795, 5103); shenk1_path[2] = new coord(3813, 5106); shenk1_path[3] = new coord(3826, 5108); shenk1_path[4] = new coord(3844, 5119); shenk1_path[5] = new coord(3866, 5125); var shenk2_path = new Array(2); shenk2_path[0] = new coord(3870, 5113); shenk2_path[1] = new coord(3887, 5113); var pindle_path = new Array(3); pindle_path[0] = new coord(10064, 13277); pindle_path[1] = new coord(10059, 13250); pindle_path[2] = new coord(10061, 13232); var zombie_path = new Array(2); zombie_path[0] = new coord(10058, 13236); zombie_path[1] = new coord(10062, 13268); //////////////////////////////////////////////////////////////////////////////// // Main Function //////////////////////////////////////////////////////////////////////////////// function JSMain() { Sleep(Randomize(4000, 1000)); SetEventHandler("onDeath", "DeathEventFunc"); if(!CheckHand()) { ELog("Item in hand cannot be stashed!"); Sleep(2000); Disconnect(); return; } Print(CYellow + "AA_PindleSorc" + CBrown + ", a script by " + CGreen + "Avarice" + CBrown + " and " + CRed + "Aennor" + CBrown + "."); Print(CBrown + "Version: " + CGold + version); Print(""); Sleep(100); // Use the Force Luke (enable on-screen display) UseTheForce(); if (UseWeaponSwitch) SetWeapon(MYweapon); // Make sure we are a Sorceress if(!Player.Class == 1) { ELog("You must be a sorceress to use this script!"); Sleep(2000); Disconnect(); return; } // If we died and can't get the body then panic if (!PickupBody()) { ELog("Cannot retrieve body!"); Sleep(2000); Disconnect(); return; } // Setup potion controls SetupGlobalBeltPotions(); ClearInventoryPotions(potionType); if (Act5Run()) { Disconnect(); return; } else { ELog("The Pindleskin run failed."); Sleep(2000); Disconnect(); return; } } //////////////////////////////////////////////////////////////////////////////// // Pindle-run Function //////////////////////////////////////////////////////////////////////////////// function Act5Run() { // See if we are in Act 5 if (Player.Act != 5) { PRed("Not in Act 5, moving there."); if (!ActWarp(5)) return false; PGreen("Now in Act 5, proceeding."); } PBrown("The Pindleskin run is starting."); TownBegin() if (doEldritchRun && !DoWaypoint("frigid highlands")) { ELog("Could not get through Waypoint to Eldritch.") } else if (doEldritchRun) { if (!killEldritch()) return false; else if (doShenkRun) { if (NeedTown()) { if (!DoWaypoint("harrogath")) { ELog("I could not get back into Town from Eldritch."); return false; } TownBegin(); if (!DoWaypoint("frigid highlands")) { ELog("I could not get through Waypoint to Shenk."); } else if (!killShenk()) { return false; } } else if (!killShenk()) { return false; } } if (!DoWaypoint("harrogath")) { ELog("I could not get back into Town from Shenk."); return false; } } if (!doEldritchRun && doShenkRun) { if (!DoWaypoint("frigid highlands")) ELog("Could not get through Waypoint to Shenk.") else if (!killShenk()) return false; else if (!DoWaypoint("harrogath")) { ELog("I could not get back into Town from Shenk."); return false; } } if (NeedTown()) TownBegin(); if (doPindleRun) { TownPrepMove("cp"); // Move to portal/Anya if (!DoRedPortal()) return false; if (!killPindle()) return false; } return true; } function NeedTown() { if (Player.Health < heal_life || Player.Mana < heal_mana || NeedToIdentify() || CheckForRepair(repair_level) ) { return true; } else { return false } } function TeleportToMonster(tele_path) { for (TTMi=0; TTMi < tele_path.length; TTMi++) { if (!TeleMove(tele_path[TTMi])) { ELog("Cannot teleport to monster area."); return false; } } return true; } function TeleportFromMonster(tele_path) { for (TFMi=tele_path.length-1; TFMi >= 0; TFMi--) { if (!TeleMove(tele_path[TFMi])) { ELog("Cannot teleport away from monster area."); return false; } } return true; } //////////////////////////////////////////////////////////////////////////////// // Town Functions //////////////////////////////////////////////////////////////////////////////// function TownBegin() { // if we need healing or need to ID something if ((Player.Health < heal_life || Player.Mana < heal_mana) || NeedToIdentify()) { TownPrepMove("om"); // do om, get healed or ID // if we need a merc if (use_merc && Merc.IsDead) { TownPrepMove("mq"); // do mq, get merc // if we need repair (eq is under > repair_level damaged) if (CheckForRepair(repair_level)) { TownPrepMove("ql"); // do ql, get repair or ammo TownPrepMove("om"); //back to chest area } else TownPrepMove("qc"); // else do qc } // else if we need repair else if (CheckForRepair(repair_level)) { TownPrepMove("ol"); // do ol, get repair TownPrepMove("om"); //back to chest area } else { TownPrepMove("oc"); // do oc } // end with chest available // if we don't need healing but need a merc } else if (use_merc && Merc.IsDead) { TownPrepMove("oq"); // do oq, get merc // if we need repair (eq is under 70% durability) if (CheckForRepair(repair_level)) { TownPrepMove("ql"); // do ql, get repair or ammo TownPrepMove("om"); //back to chest area } else { TownPrepMove("qc"); // else do qc } } // else if we need repair else if (CheckForRepair(repair_level)) { TownPrepMove("ol"); // do ol, get repair or ammo TownPrepMove("om"); //back to chest area } // else go to the chest else TownPrepMove("oc"); // goto chest area HandleGold(); // Do gold stashing, gold pick setting StashInventory(); // Stash anything on our pick list that's in inv } function RestToRegenMana() { if (Player.Mana < rest_mana) { PBrown("Resting to regen mana."); while (Player.Mana < rest_mana) SmartSleep(100); } } function killEldritch() { SetEventHandler("onHealth", "HealthEventFunc"); if(mana_check) SetEventHandler("onMana", "ManaEventFunc"); if(!Merc.IsDead && merc_heal) SetEventHandler("onMercHealth", "MercHealthEventFunc"); Sleep(1000); HandleDefenses(); for (LFEi=0; LFEi < 5 && !Eldritch; LFEi++) { Eldritch = GetBossInfo("Megaflow Rectifier"); Sleep(200); } if (Eldritch) { if (EnchantmentsShow) Eldritch.PrintEnchantments(4); if(UseEnchantments && CheckEnchantments(skipthese, Eldritch)) { ELog("BAD Immunities Detected - Skipping Eldritch."); SmartSleep(500); return true; } } else { ELog("Eldritch not found."); return true; } if (!TeleportToMonster(eldritch_path)) return; PickitEnable(); AttackSequence(eldritch_attack_seq, Eldritch, eldritch_repeat_after); PBrown("Eldritch has been destroyed."); Stats("increment eldritch"); Sleep(100); if (UseWeaponSwitch) SetWeapon(MYweapon); PickitDisable(); PickIt(); RefillBeltPotions(potionType, RefillBeltAmount()); RestToRegenMana(); if (!TeleportFromMonster(eldritch_path)) return false; RemoveEventHandler("onHealth", "HealthEventFunc"); if(mana_check) RemoveEventHandler("onMana", "ManaEventFunc"); if(!Merc.IsDead && merc_heal) RemoveEventHandler("onMercHealth", "MercHealthEventFunc"); return true; } function killShenk() { HandleDefenses(); if (!TeleportToMonster(shenk1_path)) return; for (LFSi=0; LFSi < 5 && !Shenk; LFSi++) { Shenk = GetBossInfo("Siege Boss"); Sleep(1000); } if (Shenk) { if (EnchantmentsShow) Shenk.PrintEnchantments(4); if(UseEnchantments && CheckEnchantments(skipthese, Shenk)) { ELog("BAD Immunities detected for Shenk."); SmartSleep(500); if (!TeleportFromMonster(shenk1_path)) return false; return true; } } else { ELog("Shenk not found."); if (!TeleportFromMonster(shenk1_path)) return false; return true; } SetEventHandler("onHealth", "HealthEventFunc"); if(mana_check) SetEventHandler("onMana", "ManaEventFunc"); if(!Merc.IsDead && merc_heal) SetEventHandler("onMercHealth", "MercHealthEventFunc"); if (!TeleportToMonster(shenk2_path)) return false; PickitEnable(); AttackSequence(shenk_attack_seq, Shenk, shenk_repeat_after) PBrown("Shenk has been destroyed."); Stats("increment shenk"); Sleep(100); if (UseWeaponSwitch) SetWeapon(MYweapon); PickitDisable(); PickIt(); RefillBeltPotions(potionType, RefillBeltAmount()); RestToRegenMana(); if (!TeleportFromMonster(shenk2_path)) return false; if (!TeleportFromMonster(shenk1_path)) return false; RemoveEventHandler("onHealth", "HealthEventFunc"); if(mana_check) RemoveEventHandler("onMana", "ManaEventFunc"); if(!Merc.IsDead && merc_heal) RemoveEventHandler("onMercHealth", "MercHealthEventFunc"); return true; } function killPindle() { SetEventHandler("onHealth", "HealthEventFunc"); if(mana_check) SetEventHandler("onMana", "ManaEventFunc"); if(!Merc.IsDead && merc_heal) SetEventHandler("onMercHealth", "MercHealthEventFunc"); SmartSleep(Randomize(1500, 500)); HandleDefenses(); if (!TeleportToMonster(pindle_path)) return false; for (pTry=0; pTry < 10; pTry++) { Pindle = GetBossInfo("Pindleskin"); SmartSleep(100); } if (Pindle) { if (EnchantmentsShow) Pindle.PrintEnchantments(4); if(UseEnchantments && CheckEnchantments(skipthese, Pindle)) { ELog("BAD Immunities detected for Pindleskin."); Stats("increment immunes"); SmartSleep(500); return true; } } else { ELog("Pindle not found."); return false; } PickitEnable(); AttackSequence(pindle_attack_seq, Pindle, pindle_repeat_after); Stats("increment pindle"); PBrown("Pindleskin has been destroyed."); Sleep(100); if (UseWeaponSwitch) SetWeapon(MYweapon); PickitDisable(); PickIt(); RefillBeltPotions(potionType, RefillBeltAmount()); if (doZombieRun) { PBrown("Beginning zombie slaughter."); ZombieAttack(); } SmartSleep(500); RemoveEventHandler("onHealth", "HealthEventFunc"); if(mana_check) RemoveEventHandler("onMana", "ManaEventFunc"); if(!Merc.IsDead && merc_heal) RemoveEventHandler("onMercHealth", "MercHealthEventFunc"); return true; } function TownPrepMove(path) { switch (path) { case "om": for (itownmove=0; itownmove < om_path.length; itownmove++){ if (!Move(om_path[itownmove])) return false; } if ((Player.Health < heal_life || Player.Mana < heal_mana)) TalkToMalah(heal_life, heal_mana); // Heal if we need it if (NeedToIdentify()) IdentifyInventoryItems(); // ID anything set to check if (!Move(om_path[itownmove-1])) return false; break; case "ol": for (itownmove=0; itownmove < ol_path.length; itownmove++){ if (!Move(ol_path[itownmove])) return false; } TalkToLarzuk(); // Refill Javs/repair if (!Move(ol_path[itownmove-1])) return false; break; case "cl": for (itownmove=0; itownmove < cl_path.length; itownmove++){ if (!Move(cl_path[itownmove])) return false; } TalkToLarzuk(); // Refill Javs/repair if (!Move(cl_path[itownmove-1])) return false; break; case "ml": for (itownmove=0; itownmove < ml_path.length; itownmove++){ if (!Move(ml_path[itownmove])) return false; } TalkToLarzuk(); // Refill Javs/repair if (!Move(ml_path[itownmove-1])) return false; break; case "oq": for (itownmove=0; itownmove < oq_path.length; itownmove++){ if (!Move(oq_path[itownmove])) return false; } if (use_merc && Merc.IsDead) TalkToQualKehk(); // resurrect merc if (!Move(oq_path[itownmove-1])) return false; break; case "cq": for (itownmove=0; itownmove < cq_path.length; itownmove++){ if (!Move(cq_path[itownmove])) return false; } if (use_merc && Merc.IsDead) TalkToQualKehk(); // resurrect merc if (!Move(cq_path[itownmove-1])) return false; break; case "mq": for (itownmove=0; itownmove < mq_path.length; itownmove++){ if (!Move(mq_path[itownmove])) return false; } if (use_merc && Merc.IsDead) TalkToQualKehk(); // resurrect merc if (!Move(mq_path[itownmove-1])) return false; break; case "ql": for (itownmove=0; itownmove < ql_path.length; itownmove++){ if (!Move(ql_path[itownmove])) return false; } TalkToLarzuk(); // Refill Javs/repair if (!Move(ql_path[itownmove-1])) return false; break; case "lq": for (itownmove=0; itownmove < lq_path.length; itownmove++){ if (!Move(lq_path[itownmove])) return false; } if (use_merc && Merc.IsDead) TalkToQualKehk(); // resurrect merc if (!Move(lq_path[itownmove-1])) return false; break; case "lc": for (itownmove=0; itownmove < lc_path.length; itownmove++){ if (!Move(lc_path[itownmove])) return false; } break; case "lc": for (itownmove=0; itownmove < lc_path.length; itownmove++){ if (!Move(lc_path[itownmove])) return false; } break; case "oc": for (itownmove=0; itownmove < oc_path.length; itownmove++){ if (!Move(oc_path[itownmove])) return false; } break; case "co": for (itownmove=0; itownmove < co_path.length; itownmove++){ if (!Move(co_path[itownmove])) return false; } break; case "qc": for (itownmove=0; itownmove < qc_path.length; itownmove++){ if (!Move(qc_path[itownmove])) return false; } break; case "cp": for (itownmove=0; itownmove < cp_path.length; itownmove++){ if (!Move(cp_path[itownmove])) return false; } break; default: ELog("Invalid path selection in TownPrepMove() case."); break; } } //////////////////////////////////////////////////////////////////////////////// // Spell Functions //////////////////////////////////////////////////////////////////////////////// function HandleDefenses() { for (HDi = 0; HDi < defenses.length; HDi++) { SmartSleep(500); Player.SetRightSkill(defenses[HDi].skill); SmartSleep(Randomize(600, 100)); Player.UseRightSkill(Player.Location.x, Player.Location.y); SmartSleep(Randomize(defenses[HDi].delay, 200)); } } function spell(s, p, r, d) { this.skill = s; this.repeat = p; this.range = r; this.delay = d; } function SkipEnchantment(e, c) { skipthese[skiptotal++] = new enchantment(e, c); } function DefensiveSpell(s, p, r, d) { defenses[defensestotal++] = new spell(s, p, r, d); } function EldritchAttack(s, p, r, d) { eldritch_attack_seq[eldritchattacktotal++] = new spell(s, p, r, d); } function ShenkAttack(s, p, r, d) { shenk_attack_seq[shenkattacktotal++] = new spell(s, p, r, d); } function PindleAttack(s, p, r, d) { pindle_attack_seq[pindleattacktotal++] = new spell(s, p, r, d); } function ZombAttack(s, p, r, d) { zombie_attack_seq[zombieattacktotal++] = new spell(s, p, r, d); } //////////////////////////////////////////////////////////////////////////////// // Attack Functions //////////////////////////////////////////////////////////////////////////////// function AttackSequence(attack_seq, mon, repeat_after) { Sleep(100); for (i = 0; i < repeat_after && i < attack_seq.length; i++) { Player.SetRightSkill(attack_seq[i].skill); for (n=0; n < attack_seq[i].repeat && !mon.Dead && !Player.Dead; n++) { Player.UseRightSkill(mon.Location.x, mon.Location.y); SmartSleep(Randomize(attack_seq[i].delay,50)); } } while (!mon.Dead && !Player.Dead) { for (i = repeat_after; i < attack_seq.length && !mon.Dead && !Player.Dead; i++) { if (reposition) RepositionForAttack(mon, attack_seq[i].range); Player.SetRightSkill(attack_seq[i].skill); for (n=0; n <= Randomize(attack_seq[i].repeat, 1) && !mon.Dead && !Player.Dead; n++) { if (UseWeaponSwitch && mon.Health < WeaponSwitchHealth) SetWeapon(MFweapon); Player.UseRightSkill(mon.Location.x, mon.Location.y); SmartSleep(Randomize(attack_seq[i].delay,50)); } } } } function RepositionForAttack(monster, maxrange) { MonX = monster.Location.x; MonY = monster.Location.y; PlayX = Player.Location.x; PlayY = Player.Location.y; reprange = Math.floor(Math.sqrt(2 * Math.pow((maxrange / 2),2))); deltaX = Math.abs(PlayX - MonX); deltaY = Math.abs(PlayY - MonY); distance = Math.floor(Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY,2))); if (distance > maxrange || distance < 4) { PBrown("Repositioning..."); if (PlayX > MonX) newX = MonX + reprange; else newX = MonX - reprange; if (PlayY > MonY) newY = MonY + reprange; else newY = MonY - reprange; TeleMove(new coord(newX, newY)); } } function ZombieAttack() { PickUpGoldAmount = 0; // Don't pickup gold, moves around too much. Alternate is to make PickUpRadius less (10) PickitEnable(); if (!TeleMove(zombie_path[0])) return false; SmartSleep(Randomize(300, 100)); for (izcoord=1; izcoord < zombie_path.length; izcoord++) { if (!TeleMove(zombie_path[izcoord])) return false; SmartSleep(Randomize(110,20)); for (i = 0; i < zombie_attack_seq.length; i++) { Player.SetRightSkill(zombie_attack_seq[i].skill); for (n=0; n <= Randomize(zombie_attack_seq[i].repeat, 1); n++) { Player.UseRightSkill(Player.Location.x, Player.Location.y); SmartSleep(Randomize(zombie_attack_seq[i].delay,50)); } } PickIt(); SmartSleep(Randomize(100,75)); } PickitDisable(); } function GetBossInfo(MonsterName) { EntityList = Entity.GetEntities(); for(i = 0; i < EntityList.length; i++){ monster = EntityList[i]; if(monster.Class == 1 && monster.MonsterType == 1 && monster.Name == MonsterName) { return monster; } } return 0; } //////////////////////////////////////////////////////////////////////////////// // Event Handler Functions //////////////////////////////////////////////////////////////////////////////// function HealthEventFunc(health) { if (health < health_bugout) { Stats("increment chickens"); ELog("I'm outta here."); Disconnect(); return; } if (health < health_chicken) { if (!UseGlobalBeltPotion()) { Stats("increment chickens"); Disconnect(); return; } } } function ManaEventFunc(mana) { if(mana < mana_chicken && mana_check) { if (potionType != "Full Rejuv Potion" && potionType != "Rejuv Potion") { Stats("increment chickens"); Disconnect(); return; } if (!UseGlobalBeltPotion()) { Stats("increment chickens"); Disconnect(); return; } } } function MercHealthEventFunc(health) { if(health < merc_chicken && !Merc.IsDead) { MercUseGlobalBeltPotion(); } } function DeathEventFunc() { ELog("Ow. That hurt."); Stats("increment deaths"); Disconnect(); } function UseTheForce() { SetSuccessString = "" Stats("setscript AA_PindleSorc"); Stats("add Total"); Stats("add Deaths"); Stats("add Chickens"); Stats("add Immunes"); if (doEldritchRun) { Stats("add Eldritch"); SetSuccessString = SetSuccessString + " Eldritch " } else { Stats("remove Eldritch"); } if (doShenkRun) { Stats("add Shenk"); SetSuccessString = SetSuccessString + " Shenk " } else { Stats("remove Shenk"); } if (doPindleRun) { Stats("add Pindle"); SetSuccessString = SetSuccessString + " Pindle " } else { Stats("remove Pindle"); } Stats("setsuccess" + SetSuccessString); Stats("show"); }