justhackitup

muhbear

Jan 25th, 2021
902
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. //This is the very start of the file, below my lines are the actual attack script.  I used a few special conditions as I run 2 //different melee sorcs and have them both precasting differently.  This way the do not override each other or get caught in loops //attempting each others skills.  
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  4.  
  5. var ClassAttack = {
  6.    
  7.            
  8.     doAttack: function (unit, preattack) {
  9.         if (Config.MercWatch && Town.needMerc()) {
  10.             print("mercwatch");
  11.             Town.visitTown();
  12.         }
  13.         var slot = me.weaponswitch;
  14.         if (me.getSkill(58, 1) && !me.getState(30)) { // Energy Shield in the Field for Zealer
  15.             Skill.cast(58, 0);
  16.         }
  17.         //////////////////////////////////////////////// The Beast ////////////////////////////////////////////////////
  18.         if (!me.getState(140) && me.charname === "defeated" && !me.getState(10) || !me.getState(16)) { // Field full buff
  19.         Precast.doPrecast(true); // Beast takes place of CTA so just Enchant and Frozen Armor are needed
  20.         delay(200);
  21.         }
  22.         if (!me.getState(140) && me.charname === "defeated") { // Not Werebear Check
  23.         Attack.weaponSwitch(); // Switch to Beast
  24.         Skill.cast(228, 0); // Cast Werebear
  25.        
  26.         }
  27.         if (me.charname === "defeated") { // always checks for Primary Slot for attack which is set in the Chars Config File
  28.             Attack.weaponSwitch(Attack.getPrimarySlot());
  29.                                             }
  30.         //////////////////////////End The Beast And Begin/////////////////////Beast Needs Frozen Shield//////////////////                                  
  31.         if (me.getState(140) && me.charname === "defeated" && !me.getState(10)) { // Frozen Armor went away!
  32.         Attack.weaponSwitch(Attack.getPrimarySlot()); // Get Primary slot in case it drops Frozen Armor at a bad time
  33.         delay(200);
  34.         Attack.weaponSwitch(); // Switch to Beast
  35.         Skill.cast(228, 0); // Unshift from Werebear
  36.         Precast.doPrecast(true); // Rebuff Frozen Armor (enchant if missing, unlikely but its checked, precast I removed "|| force")
  37.         Attack.weaponSwitch(Attack.getPrimarySlot()); // Ensure primary weapon is back out so we know our weapon state
  38.        
  39.         }
  40.         if (!me.getState(140) && me.charname === "defeated") { // Not Werebear Check
  41.         Attack.weaponSwitch(); // Switch to beast
  42.         Skill.cast(228, 0); // Cast Werebear
  43.         }
  44.         if (me.charname === "defeated") { // always checks for Primary Slot for attack which is set in the Chars Config File
  45.         Attack.weaponSwitch(Attack.getPrimarySlot());}
  46.         //////////////////////////////////////////End All Beast///////////////////////////////////////////////////////
RAW Paste Data