Code: Select all
||assist.mac
|Beastlord Melee Nuke and Buff macro.
|version 2.2 by Gonemental
|
|Original code taken from rogue-assist.mac written by Grimjack
|Special Thanks to A_Druid_00 for the buffing section
|
|Added Toggle commands
|Requires Mq2moveutils, Mq2Melee, and Mq2Cast plugins (Avaliable
|through Vip section. Yes that means you need to donate)
#turbo 20
|No casting while invisible
/declare noInvis int outer 1
#include assist.inc
|Events
#Event Pause "[MQ2] Pause#*#"
#Event Nuke "[MQ2] Nuke#*#"
#Event SelfBuffs "[MQ2] Selfbuffs#*#"
#Event PetBuffs "[MQ2] PetBuffs#*#"
#Event Outdoors "#*#You can only cast this spell in the outdoors.#*#"
#Event Zoned "#*#You have entered#*#"
#Event Slow "[MQ2] Slow#*#"
#Event Debug "[MQ2] Debug#*#"
Sub Main
/Echo Assist Macro Has Started
/call Declares
:Mainloop
/doevents
/if (!${Me.Combat} && ${OldTarget} && ${Me.CombatState.Equal[COOLDOWN]}) /varset OldTarget 0
/if (${Me.Combat} && !${Pause}) {
/if (${DoSlow}) /call Slowit
/if (${Nuke}) /call Nuke
/if (${DoHeal}) /call Healthcheck
}
/if (${Me.CombatState.Equal[ACTIVE]} && !${Me.Moving} || ${Me.Mount.ID} && ${Me.CombatState.Equal[RESTING]}) {
/if (${SelfBuffs} && !${Pause} && ${Me.FreeBuffSlots}>1) /call CheckBuffs
/if (${PetBuffs} && !${Pause}) /call PetBuffs
}
/delay 1s
/goto :Mainloop
/return
Sub Healthcheck
/declare MyTarget int local
/if (${Me.Casting.ID} || ${Me.Moving}) /return
/if (${Me.PctHPs}<=${HealPct} && ${Me.CurrentMana}>${Spell[${HealThingID}].Mana}) {
/if (${Target.ID}) /varset MyTarget ${Target.ID}
/target id ${Me.ID}
/casting "${HealThing}" gem7
/if (${MyTarget}) /target id ${MyTarget}
}
/delay 1s
/return
Sub Nuke
/declare n int local
/for n 1 to ${Nuketotal}
/if (${Me.PctMana}>${Nuketill} && ${Target.PctHPs}<=${Nukeat} && ${NukeTimer} && ${Me.SpellReady[${SpellNuke[${n}]}]}) {
/echo Casting "${SpellNuke[${n}]}"
/casting "${SpellNuke[${n}]}"
}
/varset NukeTimer 5s
/delay 1s
/next n
/return
Sub Slowit
/If ((${Debug})) /echo I Made it to the Slow Routine
/if (!${Target.ID} || ${Target.Type.Equal[NPC]}) {
/If ((${Debug})) /echo Im Sure its no Tank
:Slow_Loop
/doevents
/If (${Debug}) /echo ${Target.PctHPs}<=${SlowAt} && !${MobSlowed} && ${Target.ID}!=${OldTarget}) {
/if (${Target.PctHPs}<=${SlowAt} && !${MobSlowed} && ${Target.ID}!=${OldTarget}) {
/If (${Debug}) /echo Passed Slow Conditions 1
/if (${Me.CurrentMana}<${Spell[${SlowSpellID}].Mana}) {
/echo Shid ! I don't have mana to Slow ${Target.CleanName}
} else {
/stick pause
/If (${Debug}) /echo Passed Conditions Casting "${SpellSlow}" gem1 6s
/casting "${SpellSlow}" gem4 6s
/if (${Cast.Return.Equal["CAST_INTERRUPTED"]}) /goto :Slow_Loop
/if (${Cast.Return.Equal["CAST_IMMUNE"]}) {
/echo *** ${Target.CleanName} is IMMUNE to my slow !
/varset MobSlowed TRUE
/stick unpause
/varset OldTarget ${Target.ID)
}
/if (${Cast.Return.Equal["CAST_RESISTED"]}) {
/if (!${FastSlow}) {
/echo *** ${Target.CleanName} RESISTED slow ! Trying again asap
/goto :Slow_Loop
}
/varset MobSlowed TRUE
/stick unpause
/varset OldTarget ${Target.ID)
}
/if (${Cast.Return.Equal["CAST_SUCCESS"]}) {
/echo *** ${Target.CleanName} is SLOWED
/varset MobSlowed TRUE
/stick unpause
/varset OldTarget ${Target.ID)
}
}
}
/delay 1s
/return
Sub CheckBuffs
/declare i int local
/declare a int local
/declare MyTarget int local
/for i 1 to ${SelfBuffTotal}
/If ((${Debug})) /echo Checking Me for (${Me.Buff[${SelfBuffIcon[${i}]}]})
/if (${Me.Buff[${SelfBuffIcon[${i}]}].Duration}<10) {
/for a 1 to 20
/If ((${Debug})) /echo Checking My Conditions
/if (${SelfBuffBlock[${i}].Find[${Me.Buff[${a}].Spell}]} || ${NearestSpawn[NPC].Distance}<20) /goto :NextSelfBuff
/If ((${Debug})) /echo My Conditions Meet
/next a
/if (!${Outdoors} && !${SelfBuffIndoors[${i}]}) /goto :NextSelfBuff
/varset MyTarget ${Target.ID}
/squelch /target myself
/if (${SelfBuffGem[${i}].Equal[item]}) {
/If (${Debug}) /echo Casting "${SelfBuff[${i}]}" item 1s
/casting "${SelfBuff[${i}]}" item 1s
} else /if (${SelfBuffGem[${i}].Equal[alt]} && ${Me.AltAbilityReady[${SelfBuff[${i}]}]}) {
/If (${Debug}) /echo Casting "${SelfBuff[${i}]}" alt 1s
/casting "${SelfBuff[${i}]}" alt 1s
} else /if (${Me.CurrentMana}>${Spell[${SelfBuffID[${i}]}].Mana}) {
/If (${Debug}) /echo Casting "${SelfBuff[${i}]}" ${SelfBuffGem[${i}]} 1s
/casting "${SelfBuffID[${i}]}"|${SelfBuffGem[${i}]} 1s
}
/target id ${MyTarget}
}
:NextSelfBuff
/doevents
/delay 2s
/next i
}
/return
Sub PetBuffs
/declare i int local
/declare a int local
/declare MyTarget int local
|If we don't have pet, make one
/if ( !${Me.Pet.ID} && ${PetSummon}) {
/echo Creating new pet
/ban activate Pet
/delay 3
/casting "${PetSpellName}" gem9
/delay 10s
/target ${Me.Pet.Name}
/casting "Tiny Companion" gem7
}
/for i 1 to ${PetBuffTotal}
/If ((${Debug})) /echo Checking Pet for (!${Me.PetBuff[${PetBuffIcon[${i}]}]})
/if (!${Me.PetBuff[${PetBuffIcon[${i}]}]}) {
/for a 1 to 20
/If ((${Debug})) /echo Checking Pet Conditions
/if (${PetBuffBlock[${i}].Find[${Me.PetBuff[${a}]}]} || ${NearestSpawn[NPC].Distance}<20) /goto :NextPetBuff
/If ((${Debug})) /echo Pet Conditions Meet
/next a
/if (!${Outdoors} && ${PetBuffIndoors[${i}]}) /goto :NextPetBuff
/varset MyTarget ${Target.ID}
/squelch /target ${Me.Pet.Name}
/if (${PetBuffGem[${i}].Equal[item]}) {
/echo Casting "${PetBuff[${i}]}" item 1s
/casting "${PetBuff[${i}]}" item 1s
} else /if (${PetBuffGem[${i}].Equal[alt]} && ${Me.AltAbilityReady[${PetBuff[${i}]}]}) {
/echo Casting "${PetBuff[${i}]}" alt 1s
/casting "${PetBuff[${i}]}" alt 1s
} else /if (${Me.CurrentMana}>${Spell[${PetBuffID[${i}]}].Mana}) {
/echo Casting "${PetBuffID[${i}]}" ${PetBuffGem[${i}]} 1s
/casting "${PetBuffID[${i}]}" ${PetBuffGem[${i}]} 1s
}
/target id ${MyTarget}
}
:NextPetBuff
/doevents
/delay 3s
/next i
}
/return
Sub Event_Pause
/if (${Pause}) {
/echo Macro is no longer Paused
/varset Pause 0
} else {
/echo Macro is now Paused
/varset Pause 1
}
/return
Sub Event_Nuke
/if (!${Nuke}) {
/echo Ice bombs Inc
/varset Nuke 1
} else {
/echo NO Nukes
/varset Nuke 0
}
/return
Sub Event_SelfBuffs
/if (!${SelfBuffs}) {
/echo Self Buffing Now
/varset SelfBuffs 1
} else {
/echo Buffs on Hold
/varset SelfBuffs 0
}
/return
Sub Event_PetBuffs
/if (!${PetBuffs}) {
/echo Buffing Pet Now
/varset PetBuffs 1
} else {
/echo Pet Buffs on Hold
/varset PetBuffs 0
}
/return
Sub Event_Debug
/if (!${Debug}) {
/echo I love Spam!! Debuggin Now
/varset Debug 1
} else {
/echo No more Spam!! Debuggin Off
/varset Debug 0
}
/return
Sub Event_Outdoors
/varset Outdoors FALSE
/echo setting outdoors False
/return
Sub Event_Zoned
/varset Outdoors TRUE
/echo setting outdoors True
/return
Sub Event_Slow
/if (!${DoSlow}) {
/echo Now Casting Slow
/varset DoSlow 1
} else {
/echo No Longer Casting Slow
/varset DoSlow 0
}
/return


