To start this I had to cobble together magecamp.mac and Mckoors run to target with obstacle avoidance.
This is my first version, I haven't had a chance to even test it yet, so I'm asking mostly for extra eyes anything blindingly glaringly obvious that might be missing from this macro. Or more subtle things like missing brackets, misspelled words or what not.
The macro is meant for a level 50ish magician to use a very effective method of hunting, with only a single key press
Code: Select all
|magefight.mac v1.0 Imanoob
|This macro will target a mob, run close enough to pull it.
|Cast a debuff, then run back to safe point sic pet on mob, cast dot, dd then med
|Heal and buff pet if either fails.
|Run and try to gate if mob aggros you
|
|To use this macro
|/macro magefight mobname
|
|Includes and defines
#turbo 50
#include SpellCast.inc
#define ENEMY @param0
#Event PetHasteDown "Your pet's Burnout III spell has worn off."
#Event PetDSDown "Your pet's Shield of Lava spell has worn off."
#Event DoTDown "Your Elemental Maelstrom spell has word off."
#Event SLAINBY "You have been slain by "
#Event EXP "You gain experience!!"
|Declarations
/declare DSSpell global
/declare SelfBuffSpell global
/declare DebuffSpell global
/declare DoTSpell global
/declare DDSpell global
/declare PetSpell global
/declare PetBuffSpell global
/declare PetDSSpell global
/declare PetHealSpell global
/declare EvacSpell global
/declare HomeXLOC global
/declare HomeYLOC global
/declare MyXLOC global
/declare MyYLOC global
/declare PetHasteStatus global
/declare PetDSStatus global
/declare TargetDead global
|Main macro
Sub Main
/call SetGlobals
/call GetTarget
/call Pull
/call killaction
/endmacro
Sub SetGlobals
/varset DSSpell "Shield of Lava"
/varset SelfBuffSpell "Greater Shielding"
/varset DebuffSpell "Malosi"
/varset DoTSpell "Elemental Maelstrom"
/varset DDSpell "Shock of Blades"
/varset PetSpell "Greater Conjuration Earth"
/varset PetBuffSpell "Burnout III"
/varset PetDSSpell "Shield of Lava"
/varset PetHealSpell "Renew Elements"
/varset EvacSpell "Gate"
/echo Spells Loaded
/varset HomeXLOC $char(x)
/varset HomeYLOC $char(y)
/return
Sub GetTarget
:TargetLoop
/press ESC
/echo Searching for ENEMY!
/target npc ENEMY nopcnear 200
/if ("$target()"=="FALSE" || n $target(hp,pct)<=95) {
/echo Unable to locate any targets nearby... Will try again in 15 seconds.
/if "$char(state)"!="SIT" /sit
/delay 15s
/goto :TargetLoop
}
/echo Closing in on $target(name,clean)...
/varset DIST 80
/call MoveToTarget
/return
Sub Pull
|TODO Run to target Malosi and run back
/face target
/MoveToMob
/delay 2s
/call Cast DebuffSpell
/call RunForMyLife
/return
Sub RunForMyLife
:keeprunning
/face fast loc @HomeYLOC,@HomeXLOC
if($char(x) != @HomeXLOC) || ($char(y) != @HomeYLOC){
/sendkey up up
/goto :keeprunning
}
/sendkey down down
/face $target
/return
Sub MoveToMob
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstacleCount 0
/if n $target(distance,nopredict)<=15 {
/face look
/return
}
/doEvents
/sendkey down up
:Movementloop
/varadd ObstacleCount 1
/if $target()=="FALSE" /return
/face look
/if n $target(distance,nopredict)<= $target(maxrange)-10 {
/face look
/sendkey up up
/varset InCombat 1
/return
}
/if @ObstacleCount>=3 {
/call CheckObstacle
/goto :Movementloop
}
/if n $target(distance,nopredict)> $target(maxrange)+10 /goto :MovementLoop
/return
Sub CheckObstacle
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObstacle
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstacleCount 0
/return
Sub HitObstacle
/sendkey up up
/sendkey down down
/delay 3
/sendkey up down
/sendkey down ctrl
/if n $rand(99)>50 {
/sendkey down right
} else {
/sendkey down left
}
/delay 5
/sendkey up right
/sendkey up left
/sendkey up ctrl
/sendkey down up
/return
Sub killaction
/doevents
/call Castspells
/target npc @mob1 radius @area
/pet attack
:MainCombatLoop
/call CastSpells
/if n $target(id)==0 /varset TargetDead 1
/doevents
/if n @TargetDead!=1 /goto :maincombatloop
/if $target()=="FALSE" /goto :EndKillTarget
:EndKillTarget
/pet follow
/goto :Cleanup
/return
Sub CastSpells
:StartSpells
/sit on
/if n $char(mana,pct)<60 /call MedUp
/if n $char(buff,DSSpell)==0 {
/sit off
/call Cast DSSpell
/delay $spell(DSSpell,casttime)
/goto :StartSpells
}
/if n @PetHasteStatus==0 {
/target id $char(pet)
/sit off
/call Cast PetBuffSpell
/delay $spell(PetBuffSpell,casttime)
/varset PetHasteStatus 1
/goto :StartSpells
}
| check to see if we need to DS our Pet
/if n @PetDSStatus==0 {
/target id $char(pet)
/sit off
/call Cast PetDSSpell
/delay $spell(PetDSSpell,casttime)
/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)
/sit off
/call Cast "PetHealSpell"
/delay $spell(PetHealSpell,casttime)
/goto :StartSpells
}
/if n @DoTStatus ==0 {
/target $spawn(@mobid)
/sit off
/call Cast DoTSpell
/delay $spell(DoTSpell,casttime)
}
| Check to see if we should nuke the mob.
/target npc @ENEMY radius @area
/if n $target(id)==$char(pet) /goto :nonuke
/if $target()==FALSE /goto :nonuke
/if $spawn(@mobid,hp,pct)==0 /goto :nonuke
/if n $spawn(@mobid,hp,pct)<75 {
/call Cast DDSpell
/delay $spell(DDSpell,casttime)
}
:nonuke
/if DEBUG /echo No Nuke Needed ATM.
/return
Sub Event_PetHasteDown
/varset PetHasteStatus 0
/return
Sub Event_PetDSDown
/varset PetDSStatus 0
/return
Sub Event_DoTDown
/varset DoTStatus 0
/reutrn
Sub Event_SLAINBY
/echo "Ack I died!"
/delay 1m
/sit
/camp desktop
/endmacro
/return
3-23-04
Began Implementing changes suggested by bonehand

