Ok, I'm still not completely happy with this, but figured I'd post it anyway. There are certain situations I think it could handle better, but for now, it works not too badly.... only really has issues when things get REALLY harry (main healer/slower with multiple adds and many people needing healing.... healing and slowing take priority over rooting/moving away from adds, which can result in a dead shammy)
Of course, for most peoples usage, this shouldn't be a problem (or if it is, shammy usually can't be held responsible anyway =P)
Code: Select all
|__________________ Shaman Do Stuff Script _____________________|
|
| Version: v0.8.0
| Release Date: 2004-11-09
|____________________________________ By Hubba _________________|
|____________________________________ Updated by guest_01 ______|
|
| Usage:
| 1. Target player you like to assist (main tank is good)
| 2. Start the script with: /mac <scriptname>
|
| Don't forget to use /clearpathing when you get to camp, and
| run around the area a bit to set up the safe locations,
| otherwise shammy will just stand there looking dumb when
| something attacks him, or run off back the way you came,
| quite possibly agroing things along the way.
|
| /resetbuffs [1-6] - this command resets the buff timers.
| If used by it's self, it resets all buff timers, Otherwise,
| it only resets the timers of the specified group member.
|
| Responds to the following commands in group chat and tells:
|
| follow me - this command will cause it to start to autofollow you
| wait here - ceases autofollow and resumes normal opperation
| mana - reports mana % in group chat
| sow - rebuffs bihli
| heal - uses instant heal on chat sender
| hot - uses hot on chant sender
| slow - assists and slows target - shouldn't be necessary
|
|
| Use "help" for more help ( ! help is incomplete ! )
|_______________________________________________________________|
| -!- This Script Uses spell_routines.inc by Rusty
| -!- This Script Uses advpath.inc
| -!- This Script Uses move.inc
| -!- Exptrack snippet from exptracker.mac by Raebis, with tweaks from Phoenix
| -!- Wait4Rez snippet from wait4rez.mac by fantum409
#chat group
#chat tell
#Event ToggleVariable "[MQ2] Toggle #1#"
#Event ToggleVariable "[MQ2] Toggle #1# #2#"
#Event OutDoor "#*#outdoors#*#"
#Event NoMount "You can not summon a mount here."
#Event ImDead "You have been slain by#*#"
#Event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#"
#Event UnderAttack "#*#YOU for#*#points of damage."
#Event UnderAttack "#*#YOU, but YOU#*#!"
#Event UnderAttack "#*#YOU, but misses!"
/declare noInvis int outer 1
#include Spell_Routines.inc
#include advpath.inc
#include move.inc
Sub Main
/call InitAPFVars 1 15 20
| ########### Make changes in spells as you need.
| The % of your spell duration bonus.
/declare SpellDurationBonus outer 0
|- If you have no focus item, leave it blank.
/declare BuffFocusItem outer ""
/declare SpellSlow outer Turgur's Insects
/declare SpellSlowGem outer 3
/declare SpellDoT outer Envenomed Bolt
/declare SpellDoTGem outer 2
/declare SpellPet outer Frenzied Spirit
/declare SpellPetGem outer 8
/declare SpellDeBuff outer Malosi
/declare SpellDeBuffGem outer 6
/declare SpellCanni outer Cannibalize III
/declare SpellCanniGem outer 7
/declare SpellHoT outer Stoicism
/declare SpellHoTGem outer 5
/declare SpellHeal outer Superior Healing
/declare SpellHealGem outer 1
/declare SpellRoot outer Root
/declare SpellRootGem outer 4
/declare SpellNuke outer Ice Strike
/declare SpellNukeGem outer 8
/declare SpellATK outer
/declare SpellATKGem outer 4
/declare Mount outer Tan Rope Bridle
/declare SpellBuffsGem outer 8
/declare SpellPetBuff[1] string outer
/varset SpellPetBuff[1] "Alacrity"
| ############ The Magic of single spell buffs...
| ############
| ############ /declare SpellBuff[2,2] string outer
| ############ Do only change the 1st number in [#,#]
| ############ If you have three single spells to cast change the 1st number to 3.
| ############ /declare SpellBuff[3,2] string outer
| ############
| ############ /varset SpellBuff[1,1] "Spirit of Sense"
| ############ This is the 1st line that is needed, Here you write your spell name
| ############ /varset SpellBuff[1,2] "Warrior,Monk,Cleric,Shaman,Enchanter,"
| ############ The 2nd line is for the classes who gets the buff.
| ############ NOTE: Only classes in group will get buffed
| ############ NOTE: End the class line with a , If not you can BLOW up your computer. ;P
| Turn on or off Single buffs here.
/declare DoSingleBuffs outer TRUE
/declare SpellBuff[9,2] string outer
/varset SpellBuff[1,1] Regrowth
/varset SpellBuff[1,2] "Bard,Beastlord,Berserker,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,"
/varset SpellBuff[2,1] Alacrity
/varset SpellBuff[2,2] "Bard,Beastlord,Berserker,Monk,Paladin,Ranger,Rogue,Shadowknight,Warrior,"
/varset SpellBuff[3,1] Deliriously Nimble
/varset SpellBuff[3,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard,"
/varset SpellBuff[4,1] Dexterity
/varset SpellBuff[4,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard,"
/varset SpellBuff[5,1] Riotous Health
/varset SpellBuff[5,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard,"
/varset SpellBuff[6,1] Strength
/varset SpellBuff[6,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard,"
/varset SpellBuff[7,1] Inner Fire
/varset SpellBuff[7,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard,"
/varset SpellBuff[8,1] Infusion of Spirit
/varset SpellBuff[8,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard,"
/varset SpellBuff[9,1] Talisman of Altuna
/varset SpellBuff[9,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard,"
| ############ Group buffs...
/declare SpellGrpBuff[0] string outer
| /varset SpellGrpBuff[1] Talisman of Jasinth
/declare AssistAt int outer 100
/declare CombatAt int outer 99
/declare CastDoTat int outer 98
/declare MinDoTat int outer 40
/declare Rootat int outer 30
/declare NukeAt int outer 90
/declare CasterHeals int outer 90
/declare MeleeHeals int outer 75
/declare TankHeal int outer 45
/declare DoMalo outer FALSE
/declare DoSlow outer TRUE
/declare FastSlow outer FALSE
/declare DoRoot outer FALSE
/declare SummonPet outer TRUE
/declare BuffPet outer TRUE
/declare HealPets outer TRUE
/declare DoDoT outer FALSE
/declare DoBuffs outer TRUE
/declare DoSow outer TRUE
/declare DoNuke outer FALSE
/declare DoHeal outer TRUE
/declare DoHoT outer TRUE
/declare Cannibalization outer TRUE
/declare Verbose outer FALSE
/declare AutoMove outer TRUE
/declare AllowAutoFollow outer TRUE
/declare NoMount outer TRUE
| This is a delay for how long Avatar will hold. (8min)
/declare AvatarDelay outer 5350
/declare ClassHeals[3] string outer
/declare ClassHealsBard[3] string outer
/varset ClassHealsBard[2] 40
/varset ClassHealsBard[3] 60
/declare ClassHealsBeastlord[3] string outer
/varset ClassHealsBeastlord[2] 40
/varset ClassHealsBeastlord[3] 70
/declare ClassHealsBerserker[3] string outer
/varset ClassHealsBerserker[2] 40
/varset ClassHealsBerserker[3] 70
/declare ClassHealsCleric[3] string outer
/varset ClassHealsCleric[2] 40
/varset ClassHealsCleric[3] 70
/declare ClassHealsDruid[3] string outer
/varset ClassHealsDruid[2] 40
/varset ClassHealsDruid[3] 60
/declare ClassHealsEnchanter[3] string outer
/varset ClassHealsEnchanter[2] 40
/varset ClassHealsEnchanter[3] 70
/declare ClassHealsMagician[3] string outer
/varset ClassHealsMagician[2] 40
/varset ClassHealsMagician[3] 70
/declare ClassHealsMonk[3] string outer
/varset ClassHealsMonk[2] 40
/varset ClassHealsMonk[3] 70
/declare ClassHealsNecromancer[3] string outer
/varset ClassHealsNecromancer[2] 40
/varset ClassHealsNecromancer[3] 70
/declare ClassHealsPaladin[3] string outer
/varset ClassHealsPaladin[2] 40
/varset ClassHealsPaladin[3] 70
/declare ClassHealsRanger[3] string outer
/varset ClassHealsRanger[2] 40
/varset ClassHealsRanger[3] 70
/declare ClassHealsRogue[3] string outer
/varset ClassHealsRogue[2] 40
/varset ClassHealsRogue[3] 70
/declare ClassHealsShadowknight[3] string outer
/varset ClassHealsShadowknight[2] 40
/varset ClassHealsShadowknight[3] 70
/declare ClassHealsShaman[3] string outer
/varset ClassHealsShaman[2] 40
/varset ClassHealsShaman[3] 60
/declare ClassHealsWarrior[3] string outer
/varset ClassHealsWarrior[2] 40
/varset ClassHealsWarrior[3] 70
/declare ClassHealsWizard[3] string outer
/varset ClassHealsWizard[2] 40
/varset ClassHealsWizard[3] 70
| ########### ! No Changes Are Needed From Here !
/squelch /alias /domalo /echo toggle malo
/squelch /alias /doslow /echo toggle slow
/squelch /alias /dofastslow /echo toggle fastslow
/squelch /alias /doroot /echo toggle root
/squelch /alias /dopet /echo toggle pet
/squelch /alias /dodot /echo toggle dot
/squelch /alias /donuke /echo toggle nuke
/squelch /alias /nukeat /echo toggle nukeat
/squelch /alias /dobuffs /echo toggle buffs
/squelch /alias /dosow /echo toggle sow
/squelch /alias /assistat /echo toggle assistat
/squelch /alias /dotat /echo toggle dotat
/squelch /alias /rootat /echo toggle rootat
/squelch /alias /combatat /echo toggle combatat
/squelch /alias /healmeleeat /echo toggle healmeleeat
/squelch /alias /healcastersat /echo toggle healcastersat
/squelch /alias /healtankat /echo toggle healtankat
/squelch /alias /doassist /echo toggle assist
/squelch /alias /healat /echo toggle healat
/squelch /alias /status /echo toggle show
/squelch /alias /show /echo toggle show
/squelch /alias /bothelp /echo toggle help
/squelch /alias /verbose /echo toggle verbose
/squelch /alias /resetbuffs /echo toggle resetbuffs
/squelch /alias /clearpathing /echo toggle clearpathing
/squelch /alias /dohot /echo toggle dohot
/squelch /alias /doheal /echo toggle doheal
/squelch /alias /HealPets /echo toggle HealPets
/declare M_Assist string outer
/declare OutDoors outer TRUE
/declare SpDuration outer
/declare SpCastTime outer
/declare SpDurBonus outer
/declare MainItem outer
/declare MeLoM outer FALSE
/declare TargetArray[4] string outer
/declare MobMaloed outer FALSE
/declare MobSlowed outer FALSE
/declare PetOn outer FALSE
/declare MobRooted outer FALSE
/declare MobDoTed outer FALSE
/declare CombatOn outer TRUE
/declare i int local
/for i 1 to ${SpellBuff.Size[1]}
/squelch /declare SpellBufftmr${i}0 timer global 0
/squelch /declare SpellBufftmr${i}1 timer global 0
/squelch /declare SpellBufftmr${i}2 timer global 0
/squelch /declare SpellBufftmr${i}3 timer global 0
/squelch /declare SpellBufftmr${i}4 timer global 0
/squelch /declare SpellBufftmr${i}5 timer global 0
/next i
/declare Exper float outer
/declare AAExp float outer
/varset Exper ${Me.Exp}
/varset AAExp ${Me.AAExp}
/declare ATKBuffed0 timer outer 0
/declare ATKBuffed1 timer outer 0
/declare ATKBuffed2 timer outer 0
/declare ATKBuffed3 timer outer 0
/declare ATKBuffed4 timer outer 0
/declare ATKBuffed5 timer outer 0
/declare CallManaTmr timer outer 0
/varset MobRooted FALSE
/varset MobMaloed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset MobRooted FALSE
/varset MobMaloed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset CombatOn FALSE
/varset TargetArray[1] NULL
/varset TargetArray[2] NULL
/varset TargetArray[3] NULL
/varset TargetArray[4] NULL
/declare GroupMemHoTTime0 timer outer 0
/declare GroupMemHoTTime1 timer outer 0
/declare GroupMemHoTTime2 timer outer 0
/declare GroupMemHoTTime3 timer outer 0
/declare GroupMemHoTTime4 timer outer 0
/declare GroupMemHoTTime5 timer outer 0
/declare GroupMemPetHoTTime0 timer outer 0
/declare GroupMemPetHoTTime1 timer outer 0
/declare GroupMemPetHoTTime2 timer outer 0
/declare GroupMemPetHoTTime3 timer outer 0
/declare GroupMemPetHoTTime4 timer outer 0
/declare GroupMemPetHoTTime5 timer outer 0
/declare DebuffTimers[10] int outer
/declare grpBuffTimer timer outer
/declare grpBuffTimesAttempted int outer
/declare j int local 1
/declare following string outer FALSE
/declare tookAction int outer 0
/declare WaitingOnSpell int outer 0
/declare didCanni int outer 0
/declare noMoveCount int outer 0
/declare underAttack timer outer 0
/declare underAttackBy int outer NULL
/declare LastSLAdded int outer
/squelch /declare SafeLocs[20,2] float global
/declare PrevLoc[2] float outer
/varset PrevLoc[1] 0
/varset PrevLoc[2] 0
/declare DotTime timer outer
/call MemSpells
| ############### Target a player as Main Assist
/if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) {
/echo Your target is NOT a player, make sure its a player character!
/endmacro
} else {
/varset M_Assist ${Target.CleanName}
/echo Assist set to ${M_Assist}
/assist off
}
:Main_Loop
/varset tookAction 0
/varset WaitingOnSpell 0
/if (${PrevLoc[1]}!=${Me.X} || ${PrevLoc[2]}!=${Me.Y}) {
/varset PrevLoc[1] ${Me.X}
/varset PrevLoc[2] ${Me.Y}
/call AddSafeLoc
}
|- Check for new events in chat etc etc...
/doevents
/call GetTarget
/if (${FollowFlag}) {
/if (${CombatOn}) {
/varset FollowFlag 0
/echo Combat Detected. No longer following. Resuming program.
/keypress FORWARD
}
| -------- You need to add this call to your loop section in Main. ------------------------------------------
/call AdvPathPoll
/delay 1
/if (!${Me.Moving}) {
/if (${Me.State.Equal[Stand]} && !${underAttack}) /sit
/vardata noMoveCount Math.Calc[${noMoveCount}+1]
}
/if (${noMoveCount} > 30) {
/varset noMoveCount 0
/goto :Hold_Main
}
/goto :Main_Loop
}
|- Do we move?
:Hold_Main
/if (!${FollowFlag} && ${Me.Moving}) /goto :Main_Loop
/if (${Me.State.Equal[Stand]}) {
/if (${TargetArray[4]} && ${Target.ID}==${TargetArray[4]}) /face fast
/if (!${underAttack}) {
/sit
}
}
|- Let the group know Im LOM
/if (${Me.PctMana} < 20 && !${CallManaTmr}) {
/if (${Verbose}) /gsay ${Me.PctMana}% Mana
/varset CallManaTmr 900
}
|- Am I LoM?
/if (${Me.PctMana} < 25) /varset MeLoM TRUE
/if (${MeLoM}) /if (${Me.PctMana} > 35) /varset MeLoM FALSE
/if (${underAttackBy}) {
/target id ${underAttackBy}
/call cast "${SpellRoot}" gem${SpellRootGem}
/if (${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_CANNOTSEE]} || ${Macro.Return.Equal[CAST_IMMUNE]}) {
/echo Rooted ${Target.CleanName}
}
/call AttemptAvoid
/goto :Main_Loop
}
|- Summon drogmore
/if (!${Me.Mount.ID} && ${OutDoors} && !${NoMount}) {
/call cast ${Mount} item 4s
/goto :Main_Loop
}
|- Wait until spells are ready it doesn't think it can't cast slow yet if it's been chain healing
/if (!${Me.SpellReady[1]} && !${Me.SpellReady[2]} && !${Me.SpellReady[3]} && !${Me.SpellReady[4]}) /goto :Main_Loop
/call CheckDebuffTimers
/if (${tookAction} && !${WaitingOnSpell}) /goto :Main_Loop
/call CheckSlowRadius
/if (${tookAction} && !${WaitingOnSpell}) /goto :Main_Loop
|- Group Heals
/call Check_grpHPs
/if (${tookAction}) /goto :Main_Loop
/if (${Me.CurrentHPs} < ${Math.Calc[${Me.MaxHPs}-900]}) /call CheckMyHPs
/if (${tookAction}) /goto :Main_Loop
|- Check for mobs and do combat stuff
/if (${CombatOn}) /call Combat
/if (${tookAction}) /goto :Main_Loop
/if (${HealPets}) /call Check_grpPetHPs
|- Canni
/if (${Cannibalization} && ${Me.AltAbilityReady[47]} && ${Me.CurrentMana} < ${Math.Calc[${Me.MaxMana}-1200]} && ${Me.MaxHPs} > 3900) /call Cannibalization
/if (${tookAction}) /goto :Main_Loop
/if (${Me.PctMana} < 60) {
/call cast "${SpellCanni}" gem${SpellCanniGem} 6s
/goto :Main_Loop
}
|- Sow Buff
/if (!${grpBuffTimer}) /if (!${Me.Buff[Spirit of Eagle].ID} && !${Me.Buff[Flight of Eagles].ID}) /if (!${Me.Buff[Spirit of Bih`Li].ID} && ${DoSow} && ${OutDoors}) {
/if (${grpBuffTimesAttempted}<3) {
/for j 1 to 5
/if (${Group[${j}].Distance} > ${Spell[Spirit of Bih`Li].AERange}) {
/echo *** Need to rebuff Spirit of Bih`Li, but group members are too far away!
/varset grpBuffTimer 150
/varset grpBuffTimesAttempted ${Math.Calc[${grpBuffTimesAttempted}+1]}
/goto :FollowingSoW
}
/next j
}
/call checkCanCast "Spirit of Bih`Li" gem${SpellBuffsGem}
/varset WaitingOnSpell 1
/if (!${Macro.Return}) /goto :FollowingBuffs
/call EquipItem ${BuffFocusItem}
/varset MainItem ${Macro.Return}
/target pc ${M_Assist}
/if (${Verbose}) /gsay INC Spirit of Bih`Li, Stay close or miss out!
/call cast "Spirit of Bih`Li" gem${SpellBuffsGem} 17s
/call EquipItem ${MainItem}
/varset grpBuffTimesAttempted 0
/goto :Main_Loop
}
:FollowingSoW
|- Group Buffs
/if (${Me.PctMana} > 40) /if (!${grpBuffTimer}) /if (!${CombatOn} || (${CombatOn} && !(!${MobMaloed} && ${DoMalo}) && !(!${MobSlowed} && ${DoSlow}))) /if (${DoBuffs}) /call GrpBuffs
/if (${WaitingOnSpell}) /goto :FollowingBuffs
/if (${tookAction}) /goto :Main_Loop
/if (${Me.PctMana} > 40) /if (${Me.SpellReady[${SpellATK}]}) {
/call Cast_Avatar
/if (${WaitingOnSpell}) /goto :FollowingBuffs
/if (${tookAction}) /goto :Main_Loop
}
|- Single Buff !
/if (${Me.PctMana} > 40) /if (!${CombatOn} || (${CombatOn} && !(!${MobMaloed} && ${DoMalo}) && !(!${MobSlowed} && ${DoSlow}))) /if (${DoSingleBuffs}) /call SingleBuffs
/if (${WaitingOnSpell}) /goto :FollowingBuffs
/if (${tookAction}) /goto :Main_Loop
|- Pet
/if (!${CombatOn} && !${Me.Pet.ID} && ${SummonPet} && ${Spell[${SpellPet}].Mana} <= ${Me.CurrentMana}) {
/call checkCanCast "${SpellPet}" gem${SpellPetGem}
/if (!${Macro.Return}) /goto :FollowingBuffs
/call cast "${SpellPet}" gem${SpellPetGem} 25s
/goto :Main_Loop
}
/if (!${CombatOn} && ${Me.Pet.ID} && ${BuffPet}) {
/call BuffPet
/if (${WaitingOnSpell}) /goto :FollowingBuffs
/if (${tookAction}) /goto :Main_Loop
}
:FollowingBuffs
/if (((${Me.SpellReady["${SpellCanni}"]} && ${WaitingOnSpell}) || !${WaitingOnSpell}) && ${Me.PctMana} < 90) {
/call cast "${SpellCanni}" gem${SpellCanniGem} 6s
/goto :Main_Loop
}
/goto :Main_Loop
/return
Sub MemSpells
/echo Memming spells. Hang on.
/if ( !${Me.Gem["${SpellCanni}"]} ) {
/memspell ${SpellCanniGem} "${SpellCanni}"
/delay 25
}
/if ( !${Me.Gem["${SpellSlow}"]} ) {
/memspell ${SpellSlowGem} "${SpellSlow}"
/delay 20
}
/if ( !${Me.Gem["${SpellDeBuff}"]} ) {
/memspell ${SpellDeBuffGem} "${SpellDeBuff}"
/delay 20
}
/if ( !${Me.Gem["${SpellATK}"]} ) {
/memspell ${SpellATKGem} "${SpellATK}"
/delay 20
}
/if ( !${Me.Gem["${SpellHeal}"]} ) {
/memspell ${SpellHealGem} "${SpellHeal}"
/delay 20
}
/if ( !${Me.Gem["${SpellHoT}"]} ) {
/memspell ${SpellHoTGem} "${SpellHoT}"
/delay 20
}
/if ( !${Me.Gem["${SpellDoT}"]} ) {
/memspell ${SpellDoTGem} "${SpellDoT}"
/delay 30
}
|/if ( ${Window[SpellBookWnd].Open} ) /windowstate SpellBookWnd close
/echo Spells are memmed.
/return
| ################# Ensures that the spell is memmed and ready to cast,
| # so we're not waiting for 5 minutes for the recast timer to tick down
Sub checkCanCast(string spellName,string spellGem)
/if ( ${Me.SpellReady[${spellName}]} ) /return 1
/if ( !${Me.Gem[${spellName}]} ) {
:mem_spell
/if ( ${Cursor.ID} ) {
/autoinventory
/delay 5
/goto :mem_spell
}
/memspell ${spellGem.Right[1]} "${spellName}"
/delay 6s ${Me.Gem[${spellName}]}
}
/varset tookAction 1
/varset WaitingOnSpell 1
/return 0
| ################# Checks for expired slow/debuff timers
Sub CheckDebuffTimers
/declare i int local 1
/for i 1 to ${DebuffTimers.Size}
/if (${DebuffTimers[${i}]}) /if (!${Spawn[${DebuffTimers[${i}]}].ID} || ${Spawn[${DebuffTimers[${i}]}].State.Equal[DEAD]}) {
/if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
/deletevar DebuffTimer${DebuffTimers[${i}]}
}
/varset DebuffTimers[${i}] 0
}
/if (${DebuffTimers[${i}]}) /if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) /if (${DebuffTimer${DebuffTimers[${i}]}}<=6) {
/target id ${DebuffTimers[${i}]}
/call Slow
}
/next i
/return
Sub SetDebuffTimer(int id,timer t)
/declare i int local 1
/for i 1 to ${DebuffTimers.Size}
/if (!${DebuffTimers[${i}]}) {
/varset DebuffTimers[${i}] ${id}
/if (!${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
/declare DebuffTimer${DebuffTimers[${i}]} timer outer ${t}
} else {
/varset DebuffTimer${DebuffTimers[${i}]} ${t}
}
/return
}
/next i
/return
Sub CheckSlowRadius
/declare s string local
/declare i int local 1
/declare g int local 1
/declare h int local 1
/for i 1 to 10
:CheckSlowRadiusLoop1
/varset s ${Me.NearestSpawn[${i},npc].ID}
/if (${Spawn[${s}].Distance}>${Spell[${SpellSlow}].Range}) /next i
/if ((${DoMalo} && !${MobMaloed} && ${Spawn[${s}].ID}==${TargetArray[4]}) || (${Me.CurrentMana}<${Spell[${SpellSlow}].Mana})) /next i
/call CheckAttacking ${Spawn[${s}].ID}
/if (${Target.Type.Equal[NPC]} && ${Macro.Return}) {
/for g 0 to 6
/if (${Group[${g}].ID}) /if (${Math.Distance[${Spawn[${s}].X},${Spawn[${s}].Y}:${Group[${g}].X},${Group[${g}].Y}]} <= 50) {
/for h 1 to ${DebuffTimers.Size}
/if (${DebuffTimers[${h}]}==${s}) {
| /varset i ${Math.Calc[${i}+1]}
| /if (${i}>15) /return
| /goto :CheckSlowRadiusLoop1
/next i
}
/next h
|/if (${LineOfSight[${Me.X},${Me.Y},${Me.Z}:${Spawn[${s}].X},${Spawn[${s}].Y},${Spawn[${s}].Z}]}) {
| /if (${LineOfSight[${Group[${g}].X},${Group[${g}].Y},${Group[${g}].Z}:${Spawn[${s}].X},${Spawn[${s}].Y},${Spawn[${s}].Z}]}) {
/target id ${s}
|/if (${DoMalo} && ${Target.Type.Equal[NPC]}) {
| /call DeBuff
|}
/if (${DoSlow} && ${Target.Type.Equal[NPC]}) {
/call Slow
}
/if (${tookAction}) /return
| }
|}
}
/next g
}
/next i
/return
| ################# This will check what Main Assist has in target.
Sub GetTarget
/declare temp int inner 0
/squelch /target clear
/assist ${M_Assist}
/delay 5 ${Target.ID}
/if (${Target.Type.Equal[NPC]}) /if (${Target.Distance}<=${AssistAt} && ${Target.ID}!=${TargetArray[4]} && ${Target.PctHPs}<=${CombatAt}) {
/varset TargetArray[1] ${Target.CleanName}
/varset TargetArray[2] ${Target.Level}
/varset TargetArray[3] ${Target.Name}
/varset TargetArray[4] ${Target.ID}
/varset CombatOn TRUE
/varset MobRooted FALSE
/varset MobMaloed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset DotTime 0
}
/return
| ################### Check target and do stuff like slow, dot, pet attack etc.
Sub Combat
/target id ${TargetArray[4]}
/delay 3 ${Target.ID}==${TargetArray[4]}
/if (${Target.ID}==${TargetArray[4]}) /if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) {
/if (${Target.Distance}>${Spell[${SpellSlow}].Range}) /call AttemptAvoid
}
/if (${CombatOn} && !${MobMaloed} && ${DoMalo} && ${Target.ID}==${TargetArray[4]}) {
/call DeBuff
/return
}
| /if (${CombatOn} && !${MobSlowed} && ${DoSlow} && ${Target.ID}==${TargetArray[4]}) {
| /call Slow
| /return
| }
/if (${CombatOn} && !${PetOn} && ${Target.ID}==${TargetArray[4]}) {
/pet back off
/pet attack
/varset PetOn TRUE
}
/if (${Defined[DebuffTimer${Target.ID}]} && ${DebuffTimer${Target.ID}} > 0) /if (${DotTime}<=0) /if (${Me.PctMana} > 65) /if (${CombatOn} && ${DoDoT} && ${Target.PctHPs}<=${CastDoTat} && ${Target.PctHPs}>=${MinDoTat}) {
/call checkCanCast "${SpellDoT}" gem${SpellDoTGem}
/if (!${Macro.Return}) /return
/call cast "${SpellDoT}" gem${SpellDoTGem}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/varset DotTime ${Math.Calc[${Spell["${SpellDoT}"].Duration}*60-${Spell["${SpellDoT}"].CastTime}*10]}
} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
/call AttemptAvoid
} else {
/varset DotTime 50
}
/varset tookAction 1
/return
}
/if (${Me.PctMana} > 60) /if (${CombatOn} && ${DoNuke} && ${Target.PctHPs}<=${NukeAt} && ${Target.PctHPs}>=15) {
/call checkCanCast "${SpellNuke}" gem${SpellNukeGem}
/if (!${Macro.Return}) /return
/call cast "${SpellNuke}" gem${SpellNukeGem}
/return
}
/if (!${MobRooted} && ${CombatOn} && ${DoRoot} && ${Target.PctHPs}<=${Rootat}) {
/call checkCanCast "${SpellRoot}" gem${SpellRootGem}
/if (!${Macro.Return}) /return
/call cast "${SpellRoot}" gem${SpellRootGem}
/varset tookAction 1
/varset MobRooted TRUE
}
|- EndCombat
/target id ${TargetArray[4]}
/if (!${Target.Name.Equal[${TargetArray[3]}]} || !${Target.ID}) {
/varset MobRooted FALSE
/varset MobMaloed FALSE
/varset MobSlowed FALSE
/varset PetOn FALSE
/varset MobDoTed FALSE
/varset CombatOn FALSE
/varset DotTime 0
/varset TargetArray[1] NULL
/varset TargetArray[2] NULL
/varset TargetArray[3] NULL
/varset TargetArray[4] NULL
/varset AAExp ${Math.Calc[${Me.PctAAExp}-${AAExp}]}
/varset Exper ${Math.Calc[${Me.PctExp}-${Exper}]}
/echo EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.PctAAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes
/popup EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.PctAAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes
/varset Exper ${Me.PctExp}
/varset AAExp ${Me.PctAAExp}
/if (!${following.Equal[FALSE]}) {
/echo Combat over. Resume following ${following}.
/call FollowFunction "${following}"
}
}
/return
Sub DeBuff
:DeBuff_Loop
/if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) {
/if (${Me.CurrentMana}<${Spell[${SpellDeBuff}].Mana}) {
/echo *** Shid ! I don't have mana to Malo %T
} else {
/call checkCanCast "${SpellDeBuff}" gem${SpellDeBuffGem}
/if (!${Macro.Return}) /return
/call cast "${SpellDeBuff}" gem${SpellDeBuffGem} 6s
/varset tookAction 1
/if (!${Macro.Return.Equal["CAST_SUCCESS"]}) {
/return
} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
/call AttemptAvoid
}
/varset MobMaloed TRUE
}
}
/return
Sub Slow
/if (${DoMalo} && !${MobMaloed} && ${Target.ID}==${TargetArray[4]}) /return
|/if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) {
/if (${Me.CurrentMana}<${Spell[${SpellSlow}].Mana}) {
/echo Shid ! I don't have mana to Malo %T
} else {
:Slow_Loop
/call checkCanCast "${SpellSlow}" gem${SpellSlowGem}
/if (!${Macro.Return}) /return
/call cast "${SpellSlow}" gem${SpellSlowGem} 6s
/varset tookAction 1
/if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /return
/if (${Macro.Return.Equal["CAST_IMMUNE"]}) {
/if (${Verbose}) /gsay < %T > is IMMUNE to slow !
/varset MobSlowed TRUE
}
/if (${Macro.Return.Equal["CAST_RESISTED"]}) {
/if (!${FastSlow}) {
/if (${Verbose}) /gsay < %T > RESISTED slow ! Trying again...
/return
}
/varset MobSlowed TRUE
}
/if (${Macro.Return.Equal["CAST_SUCCESS"]}) {
/if (${Verbose}) /gsay < %T > is SLOWED
/varset MobSlowed TRUE
/call SetDebuffTimer ${Target.ID} ${Math.Calc[${Spell[${SpellSlow}].Duration}*60-100]}
} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
/call AttemptAvoid
}
/if (${Macro.Return.Equal["CAST_CANNOTSEE"]}) {
/call SetDebuffTimer ${Target.ID} 150
/echo Cannot See: ${Target.CleanName}
}
}
|}
/return