Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |
- | GM spell resist test
- | gm_srt.mac
- |
- | Casts the specified spell using #cast repeatedly while tracking the count cast and count resisted.
- |
- |
- #Event Resisted "Your target resisted the #1# spell."
- #Event Landed "#1#'s body is bathed in chaotic fire."
- #Event Report "#1#show counts#*#"
- #Event EndTest "#1#end test#*#"
- Sub Main
- /if (!${Param0}) {
- /declare SpellToCast int outer 4981
- } else {
- /declare SpellToCast int outer ${Param0}
- }
- /declare CastCounter int outer 0
- /declare ResistCounter int outer 0
- /declare LandCounter int outer 0
- /declare TargetID outer ${Target.ID}
- /echo ${Macro.Name} now starting...
- /echo You will be casting ${Spell[${SpellToCast}].Name} (${SpellToCast}) on ${Spawn[${Target.ID}].Name}
- /echo You have 10 seconds to /endmacro if you wish to abort
- /delay 100
- /echo Now beginning, use "/say show counts" to see stats or "/say end test" to show counts and end the macro.
- :MainLoop
- /doevents
- /if (${Target.ID} <> ${TargetID}) {
- /target ID ${Target.ID}
- /delay 5
- /goto :MainLoop
- } else {
- /docommand /say #cast ${SpellToCast}
- /varcalc CastCounter ${CastCounter}+1
- /delay 5
- }
- /goto :MainLoop
- /return
- Sub Event_Resisted(EventText,SpellResisted)
- /if (${Spell[${SpellToCast}].Name.Equal[${SpellResisted}]}) {
- /varcalc ResistCounter ${ResistCounter}+1
- }
- /delay 1
- /return
- Sub Event_Landed(EventText,SpellLandedOn)
- /if (${Spawn[${Target.ID}].CleanName.Equal[${SpellLandedOn}]}) {
- /varcalc LandCounter ${LandCounter}+1
- }
- /delay 1
- /return
- Sub Event_Report(EventText,Requester)
- /if (${CastCounter} > 0) {
- /docommand /say ${Requester}, here is your report:
- /docommand /say Spells Cast: ${CastCounter}
- /docommand /say Spells Landed: ${LandCounter} | ${Math.Calc[(${LandCounter}/${CastCounter})*100]}%
- /docommand /say Spells Resisted: ${ResistCounter} | ${Math.Calc[(${ResistCounter}/${CastCounter})*100]}%
- }
- /return
- Sub Event_EndTest(EventText,Requester)
- /if (${CastCounter} > 0) {
- /docommand /say ${Requester}, here is your report:
- /docommand /say Spells Cast: ${CastCounter}
- /docommand /say Spells Landed: ${LandCounter} | ${Math.Calc[(${LandCounter}/${CastCounter})*100]}%
- /docommand /say Spells Resisted: ${ResistCounter} | ${Math.Calc[(${ResistCounter}/${CastCounter})*100]}%
- /endmacro
- }
- /return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement