#include spell_routines.inc
#turbo 10
#Event Slain "#*# slain#*#"
#Event Zoned "LOADING, PLEASE WAIT..."
Sub Main
|------------------------------------------------------------
|How far would you like to target a mob?
|------------------------------------------------------------
/declare RV_MaxRadius int outer 300
/declare Spell1 string outer "NAME HERE"
/declare Spell2 string outer "NAME HERE"
|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare RV_MyTargetID int outer 0
/declare RV_MyTargetName string outer
/declare RV_MyTargetDead int outer 0
/declare RV_HasTarget int outer 0
|------------------------------------------------------------
|I think this is the right MQ2MElee Command to turn on
|automatic Ranged attacks to be with in your desired range.
|------------------------------------------------------------
/melee range ${RV_MaxRadius}
:Start
/doevents
/call GMCheck
/call GetTarget
/if (${RV_HasTarget}) /call CombatSub
/call ResetSub
/goto :Start
/return
|--------------------------------------------------------------------------------
|SUB: GMCheck
|--------------------------------------------------------------------------------
Sub GMCheck
/if (${Spawn[gm].ID}) {
/beep
/beep
/beep
/echo GM has entered the zone!
/echo FUCK HIM but ending the macro...
/keypress forward
/keypress back
/quit
/endmacro
}
/return
|--------------------------------------------------------------------------------
|SUB: Get Target
|--------------------------------------------------------------------------------
Sub GetTarget
/doevents
/declare RV_CurrentRadius int local
/declare RV_TargetSub int local
/echo Looking for Mobs
/doevents
/for RV_CurrentRadius 100 to ${RV_MaxRadius} step 5
/if (${Target.ID}) {
/squelch /target radius ${RV_CurrentRadius} npc
/varset RV_MyTargetID ${Target.ID}
/varset RV_MyTargetName ${Target.Name}
/echo Acquired ${Target.Name} at range ${Int[${Target.Distance}]}
/varset RV_HasTarget=1
/return
}
/next RV_CurrentRadius
/return
|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub CombatSub
/doevents
/echo Attacking Mob NOW!
:CombatLoop
/if (!${Me.Combat}) /attack on
/if (${Target.PctHPs}<50) /call cast "${Spell1}"
/if (${Target.PctHPs}<50) /call cast "${Spell2}"
/if (!${Target.ID}) /return
/if (!${RV_TargetDead}) /goto :CombatLoop
/doevents
/return
|--------------------------------------------------------------------------------
|SUB: Slain
|--------------------------------------------------------------------------------
Sub Event_Slain
/varset RV_TargetDead 1
/target clear
/keypress forward
/keypress back
/return
|--------------------------------------------------------------------------------
|SUB: Zoned
|--------------------------------------------------------------------------------
Sub Event_Zoned
/echo Zoned
/delay 60s
/quit
/endmacro
|--------------------------------------------------------------------------------
|SUB: Reset
|--------------------------------------------------------------------------------
Sub ResetSub
/doevents
/varset RV_HasTarget 0
/varset RV_TargetDead 0
/return