daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Feb 12th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include MQ2Cast_Spell_Routines.inc
  2. #include ChatParse.inc
  3. #include mokaddon.inc
  4.  
  5. #Chat tell
  6. #Chat group
  7.  
  8. Sub Main
  9. |------------READ THIS SECTION AND EDIT IF NEEDED-----------
  10.    /declare autointerrupt int outer 0
  11.    /declare autosit int outer 1
  12.    /declare interrupt2healself int outer 0
  13.    /declare usegroupheal int outer 0
  14.    /declare noInvis int outer 0
  15.  
  16.    /declare DestroySummoned bool outer TRUE
  17.    /declare MyMount string outer Orb of Coalescence
  18.    /declare mychannel string outer NotUsingChannels
  19.    /declare usegroupchat int outer 1
  20.    /declare useircchat int outer 0
  21.    /declare autohealmode int outer 2
  22.    /declare healspell string outer Sacred Light
  23.    /declare healspellrange int outer 100
  24.    /declare patchheal string outer Sacred Remedy
  25.    /declare patchhealrange int outer 200  
  26.    /declare hotspell string outer Sacred Elixir
  27.    /declare hotspellrange int outer 100
  28.    /declare daspell string outer Divine Custody
  29.    /declare groupheal string outer Word of Vivification
  30.    /declare grouphealrange int outer 70
  31.    /declare announce int outer 1
  32.    /declare distancetosit int outer 10
  33.    /declare onlyhealfd int outer 0
  34.    /declare interrupt2healselfhp int outer 50
  35.    /declare defaultstophealpoint int outer 80  
  36.    /declare longhpbuff string outer Tenacity    
  37.    /declare groupspellhastebuff string outer Aura of Purpose
  38.    /declare rgcspell string outer Remove Greater Curse  
  39.    /declare healpetmode int outer 2
  40.    /declare pethealpoint int outer 65
  41.    /declare manatohealpet int outer 25
  42.    /declare pethealspell string outer Sacred Light
  43.    /declare pethealspellrange int outer 100  
  44.  
  45. |** Tweak Heals Here - tankhealpoint is for War/Pal/SK other
  46. than MT, casterhotpoint and casterpatchpoint refer to
  47. wiz/mag/enc/dru, necshmpatchpoint refers to necros and
  48. shamans, defaultpatchpoint refers to all other classes.   **|
  49.  
  50.    /declare selfhealpoint int outer 70
  51.    /declare dacastpoint int outer 29
  52.    /declare tankhealpoint int outer 65
  53.    /declare casterhotpoint int outer 85
  54.    /declare casterpatchpoint int outer 60
  55.    /declare necshmpatchpoint int outer 50
  56.    /declare defaultpatchpoint int outer 70
  57.    
  58.    |**---------------Divine Arbitration Config-----------------
  59. Fine tune div arb interruptions. interrupt2divarb is the
  60. threshold for interrupting other spells for target/self HP
  61. dropping below divarbpoint. interrupt2divarb is in 1/10th
  62. seconds, so if 16 is used, spells with more than 1.6 seconds
  63. left would be interrupted if divarbpoint HP is reached. **|
  64.    /declare usedivarb int outer 0
  65.    /declare divarbpoint int outer 25
  66.    /declare healafterdivarb int outer 1
  67.    /declare interrupt2divarb int outer 14
  68.  
  69. |**---------------------TrickyDA Config---------------------
  70. The following are HP buffs cleric will click off, in order,
  71. to get above 40% HP and avoid low HP aggro. Clr will then
  72. click off DA and resume duties, beg new buffs, etc. To
  73. enable, set trickyda to 1, 0 will disable **|
  74.  
  75.    /declare trickyda int outer 0
  76.    /if (${trickyda}==1) {
  77.       /declare intcount int outer 0
  78.       /declare trickybuff[20] string outer
  79.       /varset trickybuff[1] Virtue
  80.       /varset trickybuff[2] Hand of Virtue
  81.       /varset trickybuff[3] Conviction
  82.       /varset trickybuff[4] Hand of Conviction
  83.       /varset trickybuff[5] Focus of Soul
  84.       /varset trickybuff[6] Focus of the Seventh
  85.       /varset trickybuff[7] Wunshi's Focusing
  86.       /varset trickybuff[8] Talisman of Wunshi
  87.       /varset trickybuff[9] Protection of the 9
  88.       /varset trickybuff[10] Blessing of the Nine
  89.       /varset trickybuff[11] Steeloak Skin
  90.       /varset trickybuff[12] Blessing of Steeloak
  91.       /varset trickybuff[13] Symbol of Kazad
  92.       /varset trickybuff[14] Kazad`s Mark
  93.       /varset trickybuff[15] Symbol of Balikor
  94.       /varset trickybuff[16] Balikor's Mark
  95.       /varset trickybuff[17] Brell's Stalwart Shield
  96.       /varset trickybuff[18] Brell's Brawny Bulwark
  97.       /varset trickybuff[19] Spiritual Vigor
  98.       /varset trickybuff[20] Spiritual Vitality
  99.    }
  100. |-------------------End TrickyDA Config---------------------
  101.  
  102. |------------------------END EDITING------------------------
  103.  
  104.    /declare healpct int outer 70
  105.    /declare tankname string outer ${Target.CleanName}
  106.    /declare tanknameid int outer ${Target.ID}
  107.    /declare tankclass string outer
  108.    /declare minorhurt int outer 0
  109.    /declare majorhurt int outer 0
  110.    /declare worsthurt string outer NULL
  111.    /declare worsthurtid int outer
  112.    /declare worsthp int outer 100
  113.    /declare worstclass string outer NULL
  114.    /declare gmember int outer
  115.    /declare nohotforua string outer NULL
  116.    /declare nohotforub string outer NULL
  117.    /declare nohotforuc string outer NULL
  118.    /declare nohotforud string outer NULL
  119.    /declare rodwait int outer 0
  120.    /declare following int outer 0
  121.    /declare follname string outer NULL
  122.    /declare pallycount int outer 0
  123.    /declare stophealpoint int outer ${defaultstophealpoint}
  124.    /declare buffbeg int outer 0
  125.    /declare oomspam int outer 0
  126.    /declare lomspam int outer 0
  127.    /declare duckspam int outer 1
  128.    /declare duckfdspam int outer 1dddd
  129.    /declare duckselfspam int outer 1
  130.    /declare nomtspam int outer 1
  131.    /declare ghealhurtcount int outer 0
  132.    /declare divarboor int outer 0
  133.    /declare aetime int outer 0
  134.    /declare manastonecycle int outer 0
  135.    /declare olditem string outer
  136.    /declare oldprimary string outer
  137.  
  138. |   /if (${useircchat}==0) /join ${mychannel}
  139. |   /if (${useircchat}==1) {
  140. |      /iconnect 192.168.0.1 6667 #${mychannel} ${Me}
  141. |      /i nick ${Me}
  142. |      /timed 50 /i join #${mychannel}
  143. |   }
  144. |
  145. |   /if (${FindItem[=Stone of Tainted Health].ID}) /call EquipItem "Stone of Tainted Health"
  146.  
  147.    /if (!${Target.ID}) {
  148.       /echo Target the Tank when you run this macro to designate him as MT
  149.       /end
  150.    } else {
  151.       /varset tanknameid ${Target.ID}
  152.       /varset tankclass ${Target.Class.Name}
  153.    }
  154.  
  155.    /if (${Defined[Param0]}) {    
  156.       /varset healpct ${Param0}
  157.    } else {
  158.         /echo No Heal% specified, defaulting to ${healpct}
  159.    }
  160.    
  161.    /if (!${Defined[Param1]}) {    
  162.       /echo Usage: /mac AFCleric % healspell
  163.       /echo Example: /mac AFCleric 40 Complete Heal
  164.       /echo Defaulting to ${healspell} at ${healpct}%
  165.    } else {    
  166.       /if (!${Defined[Param2]}) {
  167.          /varset healspell ${Param1}
  168.       } else /if (!${Defined[Param3]}) {
  169.          /varset healspell ${Param1} ${Param2}
  170.       } else /if (!${Defined[Param4]}) {
  171.          /varset healspell ${Param1} ${Param2} ${Param3}
  172.       } else {
  173.          /varset healspell ${Param1} ${Param2} ${Param3} ${Param4}
  174.       }
  175.    }
  176.  
  177.    /echo AFCleric Active, running in Autohealmode ${autohealmode}
  178.    /echo Casting ${healspell} on ${tankname} at ${healpct}% HP
  179.    /if (${autohealmode}==0) /echo ONLY ${tankname} will be healed
  180.    /if (${autohealmode}==1) /echo ONLY ${tankname} and myself will be healed
  181.    /if (${autohealmode}==2) /echo ${tankname}, myself and my group will be healed
  182.    /if (${autohealmode}==3) /echo ${tankname} and myself will be healed before the rest of the group
  183.    
  184.    :tankwatchloop
  185.    
  186.         |check cursor for an item. If we are not casting, either bag it or destroy it
  187.         :CheckCursor
  188.         /if (${Cursor.ID} && !${Me.Casting.ID}) {
  189.                 /if (${Cursor.ID}==3426 || ${Cursor.ID}==6346) {
  190.                         |always autoinv a modrod
  191.                         /autoinv
  192.                 } else /if (${Cursor.NoRent}) {
  193.                         /if (${DestroySummoned}) {
  194.                                 /destroy
  195.                         } else {
  196.                                 /autoinv
  197.                         }
  198.                 } else {
  199.                         |5 second delay on normal items in case the user is trying to move sometihng.
  200.                         /delay 5s !${Cursor.ID}
  201.                         /autoinv
  202.                 }
  203.                 /goto :CheckCursor
  204.         }
  205.    
  206.    /if (${Spawn[${tanknameid}].Name.NotEqual[${tankname}]}) /varset tanknameid 0
  207.    /if (!${Spawn[${tanknameid}].ID}) /if (${Spawn[${tankname}].ID}) {
  208.       /if (${SpawnCount[${tankname} ${tankclass}]}==1) {
  209.          /varset tanknameid ${Spawn[${tankname} ${tankclass}].ID}
  210.          /echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid}
  211.       }
  212.       /if (${SpawnCount[${tankname} ${tankclass}]}>1) {
  213.          /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) {
  214.             /beep
  215.             /varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID}
  216.             /echo Defaulting to PC ${Spawn[pc ${tankname} ${tankclass}].Name} as MT. If incorrect, please restart macro
  217.          } else {
  218.             /beep
  219.             /echo Need to restart macro to correctly identify the MT
  220.          }
  221.       }
  222.    }
  223.    /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.Equal[Corpse]}) {
  224.       /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) {
  225.          /varset tanknameid ${Spawn[pc ${tankname ${tankclass}}].ID}
  226.          /echo ${Spawn[pc ${tankname} ${tankclass}].Name} is MT and has ID# ${tanknameid}. If incorrect, please restart macro
  227.       }
  228.    }
  229.    /if ((!${Target.ID})||(${Target.ID}!=${tanknameid})) {
  230.       /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) {
  231.          /target id ${tanknameid}
  232.          /delay 6 ${Target.ID}==${tanknameid}
  233.       }
  234.    }
  235.    /if (!${Spawn[${tanknameid}].ID}) {
  236.       /if (${nomtspam}==1) {
  237.          /e Warning No Designated MT is available
  238.          /timed 300 /varset nomtspam 1
  239.          /varset nomtspam 0
  240.       }
  241.    }
  242.    /if ((${Me.PctMana}<=20)&&(${announce}==1)&&(${lomspam}==1)) {
  243.       /g ${Me.PctMana}m
  244.       /varset lomspam 0
  245.       /timed 300 /varset lomspam 1
  246.    }
  247.    /if ((${Me.PctMana}<=7)&&(${announce}==1)&&(${oomspam}==1)) {
  248.       /g oom
  249.       /varset oomspam 0
  250.       /timed 300 /varset oomspam 1
  251.       /call MedTime
  252.    }
  253.                 |check gamestate
  254.                 /if (${MacroQuest.GameState.Equal[CHARSELECT]}) {
  255.                         |if we drop to character selected wait up to 5 minutes for us to getback in game
  256.                         /delay 5m ${MacroQuest.GameState.Equal[INGAME]}
  257.                         /if (${MacroQuest.GameState.Equal[CHARSELECT]}) /endmacro
  258.                 }
  259.  
  260.                 |I am either dead or looting. delay and then loop for recheck
  261.                 /if ((!${InvSlot[chest].Item.ID} && !${InvSlot[mainhand].Item.ID} && !${Me.Platinum}) || ${Me.State.Equal[HOVER]}) {
  262.                         /delay 5m ((${InvSlot[chest].Item.ID} || ${InvSlot[mainhand].Item.ID} || ${Me.Platinum}) && !${Me.State.Equal[HOVER]})
  263.                         /goto :tankwatchloop
  264.                 }
  265.  
  266.    /if (${Target.ID}==${tanknameid}) {
  267.       /varset stophealpoint ${Math.Calc[${healpct}*1.1]}
  268.       /if ((${Target.Distance}<=${patchhealrange})&&(${Target.PctHPs}<=${Math.Calc[0.7*${healpct}]})&&(${Target.PctHPs}>=1)) {
  269.          /if (${announce}==1) /g Casting ${patchheal} on %T
  270.          /call MQ2Cast "${patchheal}" gem2 1s CheckHP
  271.          /delay 15 ${Me.SpellReady[${patchheal}]}
  272.       }
  273.       /if ((${Target.Distance}<=${healspellrange})&&(${Target.PctHPs}<=${healpct})&&(${Target.PctHPs}>=${Math.Calc[0.7*${healpct}]})) {
  274.          /if (${announce}==1) /g Casting ${healspell} on %T
  275.          /call MQ2Cast "${healspell}" gem1 1s CheckHP
  276.          /delay 15 ${Me.SpellReady[${healspell}]}
  277.       }
  278.       /varset stophealpoint ${defaultstophealpoint}
  279.       /call CheckEvents
  280.    }
  281.    |/if ((${autosit}>=1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) {
  282.    |   /if ((${Me.PctMana}>98)||(${Me.PctHPs}<=90)) /stand
  283.    |}
  284.    |/if ((${autosit}==1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) {
  285.    |   /if (${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]}) /stand
  286.    |}
  287.    /if (${autohealmode}==0) {
  288.       /call CheckEvents
  289.       /goto :tankwatchloop
  290.    }
  291.    /if ((${autohealmode}>=1)&&(${Me.PctHPs}<=${selfhealpoint})) /call Healself
  292.    /if (${autohealmode}>=2) {
  293.       /if ((${Target.PctHPs}>${healpct})||(${Target.Distance}>${healspellrange})||(${Target.PctHPs}<=1)||(!${Target.ID})||(${Target.ID}!=${tanknameid})) {
  294.          /call Healgroup
  295.       }
  296.    }
  297.    /if ((${autohealmode}<2)&&(${Me.PctHPs}>${selfhealpoint})&&(${Me.PctMana}<=98)) /call MedTime
  298.    /call CheckEvents
  299.    /goto :tankwatchloop
  300. /return
  301.    
  302.  
  303. Sub Healself
  304.    /if (${Me.PctHPs}<=${healpotpoint}) /call HealPotUse
  305.    /if (${Me.PctHPs}>${selfhealpoint}) /return
  306.    /varset stophealpoint ${Math.Calc[${selfhealpoint}+5]}
  307.    /if ((!${Target.ID})||(${Target.PctHPs}>=${Math.Calc[1.1*${healpct}]})||(${Target.PctHPs}<=1)||(${Target.ID}!=${tanknameid})) {
  308.       /if ((${Me.PctHPs}<=${selfhealpoint})&&(${Me.PctHPs}>${dacastpoint})) {
  309.          /target myself
  310.          /delay 6 ${Target.Name.Equal[${Me}]}
  311.          /if (${Target.Name.Equal[${Me}]}) {
  312.             /if (${announce}==1) /g Casting ${patchheal} on %T
  313.             /call MQ2Cast "${patchheal}" gem2 1s CheckHP
  314.             /delay 15 ${Me.SpellReady[${patchheal}]}
  315.          }
  316.       }
  317.       /if ((${Me.PctHPs}<=${dacastpoint})&&(${Me.SpellReady[${daspell}]})) {
  318.          /if (${announce}==1) /g Casting DA!! <<WARNING>> DA!! No Heals for 18 SECONDS
  319.          :retryda
  320.          /call MQ2Cast "${daspell}"
  321.          /delay 1
  322.          /if ((!${Me.Buff[${daspell}].ID})&&(${Me.SpellReady[${daspell}]})) /goto :retryda
  323.          /if ((${trickyda}==1)&&(${Me.Buff[${daspell}].ID})) /call TrickyDA
  324.          :dawait
  325.          /if (${Me.Buff[${daspell}].ID}) {
  326.             /delay 1s !${Me.Buff[${daspell}].ID}
  327.             /varset stophealpoint ${defaultstophealpoint}
  328.             /call CheckEvents
  329.             /goto :dawait
  330.          }
  331.       }            
  332.    }
  333.    /if (${Me.PctHPs}<=${Math.Calc[${selfhealpoint}*0.7]}) {
  334.       /target myself
  335.       /delay 6 ${Target.Name.Equal[${Me}]}
  336.       /if (${Target.Name.Equal[${Me}]}) {
  337.          /if (${announce}==1) /g Casting ${patchheal} on %T
  338.          /varset stophealpoint ${Math.Calc[${selfhealpoint}+5]}
  339.          /call MQ2Cast "${patchheal}" gem2 1s CheckHP
  340.          /delay 15 ${Me.SpellReady[${patchheal}]}
  341.       }
  342.    }
  343.    /varset stophealpoint ${defaultstophealpoint}
  344. /return
  345.  
  346.  
  347. Sub Healgroup
  348.    :healgroup
  349.    /varset worsthurt NULL
  350.    /varset worsthp 100
  351.    /varset worstclass NULL
  352.    /varset minorhurt 0
  353.    /varset majorhurt 0
  354.    /varset ghealhurtcount 0
  355.    /for gmember 0 to ${Group.Members}
  356.       /if (${onlyhealfd}==0) {
  357.          /if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) {
  358.             /if (${Group.Member[${gmember}].PctHPs}<=${worsthp}) {
  359.                /varset worsthurt ${Group.Member[${gmember}].Name}
  360.                /varset worsthurtid ${Group.Member[${gmember}].ID}
  361.                /varset worsthp ${Group.Member[${gmember}].PctHPs}
  362.                /varset worstclass ${Group.Member[${gmember}].Class.Name}
  363.             }
  364.          }
  365.       }
  366.       /if (${onlyhealfd}==1) {
  367.          /if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) {
  368.             /if ((${Group.Member[${gmember}].Class.Name.NotEqual[Monk]})&&(${Group.Member[${gmember}].Class.Name.NotEqual[Necromancer]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) {
  369.                /varset worsthurt ${Group.Member[${gmember}].Name}
  370.                /varset worsthurtid ${Group.Member[${gmember}].ID}
  371.                /varset worsthp ${Group.Member[${gmember}].PctHPs}
  372.                /varset worstclass ${Group.Member[${gmember}].Class.Name}
  373.             }
  374.             /if ((${Group.Member[${gmember}].Class.Name.Equal[Monk]})||(${Group.Member[${gmember}].Class.Name.Equal[Necromancer]})) {
  375.                /if ((${Group.Member[${gmember}].State.Equal[feign]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) {
  376.                   /varset worsthurt ${Group.Member[${gmember}].Name}
  377.                   /varset worsthurtid ${Group.Member[${gmember}].ID}
  378.                   /varset worsthp ${Group.Member[${gmember}].PctHPs}
  379.                   /varset worstclass ${Group.Member[${gmember}].Class.Name}
  380.                }
  381.             }
  382.          }
  383.       }
  384.       /if ((${Group.Member[${gmember}].Distance}<=${grouphealrange})&&(${Group.Member[${gmember}].PctHPs}<=85)) /varcalc ghealhurtcount ${ghealhurtcount}+1
  385.       /if ((${Group.Member[${gmember}].PctHPs}<=85)&&(${Group.Member[${gmember}].PctHPs}>=60)) /varcalc minorhurt ${minorhurt}+1
  386.       /if ((${Group.Member[${gmember}].PctHPs}<=60)&&(${Group.Member[${gmember}].PctHPs}>=1)) /varcalc majorhurt ${majorhurt}+1
  387.    /next gmember
  388.    /if (${autohealmode}==3) {
  389.       /if ((!${Target.ID})||(${Target.Name.NotEqual[${tankname}]})) /if (${Spawn[${tanknameid}].ID}) {
  390.          /target id ${tanknameid}
  391.          /delay 6 ${Target.ID}==${tanknameid}
  392.          /delay 1
  393.          /if ((${Target.ID}==${tanknameid})&&(${Target.PctHPs}<=${healpct})&&(${Target.Distance}<=${healspellrange})) /return
  394.       }
  395.       /if (${Me.PctHPs}<=${selfhealpoint}) /return
  396.    }
  397.    /if ((${majorhurt}==0)&&(${minorhurt}==0)) {
  398.       /if (${Spawn[${tanknameid}].ID}) {
  399.          /target id ${tanknameid}
  400.          /delay 6 ${Target.ID}==${tanknameid}
  401.          /delay 1
  402.       }
  403.       /if (((${Target.ID}==${tanknameid})&&(${Target.PctHPs}>${healpct}))||(!${Spawn[${tanknameid}].ID})||(${Spawn[${tanknameid}].Type.Equal[corpse]})) {
  404.          /if ((${healpetmode}>0)&&(${Me.PctMana}>=${manatohealpet})) /call HealPet
  405.          /if (${mokaddon}==1) /if (${Target.ID}==${tanknameid}) /call AutoMOK
  406.          /if (${Me.PctMana}<=98) /call MedTime
  407.       }
  408.       /call CheckEvents
  409.       /return
  410.    }
  411.    /if ((${usedivarb}==1)&&(${worsthp}<=${divarbpoint})&&(${Me.AltAbilityReady[divine arbitration]})) /call Divarbcast
  412.    /if ((${Math.Calc[${majorhurt}+${minorhurt}]}>=3)&&(${usegroupheal}==1)) {
  413.       /if (${announce}==1) /g Inc Grp Heal, get close
  414.       /call MQ2Cast "${groupheal}" gem4 1s
  415.       /delay 15 ${Me.SpellReady[${groupheal}]}
  416.       /call CheckEvents
  417.       /return
  418.    }
  419.    /if (${worsthurtid}==${tanknameid}) /return
  420.    /if (${worsthurtid}==${Me.ID}) {
  421.       /call Healself
  422.       /call CheckEvents
  423.       /return
  424.    }
  425.    /if ((${worstclass.Equal[Warrior]})||(${worstclass.Equal[Paladin]})||(${worstclass.Equal[Shadow Knight]})) {
  426.       /if ((${worsthp}<=${tankhealpoint})&&(${worsthp}>=${Math.Calc[0.7*${tankhealpoint}]})&&(${majorhurt}<=1)&&(${minorhurt}<=1)) {
  427.          /target id ${worsthurtid}
  428.     /delay 5 ${Target.ID}==${worsthurtid}
  429.          /if (!${Target.ID}) /return
  430.          /if (${Target.ID}!=${worsthurtid}) /return
  431.          /varset stophealpoint ${Math.Calc[${tankhealpoint}+5]}
  432.          /if (${announce}==1) /g Casting ${healspell} on %T
  433.          /call MQ2Cast "${healspell}" gem1 1s CheckHP
  434.          /delay 15 ${Me.SpellReady[${healspell}]}
  435.          /varset stophealpoint ${defaultstophealpoint}
  436.          /call CheckEvents
  437.          /return
  438.       }
  439.       /if (${worsthp}<=${tankhealpoint}) {
  440.          /target id ${worsthurtid}
  441.     /delay 5 ${Target.ID}==${worsthurtid}
  442.          /if (!${Target.ID}) /return
  443.          /if (${Target.ID}!=${worsthurtid}) /return
  444.          /varset stophealpoint ${Math.Calc[${tankhealpoint}+5]}
  445.          /if (${announce}==1) /g Casting ${patchheal} on %T
  446.          /call MQ2Cast "${patchheal}" gem2 1s CheckHP
  447.          /delay 15 ${Me.SpellReady[${patchheal}]}
  448.          /varset stophealpoint ${defaultstophealpoint}
  449.          /call CheckEvents
  450.          /return
  451.       }
  452.    } else /if ((${worstclass.Equal[Magician]})||(${worstclass.Equal[Wizard]})||(${worstclass.Equal[Enchanter]})||(${worstclass.Equal[Druid]})) {
  453.       /if ((${worsthp}<=${casterhotpoint})&&(${worsthp}>${casterpatchpoint})) {
  454.          /if ((${worsthurt.Equal[${nohotforua}]})||(${worsthurt.Equal[${nohotforub}]})||(${worsthurt.Equal[${nohotforuc}]})||(${worsthurt.Equal[${nohotforud}]})) /return
  455.          /if (${nohotforua.Equal[NULL]}) {
  456.             /target id ${worsthurtid}
  457.        /delay 5 ${Target.ID}==${worsthurtid}
  458.        /if (!${Target.ID}) /return
  459.             /if (${Target.ID}!=${worsthurtid}) /return
  460.             /varset nohotforua ${Target.Name}
  461.             /if (${announce}==1) /g Casting ${hotspell} on %T
  462.             /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
  463.             /call MQ2Cast "${hotspell}" gem3 1s CheckHP
  464.             /timed 200 /varset nohotforua NULL
  465.             /delay 15 ${Me.SpellReady[${hotspell}]}
  466.          } else /if (${nohotforub.Equal[NULL]}) {
  467.             /target id ${worsthurtid}
  468.        /delay 5 ${Target.ID}==${worsthurtid}
  469.        /if (!${Target.ID}) /return
  470.             /if (${Target.ID}!=${worsthurtid}) /return
  471.        /varset nohotforub ${Target.Name}
  472.             /if (${announce}==1) /g Casting ${hotspell} on %T
  473.             /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
  474.             /call MQ2Cast "${hotspell}" gem3 1s CheckHP
  475.             /timed 200 /varset nohotforub NULL
  476.             /delay 15 ${Me.SpellReady[${hotspell}]}
  477.          } else /if (${nohotforuc.Equal[NULL]}) {
  478.             /target id${worsthurtid}
  479.        /delay 5 ${Target.ID}==${worsthurtid}
  480.        /if (!${Target.ID}) /return
  481.             /if (${Target.ID}!=${worsthurtid}) /return
  482.        /varset nohotforuc ${Target.Name}
  483.             /if (${announce}==1) /g Casting ${hotspell} on %T
  484.             /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
  485.             /call MQ2Cast "${hotspell}" gem3 1s CheckHP
  486.             /timed 200 /varset nohotforuc NULL
  487.             /delay 15 ${Me.SpellReady[${hotspell}]}
  488.          } else /if (${nohotforud.Equal[NULL]}) {
  489.             /target id ${worsthurtid}
  490.        /delay 5 ${Target.ID}==${worsthurtid}
  491.        /if (!${Target.ID}) /return
  492.             /if (${Target.ID}!=${worsthurtid}) /return
  493.        /varset nohotforud ${Target.Name}
  494.             /if (${announce}==1) /g Casting ${hotspell} on %T
  495.             /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
  496.             /call MQ2Cast "${hotspell}" gem3 1s CheckHP
  497.             /timed 200 /varset nohotforud NULL
  498.             /delay 15 ${Me.SpellReady[${hotspell}]}
  499.          }
  500.          /varset stophealpoint ${defaultstophealpoint}
  501.          /call CheckEvents
  502.          /return
  503.       }
  504.       /if ((${worsthp}<=${casterpatchpoint})&&(${worsthp}>=1)) {
  505.          /target id ${worsthurtid}
  506.     /delay 5 ${Target.ID}==${worsthurtid}
  507.     /if (!${Target.ID}) /return
  508.          /if (${Target.ID}!=${worsthurtid}) /return
  509.          /if (${announce}==1) /g Casting ${patchheal} on %T
  510.          /call MQ2Cast "${patchheal}" gem2 1s CheckHP
  511.          /varset stophealpoint ${defaultstophealpoint}
  512.          /call CheckEvents
  513.          /delay 15 ${Me.SpellReady[${patchheal}]}
  514.          /return
  515.       }
  516.       /varset stophealpoint ${defaultstophealpoint}
  517.    } else /if ((${worstclass.Equal[Necromancer]})||(${worstclass.Equal[Shaman]})) {
  518.       /if ((${worsthp}<=${necshmpatchpoint})&&(${worsthp}>=1)) {
  519.          /target id ${worsthurtid}
  520.     /delay 5 ${Target.ID}==${worsthurtid}
  521.     /if (!${Target.ID}) /return
  522.          /if (${Target.ID}!=${worsthurtid}) /return
  523.          /varset stophealpoint ${Math.Calc[${necshmpatchpoint}+5]}
  524.          /if (${announce}==1) /g Casting ${patchheal} on %T
  525.     /call MQ2Cast "${patchheal}" gem2 1s CheckHP
  526.     /varset stophealpoint ${defaultstophealpoint}
  527.     /call CheckEvents
  528.     /delay 15 ${Me.SpellReady[${patchheal}]}
  529.     /return
  530.       }
  531.    } else /if ((${worsthp}<=${defaultpatchpoint})&&(${worsthp}>=1)) {
  532.       /target id ${worsthurtid}
  533.       /delay 5 ${Target.ID}==${worsthurtid}
  534.       /if (!${Target.ID}) /return
  535.       /if (${Target.ID}!=${worsthurtid}) /return
  536.       /if (${announce}==1) /g Casting ${patchheal} on %T
  537.       /varset stophealpoint ${Math.Calc[${defaultpatchpoint}+5]}
  538.       /call MQ2Cast "${patchheal}" gem2 1s CheckHP
  539.       /varset stophealpoint ${defaultstophealpoint}
  540.       /call CheckEvents
  541.       /delay 15 ${Me.SpellReady[${patchheal}]}
  542.       /return
  543.    }
  544.    /varset stophealpoint ${defaultstophealpoint}
  545.    /if ((${healpetmode}==2)&&(${Me.PctMana}>${manatohealpet})) /call HealPet
  546.    /if (${mokaddon}==1) /call AutoMOK
  547. /return
  548.  
  549.  
  550. Sub Divarbcast
  551.    /varset divarboor 0
  552.    /for gmember 0 to ${Group.Members}
  553.       /if (${Group.Member[${gmember}].Distance}>200) /varcalc divarboor ${divarboor}+1
  554.    /next gmember
  555.    /if (${Math.Calc[${Group.Members}-${divarboor}]}>=2) {
  556.       /if (${announce}==1) /g Inc Divine Arbitration
  557.       /call MQ2Cast "Divine Arbitration" alt 2s
  558.       /if ((${healafterdivarb}==1)&&(${Me.PctMana}>40)) {
  559.          /if (${announce}==1) /g Inc Grp Heal, get close
  560.          /call MQ2Cast "${groupheal}" gem4 2s
  561.          /delay 15 ${Me.SpellReady[${groupheal}]}
  562.       }
  563.    }
  564. /return
  565.  
  566.  
  567. Sub HealPet
  568.    /varset worsthurt NULL
  569.    /varset worsthp 100
  570.    /for gmember 0 to ${Group.Members}
  571.       /if (${Group.Member[${gmember}].Pet.ID}) {
  572.          /if (${Group.Member[${gmember}].Pet.Distance}<=${pethealspellrange}) {
  573.             /if ((${Group.Member[${gmember}].Pet.PctHPs}<=${worsthp})&&(${Group.Member[${gmember}].Pet.PctHPs}<=${pethealpoint})) {
  574.                /varset worsthurt ${Group.Member[${gmember}].Pet.Name}
  575.                /varset worsthurtid ${Group.Member[${gmember}].Pet.ID}
  576.                /varset worsthp ${Group.Member[${gmember}].Pet.PctHPs}
  577.             }
  578.          }
  579.       }
  580.    /next gmember
  581.    /if (${worsthurt.NotEqual[NULL]}) {
  582.       /target id ${worsthurtid}
  583.       /delay 5 ${Target.ID}==${worsthurtid}
  584.       /if (!${Target.ID}) /return
  585.       /if (${Target.ID}!=${worsthurtid}) /return
  586.       /delay 3
  587.       /if (${Target.PctHPs}<=${pethealpoint}) {
  588.          /if (${announce}==1) /g Casting ${pethealspell} on %T
  589.          /varset stophealpoint ${Math.Calc[${pethealpoint}+5]}
  590.          /call MQ2Cast "${pethealspell}" spell 1s CheckHP
  591.          /varset stophealpoint ${defaultstophealpoint}
  592.          /delay 15 ${Me.SpellReady[${pethealspell}]}
  593.       }
  594.    }
  595. /return
  596.  
  597.  
  598. Sub CheckEvents
  599.         /delay 1
  600.         /doevents Chat
  601.         /doevents tell
  602.         /if (${Window[TradeWnd].Open}) {
  603.                 /delay 3s
  604.                 /notify TradeWnd TRDW_Trade_Button leftmouseup
  605.                 /delay 10s !${Window[TradeWnd].Open}
  606.                 /if (${Window[TradeWnd].Open}) {
  607.                         /delay 5s
  608.                         /notify TradeWnd TRDW_Trade_Button leftmouseup
  609.                         /delay 10s !${Window[TradeWnd].Open}
  610.                         /if (${Window[TradeWnd].Open}) /keypress ESC
  611.                 }
  612.         }
  613. /return
  614.  
  615.  
  616. Sub MedTime
  617.    :oomwait
  618.    /call CheckEvents
  619.  
  620.  
  621.        
  622.         |look for a modrod
  623.         /if (!${FoundRod}) {
  624.                 /if (${FindItem[${BigRod}].ID}) {
  625.                         /varset FoundRod ${FindItem[${BigRod}].ID}
  626.                 } else /if (${FindItem[${BigRod}].ID}) {
  627.                         /varset FoundRod ${FindItem[${SmallRod}].ID}
  628.                 }
  629.         }    
  630.         /if (${FoundRod} && ${Me.PctMana}<=70 && ${Me.PctHPs}>=80 && !${FindItem[${DisplayItem[${FoundRod}]}].Timer}) {
  631.                 /casting ${FoundRod} mainhand
  632.                 /delay 5
  633.                 /varset FoundRod 0
  634.         }
  635.        
  636.    /if ((${autosit}>0)&&(${Me.PctMana}<=95)&&(!${Me.Casting.ID})) {
  637.                 |mount up if i have one and i'm not on it if the zone lets me. otherwise, sit
  638.                 /if (!${Me.Mount.ID} && ${FindItem[${MyMount}].ID} && ${Ini[zonetype.ini,mount,${Zone.ShortName}]} && !${Me.Casting.ID}) {
  639.                         /casting "${MyMount}" ammo
  640.                 }
  641.  
  642.       /if ((${Bool[${Me.Standing}]})&&(${Me.PctHPs}>90)) {
  643.              /if ((!${NearestSpawn[1,npc radius ${distancetosit} zradius 5].Distance})&&(!${Me.Moving}) ) /sit
  644.      }
  645.    }
  646.  
  647.    /if ((${Bool[${Me.Sitting}]})&&(${autosit}>=1)&&(${Me.PctMana}>98)&&(!${Window[SpellBookWnd].Open})) /stand
  648.    /if ((${Bool[${Me.Standing}]})&&(!${Me.Mount.ID})&&(${Me.SpellReady[${yaulpspell}]})&&(!${Me.Buff[${yaulpspell}].ID})) {
  649.       /if ((!${Me.Buff[Vallon].ID})&&(!${Me.Buff[Spiritual Vigor].ID})&&(!${Me.Buff[Strength of Tunare].ID})) /call MQ2Cast "${yaulpspell}" gem8
  650.    }
  651.    /if (${buffbeg}==1) /call Buffbeg
  652.    /if (${Me.PctHPs}<=${selfhealpoint}) /return
  653.    /if (${Me.PctMana}<=8) /goto :oomwait
  654. /return
  655.  
  656.  
  657. Sub CheckHP
  658. |  ${castEndTime} is variable to express time remaining, in deciseconds, from spell_routines.inc
  659.    /if (!${Window[CastingWindow].Open}) /return
  660.    /if ((${interrupt2healself}==1)&&(${Target.ID}==${tanknameid})) /if ((${Me.PctHPs}>=90)&&(${castEndTime}>=12)) /return
  661.    /if ((${interrupt2healself}==0)&&(${Target.ID}==${tanknameid})) /if (${castEndTime}>=12) /return
  662.    /if ((${autointerrupt}>=1)&&(${Target.PctHPs}>=${stophealpoint})) {
  663.       /if ((${announce}==1)&&(${duckspam}==1)) {
  664.          /g Ducking heal on %T
  665.          /e Ducking heal on ${Target.Name}
  666.          /varset duckspam 0
  667.          /timed 60 /varset duckspam 1
  668.       }
  669.       /call Interrupt
  670.       /return
  671.    }
  672.    /if ((${interrupt2healself}==1)&&(${Target.Name.NotEqual[${Me}]})&&(${Me.PctHPs}<${interrupt2healselfhp})) {
  673.       /if ((${usedivarb}==1)&&(${Me.PctHPs}<=${divarbpoint})&&(${Me.AltAbilityReady[Divine Arbitration]})) {
  674.          /call Interrupt
  675.          /call Divarbcast
  676.          /return
  677.       }
  678.       /if ((${announce}==1)&&(${duckselfspam}==1)) {
  679.          /g Ducking heal on %T so I can heal my (ChickenShit) self
  680.          /e Ducking heal on ${Target} so I can heal myself
  681.          /varset duckselfspam 0
  682.          /timed 60 /varset duckselfspam 1
  683.       }
  684.       /call Interrupt
  685.       /return
  686.    }
  687.    /if (${onlyhealfd}==1) {
  688.       /if ((${Target.Class.Name.Equal[Necromancer]})||(${Target.Class.Name.Equal[Monk]})) {
  689.          /if (${Target.State.NotEqual[feign]}) {
  690.             /if ((${announce}==1)&&(${duckfdspam}==1)) {
  691.                /g Ducking heal on %T because he isn't staying FD
  692.                /e Ducking heal on ${Target.Name} because he isn't staying FD
  693.                /varset duckfdspam 0
  694.                /timed 40 /varset duckfdspam 1
  695.             }
  696.             /call Interrupt
  697.             /return
  698.          }
  699.       }
  700.    }
  701.    /if ((${usedivarb}==1)&&(${Target.PctHPs}<=${divarbpoint})&&(${Target.Distance}<=200)&&(${Me.AltAbilityReady[Divine Arbitration]})&&(${castEndTime}>=${interrupt2divarb})) {
  702.       /for gmember 0 to ${Group.Members}
  703.          /if (${Target.ID}==${Group.Member[${gmember}].ID}) {
  704.             /call Interrupt
  705.             /call Divarbcast
  706.             /return
  707.          }
  708.       /next gmember
  709.    }
  710. /return
  711.  
  712.  
  713. Sub TrickyDA
  714.    /for intcount 1 to 20
  715.       /if ((${Me.PctHPs}<40)&&(${Me.Buff[${trickybuff[${intcount}]}].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${trickybuff[${intcount}]}].ID}-1].Int} leftmouseup
  716.    /next intcount
  717.    /if (${Me.Buff[${daspell}].ID}) {
  718.       :waitalittle
  719.       /delay 1s ${Me.Buff[${daspell}].Duration}<2
  720.       /if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle
  721.    }
  722.    /varset buffbeg 1
  723.    /call Buffbeg
  724. /return
  725.  
  726.  
  727. Sub Buffbeg
  728.    /if (${buffbeg}==0) /return
  729.    /echo Begging for buffs now
  730.    /if ((!${Me.Buff[Voice of Quellious].ID})&&(!${Me.Buff[Tranquility].ID})&&(!${Me.Buff[Koadic's Endless Intellect].ID})&&(!${Me.Buff[Clairvoyance].ID})&&(!${Me.Buff[Voice of Clairvoyance].ID})) {
  731.       /if (${Spawn[pc guild enchanter].ID}) /if (${NearestSpawn[PC guild enchanter].Distance}<=100) {
  732.          /tell ${NearestSpawn[PC guild enchanter]} need C plz
  733.          /delay 20
  734.          /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
  735.       } else /e No guild Enchanter available for C5
  736.    }
  737.    /if ((!${Me.Buff[Protection of the Nine].ID})&&(!${Me.Buff[Blessing of the Nine].ID})&&(!${Me.Buff[Steeloak Skin].ID})&&(!${Me.Buff[Blessing of Steeloak].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})&&(!${Me.Buff[Conviction].ID})&&(!${Me.Buff[Hand of Conviction].ID})) {
  738.       /if (${Spawn[pc guild druid].ID}) /if (${NearestSpawn[PC guild druid].Distance}<=100) {
  739.          /tell ${NearestSpawn[PC guild druid]} need dru crack plz
  740.          /delay 20
  741.          /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
  742.       } else /e No guild Druid available for DRU crack
  743.    }
  744.    /if ((!${Me.Buff[Spiritual Dominion].ID})&&(!${Me.Buff[Spiritual Ascendance].ID})) {
  745.       /if (${Spawn[pc guild beastlord].ID}) /if (${NearestSpawn[PC guild beastlord].Distance}<=100) {
  746.          /tell ${NearestSpawn[PC guild beastlord]} need bst crack plz
  747.          /delay 20
  748.          /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
  749.       } else /e No guild Beastlord available for BST crack
  750.    }
  751.    /if ((!${Me.Buff[Kazad`s Mark].ID})&&(!${Me.Buff[Symbol of Kazad].ID})&&(!${Me.Buff[Symbol of Balikor].ID})&&(!${Me.Buff[Balikor's Mark].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})&&(!${Me.Buff[Conviction].ID})&&(!${Me.Buff[Hand of Conviction].ID})) {
  752.       /if (${Spawn[pc guild cleric].ID}) /if (${NearestSpawn[PC guild cleric].Distance}<=100) {
  753.          /tell ${NearestSpawn[PC guild cleric]} need sym plz
  754.          /delay 20
  755.          /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
  756.       } else /e No guild Cleric available for Symbol
  757.    }
  758.    /if ((!${Me.Buff[Brell's Stalwart Shield].ID})&&(!${Me.Buff[Brell's Brawny Bulwark].ID})&&(!${Me.Buff[Spiritual Vigor].ID})&&(!${Me.Buff[Spiritual Vitality].ID})) {
  759.       /if (${Spawn[pc guild paladin].ID}) /if (${NearestSpawn[PC guild paladin].Distance}<=100) {
  760.          /tell ${NearestSpawn[PC guild paladin]} need BSS plz
  761.          /delay 20
  762.          /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
  763.       } else /e No guild Paladin available for BSS
  764.    }      
  765.    /if ((!${Me.Buff[Shield of Maelin].ID})&&(!${Me.Buff[Focus of the Seventh].ID})&&(!${Me.Buff[Focus of Soul].ID})&&(!${Me.Buff[Wunshi's Focusing].ID})&&(!${Me.Buff[Talisman of Wunshi].ID})) {
  766.       /if (${Spawn[pc guild shaman].ID}) /if (${NearestSpawn[PC guild shaman].Distance}<=100) {
  767.          /tell ${NearestSpawn[PC guild shaman]} need focus plz
  768.          /delay 20
  769.          /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
  770.       } else /e No guild Shaman available for Focus
  771.    }
  772.    /varset buffbeg 0
  773. /return
  774.  
  775.  
  776. Sub FindExactPC(string name)
  777.    /declare nameid int local
  778.    /declare counter int local 1
  779.    :FindNext
  780.    /if (!${NearestSpawn[${counter}, pc ${name}].ID}) /return NOT_FOUND
  781.    /varset nameid ${NearestSpawn[${counter}, pc ${name}].ID}
  782.    /if (${Spawn[${nameid}].CleanName.Equal[${name}]}) {
  783.       /target id ${nameid}
  784.       /delay 1s ${Target.ID}==${nameid}
  785.       /if (${Target.ID}==${nameid}) /return TARGET_SUCCESS
  786.    }
  787.    /varcalc counter ${counter}+1
  788.    /if (${NearestSpawn[${counter}, pc ${name}].ID}) /goto :FindNext
  789. /return NOT_FOUND
  790.  
  791.  
  792. Sub HealPotUse
  793. |**  Call from a frequent subroutine. Use a variable to trigger it at a specific health
  794. Example of a call for this routine, for use at 15% health as a backup for normal heals:
  795.    /if (!${Defined[healpotpoint]}) /declare healpotpoint int outer 15
  796.    /if (${Me.PctHPs}<=${healpotpoint}) /call HealPotUse
  797. **|
  798.    /if (!${Defined[healpottimer]}) /declare healpottimer int outer 1
  799.    /if (!${Defined[healpotname]}) /declare healpotname string outer NULL
  800.    /if (${healpottimer}==0) /return
  801.    /if (!${FindItem[Healing Potion].ID}) {
  802.       /varset healpotname NULL
  803.       /return
  804.    }
  805.    /if (!${FindItem[=${healpotname}].ID}) /varset healpotname NULL
  806.    /if (${FindItem[=Healing Potion X].ID}) {
  807.       /if (${announce}==1) /g WHEW -----> Healing Potion Used
  808.       /varset healpotname Healing Potion X
  809.       /goto :casthealpot
  810.    }
  811.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion IX].ID}) /varset healpotname Healing Potion IX
  812.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VIII].ID}) /varset healpotname Healing Potion VIII
  813.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VII].ID}) /varset healpotname Healing Potion VII
  814.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VI].ID}) /varset healpotname Healing Potion VI
  815.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion V].ID}) /varset healpotname Healing Potion V
  816.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion IV].ID}) /varset healpotname Healing Potion IV
  817.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion III].ID}) /varset healpotname Healing Potion III
  818.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion II].ID}) /varset healpotname Healing Potion II
  819.    /if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion I].ID}) /varset healpotname Healing Potion I
  820.    :casthealpot
  821.    /call MQ2Cast "${healpotname}" item
  822.    /varset healpottimer 0
  823.    /timed 1200 /varset healpottimer 1
  824. /return
  825.  
  826.  
  827. Sub ClarPotUse
  828. |**  Call from the rebuff or buffbeg subroutine if no enc clarity effects are available
  829. Example of a call for this routine:
  830.    /if ((!${Me.Buff[Voice of Quellious].ID})&&(!${Me.Buff[Tranquility].ID})&&(!${Me.Buff[Koadic's Endless Intellect].ID})&&(!${Me.Buff[Clairvoyance].ID})&&(!${Me.Buff[Voice of Clairvoyance].ID})) {
  831.       /if ((!${Spawn[PC enchanter].ID})||(${NearestSpawn[PC enchanter].Distance}>200)) {
  832.          /call ClarPotUse
  833.       }
  834.    }
  835. **|
  836.    /if (!${Defined[clarpottimer]}) /declare clarpottimer int outer 1
  837.    /if (!${Defined[clarpotname]}) /declare clarpotname string outer NULL
  838.    /if (${clarpottimer}==0) /return
  839.    /if (!${FindItem[Elixir of Clarity].ID}) {
  840.       /varset clarpotname NULL
  841.       /return
  842.    }
  843.    /if (!${FindItem[=${clarpotname}].ID}) /varset clarpotname NULL
  844.    /if (${FindItem[=Elixir of Clarity X].ID}) /varset clarpotname Elixir of Clarity X
  845.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity IX].ID}) /varset clarpotname Elixir of Clarity IX
  846.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VIII].ID}) /varset clarpotname Elixir of Clarity VIII
  847.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VII].ID}) /varset clarpotname Elixir of Clarity VII
  848.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VI].ID}) /varset clarpotname Elixir of Clarity VI
  849.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity V].ID}) /varset clarpotname Elixir of Clarity V
  850.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity IV].ID}) /varset clarpotname Elixir of Clarity IV
  851.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity III].ID}) /varset clarpotname Elixir of Clarity III
  852.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity II].ID}) /varset clarpotname Elixir of Clarity II
  853.    /if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity I].ID}) /varset clarpotname Elixir of Clarity I
  854.    /if ((!${Me.Buff[Elixir of Clarity X].ID})&&(!${Me.Buff[Elixir of Clarity IX].ID})&&(!${Me.Buff[Elixir of Clarity VIII].ID})&&(!${Me.Buff[Elixir of Clarity VII].ID})&&(!${Me.Buff[Elixir of Clarity VI].ID})&&(!${Me.Buff[Elixir of Clarity V].ID})&&(!${Me.Buff[Elixir of Clarity IV].ID})&&(!${Me.Buff[Elixir of Clarity III].ID})&&(!${Me.Buff[Elixir of Clarity II].ID})&&(!${Me.Buff[Elixir of Clarity I].ID})) {
  855.       /call MQ2Cast "${clarpotname}" item
  856.       /varset clarpottimer 0
  857.       /timed 26700 /varset clarpottimer 1
  858.    }
  859. /return
  860.  
  861.  
  862. Sub Event_Chat(string ChatType,string Sender,string ChatText)
  863.    /if ((!${ChatType.Equal[${mychannel}]})&&(!${ChatType.Equal[TELL]})&&(!${ChatType.Equal[group]})) /return
  864.    /if (${usegroupchat}==0) /if (${ChatType.Equal[group]}) /return
  865.    /call ChatParse ${ChatType} ${Sender} "${ChatText}"
  866. /return
  867.  
  868.  
  869. Sub Event_IRCchat(string Line,string Sender,string ChatText)
  870.    /call ChatParse IRC ${Sender} "${ChatText}"
  871. /return
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top