MoR/MoB/Heal Cleric-Macro
Posted: Thu May 19, 2005 11:37 am
Hi, after a bit of procrastinating I decided to have my first post here, too. Until now the only macros I made and used for myself were very small and situnational ones that - I would guess - no one else but me could use, anyway. However, I made this one from a request on the request boards (yes!), out of boredom. It's still pretty simple, but in relation, it's one of my longer macros, hehe. Reason for posting it is, that I would like to hear some advice on what I could have made better/in a different way. And maybe some people could even use it as it is, as well.
As the macro is now, it makes the cleric use MoR pants, MoB spell, and CH. But that's of course something that could be easily altered. TIA.
As the macro is now, it makes the cleric use MoR pants, MoB spell, and CH. But that's of course something that could be easily altered. TIA.
Code: Select all
| PL.mac by ms1089
| Usage: /mac PL <name of PL'ee> <percentage of heal>
| Example: /mac PL Bob 50
#include spellcast.inc
#event dead "#*#have been slain#*#"
#event resist "#*#Your target resisted#*#"
#event marked "#*#gleams with bright red runes#*#"
#event marked "#*#bound by the mark of the blameless#*#"
sub main
/echo Heal&MoR PL Macro
/declare plee string outer ${Param0}
/declare healhps int outer ${Param1}
/declare mobid int outer
/declare idaq int outer
/declare mor int outer
/declare markspell string outer Ultor's Greaves of Faith
/declare markspell2 string outer Mark of the Blameless
/declare healspell string outer Complete Healing
/if (!${Defined[Param0]}) {
/echo You didn't name your PL'ee
/echo Usage: /mac PL <name of PL'ee> <percentage of heal>
/echo Ex: /mac PL Bob 50
/endmac
}
/if (!${Defined[Param1]}) {
/echo You didn't define when to heal
/echo Usage: /mac PL <name of PL'ee> <percentage of heal>
/echo Ex: /mac PL Bob 50
/endmac
}
/keypress Esc
:mainloop
/call assist
/call mark
/call mark2
/call heal
/call checkifdead
/doevents
/goto :mainloop
sub assist
:assist
/if (${mor}==0 && ${idaq}==0) {
/assist ${plee}
/delay 1s
/if (${Target.Type.Equal[NPC]}) {
/varset mobid ${Target.ID}
/varset mor 0
/varset idaq 1
/echo Target aquired.
/goto :assist
}
}
/doevents
/return
sub mark
:mark
/if (${mor}==0 && ${idaq}==1) {
/target ID ${mobid}
/if (${Target.ID} && ${Target.PctHPs}<98 && ${Target.Distance}<80) {
/target ID ${mobid}
/echo Casting MoR
/call cast "${markspell}" item
/doevents
/goto :mark
}
}
/doevents
/return
sub mark2
:mark2
/if (${mor}==1 && ${idaq}==1) {
/target ID ${mobid}
/if (${Target.ID} && ${Target.PctHPs}<98 && ${Target.Distance}<80) {
/target ID ${mobid}
/echo Casting MoB
/call cast "${markspell2}"
/doevents
/goto :mark2
}
}
/doevents
/return
sub heal
:heal
/if (${mor}==2 && ${idaq}==1) {
/target ${plee}
/if (${Target.ID} && ${Target.PctHPs}<${healhps} && ${Target.Distance}<80) {
/target ${plee}
/echo Casting HEAL
/call cast "${healspell}"
/goto :heal
}
}
/doevents
/return
sub checkifdead
/if (${mor}>0 && ${idaq}>0) {
/if (!${Spawn[${mobid}].Type.Equal[NPC]}) {
/echo Mob defeated. Waiting for next.
/varset idaq 0
/varset mor 0
}
}
/return
sub event_dead
/echo You have been owned. GL finding a rezz. Ending Macro.
/endmac
sub event_resist
/echo ${Target.CleanName} RESISTED
/return
sub event_marked
/echo ${Target.CleanName} was MARKED
/varset mor ${Math.Calc[${mor}+1]}
/return