All credit goes to board members here.. I pieced code together pretty much.
In any event, I use it with my 65 mag. Feel free to modify it any to make it work better or work with your class. I couldn't find any good mag macros for hunting a single spawn target. Which is the reason for this.
Event's Arn't working right but I posted in macro help so I'll fix it when I learn whats wrong.
Cheers
Code: Select all
| special events to respond to
| used to echo debugging messages. set to 1=1 if you want to see them, 0==1 if you dont
#define DEBUG 0==1
#include SpellCast.inc
#event PetHasteDown "Your pet's Burnout V spell has worn off."
#event PetDSDown "Your pet's Flameshield of Ro spell has worn off."
#Event SLAINBY "You have been slain by "
#Event EXP "You gain experience!!"
#define SelfShieldSpell "Xegony's Phantasmal Guard"
#define firenuke "Sun Vortex"
#define PetDSSpell "Flameshield of Ro"
#define PetBuffSpell "Burnout V"
#define PetHealSpell "Planar Renewal"
sub main
/zapvars
/declare mob1 global
/declare area global
/declare MainArray array2
/declare PetHasteStatus global
/declare PetDSStatus global
/declare TargetDead global
/declare horsy global
/declare horsecast global
/declare mobid global
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
| CHANGE THIS to your targets name...
/varset mob1 "Durkis"
| CHANGE THIS to your Mount Hotkey
/varset horsecast 9
/alert clear alerts
/alert add 1 npc radius 200 @mob1
/alert add 2 npc radius 100 "corpse"
/varset MainArray(1,0) "green"
/varset area "200"
|---------------------------
:Cleanup
/if DEBUG /echo Cleanup, Cleanup, Everybody do their share.
/if DEBUG /echo Cleanup, Cleanup, Everybody everywhere.
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
/alert clear alerts
/alert add 1 npc radius @area @mob1
/alert add 2 npc radius @area "corpse"
:Loop
/if $alert(1)==TRUE /call target
/if DEBUG /echo In :Loop Just checked alert
/doevents
/if $char(mounted)==TRUE {
/varset horsy 1
}
/if $char(mounted)==FALSE {
/varset horsy 0
}
/doevents
/if DEBUG /echo Checking for horse
/if n @horsy==0 /call horsy
/if DEBUG /echo Restarting Loop in 20 seconds
/delay 20s
/goto :loop
/return
SUB target
/if DEBUG /echo In "Sub Target"
/target npc @mob1 radius @area
/if DEBUG /echo Just tried to target Durkis.
/varset mobid $target(id)
/if DEBUG /echo Set mobid to be $target(id)
/if DEBUG /echo Our targets HP% is $spawn(@mobid,hp,pct)
/varset TargetDead 0
/delay 2
/if DEBUG /echo Calling Killaction sub
/if n $target(name)==@mob1 /call killaction
/return
SUB killaction
/if DEBUG /echo In "Sub Killaction"
/doevents
/if DEBUG /echo calling castspells from inside killaction
/call Castspells
/if DEBUG /echo in "Sub killaction" done with spells retargeting
/target npc @mob1 radius @area
/if DEBUG /echo Sending Pet
/pet attack
:MainCombatLoop
/if DEBUG /echo In MainCombatLoop Calling Castspells
/call CastSpells
/if DEBUG /echo Done with spells checking to see if mob alive.
/if n $target(id)==0 /varset TargetDead 1
/doevents
/if DEBUG /echo set the TargetDead variable to 1 if target was 0
/if DEBUG /echo if target was alive went to maincombat loop to cast spells
/if n @TargetDead!=1 /goto :maincombatloop
/if DEBUG /echo if target was null went to EndKillTarget
/if $target()=="FALSE" /goto :EndKillTarget
:EndKillTarget
/if DEBUG /echo In EndKillTarget making pet follow and CALL MAIN
/pet follow
/goto :Cleanup
/return
Sub MedUp
:MedStart
/if DEBUG /echo Had Less Than 60% Mana, Mounting and Medding
/if DEBUG /echo Checking for horse
/if $char(mounted)==TRUE {
/varset horsy 1
/if DEBUG /echo Our Mount is on Hotkey 9
/varset horsecast 9
}
/if n @horsy==0 /call horsy
/if "$char(state)"=="STAND" /sit
/delay 1m
/if n $char(mana,cur)<70 /goto :MedStart
/if "$char(state)"!="STAND" /stand
/return
Sub CastSpells
:StartSpells
/if DEBUG /echo IN "Sub CastSpells"
/if DEBUG /echo Checking for Less than 60mana
/if n $char(mana,pct)<60 /call MedUp
/if DEBUG /echo Choosing What spell to Cast...
/if n $char(buff,"SelfShieldSpell")==0 {
/if DEBUG /echo I Choose "SelfSheildSpell"
/call Cast "SelfShieldSpell"
/delay 3s
/goto :StartSpells
}
/if n @PetHasteStatus==0 {
/target id $char(pet)
/call Cast "PetBuffSpell"
/delay 3s
/varset PetHasteStatus 1
/goto :StartSpells
}
| check to see if we need to DS our Pet
/if n @PetDSStatus==0 {
/target id $char(pet)
/call Cast "PetDSSpell"
/delay 3s
/varset PetDSStatus 1
/goto :StartSpells
}
| check to see if we need to heal our pet.
/if n $spawn($char(pet),hp,pct)<40 {
/target id $char(pet)
/call Cast "PetHealSpell"
/delay 3s
/goto :StartSpells
}
| Check to see if we should nuke the mob.
/if DEBUG /echo in nuke section
/target npc @mob1 radius @area
/if DEBUG /echo Just targeted @mob1
/if n $target(id)==$char(pet) /goto :nonuke
/if DEBUG /echo checked to see if target id was pet id
/if $target()==FALSE /goto :nonuke
/if DEBUG /echo Checked to see target not null
/if $spawn(@mobid,hp,pct)==0 /goto :nonuke
/if DEBUG /echo Checked to see that spawnid hp% wasn not 0
/if n $spawn(@mobid,hp,pct)<75 {
/call Cast "firenuke"
/delay 3s
}
:nonuke
/if DEBUG /echo No Nuke Needed ATM.
/return
Sub horsy
/if DEBUG /echo Looks like we need a MOUNT
/if $char(state)!="STAND" /stand
/press 9
:Waitmount
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :Waitmount
}
/delay 1s
/return
Sub Event_EXP
/call Main
/echo We got him now stop fucking fighting and shit
/return
Sub Event_PetHasteDown
/varset PetHasteStatus 0
/return
Sub Event_PetDSDown
/varset PetDSStatus 0
/return
|This should happen when you die!
Sub Event_SLAINBY
/echo "You Dead!"
/delay 1m
/delay 10s
/sit
/camp desktop
/endmacro
/return
/if DEBUG /echo THIS IS THE END OF THE SCRIPT.

