Moderator: MacroQuest Developers

Code: Select all
| ################# Checks for expired slow/debuff timers
Sub CheckDebuffTimers
/declare i int local 1
/for i 1 to ${DebuffTimers.Size}
/if (${DebuffTimers[${i}]}) /if (!${Spawn[${DebuffTimers[${i}]}].ID} || ${Spawn[${DebuffTimers[${i}]}].State.Equal[DEAD]}) {
/if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
/deletevar DebuffTimer${DebuffTimers[${i}]}
}
/varset DebuffTimers[${i}] 0
}
/if (${DebuffTimers[${i}]}) /if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) /if (${DebuffTimer${DebuffTimers[${i}]}}<=6) {
/call checkCanCast "${SpellSlow}" gem${SpellSlowGem}
/if (!${Macro.Return}) /return
/squelch /stick off
/squelch /moveto off
/if (${Me.Combat}) /attack off
/target id ${DebuffTimers[${i}]}
/call Slow
/target id ${TargetArray[4]}
/attack on
}
/next i
/return
Sub SetDebuffTimer(int id,timer t)
/declare i int local 1
/for i 1 to ${DebuffTimers.Size}
/if (!${DebuffTimers[${i}]}) {
/varset DebuffTimers[${i}] ${id}
/if (!${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
/declare DebuffTimer${DebuffTimers[${i}]} timer outer ${t}
} else {
/varset DebuffTimer${DebuffTimers[${i}]} ${t}
}
/return
}
/next i
/return
Sub CheckSlowRadius
/declare s string local
/declare sID int local
/declare i int local 1
/declare g int local 1
/declare h int local 1
/for i 1 to 10
:CheckSlowRadiusLoop1
/varset s ${Me.NearestSpawn[${i},npc].ID}
/if (${Spawn[${s}].Distance}>${Spell[${SpellSlow}].Range}) /next i
/if ((${Me.CurrentMana}<${Spell[${SpellSlow}].Mana})) /next i
/call CheckAttacking ${Spawn[${s}].ID}
/if (${Target.Type.Equal[NPC]} && ${Macro.Return}) {
/for g 0 to ${Math.Calc[${Group.Members}+${otherBuffees.Size}]}
/if (${g}<=${Group.Members}) {
/varset sID ${Group.Member[${g}].ID}
} else {
/varset sID ${Spawn[${otherBuffees[${Math.Calc[${g}-${Group.Members}]}]}].ID}
}
/if (${Spawn[${sID}].ID}) /if (${Math.Distance[${Spawn[${s}].X},${Spawn[${s}].Y}:${Spawn[${sID}].X},${Spawn[${sID}].Y}]} <= 50) {
/for h 1 to ${DebuffTimers.Size}
/if (${DebuffTimers[${h}]}==${s}) {
/varset i ${Math.Calc[${i}+1]}
/if (${i}>10) /return
/goto :CheckSlowRadiusLoop1
| /next i
}
/next h
|/if (${LineOfSight[${Me.Y},${Me.X},${Me.Z}:${Spawn[${s}].Y},${Spawn[${s}].X},${Spawn[${s}].Z}]}) {
| /if (${LineOfSight[${Spawn[${sID}].Y},${Spawn[${sID}].X},${Spawn[${sID}].Z}:${Spawn[${s}].Y},${Spawn[${s}].X},${Spawn[${s}].Z}]}) {
/call checkCanCast "${SpellSlow}" gem${SpellSlowGem}
/if (!${Macro.Return}) /return
/squelch /stick off
/squelch /moveto off
/if (${Me.Combat}) /attack off
/target id ${s}
/delay 5
|/if (${DoMalo} && ${Target.Type.Equal[NPC]}) {
| /call DeBuff
|}
/if (${DoSlow} && ${Target.Type.Equal[NPC]}) {
/call Slow
}
/target id ${TargetArray[4]}
/attack on
/if (${tookAction}) /return
| }
|}
}
/next g
}
/next i
/return