Advertisement
sorvani

gm_srt.mac

Feb 18th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. |
  2. | GM spell resist test
  3. | gm_srt.mac
  4. |
  5. | Casts the specified spell using #cast repeatedly while tracking the count cast and count resisted.
  6. |
  7. |
  8.  
  9.  
  10. #Event Resisted "Your target resisted the #1# spell."
  11. #Event Landed "#1#'s body is bathed in chaotic fire."
  12. #Event Report "#1#show counts#*#"
  13. #Event EndTest "#1#end test#*#"
  14.  
  15. Sub Main
  16. /if (!${Param0}) {
  17. /declare SpellToCast int outer 4981
  18. } else {
  19. /declare SpellToCast int outer ${Param0}
  20. }
  21. /declare CastCounter int outer 0
  22. /declare ResistCounter int outer 0
  23. /declare LandCounter int outer 0
  24. /declare TargetID outer ${Target.ID}
  25.  
  26.  
  27. /echo ${Macro.Name} now starting...
  28. /echo You will be casting ${Spell[${SpellToCast}].Name} (${SpellToCast}) on ${Spawn[${Target.ID}].Name}
  29. /echo You have 10 seconds to /endmacro if you wish to abort
  30. /delay 100
  31. /echo Now beginning, use "/say show counts" to see stats or "/say end test" to show counts and end the macro.
  32.  
  33. :MainLoop
  34. /doevents
  35. /if (${Target.ID} <> ${TargetID}) {
  36. /target ID ${Target.ID}
  37. /delay 5
  38. /goto :MainLoop
  39. } else {
  40. /docommand /say #cast ${SpellToCast}
  41. /varcalc CastCounter ${CastCounter}+1
  42. /delay 5
  43. }
  44. /goto :MainLoop
  45. /return
  46.  
  47. Sub Event_Resisted(EventText,SpellResisted)
  48. /if (${Spell[${SpellToCast}].Name.Equal[${SpellResisted}]}) {
  49. /varcalc ResistCounter ${ResistCounter}+1
  50. }
  51. /delay 1
  52. /return
  53.  
  54. Sub Event_Landed(EventText,SpellLandedOn)
  55. /if (${Spawn[${Target.ID}].CleanName.Equal[${SpellLandedOn}]}) {
  56. /varcalc LandCounter ${LandCounter}+1
  57. }
  58. /delay 1
  59. /return
  60.  
  61. Sub Event_Report(EventText,Requester)
  62. /if (${CastCounter} > 0) {
  63. /docommand /say ${Requester}, here is your report:
  64. /docommand /say Spells Cast: ${CastCounter}
  65. /docommand /say Spells Landed: ${LandCounter} | ${Math.Calc[(${LandCounter}/${CastCounter})*100]}%
  66. /docommand /say Spells Resisted: ${ResistCounter} | ${Math.Calc[(${ResistCounter}/${CastCounter})*100]}%
  67. }
  68. /return
  69.  
  70. Sub Event_EndTest(EventText,Requester)
  71. /if (${CastCounter} > 0) {
  72. /docommand /say ${Requester}, here is your report:
  73. /docommand /say Spells Cast: ${CastCounter}
  74. /docommand /say Spells Landed: ${LandCounter} | ${Math.Calc[(${LandCounter}/${CastCounter})*100]}%
  75. /docommand /say Spells Resisted: ${ResistCounter} | ${Math.Calc[(${ResistCounter}/${CastCounter})*100]}%
  76. /endmacro
  77. }
  78. /return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement