• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

shaman macro (1 Viewer)

slandaro

Member
Joined
Sep 12, 2004
RedCents
80¢
Hey all ive been using this shaman macro from mq2 forums and it works spectacular except i cant seem to get it to use talisman of unity on self buffs was hoping maybe one of you coding genius's could take a quick look. Thank alot.
p.s. I found out if i tell it the buff icon is Talisman of unity instead of darkpaw focusing or mammoth's str ect then it will cast it but it just keeps casting it over and over since thats not unity's buff icon

This is the ini file
Rich (BB code):
[Settings]
MyChannel=g
TellChannel=t
MySpellSet=Normal
Announce=1
AutoAnchor=FALSE
EngageDelay=30
NukeAt=90
NukeMana=40
NukeDelay=180
PantherSkip=35
SlothSkip=35
SitAt=80
DoDebuffs=TRUE
DoMalo=FALSE
DoSlow=TRUE
SlowDuration=3500
DoCripple=FALSE
SummonPet=TRUE
DoPetPanther=FALSE
DoGroupPanther=TRUE
DoPetSloth=FALSE
DoSloth=TRUE
SlothGroup=FALSE
DoNuke=FALSE
DoHeal=TRUE
DoPetHeal=TRUE
DoCanniAA=TRUE
DoSelfShrink=TRUE
DoAvatar=TRUE
BegForBuffs=TRUE
useAutoLoot=FALSE
UseConsider=FALSE
UseEpic=TRUE
UseGroupHot=TRUE
UseMount=TRUE
UseRoot=FALSE
UseSecondSlow=FALSE
UseVPAA=TRUE
UseWard=FALSE
DebuffGreens=FALSE
DebuffGreys=FALSE
MinRadius=50
NPCZRadius=50
Mount=Ornate Barding
Puller=Noone
ZoneDelay=10
[Spells]
AESlowSpell=Tortugone's Drowse
AESlowGem=Gem2
SlowSpell=Turgur's Swarm
SlowSpellGem=Alt
SecondSlowSpell=Balance of Discord
SecondSlowSpellGem=Gem5
MaloSpell=Malos
MaloSpellGem=Gem3
CrippleSpell=Feralisis Rk. II
CrippleSpellGem=Gem5
PetSpell=aina's Faithful Rk. II
PetSpellGem=Gem5
CanniSpell=Ancestral Obligation Rk. II
CanniSpellGem=Gem1
ShrinkSpell=Shrink
ShrinkSpellGem=Gem2
GroupHot=Shadow of Renewel RK. II
GroupHotGem=Gem2
HotSpell=Halcyon whisper rk. II
HotSpellGem=Gem8
HealSpell=Dannal's Mending Rk. II
HealSpellGem=Gem7
NukeSpell=Glacial Avalanche
NukeSpellGem=Gem9
PantherSpell=Talisman of the Lynx
PantherSpellGem=Gem5
ATKSpell=Champion
ATKSpellGem=Gem4
SlothSpell=Listlessness
SlothSpellGem=Gem5
DrinkSpell=Summon Drink
DrinkSpellGem=Gem2
FoodSpell=Summon Food
FoodSpellGem=Gem2
RootSpell=Petrifying Earth
RootSpellGem=Gem2

[Items]
UseExtEnhanceFocus=TRUE
ExtEnhanceItem=Mottled Stenchcloak

[HealStuff]
SelfHealPoint=60
CasterHealPoint=70
MeleeHealPoint=65
TankHealPoint=60
PetHealPoint=60
UnionHP=35
CancelPct=90

[SelfBuffStuff]
SelfBuffTotal=4
SelfBuffs=TRUE
SelfBuffRecheck=10s

SelfBuff1=Talisman of Unity
SelfBuffIcon1=Mammoth's Strength
SelfBuffGem1=Gem9
SelfBuffCount1=35
SelfBuffIndoors1=1

SelfBuff2=Talisman of the resolute
SelfBuffIcon2=Talisman of the resolute
SelfBuffGem2=Gem2
SelfBuffCount2=35
SelfBuffIndoors2=1

SelfBuff3=Talisman of Unity
SelfBuffIcon3=Transcendant Foresight
SelfBuffGem3=Gem8
SelfBuffCount3=30
SelfBuffIndoors3=1

selfbuff4=Talisman of Celerity
selfbufficon4=Talisman of Celerity
selfbuffgem4=gem8
SelfBuffCount4=35
SelfBuffIndoors4=1

SelfBuff5=Self Buff Item/Spell #5
SelfBuffIcon5=Self Buff #5 Buff Icon
SelfBuffGem5=Self Buff #5 Gem or put item if an item
SelfBuffCount5=15
SelfBuffIndoors5=0

SelfBuff6=Self Buff Item/Spell #6
SelfBuffIcon6=Self Buff #6 Buff Icon
SelfBuffGem6=Self Buff #6 Gem or put item if an item
SelfBuffCount6=15
SelfBuffIndoors6=0

SelfBuff7=Self Buff Item/Spell #7
SelfBuffIcon7=Self Buff #7 Buff Icon
SelfBuffGem7=Self Buff #7 Gem or put item if an item
SelfBuffCount7=15
SelfBuffIndoors7=0

SelfBuff8=Self Buff Item/Spell #8
SelfBuffIcon8=Self Buff #8 Buff Icon
SelfBuffGem8=Self Buff #8 Gem or put item if an item
SelfBuffCount8=15
SelfBuffIndoors8=0


[DoBuffStuff]
DoBuffTotal=1
DoBuffs=TRUE
DoBuffTells=TRUE
DoBuffChannel=tell
RefreshBuffs=FALSE
DoBuffMana=40

DoBuff1=Talisman of Unity
DoBuffIcon1=Darkpaw Focusing
DoBuffGem1=5
DoBuffAliases1=unity
DoBuffIndoors1=1
DoBuffRefresh1=0

[RaidBuffs]
RaidBuffTotal=1
DoRaidBuffs=TRUE
RaidBuff1=Raid Buff Item/Spell #1
RaidBuffIcon1=Raid Buff #1 Buff Icon
RaidBuffGem1=Raid Buff #1 Gem or put item if an item
RaidBuffIndoors1=0
[PetStuff]
PetBuffTotal=1
DoPetBuffs=TRUE
ShrinkPet=FALSE
ShrinkPetSpell=Tiny Companion
ShrinkPetSpellGem=gem2
PetBuffRecheck=10s
PetBuff1=pet Buff Item/Spell #1
PetBuffIcon1=pet Buff #1 Buff Icon
PetBuffGem1=pet Buff #1 Gem or put item if an item
PetBuffIndoors1=0

[DotStuff]
DotTotal=2
DoDots=True
DotAt=90
DotMinHPs=30
DotMinMana=50
DotRecasts=2
WhichDot=1

Dot1=Mojo
DotGem1=Gem4
DotSpellSet1=1

Dot2=Blood of Jaled'dar Rk. II
DotGem2=Gem6
DotSpellSet2=1

[AuraStuff]
UseAura=FALSE
AuraBuff=Self Aura Spell or Combat Ability full name
AuraBuffGem=gem# for spell, comb for combat ability
AuraEndurance=200

[GotHitStuff]
GotHitTotal=1
UseGotHit=FALSE
GotHit1=Name of Item/AA/Spell to cast.
GotHitGem1=GotHit Gem# or aa
GotHitHp1=90
GotHitType1=0
GotHitRUN1=FALSE

[CureStuff]
CureTotal=1
DoCures=FALSE
ReportCures=FALSE
CureSpell1=Cure Item/Spell #1
CureGem1=Cure #1 Gem or put item if an item
CurseCounters1=0
DiseaseCounters1=0
PoisonCounters1=0
CorruptCounters1=0

[Misc]
LoadDate=2009109
Version=1.25
[Excludes.guardian_80]
Exclude=|
[Excludes.PoKnowledge]
Exclude=|
[Excludes.oldkurn_85]
Exclude=|
[Excludes.Oldfieldofbone]
Exclude=|
[Excludes.oldkaesorab_85]
Exclude=|
[Excludes.oldkaesoraa_85]
Exclude=|
[Excludes.GuildLobby]
Exclude=|
[Excludes.Toskirakk]
Exclude=|
[Excludes.Korascian]
Exclude=|
[Excludes.toskirakk_mission]
Exclude=|
[Excludes.olddranik]
Exclude=a Dragorn Guardian|
[Excludes.Oceangreenvillage_mission]
Exclude=|
[Excludes.oldblackburrow_80]
Exclude=|
[Excludes.Oceangreenhills]
Exclude=|
[Excludes.oldkaesorab_80]
Exclude=|
[Excludes.Umbral]
Exclude=|
[Excludes.Oldkithicor]
Exclude=|
[Excludes.oldcommons_mission]
Exclude=|
[Excludes.Thevoide]
Exclude=|

and this is the main macro

Rich (BB code):
| Shaman.mac by Nils v1.25 Jan.27/08 Usage: target your MA and type /mac shaman <healpct>
#turbo 40
#include spell_routines.inc
#include QuickBeg.inc
#include Ninjadvloot.inc

#chat Chat
#chat Tell

#event CastSpell                "#*# castspell #1# on #2#"
#event Consider_Ally            "#1# regards you as an ally#*#" 
#event Consider_Warmly          "#1# looks upon you warmly#*#" 
#event Consider_Kindly          "#1# kindly considers you#*#" 
#event Consider_Amiable         "#1# judges you amiably#*#" 
#event Consider_Indifferent     "#1# regards you indifferently#*#" 
#event Consider_Apprehensive    "#1# looks your way apprehensively#*#" 
#event Consider_Dubious         "#1# glowers at you dubiously#*#" 
#event Consider_Threatening     "#1# glares at you threateningly#*#" 
#event Consider_ReadyToAttack   "#1# scowls at you, ready to attack#*#"
#event EQBC                     "<#1#> #2#"
#event EQBC                     "[#1#(msg)] #2#"
#event ExcludeMob               "#*# excludemob #1#"
#event GotHit                   "#1# #*# YOU for #*#"
#event GotHit                   "#1# #*# YOU, but #*#"
#event Hungry                   "#*#are hungry#*#"
#event ImDead                   "You have been slain by#*#"
#event ImDead                   "You died."
#event ImDead                   "#*#Returning to Bind Location#*#"
#event Invited                  "#*#invites you to join a group.#*#"
#event Invited                  "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#"
#event MobDead                  "#*#You have slain#*#"
#event MobDead                  "#1# has been slain by#*#"
#event OutDoor                  "#*#outdoors#*#"
#event OutDoor                  "#*#You can not summon a mount here.#*#"
#event OutDoor                  "#*#You can only cast this spell in the Outdoors#*#"
#event OutDoor                  "#*#This spell does not work here.#*#"
#event RageOff                  "#*#|${Target.CleanName}| is no longer enraged#*#"
#event RageOn                   "#*#|${Target.CleanName}| has become ENRAGED#*#"
#event RaidBuff                 "#*# raidbuff #1#"
#event RootOff                  "Your Virulent Paralysis spell has worn off of #1#."
#event RootOff                  "Your ${RootSpell} spell has worn off of #1#."
#event SayZone                  "#*# sayzone #1#"
#event SelfShrink               "#*#SelfShrink#*#"
#event ShrinkGroup              "#*#Shrinkgroup#*#"
#event SetAnchor                "[MQ2] SetAnchor #1#"
#event Thirsty                  "#*#are thirsty#*#"
#event ToggleString             "[MQ2] ToggleString #1#,#2#,#3#,#4#,#5#"
#event ToggleUseMount           "[MQ2] Toggling UseMount"
#event ToggleVar                "[MQ2] ToggleVar #1#,#2#,#3#,#4#,#5#"
#event WornOff                  "#*#Your #1# spell has worn off of #2#."
#event Zoning                   "You have entered#*#"
#event Zoning                   "LOADING, PLEASE WAIT..."

Sub Main
  /declare Version string outer 1.25
  /declare IniFile string outer ${Me.Name}_Shaman.ini
  /declare i int local
  /declare j int local
  /declare OldTarget int local
  /declare TempTimer timer local 0
  /call LoadIni "${Me.CleanName}_Shaman.ini" LOAD
  /MemSpellSet ${MySpellSet}
  /call SetupAdvLootVars
  /call QuickBegDeclares
  /delay 15s
  /squelch /alert clear 1
  /if (${Announce}) /Announce on
  /if (${Version.NotEqual[${Ini[${Me.Name}_Shaman.ini,Misc,Version]}]}) /call LoadAliases
| Macro Setup
  /varset MTHP ${Param0}
  /varset TankID ${Target.ID}
  /varset TankName ${Target.CleanName}
  /if (!${TankID}) {
    /echo No Target, no Tank, Defaulting to RaidMode!
    /varset RaidMode TRUE
    /varset TankID 0
  }
  /if (!${MTHP}) {
    /echo No Heal% Specified! Defaulting to RaidMode!
    /varset RaidMode TRUE
    /varset TankID 0
  }
  /if (${TankID}==${Me.ID}) {
    /echo You can't be the tank! Defaulting to RaidMode!
    /varset RaidMode TRUE
    /varset TankID 0
  }
  /echo ******************************
  /echo Shaman.mac v1.25 Initialized
  /if (!${RaidMode}) /echo ${TankName} is the Tank. Current ID: ${TankID}
  /if (${RaidMode}) /echo Operating in RaidMode, Bot and Group will be healed.
  /if (${MTHP}) /echo Healing ${TankName} at ${Param0}%
  /echo ******************************
| End Setup
  :wait_for_target
  /if (${GameState.Equal[CHARSELECT]}) /end
  /doevents
  /if (${SummonPet} && !${PetBuffTimer}) /call PetStuff
  /if (${DoNuke} || ${DoMalo} || ${DoSlow} || ${DoCripple} || ${UseVPAA} || ${UseRoot}) /echo Waiting for target...
  /varset ValidTarget 0
  /call Check_grpHPs
  /call LowMana
  :wait_for_target2
  /call CheckInvis
  /if (${UseMount} && !${Me.Mount.ID} && ${OutDoors} && !${Following} && !${Me.Invis}) /call Cast "${Mount}" item 5s
  /doevents
  /if (!${Corpse.Open} && ${Spawn[${TankID}].NearestSpawn[npc radius ${Math.Calc[${MinRadius}*2]}].ID} && !${Following} && (${DoNuke} || ${DoMalo} || ${DoSlow} || ${DoCripple} || ${UseVPAA} || ${UseRoot})) {
    /if (${Me.Casting.ID}) /call WaitCast
    /squelch /assist ${TankName}
    /varset OldTarget ${Target.ID}
    /varset TempTimer 5
    :wait_for_assist1
    /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
    /if (!${NewAdds} && ${QueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoBuffs}) /call DoBuffEvents
    /if (!${NewAdds} && ${RaidQueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoRaidBuffs}) /call RaidBuffEvents
    /if (!${NewAdds} && ${Me.PctMana}>=${DoBuffMana} && ${SelfBuffs}) /call CheckSelfBuffs
    /if (!${NewAdds}) /call LowMana
    /call Check_grpHPs
    /doevents
    /call CheckTarget
    /if (${TempTimer} && !${ValidTarget}) /goto :wait_for_assist1
  }
  /call CheckTarget
  /doevents
  /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
  /if (!${NewAdds} && !${Me.Moving} && !${SpawnCount[npc radius 20 zradius 20]} && !${Me.Casting.ID} && !${Following} && !${Me.Invis}) {
    /if (${QueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoBuffs}) /call DoBuffEvents
    /if (${RaidQueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoRaidBuffs}) /call RaidBuffEvents
  }
  /if (${DoAvatar} && !${Following} && !${Me.Invis} && ${Me.SpellReady[${ATKSpell}]} && !${GroupAvaTimer}) /call Cast_Avatar
  /if (${DoSloth} && !${Following} && !${Me.Invis} && ${Me.PctMana}>=${DoBuffMana} && !${GroupSloTimer}) /call Cast_Sloth
  /if (${SlothRaid} && !${Following} && !${Me.Invis} && ${Me.PctMana}>=${DoBuffMana}) /call Cast_Sloth
  /if (${Zone.ID}!=${currentZone} || ${Window[RespawnWnd].Open}) /call Event_Zoning
  /if (${TankID}!=${NearestSpawn[${TankName}].ID}) /varset TankID ${NearestSpawn[${TankName}].ID}
  /if (!${ValidTarget}) {
    /doevents
    /if (${Window[TradeWnd].Open}) /nomodkey /notify TradeWnd TRDW_Trade_Button leftmouseup
    /if (!${NewAdds} && !${Following} && !${Me.Invis}) {
      /if (${UseAnchor}) /call CheckLoc
      /if (${Me.PctMana}>=${DoBuffMana} && ${SelfBuffs}) /call CheckSelfBuffs
      /if (${SummonPet} && !${PetBuffTimer}) /call PetStuff
      /call LowMana
      /call CheckInvis
      /call Check_grpHPs
    }
    /goto :wait_for_target2
  }
  /if (${Following} || ${ExcludeList.Find[${Spawn[${Target.ID}]}].CleanName}) /goto :wait_for_target2
  /echo Target Aquired >> ${Target.DisplayName} <<
  /varset PetAttacking FALSE
  /varset Engaged 0
  /if (!${ExcludeList.Find[${Spawn[${Target.ID}]}].CleanName}) /varset MobID ${Target.ID}
  /varset MobHPStart ${Target.PctHPs}
  /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call UpdateMobList
  /if (!${ExcludeList.Find[${Spawn[${MobID}]}].CleanName}) /call AddToList ${MobID} 3
  /varset NukeWaitTimer 0
  /varset FightStartTime 0
  /if (${Defined[WaitTimer${MobID}]}) /deletevar WaitTimer${MobID}
  /declare WaitTimer${MobID} int outer -1
  :check_add_loop
  /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
  /if ((${Spawn[${MobID}].PctHPs}>${MinHP} && ${WaitTimer${MobID}}) || !${AssistWaitTimer}) {
    /if (${Me.Casting.ID}) /call WaitCast
    /assist ${TankName}
    /varset TempTimer 8
    :wait_for_assist
    /doevents
    /delay 1
    /doevents Chat
    /doevents EQBC
    /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds 
    /if (${TempTimer} && ${Target.ID}==${MobID}) /goto :wait_for_assist
    /varset AssistWaitTimer 5s
  }
  :check_add_loop2
  /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
  /if (${AddIndex}<=1) {
    /call TankHot
    /call Check_grpHPs
    /call LowMana
    /doevents
    /delay 1
    /doevents Chat
    /doevents EQBC
  }
  /if (!${AddIndex}) /goto :wait_for_target2
  /call Check_grpHPs
  /if (${NewAdds}) /call DebuffAdds
  /if (!${Engaged} && !${DoDebuffs}) {
    /varset Engaged 1
    /echo Engaging >> ${Target.DisplayName} <<
  }
  /if (${Me.Feigning}) /stand
  /if (${NewAdds} && ${DoDebuffs}) /call DebuffMobs ${MobID}
  /if (${DoPetHeal} && (${Me.Gem[${HealSpell}]} || ${Me.SpellReady[${HealSpell}]})) {
    /call EvaluatePets
    /if (${WorstHPs}<${PetHeal}) /call DoHeal ${WorstID} Pet
  }
  /if (!${Spawn[${MobID}].Type.Equal[NPC]}) /goto :mob_dead
  /if (!${DoNuke} && !${DoMalo} && !${DoSlow} && !${DoCripple}) /goto :wait_for_target
  /target id ${MobID}
  /delay 3s ${Target.ID}==${MobID}
  /delay 1
  /if ((${Target.PctHPs}<${MobHPStart}) && ${Spawn[pc ${TankID}].NearestSpawn[radius ${Math.Calc[${Spawn[${MobID}].MaxRangeTo}+10]} id ${MobID}].ID} && ${WaitTimer${MobID}}<0  && ${Spawn[${MobID}].Distance3D}<=${MinRadius}) {
    /deletevar WaitTimer${MobID}
    /declare WaitTimer${MobID} timer outer ${EngageDelay}
  }
  /doevents
  /target id ${MobID}
  /delay 3s ${Target.ID}==${MobID}
  /delay 1
  /if (${Target.PctHPs}>${MinHP} && ${WaitTimer${MobID}}) /goto :check_add_loop
  /if (${NewAdds}) /call DebuffAdds
  /if (${Me.Pet.ID} && !${PetAttacking} && ${Target.ID}==${MobID} && ${Target.PctHPs}<98 && ${Target.Distance}<=60 && !${ExcludeList.Find[${Spawn[${MobID}]}].CleanName}) {
    /pet attack
    /varset PetAttacking TRUE
  }
  /if (${Engaged} && ${DoGroupPanther} && ${Me.PctMana}>=${DoBuffMana} && !${GroupPanTimer}) /call Cast_Panther
  /if (${Engaged} && ${Me.PctMana}>=${DoBuffMana} && ${DoPetPanther}) {
    /if (${Me.Pet.ID}&& !${Me.PetBuff[${PantherSpell}]} && !${PetPanTimer}) {
      /pet target
      /call Cast "${PantherSpell}" ${PantherSpellGem} 3s
      /varset PetPanTimer ${PantherDelay}
    }
  }
  /if (${Engaged} && ${DoPetSloth} && ${Me.PctMana}>=${DoBuffMana}) {
    /if (${Me.Pet.ID}&& !${Me.PetBuff[${SlothSpell}]} && !${PetSloTimer}) {
      /pet target
      /call Cast "${SlothSpell}" ${SlothSpellGem} 3s
      /varset PetSloTimer ${SlothDelay}
    }
  }
  /if (${NewAdds} && ${DoDebuffs}) /call DebuffMobs ${MobID}
  /if (${NewAdds}) /call DebuffAdds
  /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call UpdateMobList
  /if (${Spawn[${MobID}].Type.Equal[NPC]} || ${Spawn[${MobID}].Type.Equal[Pet]}) {
  	/delay 1
  	/doevents Chat
  	/doevents EQBC
    /call TankHot
    /call Check_grpHPs
    /call LowMana
    /target id ${MobID}
    /delay 5s ${Target.ID}==${MobID}
    /delay 1
    /if (${MobID}==${NearestSpawn[npc named].ID} && !${ExcludeList.Find[${Spawn[${MobID}]}].CleanName}) {
    	/if (${UseWard} && ${Me.AltAbility[Call of the Ancients]} && ${Me.AltAbilityReady[Call of the Ancients]}) /call Cast "Call of the Ancients" alt
    	/if (${Me.AltAbility[Spirit Call]} && ${Me.AltAbilityReady[Spirit Call]} && ${Target.Distance}<=100 && ${Target.PctHPs}<${NukeAt} && ${Target.PctHPs}>70) /call Cast "Spirit Call" alt 1s
    	/if (${UseEpic} && !${EpicTimer} && !${FindItem[Crafted Talisman of Fates].Timer} && !${FindItem[Blessed Spiritstaff of the Heyokah].Timer}) {
    		/if (${FindItem[Blessed Spiritstaff of the Heyokah].InvSlot} && !${Me.Song[Prophet's Gift of the Ruchu].ID}) {
    			/call Cast "Blessed Spiritstaff of the Heyokah" item 1s
    			/varset EpicTimer 30s
    		} else /if (${FindItem[Crafted Talisman of Fates].InvSlot} && !${Me.Song[Fateseer's Boon].ID}) {
    			/call Cast "Crafted Talisman of Fates" item 1s
    			/varset EpicTimer 30s
    		}
    		/if (${Announce}) /${MyChannel} *** Using Epic !
    	}
    }
    /if (${DoNuke} && ${Target.PctHPs}>10 && ${Target.Distance}<=220 && ${Target.PctHPs}<${NukeAt} && ${Target.LineOfSight}) /call Nuke
    /if (${DoDots} && ${Target.Distance}<=220 && ${Target.PctHPs}>${DotMinHPs} && ${Target.PctHPs}<=${DotAt} && ${Target.LineOfSight}) /call Dot
    /if (!${NewAdds} && !${Me.Moving} && !${SpawnCount[npc radius 20 zradius 20]} && !${Me.Casting.ID} && !${Following} && !${Me.Invis}) {
      /if (${QueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoBuffs}) /call DoBuffEvents
      /if (${RaidQueueCount} && ${Me.PctMana}>${DoBuffMana} && ${DoRaidBuffs}) /call RaidBuffEvents
    }
    /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
  } else {
    /goto :mob_dead
  }
  /if (!${NewAdds} && (!${DoDebuffs} || !${DoSlow})) {
    /target id ${MobID}
    /delay 3s ${Target.ID} == ${MobID}
    /delay 1
  }
  /goto :check_add_loop
  :mob_dead
  /call UpdateMobList
  /echo Target Dead!
  /if (${Me.Pet.ID} && ${Me.AltAbility[Pet Discipline]}) /pet hold
  /varset PetAttacking FALSE
  /if (${useAutoLoot} && ${LootMobs} && !${Me.Moving} && ${ACState}<1 ) /call LootMobs
  /doevents
  /goto :wait_for_target
/return

Sub Consider
  /declare tempID int local
  /if (!${Defined[ConsiderReturn]}) /declare ConsiderReturn int outer
  /varset ConsiderReturn 0
  /if (${Target.ID}) {
  	/varset tempID ${Target.ID}
  	/if (!${Defined[ConsiderTarget${tempID}]}) /declare ConsiderTarget${tempID} int outer 1
  	/consider
    /delay 2
    /doevents
  }
  /if (${ConsiderReturn}) /return ${ConsiderReturn}
/return

Sub CheckInvis
  :InvisLoop
  /varset DeathFlag ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]}
  /if (${DeathFlag} || ${Me.State.Equal[Hover]} || ${Me.State.Equal[Dead]} || ${Window[RespawnWnd].Open}) /call Event_ImDead
  /if (${Me.Invis}) {
    /delay 1
    /doevents Chat
    /doevents EQBC
    /doevents
    /if (${Zone.ID}!=${currentZone}) /call Event_Zoning
    /goto :InvisLoop
  }
/return

Sub CheckLoc
  /if (!${UseAnchor}) /return
  /declare MyDistance float local ${Math.Distance[${Me.Y},${Me.X}:${AnchorY},${AnchorX}
  /if (${MyDistance}>${LeashLength}) {
  	/if (${MyDistance}>300) {
  		/varset UseAnchor 0
  		/return
  	}
  	/if (${Me.Mount.ID}) /dismount
  	/call MoveToLoc ${AnchorY} ${AnchorX}
  	/squelch /face fast nolook Heading ${AnchorHeading}
  }
/return

Sub PetStuff
  /declare i int local
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /if (!${Me.Pet.ID} && !${Me.Buff[${PetSpell}].ID}) {
  	/if (${Me.AltAbility[Suspended Minion]}) /alt activate 176
    /delay 10s !${Me.Casting.ID}
    /delay 5s ${Me.Pet.ID}
    /if (!${Me.Pet.ID}) {
      /call Cast "${PetSpell}" ${PetSpellGem} 5s Check_grpHPs
    }
  }
  /if (${DoPetHeal} && (${Me.Gem[${HealSpell}]} || ${Me.SpellReady[${HealSpell}]})) {
    /call EvaluatePets
    /if (${WorstHPs}<${PetHeal}) /call DoHeal ${WorstID} Pet
  }
  /if (${DoPetBuffs} && ${Me.Pet.ID}) {
    /for i 1 to ${PetBuffTotal}
      /if (${Spell[${PetBuffID[${i}]}].StacksPet[20]} && ((!${SitTimer} || ${Me.Gem[${PetBuff${i}}]} || ${Me.Mount.ID}) && (!${Me.Gem[${PetBuff${i}}]} || ${Me.SpellReady[${PetBuff${i}}]}) || ${PetBuffGem${i}.Equal[item]} || (${PetBuffGem${i}.Equal[alt]} && ${Me.AltAbilityReady[${PetBuff${i}}]})) && (${Outdoors} || ${PetBuffIndoors${i}})) {
        /if (${Me.PctMana}<${PetMana} && !${Select[${PetBuffGem${i}},alt,item]}) /return
        /squelch /target id ${Me.Pet.ID}
        /delay 3s ${Target.ID}==${Me.Pet.ID}
        /call Cast "${PetBuff${i}}" ${PetBuffGem${i}} 5s Check_grpHPs
        /if (${Spawn[${OldTarget}].ID}) {
          /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
        } else {
         	/squelch /target clear
        }
        /return
      }
    /next i
    /varset PetBuffTimer ${PetBuffRecheck}
  }
  /if (${ShrinkPet} && ${Me.Pet.ID} && (${Me.Pet.Height}-.25>1)) {
	  /if (${Target.ID}!=${Me.Pet.ID}) /target id ${Me.Pet.ID}
	  /delay 3s ${Target.ID}==${Me.Pet.ID}
	  /call Cast "${ShrinkPetSpell}" ${ShrinkPetSpellGem} 3s Check_grpHPs
    /if (${Spawn[${OldTarget}].ID}) {
      /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
    } else {
      /squelch /target clear
    }
    /delay 1
    /if (${Target.ID}==${Me.Pet.ID}) /squelch /target clear
	}
/return

Sub EvaluatePets
  /declare i int local
  /varset WorstHPs 100
  /for i 0 to ${Group}
    /if (${Group.Member[${i}].Pet.PctHPs}<=${WorstHPs} && ${Group.Member[${i}].Pet.ID} && ${Group.Member[${i}].Pet.Distance}<${Spell[${HealSpellID}].MyRange}) {
      /varset WorstHPs ${Group.Member[${i}].Pet.PctHPs}
      /varset WorstID ${Group.Member[${i}].Pet.ID}
    }
  /next i
/return

Sub DoHeal(int HealGuy,HealType)
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /declare TempTarget int local ${Target.ID}
  /if (${Target.ID}!=${HealGuy}) /target id ${HealGuy}
  /delay 3s ${Target.ID}==${HealGuy}
  /varset StartHPs ${Target.PctHPs}
  /if (${Me.Casting.Name.NotEqual[${HealSpell}]}) /call Interrupt
  /if (${Target.ID}==${HealGuy} && ${Spawn[${HealGuy}].Type.NotEqual[Corpse]}) /call Cast "${HealSpell}" ${HealSpellGem} 4s CheckHP
  /if (${Group.Member[${WorstMember}-1].PctHPs}<${StartHPs}+5 && ${Group.Member[${WorstMember}-1].PctHPs}>=${StartHPs}) {
    /varset DAArray[${WorstMember},1] ${StartHPs}
    /varset DAArray[${WorstMember},2] 1
  }
  /varset WorstHPs 100
  /if (${Target.ID}!=${TempTarget} && ${Spawn[${TempTarget}].ID}) /target id ${TempTarget}
  /call DoCastingEvents
  /varset castReturn CAST_CANCELLED
  /if (${Spawn[${OldTarget}].ID}) {
    /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
  } else {
   	/squelch /target clear
  }
/return

Sub Cannibalization
  /if (${UseEpic} && !${EpicTimer} && !${FindItem[Crafted Talisman of Fates].Timer} && !${FindItem[Blessed Spiritstaff of the Heyokah].Timer}) {
    /if (${FindItem[Blessed Spiritstaff of the Heyokah].InvSlot} && !${Me.Song[Prophet's Gift of the Ruchu].ID}) {
    	/call Cast "Blessed Spiritstaff of the Heyokah" item 1s
    	/varset EpicTimer 30s
    } else /if (${FindItem[Crafted Talisman of Fates].InvSlot} && !${Me.Song[Fateseer's Boon].ID}) {
    	/call Cast "Crafted Talisman of Fates" item 1s
    	/varset EpicTimer 30s
    }
    /if (${Announce}) /${MyChannel} *** Using Epic !
  }
  /if (${Me.CurrentHPs} < ${Me.MaxHPs}-1600 && !${EpicTimer}) /call Hot
  /if (${Announce}) /${MyChannel} *** Doing AA Cannibalization !
  /call Cast "Cannibalization" alt
  /delay 3s
  }
/return

Sub Hot
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /if (${Me.CurrentMana}<${Spell[${HotSpell}].Mana}) {
    /echo *** Shit, I don't have mana to cast ${HotSpell}
    /return
  }
  /if (${Me.SpellReady[${HotSpell}]} && ${Spell[${HotSpell}].Stacks[2]}) {
    /target myself
    /delay 3s ${Target.ID}==${Me.ID}
    /if (${Target.ID}==${Me.ID}) {
      /call Cast "${HotSpell}" ${HotSpellGem} 3s
      /delay 1
    }
  }
  /if (${Spawn[${OldTarget}].ID}) {
    /if (${Target.ID}==${Me.ID}) /target id ${OldTarget}
  } else {
   	/squelch /target clear
  }
/return

Sub TankHot
  /if (${GroupHotTimer}) /return
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /varset MinorHurt 0
  /varset MajorHurt 0
  /for gmember 0 to ${Group}
  	/if (${Me.PctMana}>35&&${Spawn[pc ${Group.Member[${gmember}]}].ID}&&${Group.Member[${gmember}].Distance}<=${Spell[${GroupHot}].MyRange}) {
      /if ((${Group.Member[${gmember}].PctHPs}<=85)&&(${Group.Member[${gmember}].PctHPs}>=60)) /varcalc MinorHurt ${MinorHurt}+1
      /if ((${Group.Member[${gmember}].PctHPs}<=60)&&(${Group.Member[${gmember}].PctHPs}>=1)) /varcalc MajorHurt ${MajorHurt}+1
    }
  /next gmember
  /if ((${MajorHurt}+${MinorHurt}>=3)&&${UseGroupHot}) {
  	/if (${Me.AltAbility[Ancestral Aid]} && ${Me.AltAbilityReady[Ancestral Aid]}) {
  		/if (${Announce}) /${MyChannel} *** Inc Ancestral Aid, get close
  		/call Cast "Ancestral Aid" alt 1s
  		/return
  	} else /if (!${Me.AltAbilityReady[Ancestral Aid]}) {
      /if (${Announce}) /${MyChannel} *** Inc ${GroupHot}, get close
      /call Cast "${GroupHot}" ${GroupHotGem} 1s
      /varset GroupHotTimer 400
      /return
    }
  }
  /declare i int local
  /for i 0 to ${Group.Members}
    /if (${Spawn[pc ${Group.Member[${i}]}].ID}&&${Group.Member[${i}].Distance}<=${Spell[${HotSpell}].MyRange} && !${HotTimer[${Group.Member[${i}].ID}]} && ${Group.Member[${i}].Name.NotEqual[${TankName}]} && ${Select[${Group.Member[${i}].Class.ShortName},WAR,MNK,ROG,RNG,BST,SHD,PAL,BER,BRD]} && ${Group.Member[${i}].PctHPs}<=${MeleeHeal}+10  && ${Me.PctMana}>35) {
      /squelch /target ID ${Group.Member[${i}].ID}
      /delay 3s ${Target.ID}==${Group.Member[${i}].ID}
      /if (${Target.ID}==${Group.Member[${i}].ID}) {
        /if (${Announce}) /${MyChannel} *** ${HotSpell} on ${Target.CleanName}
        /call Cast "${HotSpell}" ${HotSpellGem} 5s CheckHP
        /delay 15 ${Me.SpellReady[${HotSpell}]}
        /if (!${Defined[HotTimer${Group.Member[${i}].ID}]}) /declare HotTimer${Group.Member[${i}].ID} timer outer
        /varcalc HotTimer${Group.Member[${i}].ID} ${Spell[${HotSpell}].Duration.TotalSeconds}*9.8
      }
    }
  /next i
  /if (!${TankID} || ${Spawn[${TankID}].Distance}>${Spell[${HotSpell}].MyRange} || ${NoHotTimer}>=20) /return
  /if (${Spawn[${TankID}].PctHPs}<85 && !${NoHotTimer} && ${Me.PctMana}>35 && ${Me.SpellReady[${HotSpell}]}) {
    /target ${Spawn[${TankID}]}
    /delay 3s ${Target.ID}==${TankID}
    /if (${Target.ID}==${TankID}) {
      /if (${Announce}) /${MyChannel} ${HotSpell} on ${Target.CleanName}
      /call Cast "${HotSpell}" ${HotSpellGem} 5s
      /varset NoHotTimer 300
    }
  }
  /if (${Spawn[${OldTarget}].ID}) {
    /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
  } else {
   	/squelch /target clear
  }
/return

Sub LowMana
  /if (${Zone.ID}!=${currentZone}) /call Event_Zoning
  /if (${Following}) /return
  /if (${Cursor.Name.Equal[Wand of Elemental Transvergance]} || ${Cursor.Name.Equal[Rod of Mystical Transvergance]} || ${Cursor.Name.Equal[Summoned: Modulating Rod]}) /autoinventory
  /if (${Me.PctMana}<=70&&((${FindItem[Wand of Elemental Transvergance].InvSlot}&&!${FindItem[Wand of Elemental Transvergance].TimerReady})||(${FindItem[Rod of Mystical Transvergance].InvSlot}&&!${FindItem[Rod of Mystical Transvergance].TimerReady})||(${FindItem[Summoned: Modulating Rod].InvSlot}&&!${FindItem[Summoned: Modulating Rod].TimerReady}))) {
    /if (${FindItem[Wand of Elemental Transvergance].InvSlot}) {
      /call Cast "Wand of Elemental Transvergance" item
    } else /if (${FindItem[Rod of Mystical Transvergance].InvSlot}) {
      /call Cast "Rod of Mystical Transvergance" item
	  } else /if (${FindItem[Summoned: Modulating Rod].InvSlot}) {
		  /call Cast "Summoned: Modulating Rod" item
	  }
  }
  /if (${Me.CurrentHPs} < ${Me.MaxHPs}-1600 && !${EpicTimer}) /call Hot
  /if (${Me.CurrentMana} < ${Me.MaxMana}-6 && ${Me.SpellReady[${CanniSpell}]}) /call Cast "${CanniSpell}" ${CanniSpellGem} 6s
  /if (${DoCanniAA} && ${Me.AltAbility[Cannibalization]} && ${Me.AltAbilityReady[Cannibalization]} && ${Me.CurrentMana} < ${Me.MaxMana}-3000 && ${Me.MaxHPs} > 5000) /call Cannibalization
  /if (${Me.State.Equal[Stand]} && ${Me.PctMana}<${SitAt} && !${Spawn[npc radius 60 zradius 60].ID} && !${Following} && !${Me.Mount.ID} && !${Me.Casting.ID}) /sit
  /if (${Me.State.Equal[Sit]} && !${Window[SpellBookWnd].Open} && (${NearestSpawn[1, NPC radius 60 zradius 60 noalert 1].ID} || ${Me.PctMana}>95 || ${Following})) /stand
/return

Sub Check_grpHPs
  /declare i int local 1
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /call CheckInvis
  /if (${Me.PctHPs}<=${SelfHealPoint}) {
    /squelch /target myself
    /delay 3s ${Target.ID}==${Me.ID}
    /if (${Target.ID}==${Me.ID}) {
      /if (${Announce}) /${MyChannel} *** ${HealSpell} on ${Target.CleanName}
      /call Cast "${HealSpell}" ${HealSpellGem} 4s CheckHP
      /delay 15 ${Me.SpellReady[${HealSpell}]}
    }
  }
  /for i 1 to ${Group.Members}
    /if (${Spawn[pc ${Group.Member[${i}]}].ID} && ${Group.Member[${i}].Distance}<=${Spell[${HealSpell}].MyRange} && (${Group.Member[${i}].Name.NotEqual[${TankName}]} && ((${Select[${Group.Member[${i}].Class.ShortName},CLR,DRU,SHM,WIZ,MAG,ENC,NEC]} && ${Group.Member[${i}].PctHPs}<=${CasterHeal}) || (${Select[${Group.Member[${i}].Class.ShortName},WAR,MNK,ROG,RNG,BST,SHD,PAL,BER,BRD]} && ${Group.Member[${i}].PctHPs}<=${MeleeHeal}))) || (${Group.Member[${i}].Name.Equal[${TankName}]} && ${Group.Member[${i}].PctHPs}<=${MTHP})) {
      /squelch /target ID ${Group.Member[${i}].ID}
      /delay 3s ${Target.ID}==${Group.Member[${i}].ID}
      /if (${Target.ID}==${Group.Member[${i}].ID}) {
      	/if (${Spawn[pc ${Group.Member[${i}]}].PctHPs}<=${UnionHP} && ${Me.AltAbility[Union of Spirits]} && ${Me.AltAbilityReady[Union of Spirits]}) {
      	  /if (${Announce}) /${MyChannel} *** Union of Spirits on ${Target.CleanName}
      	  /call Cast "Union of Spirits" alt 1s
      	  /goto :NextHeal
        }
        /if (${Announce}) /${MyChannel} *** ${HealSpell} on ${Target.CleanName}
        /call Cast "${HealSpell}" ${HealSpellGem} 4s CheckHP
        /delay 15 ${Me.SpellReady[${HealSpell}]}
      }
    }
    :NextHeal
  /next i
  /if (${Spawn[${OldTarget}].ID}) {
    /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
  } else {
   	/squelch /target clear
  }
/return

Sub CheckHP
  /if (!${Bool[${Me.Casting}]}) /return
  /if (${Target.PctHPs} >= ${CancelPct} && ${Target.Type.Equal[PC]}) /call Interrupt
/return

Sub CheckTarget
  /declare tempID int local ${Target.ID}
  /if (${UseConsider} && ${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.Type.NotEqual[Corpse]} && !${ConsiderTarget${tempID}}) /call Consider ${Target.CleanName}
  /if (${ExcludeList.Find[${Spawn[${tempID}].CleanName}]} || (${UseConsider} && !${Select[${ConsiderReturn},8,9]})) /return
  /if ((${Spawn[${tempID}].Type.Equal[npc]} || (${Spawn[${tempID}].Type.Equal[pet]} && !${Spawn[${tempID}].Master.Type.Equal[pc]})) && (( ${Spawn[pc ${TankID}].NearestSpawn[radius ${Math.Calc[${MinRadius}*2]} id ${tempID}].ID} && ${Spawn[pc ${TankID}].Distance3D}<=${MinRadius}) || !${Spawn[pc ${TankID}].ID} || ${Spawn[pc ${TankID}].Distance3D}>200) && (${AggroAnim.Find[|${Spawn[${tempID}].Animation}|]} || ${Spawn[${tempID}].PctHPs}<100 || ${Me.TargetOfTarget.Type.Equal[pc]} || ${Me.TargetOfTarget.Master.Type.Equal[pc]})) {
    /varset ValidTarget 1
  } else {
    /varset ValidTarget 0
  }
/return  			
  		
Sub DebuffMobs(int DebuffID)
  /declare i int local
  /declare tempID int local
  /declare Counter int local 0
  /if (${AddIndex}>0) {
    /for i 1 to ${AddIndex}
    	/if (${Spawn[${MobList[${i}]}].ID} && ${Spawn[${MobList[${i}]}].ID}==${DebuffID}) {
        /varset tempID ${Spawn[${MobList[${i}]}].ID}
        /if (!${Defined[slowTimer${tempID}]} || ${slowTimer[${tempID}]}<40) {
        	/if (!${DoSlow} && !${Defined[slowTimer${tempID}]}) /declare slowTimer${tempID} int outer 0
          /if (!${Spawn[${tempID}].Type.Equal[NPC]}) {
            /if (${Defined[slowTimer${tempID}]}) {
            	/deletevar slowTimer${tempID}
            	/declare slowTimer${tempID} int outer 0
            } else {
            	/declare slowTimer${tempID} int outer 0
            }
          } else /if (((!${WaitTimer${tempID}} || ${slowTimer${tempID}}>0) && (${slowTimer${MobID}} || ${WaitTimer${MobID}})) || ${tempID}==${MobID}) {
            :WaitForEngage
            /if (${Target.ID}!=${tempID}) /target id ${tempID}
            /delay 1s ${Target.ID}==${tempID}
            /if (${Target.ID}==${tempID}) {
              /if (!${Engaged} && ${Target.ID}==${MobID}) {
              	/varcalc Counter ${Counter}+1
              	/if (${Counter}>19) {
              		/if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
              	  /return
              	}
              	/if (${Select[${Counter},2,4,6,8,10,12,14,16,18]}) /doevents
               	/if (${Select[${Counter},3,6,9,12,15,18]}) /call Check_grpHPs
               	/delay ${EngageDelay}
              	/if (${Spawn[${MobID}].PctHPs}>99 && ${Target.ID}==${MobID}) /goto :WaitForEngage
                /varset Engaged 1
                /echo Engaging >> ${Target.DisplayName} << ID:${Target.ID}
              }
              /if (${UseVPAA} || ${UseRoot}) {
              	/if (!${VPTimer${tempID}}) /call VPAA ${tempID}
              	/delay 1
              }            	
              /if ((${DoMalo} && !${maloTimer${tempID}}) && ((${Spawn[${tempID}].ConColor.NotEqual[GREEN]} || ${DebuffGreens}) || (${Spawn[${tempID}].ConColor.NotEqual[GREY]} || ${DebuffGreys}))) /call Malo ${tempID}
              /if (${Me.Pet.ID} && !${PetAttacking} && ${Target.ID}==${MobID} && ${Target.PctHPs}<98 && ${Target.Distance}<=60 && !${ExcludeList.Find[${Spawn[${tempID}]}].CleanName}) {
                /pet attack
                /varset PetAttacking TRUE
              }
              /if ((${DoSlow} && !${slowTimer${tempID}}) && ((${Spawn[${tempID}].ConColor.NotEqual[GREEN]} || ${DebuffGreens}) || (${Spawn[${tempID}].ConColor.NotEqual[GREY]} || ${DebuffGreys}))) /call Slow ${tempID}
              /if (!${DoSlow}) {
              	/if (!${Defined[slowTimer${tempID}]}) /declare slowTimer${tempID} timer outer
              	/varset slowTimer${tempID} 10000s
              	/if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
              }
              /if ((${DoCripple} && !${crippleTimer${tempID}}) && ((${Spawn[${tempID}].ConColor.NotEqual[GREEN]} || ${DebuffGreens}) || (${Spawn[${tempID}].ConColor.NotEqual[GREY]} || ${DebuffGreys}))) /call Cripple ${tempID}
              /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount} && !${DoSlow} && !${DoSlow}) /call CheckForAdds
            }
          }
        }
      }
    /next i
  }
  /call Timer
/return

Sub DebuffAdds
  /if (!${DoDebuffs}) {
    /varset NewAdds 0
    /return
  }
  /declare i int local
  /declare tempID int local
  /if (${AddIndex}>0) {
    /for i 1 to ${AddIndex}
    	/if (!${Spawn[${MobID}].Type.Equal[NPC]} && !${Spawn[${MobID}].Master.Type.Equal[NPC]}) /return
      /if (${Spawn[${AddList[${i}]}].ID} && ${Spawn[${AddList[${i}]}].ID}!=${MobID}) {
      	/varset tempID ${Spawn[${AddList[${i}]}].ID}
        /if (${ExcludeList.Find[${Spawn[${tempID}].DisplayName}]}) {
    	    /call DeleteFromList ${tempID} 3
    	    /next i
    	  }
        /if (!${Spawn[${tempID}].Type.Equal[NPC]} && !${Spawn[${tempID}].Master.Type.Equal[NPC]}) {
          /if (${Defined[slowTimer${tempID}]}) /deletevar slowTimer${tempID}
          /if (${Defined[maloTimer${tempID}]}) /deletevar maloTimer${tempID}
          /if (${Defined[crippleTimer${tempID}]}) /deletevar crippleTimer${tempID}
          /if (${Defined[WaitTimer${tempID}]}) /deletevar WaitTimer${tempID}
          /if (${Defined[VPTimer${tempID}]}) /deletevar VPTimer${tempID}
          /call DeleteFromList ${tempID} 3
        } else {
          /squelch /target id ${tempID}
          /delay 5 ${Target.ID}==${tempID}
          /delay 1
          /if (${DoDebuffs} && ${Spawn[${tempID}].ID}) /call DebuffMobs ${tempID}
        }
      }
      /next i
      /varset NewAdds 0
    }
/return

Sub VPAA(int VPAAMobID)
  /call CheckInvis
  /if (${Spawn[${VPAAMobID}].Type.NotEqual[NPC]} || ${VPAAMobID}==${MobID} || ${DeathFlag} || ${ExcludeList.Find[${Spawn[${VPAAMobID}].CleanName}]}) /return
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /declare RootResistCounter int local 0
  /if (${Me.PctHPs}>5 && ${Spawn[${VPAAMobID}].PctHPs}>80 && ((${Me.AltAbility[Virulent Paralysis]} && ${Me.AltAbilityReady[Virulent Paralysis]}) || ${UseRoot})) {
	  /squelch /target id ${VPAAMobID}
	  /delay 5s ${Target.ID}==${VPAAMobID}
	  :RecastRoot
	  /if (${Target.ID}==${VPAAMobID} && ${Target.Distance}<200 && ${Target.LineOfSight} && ${Target.PctHPs}>80) {
	  	/if (!${Defined[tempID]}) /declare tempID int local ${Target.ID}
	  	/if (!${Defined[VPTimer${tempID}]}) /declare VPTimer${tempID} timer outer
	  	/face nolook
	    /if (${Me.AltAbilityReady[Virulent Paralysis]}) {
	    	/if (${Announce}) /${MyChannel} Casting Virulent Paralysis on ${Spawn[${VPAAMobID}].CleanName} !
	    	/call Cast "Virulent Paralysis" alt 2s
	    	/if (${castReturn.Equal[CAST_SUCCESS]}) {
	    		/varset VPTimer${tempID} 850
	    	  /goto :RootDone
	    	}
	    } else /if (!${Me.AltAbilityReady[Virulent Paralysis]} && ${UseRoot} && ${VPTimer${tempID}}<30) {
	    	/if (${Announce}) /${MyChannel} Casting ${RootSpell} on ${Spawn[${VPAAMobID}].CleanName} !
	    	/call Cast "${RootSpell}" ${RootSpellGem} 2s
	    	/delay 5 !${Me.Casting.ID}
	    }
	    /if (${castReturn.Equal[CAST_SUCCESS]}) {
	    	/varcalc VPTimer${tempID} ${Spell[${RootSpell}].Duration.TotalSeconds}*9.75
	    } else /if (${castReturn.Equal[CAST_IMMUNE]} || ${spellNotHold}) {
	    	/varset VPTimer${tempID} 10000s
	    } else /if (${castReturn.Equal[CAST_RESISTED]}) {
	    	/varcalc RootResistCounter ${RootResistCounter}+1
  	    /if (${RootResistCounter}>=3) {
  		    /varset VPTimer${tempID} 10000s
  		    /goto :RootDone
  	    } else {
  		    /goto :RecastRoot
  	    }
      } else /if (${Select[${castReturn},CAST_OUTOFMANA,CAST_OUTOFRANGE,CAST_CANNOTSEE]}) {
        /varset VPTimer${tempID} 50
      } else {
        /varset VPTimer${tempID} 1
      }
      :RootDone
      /if (${Spawn[${VPAAMobID}].Distance}<${Spawn[${VPAAMobID}].MaxRange}+10) /call GotHitRun ${VPAAMobID}
	  }
	}
	/if (${Spawn[${OldTarget}].ID} && ${Target.ID}!=${Spawn[${OldTarget}].ID}) /squelch /target id ${OldTarget}		
/return

Sub Malo(int MaloID)
  /declare tempID int local ${MaloID}
  /declare MaloResistCounter int local 0
  /if (${ExcludeList.Find[${Spawn[${tempID}]}].CleanName}) {
  	/if (!${Defined[maloTimer${tempID}]}) {
  		/declare maloTimer${tempID} int outer -1
  	} else {
  		/varset maloTimer${tempID} 10000s
  	}
  	/return
  }
  :RecastMalo
  /if (${Target.ID} && ${Spawn[${tempID}].Distance}<=${Spell[${MaloSpell}].MyRange} && ${Target.LineOfSight}) {
  	/if (!${Defined[maloTimer${tempID}]}) /declare maloTimer${tempID} timer outer
    /if (${Announce}) /${MyChannel} ${MaloSpell} on ${Target.CleanName}
    /call Cast "${MaloSpell}" ${MaloSpellGem} 1s
    /delay 1
    /if (${castReturn.Equal[CAST_SUCCESS]}) {
      /varcalc maloTimer${tempID} ${Spell[${MaloSpell}].Duration.TotalSeconds}*9.75
    } else /if (${castReturn.Equal[CAST_IMMUNE]} || ${spellNotHold}) {
    	/varset maloTimer${tempID} 10000s
    } else /if (${castReturn.Equal[CAST_RESISTED]}) {
    	/varcalc MaloResistCounter ${MaloResistCounter}+1
    	/if (${MaloResistCounter}>=2) {
    		/varset maloTimer${tempID} 10000s
    		/return
    	} else {
    		/goto :RecastMalo
    	}
    }
  }
/return ${Macro.Return}

Sub Slow(int SlowID)
  /declare tempID int local ${SlowID}
  /declare SlowResistCounter int local 0
  /if (${ExcludeList.Find[${Spawn[${tempID}]}].CleanName}) {
  	/if (!${Defined[slowTimer${tempID}]}) {
  		/declare slowTimer${tempID} int outer -1
  	} else {
  		/varset slowTimer${tempID} 10000s
  	}
  	/return
  }
  	/if (!${AESlowed} && ${Spawn[${tempID}].NearestSpawn[2,npc radius 30].ID} && ${Spawn[${tempID}].Distance3D} < 30 && ${AddIndex} > 2 && ${Me.SpellReady[${AESlowSpell]}]}) {
    /if (${Announce}) /${MyChannel} Casting ${AESlowSpell} on ${Target.CleanName}
    /call Cast "${AESlowSpell}" ${AESlowGem}
    /varset AESlowed 1
  }
  :RecastSlow
  /if (${SlowResistCounter}>=2) /call Check_grpHPs
  /if (${Target.ID}==${tempID} && ${Target.LineOfSight} && ((${Spawn[${tempID}].Distance}<=${Spell[${SlowSpell}].MyRange}) || (${Select[${SlowSpellGem},item,alt]} && ${Spawn[${tempID}].Distance}<=200))) {
    /if (!${Defined[slowTimer${tempID}]}) /declare slowTimer${tempID} timer outer
    /if (${Announce}) /${MyChannel} ${SlowSpell} on ${Target.CleanName}
    /call Cast "${SlowSpell}" ${SlowSpellGem} 6s
    /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
    /if (${castReturn.Equal[CAST_IMMUNE]} || ${spellNotHold}) {
      /deletevar slowTimer${tempID}
      /declare slowTimer${tempID} int outer -1
    } else /if (${castReturn.Equal[CAST_SUCCESS]}) {
      /varset slowTimer${tempID} ${SlowDuration}
|      /varcalc slowTimer${tempID} ${Spell[${SlowSpell}].Duration.TotalSeconds}*9.75
    } else /if (${castReturn.Equal[CAST_RESISTED]}) {
    	/if (${UseSecondSlow} && ${SlowResistCounter}<5 && ${Target.LineOfSight}) {
    		/if (${Announce}) /${MyChannel} ${SlowSpell} resisted ${SecondSlowSpell} on ${Target.CleanName}
    		/call Cast "${SecondSlowSpell}" ${SecondSlowSpellGem} 6s
    		/if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
    		/if (${castReturn.Equal[CAST_SUCCESS]}) {
    			/varcalc slowTimer${tempID} ${Spell[${SecondSlowSpell}].Duration.TotalSeconds}*9.5
    			/return
    		}
    	}
    	/varcalc SlowResistCounter ${SlowResistCounter}+1
    	/if (${SlowResistCounter}>=4) {
    		/varset slowTimer${tempID} 10000s
    		/return
    	} else {
    		/goto :RecastSlow
    	}
    } else /if (${Select[${castReturn},CAST_OUTOFMANA,CAST_OUTOFRANGE,CAST_CANNOTSEE]}) {
      /varset slowTimer${tempID} 50
    }
  }
/return ${Macro.Return}

Sub Cripple(int CrippleID)
  /declare tempID int local ${Target.ID}
  /declare CrippleResistCounter int local 0
  /if (${ExcludeList.Find[${Spawn[${tempID}]}].CleanName}) {
  	/if (!${Defined[crippleTimer${tempID}]}) {
  		/declare crippleTimer${tempID} int outer -1
  	} else {
  		/varset crippleTimer${tempID} 10000s
  	}
  	/return
  }
  :RecastCripple
  /call Check_grpHPs
  /if (${Target.ID} && ${Spawn[${tempID}].Distance}<=${Spell[${CrippleSpell}].MyRange} && ${Target.LineOfSight}) {
    /if (!${Defined[crippleTimer${tempID}]}) /declare crippleTimer${tempID} timer outer
    /if (${Announce}) /${MyChannel} ${CrippleSpell} on ${Target.CleanName}
    /call Cast "${CrippleSpell}" ${CrippleSpellGem} 6s
    /if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
    /if (${castReturn.Equal[CAST_IMMUNE]} || ${spellNotHold}) {
      /deletevar crippleTimer${tempID}
      /declare crippleTimer${tempID} int outer -1
    } else /if (${castReturn.Equal[CAST_SUCCESS]}) {
      /varcalc crippleTimer${tempID} ${Spell[${CrippleSpell}].Duration.TotalSeconds}*9.75
    } else /if (${castReturn.Equal[CAST_RESISTED]}) {
    	/varcalc CrippleResistCounter ${CrippleResistCounter}+1
    	/if (${CrippleResistCounter}>=2) {
    		/varset crippleTimer${tempID} 10000s
    		/return
    	} else {
    		/goto :RecastCripple
    	}
    } else /if (${Select[${castReturn},CAST_OUTOFMANA,CAST_OUTOFRANGE,CAST_CANNOTSEE]}) {
      /varset crippleTimer${tempID} 50
    }
  }
/return ${Macro.Return}

Sub Nuke
  /if (${ExcludeList.Find[${Spawn[${Target.ID}]}].CleanName}) /return
  /if (${DoNuke} && !${NukeWaitTimer} && (${Me.PctMana}>=${NukeMana})) {
    /if (!${FightStartTime}) /varset FightStartTime ${MacroQuest.Running}
    /if (${Target.ID} && ${Target.Distance}<=${Spell[${NukeSpell}].MyRange}) {
      /if (${Announce}) /${MyChannel} Nuking  ${Target.CleanName}
      /call Cast "${NukeSpell}" ${NukeSpellGem} 4s
      /if (${Select[${castReturn},CAST_SUCCESS,CAST_RESISTED]}) {
        /varset NukeWaitTimer ${NukeDelay}
      } else /if (${castReturn.Equal[CAST_IMMUNE]} || ${spellNotHold}) {
      	/varset NukeWaitTimer 10000s
      }
    }
  }
/return

Sub Dot
  /if (${ExcludeList.Find[${Spawn[${Target.ID}]}].CleanName}) /return
  /declare DotResistCounter int local
  /declare i int local
  /if (${DotTotal}) {
    /for i 1 to ${DotTotal}
    	/if (${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}!=${LastSpawnCount}) /call CheckForAdds
      /if ((${Me.PctMana}>${DotMinMana} || ${Select[${DotGem${i}},item,alt]}) && !${Me.Moving} && !${Me.Casting.ID}) {
        /if ((${WhichDot}==${DotSpellSet${i}} || !${DotSpellSet${i}}) && !${DotTimer${i}}) {
          /varset DotResistCounter 0
          :RecastDot
          /call Check_grpHPs
          /doevents
          /target id ${MobID}
          /delay 3s ${Target.ID}==${MobID}
          /if (!${Me.Gem[${Dot${i}}]} && ${Select[${DotGem${i}},item,alt]}) /goto :RecastDot
          /if (${Target.Type.Equal[NPC]} && ${Target.ID}==${MobID} && ${Target.LineOfSight} && ${Target.Distance}<${Spell[${DotID[${i}]}].MyRange}) {
            /call Cast "${Dot${i}}" ${DotGem${i}} 10s Check_grpHPs
          } else {
            /return
          }
          /if (${castReturn.Equal[CAST_RESISTED]}) {
            /varcalc DotResistCounter ${DotResistCounter}+1
            /if (${DotResistCounter}>=${DotRecasts}) {
              /if (${Announce}) /${MyChannel} ${Target.CleanName} resisted ${Dot${i}} ${DotRecasts} times, giving up
              /varset DotTimer${i} 10000s
              /goto :NextDot
            } else {
              /goto :RecastDot
            }
          } else /if (${castReturn.Equal[CAST_INTERRUPTED]} || ${castReturn.Equal[CAST_CANCELLED]}) {
            /goto :RecastDot
          } else /if (${castReturn.Equal[CAST_SUCCESS]}) {
            /if (${Announce}) /${MyChannel} ${Target.CleanName} Dotted with ${Dot${i}}
            /varset DotTimer${i} ${Math.Calc[${Spell[${DotID[${i}]}].Duration.TotalSeconds}-6]}s
          } else /if (${castReturn.Equal[CAST_IMMUNE]} || ${spellNotHold}) {
            /varset DotTimer${i} 1000s
            /goto :NextDot
          }
        }
      }
    :NextDot
    /next i
  }
/return

Sub CheckForAdds
  /varset LastSpawnCount ${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}
  /declare CheckAddID int local
  /declare a int local
  /declare b int local
  /declare i int local
  /declare Compare int local
  /declare MobsInRange int local ${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]}
  /if (${Me.Feigning}) /stand
  /if (${Me.Casting.ID}) {
    /doevents rageon
    /doevents rageoff
    /if (${castEndTime}>5) {
      /doevents Chat
      /doevents EQBC
    }
  }
  /if ((!${Spawn[${MobID}].Type.Equal[NPC]} && !${Spawn[${MobID}].Master.Type.Equal[NPC]}) || ${ExcludeList.Find[${Spawn[${MobID}]}].CleanName}) {
    /varset NewAdds 0
    /return
  }
  /for b 1 to ${MobsInRange}
  	/if (${AddIndex}>=${MaxMobs}) /return
  	/varset CheckAddID 0
  	/varset CheckAddID ${NearestSpawn[${b},npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1].ID}
  	/if (!${Defined[slowTimer${CheckAddID}]}) /declare slowTimer${CheckAddID} timer outer 20
  	/if (${CheckAddID} && ${Spawn[${CheckAddID}].Type.NotEqual[corpse]} && (${Spawn[${CheckAddID}].ConColor.NotEqual[GREEN]} || ${DebuffGreens}) || (${Spawn[${CheckAddID}].ConColor.NotEqual[GREY]} || ${DebuffGreys})) {
  		/varset Compare 0
  		/for a 1 to ${MaxMobs}
  			/if (${CheckAddID}==${AddList[${a}]}) /varset Compare 1  		
  		/next a
  		/if (!${Compare}) /call AddToList ${CheckAddID} 3
      /if (${CheckAddID} && !${Compare}) {
        /if ((${slowTimer${CheckAddID}}<=${SlowDuration}-50 || !${slowTimer${CheckAddID}}) && ${Spawn[${CheckAddID}].Distance3D}<=${MinRadius} && ${Spawn[${CheckAddID}].LineOfSight} && ${slowTimer${CheckAddID}}!=-1 && ((!${Spawn[${CheckAddID}].Master.Type.Equal[PC]} && ${Spawn[${CheckAddID}].Type.Equal[pet]}) || (${Spawn[${CheckAddID}].Type.Equal[NPC]} && ${CheckAddID}!=${Spawn[${MobID}].Master.ID}))) {
          /if (${Macro.Return.Equal[1]}) {
            /if (!${Defined[WaitTimer${CheckAddID}]}) /declare WaitTimer${CheckAddID} timer outer
            /echo Add detected! >> ${Spawn[${CheckAddID}].DisplayName} << ${CheckAddID}
            /varset NewAdds 1
            /if (${DoDebuffs}) /call DebuffMobs ${CheckAddID}
          }
        }
      }
  	}
  /next b
/return

Sub AddToList(int AddAddID,int WhatList)
  /if (${ExcludeList.Find[${Spawn[${AddAddID}]}].CleanName}) /return
  /declare a int local
  /for a 1 to ${MaxMobs}
  	/if (!${AddList[${a}]}) {
  		/varcalc AddIndex ${AddIndex}+1  		
  		/if (${WhatList}!=2) /varset AddList[${a}] ${AddAddID}
  		/if (${WhatList}>=2) /varset MobList[${a}] ${AddAddID}
  		/if (${DoDebuffs} && ${AddAddID}==${MobID}) /call DebuffMobs ${MobID}
  		/return 1
  	}
  /next a
/return

Sub DeleteFromList(int DeleteAddID,int WhatList)
  /declare a int local
  /for a 1 to ${MaxMobs}
  	/if (${AddList[${a}]}==${DeleteAddID} && (${Spawn[${AddList[${a}]}].Type.Equal[Corpse]} || !${Spawn[${AddList[${a}]}].ID} || ${Spawn[${AddList[${a}]}].Distance}>${MinRadius}) && ${AddList[${a}]}) {
  		/if (${WhatList}!=2) /varset AddList[${a}] 0
  		/if (${WhatList}>=2) /varset MobList[${a}] 0
  		/if (!${WhatList} && !${DeleteAddID}) {
  			 /varset AddList[${a}] 0
  			 /varset MobList[${a}] 0
  		}
  		/if (${DeleteAddID}==${MobID}) /varset MobID 0
      /if (!${Spawn[${DeleteAddID}].Type.Equal[NPC]} && !${Spawn[${DeleteAddID}].Master.Type.Equal[NPC]}) {
        /if (${Defined[slowTimer${DeleteAddID}]}) /deletevar slowTimer${DeleteAddID}
        /if (${Defined[maloTimer${DeleteAddID}]}) /deletevar maloTimer${DeleteAddID}
        /if (${Defined[crippleTimer${DeleteAddID}]}) /deletevar crippleTimer${DeleteAddID}
        /if (${Defined[WaitTimer${DeleteAddID}]}) /deletevar WaitTimer${DeleteAddID}
        /if (${Defined[VPTimer${DeleteAddID}]}) /deletevar VPTimer${DeleteAddID}
      }
  		/if (${AddIndex}) /varcalc AddIndex ${AddIndex}-1
  	}
  /next a
	/if (!${SpawnCount[npc radius ${MinRadius} zradius ${NPCZRadius} noalert 1]} && !${AddIndex}) {
		/declare i int local
		/for i 1 to ${MaxMobs}
      /varset MobList[${i}] 0
      /varset AddList[${i}] 0
    /next i
  }
/return

Sub UpdateMobList
  /declare i int local
  /declare MobListID int local
  /if (${AddIndex}>0) {
    /for i 1 to ${AddIndex}
      /varset MobListID ${Spawn[${MobList[${i}]}].ID}
      /if ((!${Spawn[${MobListID}].Type.Equal[NPC]} && !${Spawn[${MobListID}].Master.Type.Equal[NPC]}) || ${Spawn[${MobListID}].Type.Equal[Corpse]}) {
        /if (${Defined[slowTimer${MobListID}]}) /deletevar slowTimer${MobListID}
        /if (${Defined[maloTimer${MobListID}]}) /deletevar maloTimer${MobListID}
        /if (${Defined[crippleTimer${MobListID}]}) /deletevar crippleTimer${MobListID}
        /if (${Defined[WaitTimer${MobListID}]}) /deletevar WaitTimer${MobListID}
        /if (${Defined[VPTimer${mobListID}]}) /deletevar VPTimer${MobListID}
        /call DeleteFromList ${MobListID} 3
      }
    /next i
  }
/return

Sub ClearMobList
  /declare i int local
  /declare MobListID int local
  /if (${MaxMobs}>0) {
    /for i 1 to ${MaxMobs}
      /varset MobListID ${Spawn[${MobList[${i}]}].ID}
      /if (${Defined[slowTimer${MobListID}]}) /deletevar slowTimer${MobListID}
      /if (${Defined[maloTimer${MobListID}]}) /deletevar maloTimer${MobListID}
      /if (${Defined[crippleTimer${MobListID}]}) /deletevar crippleTimer${MobListID}
      /if (${Defined[WaitTimer${mobListID}]}) /deletevar WaitTimer${MobListID}
      /if (${Defined[VPTimer${mobListID}]}) /deletevar VPTimer${MobListID}
      /call DeleteFromList ${MobListID} 3
    /next i
  }
/return

Sub Timer(string timerName,int timerValue)
  /if (!${Defined[${timerName}]}) /return
  /declare tempID int local
  /declare OldTargetID int local ${Target.ID}
  /if (${timerName.Left[9].Equal[maloTimer]} && ${timerValue}<100 && ${timerValue}!=-1) {
    /varset tempID ${timerName.Right[-9]}
    /if (${DoMalo} && (${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]})) {
      /target id ${tempID}
      /call Malo ${tempID}
    } else {
      /deletevar ${timerName}
    }
  } else /if (${timerName.Left[9].Equal[slowTimer]} && ${timerValue}<100 && ${timerValue}!=-1) {
    /varset tempID ${timerName.Right[-9]}
    /if (${DoSlow} && (${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]})) {
      /target id ${tempID}
      /call Slow ${tempID}
    } else {
      /deletevar ${timerName}
    }
  } else /if (${timerName.Left[12].Equal[crippleTimer]} && ${timerValue}<100 && ${timerValue}!=-1) {
    /varset tempID ${timerName.Right[-12]}
    /if (${DoCripple} && (${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]})) {
      /target id ${tempID}
      /call Cripple ${tempID}
    } else {
      /deletevar ${timerName}
    }
  } else /if (${timerName.Left[7].Equal[VPTimer]} && ${timerValue}<60) {
    /varset tempID ${timerName.Right[-7]}
    /if (${Spawn[${tempID}].PctHPs}>90 && (${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]}) && (${UseVPAA} || ${UseRoot})) {
      /target id ${tempID}
      /call VPAA ${tempID}
    } else {
    	/deletevar ${timerName}
    }
  } else /if (${timerName.Left[8].Equal[HotTimer]} && ${timerValue}<10) {
  	  /deletevar ${timerName}
  } else /if (${timerName.Left[10].Equal[SlothTimer]} && ${timerValue}<10) {
  	  /deletevar ${timerName}
  } else /if (${timerName.Left[8].Equal[PanTimer]} && ${timerValue}<10) {
  	  /deletevar ${timerName}
  } else /if (${timerName.Left[8].Equal[ATKTimer]} && ${timerValue}<4) {
  	  /deletevar ${timerName}
  } else {
    /return ${Macro.Return}
  }
  /if (${Target.ID}==${tempID}) {
    /if (${Spawn[${OldTargetID}].ID}) {
      /target id ${OldTargetID}
    } else {
      /squelch /target clear
    }
  }
/return ${Macro.Return}

Sub Cast_Avatar
  /if (${Select[${Spell[${ATKSpell}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]} && ${Spawn[pc ${Puller}].Distance}>${Spell[${ATKSpell}].MyRange}) /return
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /if (${Select[${Spell[${ATKSpell}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]}) {
  	/if (${Group.Member[${Tankname}].ID}) {
  		/squelch /target clear
  	} else {
  	  /squelch /target id ${Spawn[${TankName}].ID}
  	}
    /if (${UseExtEnhanceFocus}) {
      /varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      /call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      /varset OldItem ${Macro.Return}
    }
  	/if (!${SpamTimer}) /${MyChannel} Casting ${ATKSpell} on Group Stay in Range!!!
  	/call Cast "${ATKSpell}" ${ATKSpellGem} 1s
  	/if (${castReturn.Equal[CAST_SUCCESS]}) /varset GroupAvaTimer 9m
  	/if (${Spawn[${OldTarget}].ID}) {
      /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
    } else {
   	  /squelch /target clear
    }
    /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
  	/return
  }
  /declare i int local 0
  /declare tempID int local
  /for i 1 to ${Group.Members}
    /if (${Group.Member[${i}].ID} && ${Group.Member[${i}].Type.NotEqual[Corpse]}) {
    	/varset tempID ${Spawn[${Group.Member[${i}]}].ID}
      /if (!${ATKTimer${tempID}} && ${Select[${Group.Member[${i}].Class.ShortName},WAR,MNK,ROG,RNG,BST,SHD,PAL,BER,BRD]} && ${Me.CurrentMana}>${Spell[${ATKSpell}].Mana} && ${Group.Member[${i}].Distance}<=${Spell[${ATKSpell}].MyRange}) {
        /squelch /target id ${Spawn[${Group.Member[${i}]}].ID}
        /delay 2s ${Target.ID}==${Spawn[${Group.Member[${i}]}].ID}
        /if (${Target.ID}==${Spawn[${Group.Member[${i}]}].ID}) {
          /if (${UseExtEnhanceFocus}) {
            /varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
            /call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
            /varset OldItem ${Macro.Return}
          }
          /if (${DoBuffTells} && !${SpamTimer}) /${TellChannel} ${Group.Member[${i}]} ${ATKSpell} is incomming to you ${Group.Member[${i}]} , Stay in Range !!!
          /call Cast "${ATKSpell}" ${ATKSpellGem} 1s
          /if (!${Defined[ATKTimer${tempID}]}) /declare ATKTimer${tempID} timer outer
          /if (${castReturn.Equal[CAST_OUTOFRANGE]}) /varset ATKTimer${tempID} 200
          /if (${castReturn.Equal[CAST_SUCCESS]}) /varcalc ATKTimer${tempID} ${Spell[${ATKSpell}].Duration.TotalSeconds}*9.75
          /varset SpamTimer 100
          /if (${Spawn[${OldTarget}].ID}) {
            /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
          } else {
   	        /squelch /target clear
          }
          /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
          /return
        }
      }
    }
  /next i
/return

Sub Cast_Panther
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /if (${Spawn[${MobID}].PctHPs}>=${PantherSkip}) {
  	/if (${Select[${Spell[${PantherSpell}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]} && !${GroupPanTimer}) {
  		/if (${Group.Member[${Tankname}].ID}) {
  		  /squelch /target clear
  		} else {
  			/squelch /target id ${Spawn[${TankName}].ID}
  		}
      /if (${UseExtEnhanceFocus}) {
        /varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
        /call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
        /varset OldItem ${Macro.Return}
      }
  		/call Cast "${PantherSpell}" ${PantherSpellGem} 4s
  		/if (${castReturn.Equal[CAST_SUCCESS]}) /varset GroupPanTimer ${PantherDelay}
      /if (${Spawn[${OldTarget}].ID}) {
        /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
      } else {
   	    /squelch /target clear
      }
      /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
  		/return
  	}
    /declare i int local 1
    /declare tempID int local
    /for i 1 to ${Group.Members}
      /if (${Group.Member[${i}].ID} && ${Group.Member[${i}].Type.NotEqual[Corpse]}) {
      	/varset tempID ${Spawn[${Group.Member[${i}]}].ID}
        /if (!${PanTimer${tempID}} && ${Select[${Group.Member[${i}].Class.ShortName},WAR,MNK,ROG,RNG,BST,SHD,PAL,BER,BRD]} && ${Me.CurrentMana}>${Spell[${PantherSpell}].Mana} && ${Group.Member[${i}].Distance}<=${Spell[${PantherSpell}].MyRange}) {
          /squelch /target id ${Spawn[${Group.Member[${i}]}].ID}
          /delay 2s ${Target.ID}==${Spawn[${Group.Member[${i}]}].ID}
          /if (${Target.ID}==${Spawn[${Group.Member[${i}]}].ID}) {
          	/if (${UseExtEnhanceFocus}) {
      	      /varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      	      /call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      	      /varset OldItem ${Macro.Return}
            }
            /if (${DoBuffTells} && !${SpamTimer}) /${TellChannel} ${Group.Member[${i}]} ${PantherSpell} is incomming to you ${Group.Member[${i}]} , Stay in Range !!!
            /call Cast "${PantherSpell}" ${PantherSpellGem} 4s
            /if (!${Defined[PanTimer${tempID}]}) /declare PanTimer${tempID} timer outer
            /if (${castReturn.Equal[CAST_OUTOFRANGE]}) /varset PanTimer${tempID} 200
            /if (${castReturn.Equal[CAST_SUCCESS]} || ${spellNotHold}) /varcalc PanTimer${tempID} ${Spell[${PantherSpell}].Duration.TotalSeconds}*9.75
            /if (${Spawn[${OldTarget}].ID}) {
              /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
            } else {
   	          /squelch /target clear
   	        }
   	        /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
            /return
          }
        }
      }
    /next i
  }
/return

Sub Cast_Sloth
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
	/if (${SlothRaid}) {
		/declare a int local 1
		/for a 1 to ${Raid.Members}
			/if (${Select[${Raid.Member[${a}].Class.ShortName},WAR,SHD,PAL]} || ${Spawn[${Raid.Member[${a}]}].ID}==${Spawn[${Puller}].ID}) {
        /squelch /target id ${Spawn[${Raid.Member[${a}]}].ID}
        /delay 2s ${Target.ID}==${Spawn[${Raid.Member[${a}]}].ID}
        /if (${Me.CurrentMana}>${Spell[${SlothSpell}].Mana} && ${Raid.Member[${a}].Distance}<=${Spell[${SlothSpell}].MyRange}) {
          /if (!${SpamTimer}) /${TellChannel} ${Raid.Member[${a}]} ${SlothSpell} is incomming to you ${Raid.Member[${a}]} , Stay in Range !!!
          /call Cast "${SlothSpell}" ${SlothSpellGem} 3s
          /delay 2s
        }
      }
    /next a
    /varset SlothRaid FALSE
    /if (${Spawn[${OldTarget}].ID}) {
      /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
    } else {
 	    /squelch /target clear
    }
    /return
  }
  /if (${Spawn[${MobID}].PctHPs}>=${SlothSkip} || !${Target.ID}) {
  	/if (${Select[${Spell[${SlothSpell}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]} && !${GroupSloTimer}) {
  		/squelch /target clear
  		/call Cast "${SlothSpell}" ${SlothSpellGem} 4s
  		/if (${castReturn.Equal[CAST_SUCCESS]}) /varset GroupSloTimer ${SlothDelay}
      /if (${Spawn[${OldTarget}].ID}) {
        /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
      } else {
   	    /squelch /target clear
      }
  		/return
  	}
  	/if (${Spawn[${TankName}].ID} && !${GroupSloTimer} && !${SlothTimer} && ${Me.CurrentMana}>${Spell[${SlothSpell}].Mana} && ${Spawn[${TankName}].Distance}<=${Spell[${SlothSpell}].MyRange}) {
  		/squelch /target id ${Spawn[${TankName}].ID}
  		/delay 2s ${Target.ID}==${Spawn[${TankName}].ID}
  		/if (${Target.ID}==${Spawn[${TankName}].ID}) {
        /if (${UseExtEnhanceFocus}) {
          /varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
          /call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
          /varset OldItem ${Macro.Return}
        }
  			/if (${DoBuffTells} && !${SpamTimer}) /${TellChannel} ${TankName} ${SlothSpell} is incomming to you ${TankName} , Stay in Range !!!
  			/call Cast "${SlothSpell}" ${SlothSpellGem} 3s
  			/if (${castReturn.Equal[CAST_OUTOFRANGE]}) /varset SlothTimer 200
        /if (${castReturn.Equal[CAST_SUCCESS]}) /varset SlothTimer ${SlothDelay}
        /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
      }
    }
    /if (${SlothGroup} && !${GroupSloTimer}) {
      /declare i int local 1
      /declare tempID int local
      /for i 1 to ${Group.Members}
        /if (${Group.Member[${i}].ID} && ${Group.Member[${i}].ID}!=${Spawn[${TankName}].ID} && ${Group.Member[${i}].Type.NotEqual[Corpse]}) {
        	/varset tempID ${Spawn[${Group.Member[${i}]}].ID}
          /if (!${SlothTimer${tempID}} && ${Me.CurrentMana}>${Spell[${SlothSpell}].Mana} && ${Group.Member[${i}].Distance}<=${Spell[${SlothSpell}].MyRange} && (${Select[${Group.Member[${i}].Class.ShortName},WAR,SHD,PAL]} || ${Spawn[${Group.Member[${i}]}].ID}==${Spawn[${Puller}].ID})) {
            /squelch /target id ${Spawn[${Group.Member[${i}]}].ID}
            /delay 2s ${Target.ID}==${Spawn[${Group.Member[${i}]}].ID}
            /if (${Target.ID}==${Spawn[${Group.Member[${i}]}].ID}) {
              /if (${UseExtEnhanceFocus}) {
                /varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
                /call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
                /varset OldItem ${Macro.Return}
              }
              /if (${DoBuffTells} && !${SpamTimer}) /${TellChannel} ${Group.Member[${i}]} ${SlothSpell} is incomming to you ${Group.Member[${i}]} , Stay in Range !!!
              /call Cast "${SlothSpell}" ${SlothSpellGem} 3s
              /if (!${Defined[SlothTimer${tempID}]}) /declare SlothTimer${tempID} timer outer
              /if (${castReturn.Equal[CAST_OUTOFRANGE]}) /varset SlothTimer${tempID} 200
              /if (${castReturn.Equal[CAST_SUCCESS]} || ${spellNotHold}) /varset SlothTimer${tempID} ${SlothDelay}
              /if (${Spawn[${OldTarget}].ID}) {
                /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
              } else {
     	          /squelch /target clear
              }
              /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
              /return
            }
          }
        }
      /next i
    }
  }
/return

Sub CheckSelfBuffs
  /declare i int local
  /declare a int local
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /if (${UseMount} && !${Me.Mount.ID} && ${OutDoors} && !${Following} && !${Me.Invis}) /call Cast "${Mount}" item 5s
  /if (!${SummonPet} && ${Me.Pet.ID} && ${Me.AltAbility[Suspended Minion]} && ${Me.AltAbilityReady[Suspended Minion]}) /call Cast "Suspended Minion" alt
  /if (${Cursor.Name.Equal[Rod of Mystical Transvergance]}||${Cursor.Name.Equal[Wand of Elemental Transvergance]}||${Cursor.Name.Equal[Summoned: Modulating Rod]}) /autoinventory
  /if ((${Spawn[${TankID}].PctHPs}<90) || (${SelfBuffTimer}>0) || ${Following}) /return
  /if (!${QBTimer} && ${BegForBuffs}) {
    /call MeBegBuff
    /call MeBegItem
    /call PetBegBuff
    /varset QBTimer 300
  }
  /if (${DoCures} && ${CureTotal} && !${Me.Casting.ID}) /call CureMe
  /for i 1 to ${SelfBuffTotal}
    /if (${Me.State.NotEqual[FEIGN]} && ${Spell[${SelfBuffID[${i}]}].Stacks[25]} && ${Me.CountBuffs}<=${SelfBuffCount${i}} && (!${SitTimer} || ${Me.Gem[${SelfBuff${i}}]} || ${Me.Mount.ID} || ${SelfBuffGem${i}.Equal[item]} || (${SelfBuffGem${i}.Equal[alt]} && ${Me.AltAbilityReady[${SelfBuff${i}}]})) && (${Outdoors} || ${SelfBuffIndoors${i}})) {
      /if (${Me.CurrentMana}<${Spell[${SelfBuff${i}}].Mana} && !${Select[${SelfBuffGem${i}},alt,item]}) /return
      /if (${UseExtEnhanceFocus}) {
      	/varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      	/call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      	/varset OldItem ${Macro.Return}
      }
      /if (${Select[${Spell[${SelfBuffID[${i}]}].TargetType},pc,Single]}) {
        /squelch /target id ${Me.ID}
        /delay 3s ${Target.ID}==${Me.ID}
      }
      /call Cast "${SelfBuff${i}}" ${SelfBuffGem${i}} 5s Check_grpHPs
      /if (${Spawn[${OldTarget}].ID}) {
        /if (${Target.ID}==${Me.ID}) /target id ${OldTarget}
      } else {
   	    /squelch /target clear
      }
      /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
      /return
    }
  /next i
  /varset SelfBuffTimer ${SelfBuffRecheck}
  /if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
  /delay 1
  /doevents
/return

Sub CureMe
  /declare i int local
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /for i 1 to ${CureTotal}
	  /if (!${Following} && !${Me.Invis} && ${Debuff} && ((${Debuff.Cursed} && ${Debuff.Cursed}<=${CurseCounters${i}}) || (${Debuff.Diseased} && ${Debuff.Diseased}<=${DiseaseCounters${i}}) || (${Debuff.Poisoned} && ${Debuff.Poisoned}<=${PoisonCounters${i}}) || (${Debuff.Corrupted} && ${Debuff.Corrupted}<=${CorruptCounters${i}}))) {
      /if (((${Me.SpellReady[${CureSpell${i}}]} || (!${Me.Gem[${CureSpell${i}}]} && ${Me.Book[${CureSpell${i}}]})) || ${Me.AltAbilityReady[${CureSpell${i}}]} || ${CureGem${i}.Equal[item]})) {
		    /target id ${Me.ID}
		    /delay 3s ${Target.ID}==${Me.ID}
		    /if (${ReportCures}) /${MyChannel} Curing myself with ${CureSpell${i}}
		    /call Cast "${CureSpell${i}}" ${CureGem${i}} 3s
        /if (${Spawn[${OldTarget}].ID}) {
          /if (${Target.ID}==${Me.ID}) /target id ${OldTarget}
        } else {
   	      /squelch /target clear
   	      /return
        }
	    }
    }
  /next i
  /if ((${Me.Buff[Malo].ID} || ${Me.Buff[Mala].ID}) && ${Me.AltAbility[Radiant Cure]} && ${Me.AltAbilityReady[Radiant Cure]}) /call Cast "Radiant Cure" alt 1s
/return

Sub AddToQueue(int Buffee,int BuffNumber)
  /declare a           int local
  /declare Compare     int local
  /if (${QueueCount}<25 && ${Spawn[${Buffee}].Type.NotEqual[Corpse]} && ${Spawn[${Buffee}].ID}) {
    /varset Compare 0
    /for a 1 to 25
      /if ((${Buffee}==${DoBuffQueue[${a},1]} || (${Select[${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]} && ${Group.Member[${Spawn[${Buffee}].CleanName}]} && ${Group.Member[${Spawn[${DoBuffQueue[${a},1]}].CleanName}]})) && ${BuffNumber}==${DoBuffQueue[${a},2]}) /varset Compare 1
    /next a
    /if (!${Compare}) {
      /for a 1 to 25
        /if (!${DoBuffQueue[${a},1]}) {
          /varset DoBuffQueue[${a},1] ${Buffee}
          /varset DoBuffQueue[${a},2] ${BuffNumber}
          /varcalc QueueCount ${QueueCount}+1
          /return
        }
      /next a
    }
  }
  :DoneQueueing
/return

Sub RemoveFromQueue(int Buffee,int BuffNumber)
  /declare a int local
  /for a 1 to 25
    /if (((${Spawn[${DoBuffQueue[${a},1]}].State.Equal["DEAD"]} || !${Spawn[${DoBuffQueue[${a},1]}].ID}) || (${DoBuffQueue[${a},1]}==${Buffee} && ${DoBuffQueue[${a},2]}==${BuffNumber})) && ${DoBuffQueue[${a},1]}) {
      /varset DoBuffQueue[${a},1] 0
      /varset DoBuffQueue[${a},2] 0
      /varcalc QueueCount ${QueueCount}-1
      /return
    }
  /next a
/return

Sub DoBuffEvents
  /declare a int local
  /if (${Target.ID}) /declare OldTarget int local ${Target.ID}
  /for a 1 to 25
  	/if (!${PreviousSpell} || (${PreviousSpell}!=${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].ID})) /goto :SetCheck
  	/if (${PreviousSpell}==${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].ID}) {
  		/call RemoveFromQueue ${DoBuffQueue[${a},1]} ${DoBuffQueue[${a},2]}
  		/timed 100 /varset PreviousSpell 0
  		/goto :NextDoBuff
  	}
  	:SetCheck
    /if ((${Spawn[${DoBuffQueue[${a},1]}].Distance}>${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].MyRange} && ${Spawn[${DoBuffQueue[${a},1]}].Distance}>${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].AERange}) || !${Spawn[${DoBuffQueue[${a},1]}].ID} || ((!${Me.SpellReady[${DoBuff${DoBuffQueue[${a},2]}}]} && ${Me.Gem[${DoBuff${DoBuffQueue[${a},2]}}]}) && ${DoBuffGem${DoBuffQueue[${a},2]}.NotEqual[item]} && ${DoBuffGem${DoBuffQueue[${a},2]}.NotEqual[alt]})) /goto :NextDoBuff
    /squelch /target id ${DoBuffQueue[${a},1]}
    /delay 3s ${Target.ID}==${DoBuffQueue[${a},1]}
    /if (${Target.ID}==${DoBuffQueue[${a},1]}) {
      /if (${UseExtEnhanceFocus}) {
      	/varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      	/call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      	/varset OldItem ${Macro.Return}
      }
      /if (${DoBuffTells} && !${SpamTimer}) /${DoBuffChannel} ${DoBuffIcon${DoBuffQueue[${a},2]}} inc
      /if (${Target.ID} && ${Target.Distance}<=220) /call Cast "${DoBuff${DoBuffQueue[${a},2]}}" ${DoBuffGem${DoBuffQueue[${a},2]}} 10s Check_grpHPs
      /if (${Select[${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]}) /varset PreviousSpell ${Spell[${DoBuffID[${DoBuffQueue[${a},2]}]}].ID}
      /if (${castReturn.Equal[CAST_SUCCESS]} || ${spellNotHold}) /call RemoveFromQueue ${DoBuffQueue[${a},1]} ${DoBuffQueue[${a},2]}
      /if (${Spawn[${OldTarget}].ID}) {
        /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
      } else {
   	    /squelch /target clear
      }
      /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
      /return
    }
    :NextDoBuff
  /next a
  /if (${Spawn[${OldTarget}].ID}) {
    /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
  } else {
   	/squelch /target clear
  }
/return

Sub AddToRaidQueue(int Buffee,int BuffNumber)
  /declare a int local
  /declare Compare int local
  /if (${RaidQueueCount}<72&&${Spawn[${Buffee}].Type.NotEqual[Corpse]}&&${Spawn[${Buffee}].ID}) {
    /varset Compare 0
    /for a 1 to 72
      /if ((${Buffee}==${RaidBuffQueue[${a},1]}||(${Select[${Spell[${RaidBuffID[${RaidBuffQueue[${a},2]}]}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]}&&${Group.Member[${Spawn[${Buffee}].CleanName}]}&&${Group.Member[${Spawn[${RaidBuffQueue[${a},1]}].CleanName}]}))&&${BuffNumber}==${RaidBuffQueue[${a},2]}) /varset Compare 1
    /next a
    /if (!${Compare}) {
      /for a 1 to 72
        /if (!${RaidBuffQueue[${a},1]}) {
          /varset RaidBuffQueue[${a},1] ${Buffee}
          /varset RaidBuffQueue[${a},2] ${BuffNumber}
          /varcalc RaidQueueCount ${RaidQueueCount}+1
          /return
        }
      /next a
    }
  }
/return

Sub RemoveFromRaidQueue(int Buffee,int BuffNumber)
  /declare a int local
  /for a 1 to 72
    /if (((${Spawn[${RaidBuffQueue[${a},1]}].State.Equal["DEAD"]}||!${Spawn[${RaidBuffQueue[${a},1]}].ID})||(${RaidBuffQueue[${a},1]}==${Buffee}&&${RaidBuffQueue[${a},2]}==${BuffNumber}))&&${RaidBuffQueue[${a},1]}) {
      /varset RaidBuffQueue[${a},1] 0
      /varset RaidBuffQueue[${a},2] 0
      /varcalc RaidQueueCount ${RaidQueueCount}-1
      /return
    }
  /next a
/return

Sub RaidBuffEvents
  /declare a int local
  /for a 1 to 72
    /if ((${Spawn[${RaidBuffQueue[${a},1]}].Distance}>${Spell[${RaidBuffID[${RaidBuffQueue[${a},2]}]}].MyRange}&&${Spawn[${RaidBuffQueue[${a},1]}].Distance}>${Spell[${RaidBuffID[${RaidBuffQueue[${a},2]}]}].AERange})||!${Spawn[${RaidBuffQueue[${a},1]}].ID}||((!${Me.SpellReady[${RaidBuff${RaidBuffQueue[${a},2]}}]}&&${Me.Gem[${RaidBuff${RaidBuffQueue[${a},2]}}]})&&${RaidBuffGem${RaidBuffQueue[${a},2]}.NotEqual[item]}&&${RaidBuffGem${RaidBuffQueue[${a},2]}.NotEqual[alt]})) /goto :NextRaidBuff
    /squelch /target id ${RaidBuffQueue[${a},1]}
    /delay 2s ${Target.ID}==${RaidBuffQueue[${a},1]}
    /if (${Target.ID}==${RaidBuffQueue[${a},1]}&&${Target.Distance}<=${Spell[${RaidBuffID[${RaidBuffQueue[${a},2]}]}].MyRange}) {
      /if (${UseExtEnhanceFocus}) {
      	/varset FocusSlotName ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      	/call EquipItem "${ExtEnhanceItem}" ${FindItem[${ExtEnhanceItem}].WornSlot[1].Name}
      	/varset OldItem ${Macro.Return}
      }
      /if (${DoBuffTells}&&!${SpamTimer}&&${Target.ID}!=${Me.ID}) /tt ${RaidBuffIcon${RaidBuffQueue[${a},2]}} inc
      /call Cast "${RaidBuff${RaidBuffQueue[${a},2]}}" ${RaidBuffGem${RaidBuffQueue[${a},2]}} 3s Check_grpHPs
      /if (${castReturn.Equal[CAST_SUCCESS]} || ${spellNotHold}) /call RemoveFromRaidQueue ${RaidBuffQueue[${a},1]} ${RaidBuffQueue[${a},2]}
    }
  :NextRaidBuff
  /delay 1
  /next a
  /if (${UseExtEnhanceFocus}) /call EquipItem ${OldItem}
/return

Sub GotHitRun(int AggroMob)
  /declare i int local
  /for i 1 to 3
	  /if (${Spawn[pc ${TankID}]}) {
		  /squelch /face fast nolook id ${NearestSpawn[pc ${TankID}]}
		  /keypress forward hold
		  /delay 1s ${Spawn[${AggroMob}].Distance}>${Spawn[${AggroMob}].MaxRange}+10
		  /keypress back
		  /return
	  }
  /next i
/return

Sub Aura(string line,string MobName)
  /if (${Target.ID}) /declare ${OldTarget} int local ${Target.ID}
  /if (${UseAura} && ${Me.Aura.ID}==NULL) {
    /if ((!${SitTimer} || ${Me.Gem[${AuraBuff}]} || ${Me.Mount.ID}) && ${Me.State.NotEqual[FEIGN]})  {
     	/squelch /target id ${Spawn[NPC ${MobName}].ID}
     	/delay 5s ${Target.ID}==${Spawn[NPC ${MobName}].ID}
      /if (${Target.ID}==${Spawn[NPC ${MobName}].ID} && ${Target.LineOfSight} && ${Me.CurrentMana}>${Spell[${AuraBuff}].Mana}) {
        /call Cast "${AuraBuff}" ${AuraBuffGem} 10s Check_grpHPs
      }
    }
    /if (${Spawn[${OldTarget}].ID}) {
      /if (${Target.ID}!=${Spawn[${OldTarget}].ID}) /target id ${OldTarget}
    } else {
   	  /squelch /target clear
   	}
  }
/return

Sub RefreshAlerts
  /declare i int local
  /declare NPCAlertList int local ${Math.Calc[${ExcludeList.Count[|]}-1].Int}
  /squelch /alert clear 1
  /if (${NPCAlertList}>0) {
  	/for i 1 to ${NPCAlertList}
  		/squelch /alert add 1 ${ExcludeList.Arg[${i},|]}
  	/next i
  }
/return

Sub LoadVar(IniSection,IniVar,IniValue,MacroVar,IniFile,Function,VarType)
  /declare IniString string local
  /if (!${Defined[${MacroVar}]} && ${Defined[VarType]}) /declare ${MacroVar} ${VarType} outer
  /if (${Function.Equal[LOAD]}) {
    /varset IniString ${Ini[${IniFile},${IniSection},${IniVar},NOTFOUND]}
    /varset ${MacroVar} ${IniString}
  }
  /if (${IniString.Equal["NOTFOUND"]} || ${Function.Equal[SAVE]}) {
    /if (${IniString.Equal["NOTFOUND"]} && ${Function.Equal[LOAD]}) /varset ${MacroVar} ${IniValue}
    /ini ${IniFile} ${IniSection} ${IniVar} "${${MacroVar}}"
  }
/return

Sub LoadAliases
  /ini ${Me.Name}_Shaman.ini Misc LoadDate ${MacroQuest.BuildDate}
  /ini ${Me.Name}_Shaman.ini Misc Version ${Version}
  /squelch /alias /loadini          /echo LoadIni
  /squelch /alias /saveini          /echo SaveIni
  /squelch /alias /setanchor        /echo SetAnchor
  /squelch /alias /autoloot         /echo ToggleVar Auto Looting,useAutoLoot,Settings,useAutoLoot,
  /squelch /alias /usemount         /echo Toggling UseMount
  /squelch /alias /dobuffs          /echo ToggleVar Auto Buffing,DoBuffs,DoBuffStuff,DoBuffs,
  /squelch /alias /dobufftells      /echo ToggleVar Buffing Tells,DoBuffTells,DoBuffStuff,DoBuffTells,
  /squelch /alias /docures          /echo ToggleVar Auto Curing,DoCures,CureStuff,DoCures,
  /squelch /alias /doraidbuffs      /echo ToggleVar Setting Raid Buffing,DoRaidBuffs,RaidBuffs,DoRaidBuffs,
  /squelch /alias /refreshbuffs     /echo ToggleVar Auto Buff Refreshing,RefreshBuffs,DoBuffStuff,RefreshBuffs,
  /squelch /alias /selfbuff         /echo ToggleVar Auto Self Buffing,SelfBuffs,SelfBuffStuff,SelfBuffs,
  /squelch /alias /buffbeg          /echo ToggleVar Buff Begging,BegForBuffs,Settings,BegForBuffs,
  /squelch /alias /avatar           /echo ToggleVar Using Avatar,DoAvatar,Settings,DoAvatar,
  /squelch /alias /canniaa          /echo ToggleVar Using Canni AA,DoCanniAA,Settings,DoCanniAA,
  /squelch /alias /doheal           /echo ToggleVar Using Group Heals,DoHeal,Settings,DoHeal,
  /squelch /alias /petheal          /echo ToggleVar Using Pet Heals,DoPetHeal,Settings,DoPetHeal,
  /squelch /alias /donukes          /echo ToggleVar Using Nukes,DoNuke,Settings,DoNuke,
  /squelch /alias /panther          /echo ToggleVar Using Panther on Pets,DoPetPanther,Settings,DoPetPanther,
  /squelch /alias /grouppanther     /echo ToggleVar Using Group Panther,DoGroupPanther,Settings,DoGroupPanther,
  /squelch /alias /summonpet        /echo ToggleVar Summoning Pet,SummonPet,Settings,SummonPet,
  /squelch /alias /petbuffs         /echo ToggleVar Buffing My Pet,DoPetBuffs,PetStuff,DoPetBuffs,
  /squelch /alias /dodebuffs        /echo ToggleVar Using Debuffs,DoDebuffs,Settings,DoDebuffs,
  /squelch /alias /domalo           /echo ToggleVar Using Malo,DoMalo,Settings,DoMalo,
  /squelch /alias /dosloth          /echo ToggleVar Using Sloth,DoSloth,Settings,DoSloth,
  /squelch /alias /petsloth         /echo ToggleVar Using Pet Sloth,DoPetSloth,Settings,DoPetSloth,
  /squelch /alias /doslow           /echo ToggleVar Using Slow,DoSlow,Settings,DoSlow,
  /squelch /alias /secondslow       /echo ToggleVar Using Second Slow,UseSecondSlow,Settings,UseSecondSlow,
  /squelch /alias /docripple        /echo ToggleVar Using Cripple,DoCripple,Settings,DoCripple,
  /squelch /alias /dodots           /echo ToggleVar Using Dots,DoDots,DotStuff,DoDots,
  /squelch /alias /slothgroup       /echo ToggleVar Slothing Group,SlothGroup,Settings,SlothGroup,
  /squelch /alias /slothraid        /echo ToggleVar Slothing Raid,SlothRaid,Settings,SlothRaid,
  /squelch /alias /useaura          /echo ToggleVar Using Aura,UseAura,AuraStuff,UseAura,
  /squelch /alias /useepic          /echo ToggleVar Using Epic,UseEpic,Settings,UseEpic,
  /squelch /alias /useconsider      /echo ToggleVar Using Consider,UseConsider,Settings,UseConsider,
  /squelch /alias /usegrouphot      /echo ToggleVar Using Group Hot,UseGroupHot,Settings,UseGroupHot,
  /squelch /alias /useroot          /echo ToggleVar Using Root,UseRoot,Settings,UseRoot,
  /squelch /alias /usevpaa          /echo ToggleVar Using Virulent Paralysis AA,UseVPAA,Settings,UseVPAA,
  /squelch /alias /useward          /echo ToggleVar Using Ward,UseWard,Settings,UseWard,
  /squelch /alias /whichdot         /echo ToggleString Setting Dot Spell Set,WhichDot,DotStuff,WhichDot,
  /squelch /alias /dotat            /echo ToggleString Setting Dot At,DotAt,DotStuff,DotAt,
  /squelch /alias /mychannel        /echo ToggleString Setting My Channel,MyChannel,Settings,MyChannel,
  /squelch /alias /myspellset       /echo ToggleString Setting My Spell Set,MySpellSet,Settings,MySpellSet,
  /squelch /alias /engagedelay      /echo ToggleString Setting Engage Delay,EngageDelay,Settings,EngageDelay,
  /squelch /alias /minradius        /echo ToggleString Setting Minimum Radius,MinRadius,Settings,MinRadius,
  /squelch /alias /nukeat           /echo ToggleString Setting Nuke At,NukeAt,Settings,NukeAt,
  /squelch /alias /nukedelay        /echo ToggleString Setting Nuke Delay,NukeDelay,Settings,NukeDelay,
  /squelch /alias /sitat            /echo ToggleString Setting Sit At,SitAt,Settings,SitAt,
  /squelch /alias /selfhealpoint    /echo ToggleString Setting Self Heal Point,SelfHealPoint,HealStuff,SelfHealPoint,
  /squelch /alias /casterhealpoint  /echo ToggleString Setting Caster Heal Point,CasterHealPoint,HealStuff,CasterHealPoint,
  /squelch /alias /meleehealpoint   /echo ToggleString Setting Melee Heal Point,MeleeHealPoint,HealStuff,MeleeHealPoint,
  /squelch /alias /tankhealpoint    /echo ToggleString Setting Tank Heal Point,TankHealPoint,HealStuff,TankHealPoint,
  /squelch /alias /pethealpoint     /echo ToggleString Setting Pet Heal Point,PetHealPoint,HealStuff,PetHealPoint,
  /squelch /alias /newpuller        /echo ToggleString Setting Puller,Puller,Settings,Puller,
  /squelch /alias /cancelpct        /echo ToggleString Setting Cancel Pct,CancelPct,HealStuff,CancelPct,
/return

Sub LoadIni(IniFile,Function)
  /declare i int local  
  /if (!${Defined[LastSpawnCount]})  /declare LastSpawnCount      int  outer
  /if (!${Defined[MaxMobs]})         /declare MaxMobs             int  outer 15
  /if (!${Defined[AddList]})         /declare AddList[${MaxMobs}] int  outer
  /if (!${Defined[MobList]})         /declare MobList[${MaxMobs}] int  outer  
  /if (!${Defined[ExcludeList]})     /declare ExcludeList       string outer
  /if (!${Defined[TankName]})        /declare TankName          string outer
  /if (!${Defined[FollowGuy]})       /declare FollowGuy         string outer NULL
  /if (!${Defined[TankID]})          /declare TankID               int outer
  /if (!${Defined[currentZone]})     /declare currentZone          int outer
  /if (!${Defined[MinorHurt]})       /declare MinorHurt            int outer 0
  /if (!${Defined[MajorHurt]})       /declare MajorHurt            int outer 0
  /if (!${Defined[noInvis]})         /declare noInvis              int outer 1
  /if (!${Defined[Following]})       /declare Following            int outer 0
  /if (!${Defined[UseAnchor]})       /declare UseAnchor            int outer
  /if (!${Defined[AnchorX]})         /declare AnchorX            float outer
  /if (!${Defined[AnchorY]})         /declare AnchorY            float outer
  /if (!${Defined[AnchorHeading]})   /declare AnchorHeading      float outer
  /if (!${Defined[gmember]})         /declare gmember              int outer
  /if (!${Defined[LeashLength]})     /declare LeashLength          int outer
  /if (!${Defined[EpicTimer]})       /declare EpicTimer          timer outer
  /if (!${Defined[GroupHotTimer]})   /declare GroupHotTimer      timer outer 0
  /if (!${Defined[NoHotTimer]})      /declare NoHotTimer         timer outer 0
  /if (!${Defined[DeathFlag]})       /declare DeathFlag           bool outer ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]}
  /if (!${Defined[JustZoned]})       /declare JustZoned           bool outer FALSE
  /if (!${Defined[OutDoors]})        /declare OutDoors            bool outer TRUE
  /if (!${Defined[RaidMode]})        /declare RaidMode            bool outer FALSE
  /if (!${Defined[SlothRaid]})       /declare SlothRaid           bool outer FALSE
  /if (!${Defined[PantherDelay]})    /declare PantherDelay         int outer 334
  /if (!${Defined[SlothDelay]})      /declare SlothDelay           int outer 3600
  /if (!${Defined[SlothTimer]})      /declare SlothTimer         timer outer 0
  /if (!${Defined[PetPanTimer]})     /declare PetPanTimer        timer outer 0
  /if (!${Defined[PetSloTimer]})     /declare PetSloTimer        timer outer 0
  /if (!${Defined[GroupAvaTimer]})   /declare GroupAvaTimer      timer outer 0
  /if (!${Defined[GroupPanTimer]})   /declare GroupPanTimer      timer outer 0
  /if (!${Defined[GroupSloTimer]})   /declare GroupSloTimer      timer outer 0
  /if (!${Defined[ModRodTimer]})     /declare ModRodTimer        timer outer
  /if (!${Defined[SitTimer]})        /declare SitTimer           timer outer
  /if (!${Defined[QBTimer]})         /declare QBTimer            timer outer 0
  /if (!${Defined[FightStartTime]})  /declare FightStartTime     float outer
  /if (!${Defined[FightTotalTime]})  /declare FightTotalTime     float outer
  /if (!${Defined[MobID]})           /declare MobID                int outer 0
  /if (!${Defined[PetAttacking]})    /declare PetAttacking        bool outer FALSE
  /if (!${Defined[AddIndex]})        /declare AddIndex             int outer
  /if (!${Defined[NewAdds]})         /declare NewAdds              int outer 0
  /if (!${Defined[AssistWaitTimer]}) /declare AssistWaitTimer    timer outer 0
  /if (!${Defined[AggroAnim]})       /declare AggroAnim         string outer |5|8|12|17|18|42|44|80|106|129|144|
  /if (!${Defined[PetCheck]})        /declare PetCheck            bool outer FALSE
  /if (!${Defined[PetID]})           /declare PetID                int outer 0
  /if (!${Defined[PetOff]})          /declare PetOff               int outer 0
  /if (!${Defined[NukeWaitTimer]})   /declare NukeWaitTimer      timer outer 0
  /if (!${Defined[NukeWaitMod]})     /declare NukeWaitMod          int outer 0
  /if (!${Defined[PreviousSpell]})   /declare PreviousSpell        int outer 0
  /if (!${Defined[castSub]})         /declare castSub           string outer
  /if (!${Defined[ValidTarget]})     /declare ValidTarget          int outer
  /if (!${Defined[Engaged]})         /declare Engaged              int outer
  /if (!${Defined[MinHP]})           /declare MinHP                int outer 85
  /if (!${Defined[MobHPStart]})      /declare MobHPStart           int outer
  /if (!${Defined[WorstHPs]})        /declare WorstHPs             int outer 100
  /if (!${Defined[WorstID]})         /declare WorstID              int outer
  /if (!${Defined[WorstMember]})     /declare WorstMember          int outer
  /if (!${Defined[DAArray]})         /declare DAArray[6,2]         int outer
  /if (!${Defined[StartHPs]})        /declare StartHPs             int outer
  /if (!${Defined[AESlowed]})        /declare AESlowed             int outer
  /if (!${Defined[OldItem]})         /declare OldItem           string outer
  /if (!${Defined[FocusSlotName]})   /declare FocusSlotName     string outer
  /call LoadVar Settings MyChannel "Put your chat channel here" MyChannel "${IniFile}" ${Function} string
  /call LoadVar Settings TellChannel "Put your tell channel here" TellChannel "${IniFile}" ${Function} string
  /call LoadVar Settings MySpellSet "Put your spell set here" MySpellSet "${IniFile}" ${Function} string
  /call LoadVar Settings Announce 1 Announce "${IniFile}" ${Function} int
  /call LoadVar Settings AutoAnchor FALSE AutoAnchor "${IniFile}" ${Function} bool
  /call LoadVar Settings EngageDelay 30 EngageDelay "${IniFile}" ${Function} int
  /call LoadVar Settings NukeAt 90 NukeAt "${IniFile}" ${Function} int
  /call LoadVar Settings NukeMana 40 NukeMana "${IniFile}" ${Function} int
  /call LoadVar Settings NukeDelay 180 NukeDelay "${IniFile}" ${Function} int
  /call LoadVar Settings PantherSkip 35 PantherSkip "${IniFile}" ${Function} int
  /call LoadVar Settings SlothSkip 35 SlothSkip "${IniFile}" ${Function} int
  /call LoadVar Settings SitAt 80 SitAt "${IniFile}" ${Function} int
  /call LoadVar Settings DoDebuffs TRUE DoDebuffs "${IniFile}" ${Function} bool
  /call LoadVar Settings DoMalo TRUE DoMalo "${IniFile}" ${Function} bool
  /call LoadVar Settings DoSlow TRUE DoSlow "${IniFile}" ${Function} bool
  /call LoadVar Settings SlowDuration 3500 SlowDuration "${IniFile}" ${Function} int
  /call LoadVar Settings DoCripple FALSE DoCripple "${IniFile}" ${Function} bool
  /call LoadVar Settings SummonPet TRUE SummonPet "${IniFile}" ${Function} bool
  /call LoadVar Settings DoPetPanther FALSE DoPetPanther "${IniFile}" ${Function} bool
  /call LoadVar Settings DoGroupPanther FALSE DoGroupPanther "${IniFile}" ${Function} bool
  /call LoadVar Settings DoPetSloth FALSE DoPetSloth "${IniFile}" ${Function} bool
  /call LoadVar Settings DoSloth FALSE DoSloth "${IniFile}" ${Function} bool
  /call LoadVar Settings SlothGroup FALSE SlothGroup "${IniFile}" ${Function} bool
  /call LoadVar Settings DoNuke TRUE DoNuke "${IniFile}" ${Function} bool
  /call LoadVar Settings DoHeal TRUE DoHeal "${IniFile}" ${Function} bool
  /call LoadVar Settings DoPetHeal TRUE DoPetHeal "${IniFile}" ${Function} bool
  /call LoadVar Settings DoCanniAA TRUE DoCanniAA "${IniFile}" ${Function} bool
  /call LoadVar Settings DoSelfShrink TRUE DoSelfShrink "${IniFile}" ${Function} bool
  /call LoadVar Settings DoAvatar TRUE DoAvatar "${IniFile}" ${Function} bool
  /call LoadVar Settings BegForBuffs TRUE BegForBuffs "${IniFile}" ${Function} bool
  /call LoadVar Settings useAutoLoot FALSE useAutoLoot "${IniFile}" ${Function} bool
  /call LoadVar Settings UseConsider FALSE UseConsider "${IniFile}" ${Function} bool
  /call LoadVar Settings UseEpic FALSE UseEpic "${IniFile}" ${Function} bool
  /call LoadVar Settings UseGroupHot FALSE UseGroupHot "${IniFile}" ${Function} bool
  /call LoadVar Settings UseMount FALSE UseMount "${IniFile}" ${Function} bool
  /call LoadVar Settings UseRoot FALSE UseRoot "${IniFile}" ${Function} bool
  /call LoadVar Settings UseSecondSlow FALSE UseSecondSlow "${IniFile}" ${Function} bool
  /call LoadVar Settings UseVPAA FALSE UseVPAA "${IniFile}" ${Function} bool
  /call LoadVar Settings UseWard FALSE UseWard "${IniFile}" ${Function} bool
  /call LoadVar Settings DebuffGreens FALSE DebuffGreens "${IniFile}" ${Function} bool
  /call LoadVar Settings DebuffGreys FALSE DebuffGreys "${IniFile}" ${Function} bool
  /call LoadVar Settings MinRadius 120 MinRadius "${IniFile}" ${Function} int
  /call LoadVar Settings NPCZRadius 100 NPCZRadius "${IniFile}" ${Function} int
  /call LoadVar Settings Mount "Put the name of your mount summoning item here" Mount "${IniFile}" ${Function} string
  /call LoadVar Settings Puller "Put the name of your puller here" Puller "${IniFile}" ${Function} string
  /call LoadVar Settings ZoneDelay 10 ZoneDelay "${IniFile}" ${Function} int
  /call LoadVar Spells AESlowSpell "Tortugone's Drowse" AESlowSpell "${IniFile}" ${Function} string
  /call LoadVar Spells AESlowGem "Gem1" AESlowGem "${IniFile}" ${Function} string
  /call LoadVar Spells SlowSpell "Turgur's Insects" SlowSpell "${IniFile}" ${Function} string
  /call LoadVar Spells SlowSpellGem "Gem6" SlowSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells SecondSlowSpell "Balance of Discord" SecondSlowSpell "${IniFile}" ${Function} string
  /call LoadVar Spells SecondSlowSpellGem "Gem5" SecondSlowSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells MaloSpell "Malos" MaloSpell "${IniFile}" ${Function} string
  /call LoadVar Spells MaloSpellGem "Gem3" MaloSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells CrippleSpell "Crippling Spasm" CrippleSpell "${IniFile}" ${Function} string
  /call LoadVar Spells CrippleSpellGem "Gem5" CrippleSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells PetSpell "Farrel's Companion" PetSpell "${IniFile}" ${Function} string
  /call LoadVar Spells PetSpellGem "Gem5" PetSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells CanniSpell "Pained Memory" CanniSpell "${IniFile}" ${Function} string
  /call LoadVar Spells CanniSpellGem "Gem2" CanniSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells ShrinkSpell "Shrink" ShrinkSpell "${IniFile}" ${Function} string
  /call LoadVar Spells ShrinkSpellGem "Gem1" ShrinkSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells GroupHot "Specter of Renewel" GroupHot "${IniFile}" ${Function} string
  /call LoadVar Spells GroupHotGem "Gem1" GroupHotGem "${IniFile}" ${Function} string
  /call LoadVar Spells HotSpell "Quiescence" HotSpell "${IniFile}" ${Function} string
  /call LoadVar Spells HotSpellGem "Gem8" HotSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells HealSpell "Yoppa's Mending" HealSpell "${IniFile}" ${Function} string
  /call LoadVar Spells HealSpellGem "Gem7" HealSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells NukeSpell "Yoppa's Spear of Venom" NukeSpell "${IniFile}" ${Function} string
  /call LoadVar Spells NukeSpellGem "Gem9" NukeSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells PantherSpell "Spirit of the Leopard" PantherSpell "${IniFile}" ${Function} string
  /call LoadVar Spells PantherSpellGem "Gem5" PantherSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells ATKSpell "Ferine Avatar" ATKSpell "${IniFile}" ${Function} string
  /call LoadVar Spells ATKSpellGem "Gem4" ATKSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells SlothSpell "Lingering Sloth" SlothSpell "${IniFile}" ${Function} string
  /call LoadVar Spells SlothSpellGem "Gem5" SlothSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells DrinkSpell "Summon Drink" DrinkSpell "${IniFile}" ${Function} string
  /call LoadVar Spells DrinkSpellGem "Gem1" DrinkSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells FoodSpell "Summon Food" FoodSpell "${IniFile}" ${Function} string
  /call LoadVar Spells FoodSpellGem "Gem1" FoodSpellGem "${IniFile}" ${Function} string
  /call LoadVar Spells RootSpell "Petrifying Earth" RootSpell "${IniFile}" ${Function} string
  /call LoadVar Spells RootSpellGem "Gem1" RootSpellGem "${IniFile}" ${Function} string
  /call LoadVar Items UseExtEnhanceFocus FALSE UseExtEnhanceFocus "${IniFile}" ${Function} bool
  /call LoadVar Items ExtEnhanceItem "Put the name of your extended enhancement item here" ExtEnhanceItem "${IniFile}" ${Function} string
  /call LoadVar HealStuff SelfHealPoint 60 SelfHealPoint "${IniFile}" ${Function} int
  /call LoadVar HealStuff CasterHealPoint 70 CasterHeal "${IniFile}" ${Function} int
  /call LoadVar HealStuff MeleeHealPoint 65 MeleeHeal "${IniFile}" ${Function} int
  /call LoadVar HealStuff TankHealPoint 60 MTHP "${IniFile}" ${Function} int
  /call LoadVar HealStuff PetHealPoint 60 PetHeal "${IniFile}" ${Function} int
  /call LoadVar HealStuff UnionHP 35 UnionHP "${IniFile}" ${Function} int
  /call LoadVar HealStuff CancelPct 90 CancelPct "${IniFile}" ${Function} int
  /call LoadVar SelfBuffStuff SelfBuffTotal 1 SelfBuffTotal "${IniFile}" ${Function} int
  /if (${SelfBuffTotal}) {
    /if (!${Defined[SelfBuffID]}) /declare SelfBuffID[${SelfBuffTotal}] int outer
    /if (!${Defined[SelfBuffTimer]}) /declare SelfBuffTimer timer outer
    /call LoadVar SelfBuffStuff SelfBuffs TRUE SelfBuffs "${IniFile}" ${Function} bool
    /call LoadVar SelfBuffStuff SelfBuffRecheck 10s SelfBuffRecheck "${IniFile}" ${Function} string
    /for i 1 to ${SelfBuffTotal}
      /call LoadVar SelfBuffStuff SelfBuff${i} "Self Buff Item/Spell #${i}" SelfBuff${i} "${IniFile}" ${Function} string
      /call LoadVar SelfBuffStuff SelfBuffIcon${i} "Self Buff #${i} Buff Icon" SelfBuffIcon${i} "${IniFile}" ${Function} string
      /call LoadVar SelfBuffStuff SelfBuffGem${i} "Self Buff #${i} Gem or put item if an item" SelfBuffGem${i} "${IniFile}" ${Function} string
      /call LoadVar SelfBuffStuff SelfBuffCount${i} 15 SelfBuffCount${i} "${IniFile}" ${Function} int
      /call LoadVar SelfBuffStuff SelfBuffIndoors${i} 0 SelfBuffIndoors${i} "${IniFile}" ${Function} int
      /if (${Select[${SelfBuffGem${i}},item,alt]}) {
        /varset SelfBuffID[${i}] ${Spell[${SelfBuffIcon${i}}].ID}
      } else {
        /varset SelfBuffID[${i}] ${Me.Book[${Me.Book[${SelfBuffIcon${i}}]}].ID}
      }
    /next i
  }
  /call LoadVar DoBuffStuff DoBuffTotal 1 DoBuffTotal "${IniFile}" ${Function} int
  /if (${DoBuffTotal}) {
    /if (!${Defined[DoBuffID]}) /declare DoBuffID[${DoBuffTotal}] int outer
    /if (!${Defined[DoBuffQueue]}) /declare DoBuffQueue[25,2] int outer
    /if (!${Defined[QueueCount]}) /declare QueueCount int outer
    /call LoadVar DoBuffStuff DoBuffs TRUE DoBuffs "${IniFile}" ${Function} bool
    /call LoadVar DoBuffStuff DoBuffTells TRUE DoBuffTells "${IniFile}" ${Function} bool
    /call LoadVar DoBuffStuff DoBuffChannel "tt" DoBuffChannel "${IniFile}" ${Function} string
    /call LoadVar DoBuffStuff RefreshBuffs FALSE RefreshBuffs "${IniFile}" ${Function} bool
    /call LoadVar DoBuffStuff DoBuffMana 0 DoBuffMana "${IniFile}" ${Function} int
    /for i 1 to ${DoBuffTotal}
      /call LoadVar DoBuffStuff DoBuff${i} "Do Buff Item/Spell #${i}" DoBuff${i} "${IniFile}" ${Function} string
      /call LoadVar DoBuffStuff DoBuffIcon${i} "Do Buff #${i} Buff Icon" DoBuffIcon${i} "${IniFile}" ${Function} string
      /call LoadVar DoBuffStuff DoBuffGem${i} "Do Buff #${i} Gem or put item if an item" DoBuffGem${i} "${IniFile}" ${Function} string
      /call LoadVar DoBuffStuff DoBuffAliases${i} "Put the keywords you want to respond to for this buff" DoBuffAliases${i} "${IniFile}" ${Function} string
      /call LoadVar DoBuffStuff DoBuffIndoors${i} 0 DoBuffIndoors${i} "${IniFile}" ${Function} int
      /call LoadVar DoBuffStuff DoBuffRefresh${i} 0 DoBuffRefresh${i} "${IniFile}" ${Function} int
      /if (${Select[${DoBuffGem${i}},item,alt]}) {
        /varset DoBuffID[${i}] ${Spell[${DoBuffIcon${i}}].ID}
      } else {
        /varset DoBuffID[${i}] ${Me.Book[${Me.Book[${DoBuffIcon${i}}]}].ID}
      }
    /next i
  }
  /call LoadVar RaidBuffs RaidBuffTotal 1 RaidBuffTotal "${IniFile}" ${Function} int
  /if (${RaidBuffTotal}) {
    /if (!${Defined[RaidBuffQueue]}) /declare RaidBuffQueue[72,2] int outer
    /if (!${Defined[RaidQueueCount]}) /declare RaidQueueCount int outer
    /if (!${Defined[RaidBuffID]}) /declare RaidBuffID[${RaidBuffTotal}] int outer
    /call LoadVar RaidBuffs DoRaidBuffs TRUE DoRaidBuffs "${IniFile}" ${Function} bool
    /for i 1 to ${RaidBuffTotal}
      /call LoadVar RaidBuffs RaidBuff${i} "Raid Buff Item/Spell #${i}" RaidBuff${i} ${IniFile} ${Function} string
      /call LoadVar RaidBuffs RaidBuffIcon${i} "Raid Buff #${i} Buff Icon" RaidBuffIcon${i} ${IniFile} ${Function} string
      /call LoadVar RaidBuffs RaidBuffGem${i} "Raid Buff #${i} Gem or put item if an item" RaidBuffGem${i} ${IniFile} ${Function} string
      /call LoadVar RaidBuffs RaidBuffIndoors${i} 0 RaidBuffIndoors${i} ${IniFile} ${Function} int
      /if (${Select[${RaidBuffGem${i}},item,alt]}) {
        /varset RaidBuffID[${i}] ${Spell[${RaidBuffIcon${i}}].ID}
      } else {
        /varset RaidBuffID[${i}] ${Me.Book[${Me.Book[${RaidBuffIcon${i}}]}].ID}
      }
    /next i
  }
  /call LoadVar PetStuff PetBuffTotal 1 PetBuffTotal "${IniFile}" ${Function} int
  /if (${PetBuffTotal}) {
    /if (!${Defined[PetBuffID]}) /declare PetBuffID[${PetBuffTotal}] int outer
    /if (!${Defined[PetBuffTimer]}) /declare PetBuffTimer timer outer
    /call LoadVar PetStuff DoPetBuffs TRUE DoPetBuffs "${IniFile}" ${Function} bool
    /call LoadVar PetStuff ShrinkPet TRUE ShrinkPet "${IniFile}" ${Function} bool
    /call LoadVar PetStuff ShrinkPetSpell "Tiny Companion" ShrinkPetSpell "${IniFile}" ${Function} string
    /call LoadVar PetStuff ShrinkPetSpellGem "gem1" ShrinkPetSpellGem "${IniFile}" ${Function} string
    /call LoadVar PetStuff PetBuffRecheck 10s PetBuffRecheck ${IniFile} ${Function} string
    /for i 1 to ${PetBuffTotal}
      /call LoadVar PetStuff PetBuff${i} "pet Buff Item/Spell #${i}" PetBuff${i} ${IniFile} ${Function} string
      /call LoadVar PetStuff PetBuffIcon${i} "pet Buff #${i} Buff Icon" PetBuffIcon${i} ${IniFile} ${Function} string
      /call LoadVar PetStuff PetBuffGem${i} "pet Buff #${i} Gem or put item if an item" PetBuffGem${i} ${IniFile} ${Function} string
      /call LoadVar PetStuff PetBuffIndoors${i} 0 PetBuffIndoors${i} ${IniFile} ${Function} int
      /if (${Select[${PetBuffGem${i}},item,alt]}) {
        /varset PetBuffID[${i}] ${Spell[${PetBuffIcon${i}}].ID}
      } else {
        /varset PetBuffID[${i}] ${Me.Book[${Me.Book[${PetBuffIcon${i}}]}].ID}
      }
    /next i
  }
  /call LoadVar DotStuff DotTotal 1 DotTotal "${IniFile}" ${Function} int
  /if (${DotTotal}) {
    /if (!${Defined[DotID]}) /declare DotID[${DotTotal}] int outer
    /if (!${Defined[DotTimer1]}) /declare DotTimer1 timer outer
    /if (!${Defined[DotTimer2]}) /declare DotTimer2 timer outer
    /if (!${Defined[DotTimer3]}) /declare DotTimer3 timer outer
    /if (!${Defined[DotTimer4]}) /declare DotTimer4 timer outer
    /if (!${Defined[DotTimer5]}) /declare DotTimer5 timer outer
    /call LoadVar DotStuff DoDots FALSE DoDots "${IniFile}" ${Function} bool
    /call LoadVar DotStuff DotAt 90 DotAt "${IniFile}" ${Function} int
    /call LoadVar DotStuff DotMinHPs 40 DotMinHPs "${IniFile}" ${Function} int
    /call LoadVar DotStuff DotMinMana 60 DotMinMana "${IniFile}" ${Function} int
    /call LoadVar DotStuff DotRecasts 2 DotRecasts ${IniFile} ${Function} int
    /call LoadVar DotStuff WhichDot 1 WhichDot "${IniFile}" ${Function} int
    /for i 1 to ${DotTotal}
      /call LoadVar DotStuff Dot${i} "Put the name of Dot #${i} here" Dot${i} "${IniFile}" ${Function} string
      /call LoadVar DotStuff DotGem${i} "Put the spell gem you want to cast Dot #${i} from here" DotGem${i} "${IniFile}" ${Function} string
      /call LoadVar DotStuff DotSpellSet${i} 1 DotSpellSet${i} "${IniFile}" ${Function} int
      /if (${Select[${DotGem${i}},item,alt]}) {
        /varset DotID[${i}] ${Spell[${Dot${i}}].ID}
      } else {
        /varset DotID[${i}] ${Me.Book[${Me.Book[${Dot${i}}]}].ID}
      }
    /next i
  }
  /call LoadVar AuraStuff UseAura FALSE UseAura "${IniFile}" ${Function} bool
  /call LoadVar AuraStuff AuraBuff "Self Aura Spell or Combat Ability full name" AuraBuff "${IniFile}" ${Function} string
  /call LoadVar AuraStuff AuraBuffGem "gem# for spell, comb for combat ability" AuraBuffGem "${IniFile}" ${Function} string
  /call LoadVar AuraStuff AuraEndurance 200 AuraEndurance "${IniFile}" ${Function} int
  /call LoadVar GotHitStuff GotHitTotal 1 GotHitTotal "${IniFile}" ${Function} int
  /if (${GotHitTotal}) {
  	/call LoadVar GotHitStuff UseGotHit FALSE UseGotHit "${IniFile}" ${Function} bool
  	/for i 1 to ${GotHitTotal}
  		/call LoadVar GotHitStuff GotHit${i} "Name of Item/AA/Spell to cast." GotHit${i} "${IniFile}" ${Function} string
  		/call LoadVar GotHitStuff GotHitGem${i} "GotHit Gem# or aa" GotHitGem${i} "${IniFile}" ${Function} string
  		/call LoadVar GotHitStuff GotHitHp${i} 90 GotHitHp${i} "${IniFile}" ${Function} int
  		/call LoadVar GotHitStuff GotHitType${i} 0 GotHitType${i} "${IniFile}" ${Function} int
  		/call LoadVar GotHitStuff GotHitRUN${i} FALSE GotHitRUN${i} "${IniFile}" ${Function} bool
  	/next i
  }
  /call LoadVar CureStuff CureTotal 1 CureTotal "${IniFile}" ${Function} int
  /if (${CureTotal}) {
	  /call LoadVar CureStuff DoCures FALSE DoCures "${IniFile}" ${Function} bool
	  /call LoadVar CureStuff ReportCures FALSE ReportCures "${IniFile}" ${Function} bool
	  /for i 1 to ${CureTotal}
		  /call LoadVar CureStuff CureSpell${i} "Cure Item/Spell #${i}" CureSpell${i} "${IniFile}" ${Function} string
		  /call LoadVar CureStuff CureGem${i} "Cure #${i} Gem or put item if an item" CureGem${i} "${IniFile}" ${Function} string
		  /call LoadVar CureStuff CurseCounters${i} "Set this to the # of debuf counters you want this to react to (For example if the spell cures 25 counters and you want it to only cure if it can do it in 2 casts or less, set it to 50)" CurseCounters${i} "${IniFile}" ${Function} int
		  /call LoadVar CureStuff DiseaseCounters${i} "Set this to the # of debuf counters you want this to react to (For example if the spell cures 25 counters and you want it to only cure if it can do it in 2 casts or less, set it to 50)" DiseaseCounters${i} "${IniFile}" ${Function} int
		  /call LoadVar CureStuff PoisonCounters${i} "Set this to the # of debuf counters you want this to react to (For example if the spell cures 25 counters and you want it to only cure if it can do it in 2 casts or less, set it to 50)" PoisonCounters${i} "${IniFile}" ${Function} int
		  /call LoadVar CureStuff CorruptCounters${i} "Set this to the # of debuf counters you want this to react to (For example if the spell cures 25 counters and you want it to only cure if it can do it in 2 casts or less, set it to 50)" CorruptCounters${i} "${IniFile}" ${Function} int
	  /next i
  }
/return

Sub Event_Invited
  /delay 5
  /if (!${Me.Grouped}) /keypress invite_follow
/return

Sub Event_Hungry
  /if (${Engaged}) /return
  /echo I am Hungry
  /if (${Announce}) /${MyChannel} I am summoning food... please hold pulls
  /declare i int local 1
  /for i 1 to 8
    /autoinventory
    /delay 1
    /call Cast "${FoodSpell}" ${FoodSpellGem} 5s
  /next i
  /autoinventory
  /if (${Announce}) /${MyChannel} GTG now
/return

Sub Event_Thirsty
  /if (${Engaged}) /return
  /echo I am Thirsty
  /if (${Announce}) /${MyChannel} I am summoning drink... please hold pulls
  /declare i int local 1
  /for i 1 to 8
    /autoinventory
    /delay 1
    /call Cast "${DrinkSpell}" ${DrinkSpellGem} 5s
  /next i
  /autoinventory
  /if (${Announce}) /${MyChannel} GTG now
/return

Sub Event_RageOn(string line)
  /if ((${line.Find[${Spawn[${MobID}].DisplayName}]} || ${line.Find[${Target.DisplayName}]}) && ${Me.Pet.ID}) {
    /echo calling off pet...
    /pet back off
    /delay 1
    /pet hold
  }
/return

Sub Event_RageOff(string line)
  /if ((${line.Find[${Spawn[${MobID}].DisplayName}]} || ${line.Find[${Target.DisplayName}]}) && ${Me.Pet.ID}) {
    /target id ${MobID}
    /pet attack
  }
/return

Sub Event_ToggleString(Stuff,TempMessage,TempVar,IniSection,IniEntry,Line)
  /if (${Defined[${TempVar}]}) {
    /if (${Line.Length}) {
      /varset ${TempVar} ${Line}
      /ini "${Me.Name}_Shaman.ini" ${IniSection} ${IniEntry} "${${TempVar}}"
    }
    /echo ${TempMessage} to: ${${TempVar}}
    /varset ${IniEntry} ${${TempVar}}
  }
/return

Sub Event_ToggleVar(Stuff,TempMessage,TempVar,IniSection,IniEntry,Line)
  /if (${Defined[${TempVar}]}) {
  	/if (!${Line.Length}) {
  		/if (${${TempVar}}) {
  			/varset ${TempVar} FALSE
  		} else {
  			/varset ${TempVar} TRUE
  		}
  	}
  	/if (${Line.Arg[1].Equal[ON]} || ${Line.Arg[1].Equal[TRUE]} || ${Line.Arg[1].Equal[1]}) /varset ${TempVar} TRUE
  	/if (${Line.Arg[1].Equal[OFF]} || ${Line.Arg[1].Equal[FALSE]} || ${Line.Arg[1].Equal[0]}) /varset ${TempVar} FALSE
  	/if (${${TempVar}}) /echo ${TempMessage} is now ON!
  	/if (!${${TempVar}}) /echo ${TempMessage} is now OFF!
  	/if (${IniSection.NotEqual[NULL]} && ${IniEntry.NotEqual[NULL]}) /ini "${Me.Name}_Shaman.ini" ${IniSection} ${IniEntry} ${${TempVar}}
  }
/return

Sub Event_MobDead(string Line,string MobName)
  /delay 1
  /if (${UseVPAA}) {
  	/if (${Spawn[${MobName}].ID}) /declare tempID int local ${Spawn[${MobName}].ID}
    /if (${Defined[${VPTimer${tempID}}]}) /deletevar ${VPTimer${tempID}}
  }
  /if (!${NewAdds}) /varset AESlowed 0
  /doevents
/return

Sub Event_SelfShrink
  /if (${DoSelfShrink}) {
  	/squelch /target myself
    /delay 6 ${Target.Name.Equal[${Me}]}
    /if (${Target.Name.Equal[${Me}]}) {
      /call Cast "${ShrinkSpell}" ${ShrinkSpellGem} 4s Check_grpHPs
      /delay 10s ${Me.SpellReady[${ShrinkSpell}]}
      /call Cast "${ShrinkSpell}" ${ShrinkSpellGem} 4s Check_grpHPs
      /delay 15 ${Me.SpellReady[${ShrinkSpell}]}
    }
  }
/return

Sub Event_ShrinkGroup
  /if (${DoSelfShrink}) {
  	/squelch /target myself
    /delay 6 ${Target.Name.Equal[${Me}]}
    /if (${Target.Name.Equal[${Me}]}) {
      /call Cast "Tiny Terror" ${ShrinkSpellGem} 4s Check_grpHPs
      /delay 10s ${Me.SpellReady[Tiny Terror]}
      /call Cast "Tiny Terror" ${ShrinkSpellGem} 4s Check_grpHPs
      /delay 15 ${Me.SpellReady[Tiny Terror]}
    }
  }
/return

Sub Event_SetAnchor(string line,string leash)
  /if (${leash.Find[clear]}) {
  	/varset UseAnchor 0
  } else {
  	/varset UseAnchor 1
  	/varset AnchorX ${Me.X}
  	/varset AnchorY ${Me.Y}
  	/varset AnchorHeading ${Me.Heading.DegreesCCW}
  	/varset LeashLength ${leash}
  	/echo New anchor: ${Me.X} ${Me.Y}
  }
/return

Sub Event_WornOff(Line,SpellName,ToonName)
  /declare i int local
  /if (${DoBuffTotal} && ${RefreshBuffs}) {
    /for i 1 to ${DoBuffTotal}
      /if (${SpellName.Equal[${DoBuffIcon${i}}]} && ${DoBuffRefresh${i}}) {
      	/call AddToQueue ${Spawn[pc ${ToonName}].ID} ${i}
      }
    /next i
  }
/return

Sub Event_Zoning
  /varset currentZone ${Zone.ID}
  /varset OutDoors TRUE
  /varset ValidTarget 0
  /varset Engaged 0
  /nomodkey /keypress home
  /varset MobID 0
  /varset UseAnchor 0
  /varset ExcludeList ${Ini[${IniFile},"Excludes.${Zone.ShortName}","Exclude"]}
  /if (${ExcludeList.Equal[NULL]}) {
    /ini "${IniFile}" "Excludes.${Zone.ShortName}" "Exclude" "|"
    /varset ExcludeList ${Ini[${IniFile},"Excludes.${Zone.ShortName}","Exclude"]}
    /echo ExcludeList: ${ExcludeList}
  } else {
    /varset ExcludeList ${Ini[${IniFile},"Excludes.${Zone.ShortName}","Exclude"]}
    /echo ExcludeList: ${ExcludeList}
  }
  /call RefreshAlerts
  /if (${Defined[UseAnchor]}) /varset UseAnchor 0
  /if (${TankID}!=${NearestSpawn[${TankName}].ID}) /varset TankID ${NearestSpawn[${TankName}].ID}
  /varset DeathFlag ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]}
  /if (!${YourDead} && (${DeathFlag} || ${Me.State.Equal[Hover]} || ${Me.State.Equal[Dead]} || ${Window[RespawnWnd].Open})) /call Event_ImDead
  /if (!${JustZoned}) /varset JustZoned TRUE
  /delay 2
  /if (${Following}) {
   	:WaitForFollowGuy
   	/delay 10
   	/doevents
   	/squelch /target pc ${FollowGuy}
   	/if (!${Target.ID} || ${Target.ID}!=${Spawn[pc ${FollowGuy}].ID}) /goto :WaitForFollowGuy
    /if (${Me.Underwater} || ${Me.Levitating}) {
      /squelch /stick 10 hold uw
    } else {
      /squelch /stick 10 hold
    }
   	/if (${Announce}) /${MyChannel} Following ${FollowGuy} GTG!
  }
  /delay 1
  /doevents
  /call Timer
  /call ClearMobList
/return

Sub Event_OutDoor
  /echo This is an indoor zone. Sorry.
  /varset OutDoors FALSE
/return

Sub Event_ImDead
  /echo Bummer !
  /varset MobID 0
  /varset PetID 0
  /varset UseAnchor 0
  /squelch /alert clear 1
  /call ClearMobList
  :wait_for_loot
  /delay 5s
  /varset DeathFlag ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]}
  /if (${DeathFlag}) {
    /memspellset ${MySpellSet}
    /delay 10s
    /delay 15s !${Window[SpellBookWnd].Open}
    /call Wait4Rez
  }
  :Zone_Loop
  /if (!${JustZoned} && ${Zone.ID}!=${currentZone}) {
   	/doevents
   	/delay 2s
   	/goto :Zone_Loop
  }
  /varset JustZoned FALSE
  :Meditate
  /if (${Me.State.Equal[Stand]} && ${Me.PctMana}<${SitAt}) /sit
  /delay 1s
  /doevents
  /if (${Me.CurrentMana}<500) /goto :Meditate
/return

Sub Wait4Rez
  /if (!${Defined[YourDead]}) /declare YourDead bool outer FALSE
  /echo Awaiting rez: auto-accepting, and looting my corpse
  /consent group
  /delay 25
  /consent raid
  /delay 25
  /consent guild
  :waitforrez
  /if (${Window[TradeWnd].Open}) /nomodkey /notify TradeWnd TRDW_Trade_Button leftmouseup
  /doevents EQBC
  /delay 1
  /doevents Chat
  /doevents EQBC
  /if (!${YourDead}) /varset YourDead TRUE
  /if (${Zone.ID}!=${currentZone}) /call Event_Zoning
  /delay 10s ${Window[ConfirmationDialogBox].Open}
  /if (!${Window[ConfirmationDialogBox].Open}) /goto :waitforrez
  /varset YourDead FALSE
  /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup
  /delay 2s
  /if (${Window[RespawnWnd].Open}) {
    /nomodkey /notify RespawnWnd RW_OptionsList listselect 2 
    /delay 1s
    /nomodkey /notify RespawnWnd RW_SelectButton leftmouseup
    /delay 2s 
  }
  :waitforzone
  /delay 5m ${Spawn[${Me}'s corpse].ID}
  /delay 5s ${Spawn[${Me}'s corpse].Distance}<100
  /if (${Spawn[${Me}'s corpse].ID}) /target mycorpse
  /delay 5s ${Target.ID}==${Spawn[${Me}'s corpse].ID}
  /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :waitforzone
  :corpsepull
  /if (${Target.Distance}>100 || !${Spawn[${Me}'s corpse].ID}) /return
  /delay 5s ${Target.Distance}<20
  /loot
  /delay 5s ${Me.State.Equal[BIND]}
  /if (${Me.State.NotEqual[BIND]}) /goto :corpsepull
  /declare loottotal int local
  :lootlag
  /varset loottotal ${Corpse.Items}
  /delay 1s ${loottotal}!=${Corpse.Items}
  /if (${loottotal}!=${Corpse.Items}) /goto :lootlag
  /declare i int local
  /for i 1 to ${loottotal}
    :lootagain
    /itemnotify loot${i} rightmouseup
    /delay 10s !${Corpse.Item[${i}].ID}
    /if (${Corpse.Item[${i}].ID}) /goto :lootagain
  /next i
  /nomodkey /notify LootWnd DoneButton leftmouseup
/return

Sub Event_ToggleUseMount
  /if (${UseMount}) {
  	/varset UseMount FALSE
  	/ini ${IniFile} Settings UseMount FALSE
  	/echo UseMount Now Off!
  	/if (${Bool[${Me.Buff[Summon Drogmor]}]}) {
  		/nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Summon Drogmor].ID}-1].Int} leftmouseup
  	} else /if (${Bool[${Me.Buff[Summon Horse]}]}) {
  		/nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Summon Horse].ID}-1].Int} leftmouseup
  	} else /if (${Bool[${Me.Buff[Activate Roboboar]}]}) {
  		/nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Activate Roboboar].ID}-1].Int} leftmouseup
  	} else /if (${Bool[${Me.Buff[Summon Warhorse]}]}) {
  		/nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Summon Warhorse].ID}-1].Int} leftmouseup
  	} else /if (${Bool[${Me.Buff[Summon Worg]}]}) {
  		/nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Summon Worg].ID}-1].Int} leftmouseup
  	}
  } else {
  	/varset UseMount TRUE
  	/ini ${IniFile} Settings UseMount TRUE
  	/echo UseMount Now On!
  	/if (${UseMount} && !${Me.Mount.ID} && ${OutDoors} && !${Following} && !${Me.Invis}) /call Cast "${Mount}" item 5s
  }
/return

Sub Event_EQBC(EQBCSay,EQBCSender,EQBCCommand)
  /if (${EQBCCommand.Left[1].Equal[/]}) {
    /docommand ${EQBCCommand}
  } else {
    /call Event_Chat "EQBC" "${EQBCSender}" "${EQBCCommand}"
  }
/return

Sub Event_Chat(string ChatType,string Sender,string ChatText)
  /if ((${ChatText.Find[shamanrezz]})&&(${Spawn[${Sender}].Type.Find[Corpse]})) {
    /if (${DoBuffTells} && !${SpamTimer}) /${TellChannel} ${Sender} Rezz inc!
    /target ${Sender}'s Corpse
    /if (!${Target.ID} && ${Announce}) /${MyChannel} I can't target ${Sender}'s corpse
    /if (!${Target.ID} && ${DoBuffTells}) /${TellChannel} ${Sender} I can't target your corpse
    /if (${Target.Type.Equal[Corpse]}) {
      /if (${Announce}) /${MyChannel} I am attempting to resurrect ${Sender}
      /call Cast "Call of the Wild" alt 7s
      /return
    }
  }
  /if ((!${ChatType.Equal[${MyChannel}]})&&(!${ChatType.Equal[TELL]})&&(!${ChatType.Equal[EQBC]})) /return
  /if (!${Spawn[${Sender}].ID}) /return
  /if (${ChatText.Equal[invisoff]}) {
  	/if (${Me.Buff[Shared Camouflage].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shared Camouflage].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Sun Cloak].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sun Cloak].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Sunskin].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sunskin].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Fool the Fallen].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Fool the Fallen].ID}-1].Int} leftmouseup
  }
  /if (${ChatText.Equal[pop infusion]} && ${Me.AltAbility[Infusion of the Faithful].ID} && ${Me.AltAbilityReady[Infusion of the Faithful]}) /call Cast "Infusion of the Faithful" alt
  /if (${ChatText.Equal[levoff]}) {
  	/If (${Me.Buff[Flight of Eagles].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Flight of Eagles].ID}-1].Int} leftmouseup
  	/If (${Me.Buff[Spirit of Eagle].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Spirit of Eagle].ID}-1].Int} leftmouseup
  	/If (${Me.Buff[Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Levitation].ID}-1].Int} leftmouseup
  	/If (${Me.Buff[Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Dead Man Floating].ID}-1].Int} leftmouseup
  }
  /if (${Spawn[${TankID}].PctHPs}<90) /return
  /declare a int local
  /declare i int local
  /if (${DoBuffTotal} && ${DoBuffs} && ${Sender.NotEqual[${Me.CleanName}]} && ${Spawn[pc ${Sender}].ID}) {
    /for i 1 to ${DoBuffTotal}
      /if ((!${Outdoors} && !${DoBuffIndoors${i}})) /goto :SkipBuff
      /for a 1 to ${DoBuffAliases${i}.Count[|]}
        /if (${ChatText.Find["${DoBuffAliases${i}.Arg[${a},|]}"]}) {
          /if (${ChatText.Find[" pet "]} || ${ChatText.Find[${Spawn[pc ${Sender}].Pet.CleanName}]}) {
            /call AddToQueue ${Spawn[pc ${Sender}].Pet.ID} ${i}
          } else {
            /call AddToQueue ${Spawn[pc ${Sender}].ID} ${i}
          }
        }
      /next a
      :SkipBuff
    /next i
  }
  /if (${ChatText.Equal[follow]} && ${Sender.NotEqual[${Me.CleanName}]}) {
    /delay 5
    /if (!${Spawn[${Sender}].ID}) {
      /echo ${Sender} is not in zone for me to follow!
      /return
    }
    /varset FollowGuy ${Sender}
    /if (${Announce}) /${MyChannel} I am Following ${FollowGuy}!!!
    /if ( ${Me.Mount.ID} ) /dismount
    /varset UseAnchor 0
    /if (${AutoAnchor}) /setanchor clear
    /target pc ${FollowGuy}
    /delay 3s ${Target.Name.Equal[${FollowGuy}]}
    /if (!${Following} && ${Target.Name.Equal[${FollowGuy}]}) {
      /stand
      /face fast nolook
      /if (${Me.Underwater} || ${Me.Levitating}) {
      	/squelch /stick 10 hold uw
      } else {
        /squelch /stick 10 hold
      }
      /varset Following 1
      /if (${Me.Pet.ID}) /pet follow
      /if (!${Target.ID}) /varset Following 0
      /delay 1
      /doevents
      /return
    }
  }
  /if (${ChatText.Equal[follow stop]} && ${Sender.NotEqual[${Me.CleanName}]}) {
    /if (!${Spawn[${Sender}].ID}) {
      /return
    }
    :StillMoving
    /delay 1s
    /if (${Spawn[${FollowGuy}].Distance}>30) /goto :StillMoving
    /varset Following 0
    /squelch /stick off
    /keypress forward
    /keypress back
    /keypress home
    /if (${AutoAnchor}) /setanchor 30
    /if (${Announce}) /${MyChannel} I Stopped Following ${FollowGuy}!!!
    /if (${Me.Pet.ID} && ${Me.AltAbility[Pet Discipline]}) /pet hold
    /call ClearMobList
    /return
  }
  /if (${ChatText.Equal[clickzone]}) {
  	/declare OldZoneID int local ${Zone.ID}
  	/if (${Stick.Status.Equal[ON]}) /squelch /stick off
  	:MoveToDoor
  	/if (${OldZoneID}!=${Zone.ID}) /return
  	/if (${Target.ID}) /squelch /target clear
  	/squelch /doortarget
  	/squelch /face fast door
    /if (${DoorTarget.Distance}>12) {
    	/nomodkey /keypress forward hold
    	/delay 3
    	/nomodkey /keypress forward
    	/goto :MoveToDoor
    } else /if (${DoorTarget.Distance}<7) {
    	/nomodkey /keypress back hold
    	/delay 1
    	/nomodkey /keypress back
    }
    /delay 2
    /nomodkey /keypress u hold
    /delay 2
    /nomodkey /keypress u
    /delay 2
    /nomodkey /keypress home
    /delay 2
    /nomodkey /keypress u hold
    /delay 2
    /nomodkey /keypress u
    /delay 1s
    /if (${OldZoneID}==${Zone.ID}) /goto :MoveToDoor
  }
  /if (${ChatText.Equal[clickdoor]}) {
  	/if (${Stick.Status.Equal[ON]}) /squelch /stick off
  	:MoveToClick
  	/if (${Target.ID}) /squelch /target clear
  	/squelch /doortarget
  	/squelch /face fast door
    /if (${DoorTarget.Distance}>12) {
    	/nomodkey /keypress forward hold
    	/delay 3
    	/nomodkey /keypress forward
    	/goto :MoveToClick
    } else /if (${DoorTarget.Distance}<7) {
    	/nomodkey /keypress back hold
    	/delay 1
    	/nomodkey /keypress back
    }
    /delay ${ZoneDelay}
    /nomodkey /keypress u hold
    /delay 2
    /nomodkey /keypress u
    /delay 2
    /nomodkey /keypress home
    /delay 2s
    /doevents Zoning
  }
  /if (${ChatText.Equal[mana check]}) /${MyChannel} Shaman Mana ${Me.PctMana}%
  /if (${ChatText.Equal[leaveraid]} && ${Raid.Member[${Me.CleanName}].ID}) /raiddisband
  /if (${ChatText.Equal[slowcamp]}) {
  	/if (${Me.Pet.ID} && ${Me.AltAbility[Suspended Minion]}) {
  		/stand
  		/call Cast "Suspended Minion" alt 3s
    }
    /if (${Me.Standing}) /sit
    /delay 5m ${Me.PctMana}>=98
    /camp desktop
    /end
  }
/return

Sub Event_RaidBuff(string line,string BuffCommand)
  /declare j int local
  /if (${BuffCommand.NotEqual[all]} && ${Spawn[pc ${BuffCommand}].ID}) {
  	/for j 1 to ${RaidBuffTotal}
  		/if (${RaidBuffTotal}) {
  		  /call AddToQueue ${Spawn[pc ${BuffCommand}].ID} ${j}
  		}
    /next j
    /return
  }
  /declare a int local
  /declare i int local
  /if (${RaidBuffTotal}&&${DoRaidBuffs}&&${BuffCommand.Equal[all]}) {
    /for i 1 to ${RaidBuffTotal}
      /if (!${Outdoors}&&!${RaidBuffIndoors${i}}) /goto :SkipRaidBuff
      /for a 1 to ${Raid.Members}
      	/if (${Select[${Spell[${RaidBuffID[${i}]}].TargetType},"Group v2","AE PC v2","Group v1","AE PC v1"]}&&${Raid.Member[${a}].GroupLeader}) {
      		/call AddToRaidQueue ${Spawn[pc ${Raid.Member[${a}]}].ID} ${i}
      	} else /if (${Select[${Spell[${RaidBuffID[${i}]}].TargetType},pc,Single]}) {
          /call AddToRaidQueue ${Spawn[pc ${Raid.Member[${a}]}].ID} ${i}
        }
      /next a
    :SkipRaidBuff
    /next i
  }
/return

Sub Event_SayZone(string Sender,string ZoneText)
  /if (${Stick.Status.Equal[ON]}) /squelch /stick off
  /squelch /assist ${Sender}
  /squelch /face fast nolook
  /if (${Target.ID}) /squelch /stick 10
  /delay ${ZoneDelay}
  /if (${ZoneText.Equal[hail]}) {
  	/h
  } else {
    /say ${ZoneText}
  }
/return

Sub Event_CastSpell(string Sender,string SpellName,string SpellTarget)
  /if (${Me.Book[${SpellName}]}) {
  	/target id ${Spawn[${SpellTarget}].ID}
  	/delay 5s ${Target.Name.Equal[${SpellTarget}]}
  	/if (${DoBuffTells} && !${SpamTimer}) /${DoBuffChannel} ${SpellName} inc
  	/call Cast "${SpellName}" gem1
  }
/return

Sub Event_ExcludeMob(string line,string MobName)
  /if (!${ExcludeList.Find[${MobName}]}) {
  	/ini "${IniFile}" "Excludes.${Zone.ShortName}" "Exclude" "${MobName}|"
  } else }
    /ini "${IniFile}" "Excludes.${Zone.ShortName}" "Exclude" "${ExcludeList}${MobName}|"
  }
  /varset ExcludeList ${Ini[${IniFile},"Excludes.${Zone.ShortName}","Exclude"]}
  /echo ExcludeList: ${ExcludeList}
  /call RefreshAlerts
/return

Sub Event_GotHit(string line,string MobName)
  /call CheckInvis
  /if (${Spawn[${MobName}].Type.NotEqual[NPC]} || ${Spawn[${MobName}].Master.Type.NotEqual[NPC]} || ${ExcludeList.Find[${MobName}]}) /return
  /declare i int local
  /for i 1 to ${GotHitTotal}
  	/if (!${Me.Buff[${GotHit${i}}].ID} && ${Spawn[${MobName}].ID} && ${Me.PctHPs}<${GotHitHp${i}} && (${Me.SpellReady[${GotHit${i}}]} || ${Me.AltAbilityReady[${GotHit${i}}]} || ${Me.CombatAbilityReady[${GotHit${i}}]} || (${FindItem[${GotHit${i}}].InvSlot} && !${FindItem[${GotHit${i}}].TimerReady}))) {
  		/if (${GotHitType${i}}==1) /target id ${Me.ID}
  		/if (${GotHitType${i}}==2 && ${Spawn[npc ${MobName}].ID} && ${Target.ID}!=${Spawn[npc ${MobName}].ID}) /target ${MobName}
  		/delay 10s !${Me.Casting.ID}
  		/declare LastCastReturn string local ${castReturn}
      /if (${GotHitType${i}}==3) {
        /if (${Me.AbilityReady[${GotHit${i}}]}) {
  		    /target id ${Me.ID}
          /doability ${GotHit${i}}
          /varset castReturn CAST_SUCCESS
        }
      } else {
  		  /if (${Me.CombatAbilityReady[${GotHit${i}}]}) {
  			  /doability ${GotHit${i}}
  			  /varset castReturn CAST_SUCCESS
  		  } else {
  			  /call Cast "${GotHit${i}}" ${GotHitGem${i}} 10s
  		  }
      }
  		/if (${castReturn.Equal[CAST_SUCCESS]}) {
  			/echo ${GotHit${i}} on ${Target.CleanName}
  			/if (${GotHitRUN${i}}) /call GotHitRun ${Spawn[${MobName}].ID}
  			/if (${LastCastReturn.NotEqual[CAST_SUCCESS]}) /varset castReturn CAST_CANCELLED
  			/if (${Spawn[${OldTarget}].ID} && ${Target.ID}!=${OldTarget}) /squelch /target ${OldTarget}
  			/doevents GotHit flush
  			/return
  		}
  	}
  /next i
  /if (${LastCastReturn.NotEqual[CAST_SUCCESS]}) /varset castReturn CAST_CANCELLED
  /if (${Spawn[${OldTarget}].ID} && ${Target.ID}!=${OldTarget}) /squelch /target ${OldTarget}
  /doevents GotHit flush
/return

Sub Event_RootOff(string line, string MobName)
  /if (${UseVPAA} || ${UseRoot}) {
    /if (${Spawn[${MobName}].ID}) /declare tempID int local ${Spawn[${MobName}].ID}
    /if (${Defined[VPTimer${tempID}]}) /varset VPTimer${tempID} 0
    /call VPAA ${tempID}
  }
/return

Sub Event_Consider_Ally 
  /varset ConsiderReturn 1  
/return 

Sub Event_Consider_Warmly  
  /varset ConsiderReturn 2  
/return 

Sub Event_Consider_Kindly  
  /varset ConsiderReturn 3  
/return 

Sub Event_Consider_Amiable  
  /varset ConsiderReturn 4  
/return 

Sub Event_Consider_Indifferent  
  /varset ConsiderReturn 5  
/return 

Sub Event_Consider_Apprehensive  
  /varset ConsiderReturn 6  
/return 

Sub Event_Consider_Dubious  
  /varset ConsiderReturn 7  
/return 

Sub Event_Consider_Threatening  
  /varset ConsiderReturn 8  
/return 

Sub Event_Consider_ReadyToAttack  
  /varset ConsiderReturn 9  
/return
 
There has always been a problem with the unity line buffing right, this is how I make it work and is flawless

Add this too your shamans mq2melee plugin is the file in the mq2 directory call servername_shamanname.ini


Rich (BB code):
[MQ2Melee]
downflag1=1
downshit1=/if (${Spell[Transcendent Foresight Rk. II].Stacks} && ${Me.PctMana}>35 && !${Me.Buff[Transcendent Foresight Rk. II].ID} && !${Me.Moving} && !${Me.Invis}) /casting "Talisman of Unity Rk. II" gem9
 
shaman macro

Users who are viewing this thread

Back
Top