Page 1 of 3

Simple mezz macro

Posted: Wed Sep 30, 2009 6:10 am
by nonyck
Need help fixing this.
THe idea is macro checks a range, if there are more than 1 mob and that mob its diferent to CORPSE id or its not the tank target mezz it

#include spell_routines.inc
#Event MEZZWornOff "#*#MEZZ spell has worn off#*#"
Sub Main
/echo 1...
/declare MOBID int outer 0


:loop
|Mezzcheck
/if (${SpawnCount[npc radius 25]}>1 && ${Target.ID}!=${MOBID} && ${diferent to tank target] && ${Target.Type}!=$[CORPSE] ) /call Mezz
/delay 1s
/goto :loop
/return

Sub Mezz
/call Cast "MezzSpell" gemX 5s
/echo Mezzing >> ${Target.DisplayName} <<
/if (${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_IMMUNE]}) /varset MOBID ${Target.ID}
/return


Sub Event_MEZZWornOff
/varset MOBID FALSE
/return

Posted: Wed Sep 30, 2009 2:05 pm
by RageATM0998

Code: Select all

/call Cast "MezzSpell" gemX 5s 
Looks like you need to fill in the spell you want it to cast to mez them with, and the spell gem number for it to cast from on that line. Not sure if you were looking at a problem bigger than that, but was something I noticed on a quick glance.

Posted: Wed Sep 30, 2009 6:25 pm
by jpetrone

Code: Select all

|Mezz.mac
|Call macro with the format: /mac Mezz "checkradius" "TankName" 
|Example /mac Mezz 50 Scourge 

#include spell_routines.inc 

#Event MEZZWornOff "#*#MEZZ spell has worn off#*#" 

Sub Main(int CR, string TANK) 

/declare TEMPID    int    outer 
/declare MEZZID    int    outer 
/declare MEZZED    timer  outer 0 
/declare MezzSpell string outer "Put Mezz Spell Here without quotations"
/declare Duration  int    outer "Put Duration of Mez Spell here in seconds times 10  without quotations. so 30s would be 300"

:loop 
|Set Tank's Target 
/if (${SpawnCount[npc radius ${CR}]} > 1) { 
 /assist ${TANK} 
 /delay 5 
 /varset TEMPID ${Target.ID} 
 /goto :Target 
} 
/delay 1s 
/goto :loop 

:Target 
/if (${SpawnCount[npc radius ${CR}]} <= 1) /goto :loop 
|Find target to Mezz 
|Will check the nearest 2 spawns and then start the loop over if it can't find a target that should be mezzed.
/Target ${NearestSpawn[1 NPC radius ${CR}]} 
/delay 5 
/if (${Target.ID} != ${TEMPID} && !${Target.Type.Equal[Corpse]} && ${SpawnCount[npc radius ${CR}]} > 1) { 
 /varset MEZZID ${Target.ID} 
 /delay 5 
 /call Mezz 
 /goto :MezzCheck 
} 
/if (${Target.ID} == ${TEMPID} && ${SpawnCount[npc radius ${CR}]} > 1) { 
 /Target ${NearestSpawn[2 NPC radius ${CR}]} 
 /delay 5 
 /if (${Target.ID} != ${TEMPID} && !${Target.Type.Equal[Corpse]} && ${SpawnCount[npc radius ${CR}]} > 1) { 
  /varset MEZZID ${Target.ID} 
  /delay 5 
  /call Mezz 
  /goto :MezzCheck
 } 
} 
/delay 1s 
/goto :loop 

:MezzCheck 
|Check to see if Mezz has worn off. 
/delay 5 
/doevents 
/delay 5 
/if (!${MEZZED}) /goto :loop
/goto :MezzCheck 

/return 

Sub Mezz 
:Loop 
/call Cast "${MezzSpell}" gemX 5s 
/echo Mezzing >> ${Target.DisplayName} << 
/if (${Macro.Return.Equal[CAST_SUCCESS]}) { 
 /varset MEZZED ${DURATION} 
 /return 
} 
/goto :Loop 
/return 


Sub Event_MEZZWornOff 
/varset MEZZED 0 
/return
First off I don't have much experience with Mezz.
Second I'm still pretty new to writing macros.
Third if this works it won't handle more than 1 add.
Fourth I have never actually used the spellroutines.inc ${Macro.Return.Equal[CAST_SUCCESS]} function so my use may be incorrect.
Fifth I don't have a check to see why the Mezz wasn't successful so if it fails then it will just kep trying to mez.

If everything works correctly it will sit in the first loop until until there are 2 or more mobs within the radius you set when you call the macro. Then it will set the TEMPID to match the Tank's target and avoid mezzing that target. If when it tries to target either of the two nearest spawns both come back as being the tank's target as a result of movement or what have you then it will just start the whole loop over.

Once it actually selects a mob to Mezz and mezzes that mob, it will set a timer equal to the duration you set which should be close to the actual duration of the mezz or less. Then it will wait for that timer to run out or for the mez to wear off or get broken which ever comes first.

When the mezz needs to be refreshed it will restart the macro again from the top incase the tank has switched targets.

I hope it works for you. It may need fine tuning or flat out corrections. I'll be happy to help you out if I have the time and know how :)

Stay Safe

J

PS These need to be changed for sure before it will work:

Code: Select all

"#*#MEZZ spell has worn off#*#" 

"Put Mezz Spell Here without quotations"

"Put Duration of Mez Spell here in seconds times 10 without quotations. so 30s would be 300"

gemX
oh and simply using /hidecorpse all in game or adding it to the macro, will solve problems if you don't feel like cleaning the corpes and seem to be targetting them too often.

Posted: Wed Sep 30, 2009 7:47 pm
by dont_know_at_all

Code: Select all

/call Cast AEMez

Posted: Thu Oct 01, 2009 2:41 am
by nonyck
Thx a lot man will try it,
And yea I put that Mezzspell event incompleted, I mean I put MEZZspell for dont put the true spell so people can put the spell he wants.

And you got the idea I got in mind hehe, enchanter checks a range, marks tank target for dont mezz it, then continues checking the are for ADD

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 1:38 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 1:39 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 1:40 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 1:41 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 1:42 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 1:44 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 1:45 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 1:46 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 2:23 am
by xyilla

Re: Simple mezz macro

Posted: Sun Sep 14, 2025 3:00 am
by xyilla