|--------------------------------------------------------------------------|
| Killandloot.mac v1.0 by Mattr33 |
| |
| This is a simple kill and loot macro. Requirements for this to run: |
| Plugins: MQ2Melee and MQ2Moveutils (and setup properly for class |
| Inc files: ninjadvloot.inc and spell_routines.inc |
| |
| Start macro with /mac killandloot |
| Then when you either have a mob targeted and start attacking it |
| (it detects when you go into "Combat State" (crossed swords), or |
| a mob hits you (sitting AFK in a corner somewhere), it will fight |
| the mob, and then once dead, wait a specified number of seconds |
| to see if any other mobs are around you and already attacking you, |
| then it will loot the corpses around you. |
| |
| To modify the loot parameters, edit the loot.ini file under |
| settings to change if you loot mobs, radius to check for corpses, |
| radius to check for other mobs and corpse rot time. |
| |
| To change adjust snare settings see the declare settings below to |
| set that. Ranger AA Entrap is untested since I don't have a ranger. |
| |
| GM checking will have PC go afk and then check zone to see if GM |
| is in it every 3 minutes. After GM leaves it will resume macro. |
| I didn't get a chance to test this part. |
|--------------------------------------------------------------------------|
#include ninjadvloot.inc
#include spell_routines.inc
#Event Killthis "#*#YOU#*#points of damage"
#Event Snareresist "#*#Your target resisted the Ensnare spell#*#"
Sub Main
|---------Put the name of your snare spell here-----------------------------|
/declare snarespell string outer Ensnare
|---------------------------------------------------------------------------|
|---------Put gem number for snare spell here-------------------------------|
/declare snarespellgem int outer 3
|---------------------------------------------------------------------------|
|---------Change value to 1 if Ranger has AA Entrap-------------------------|
/declare AAEntrap int outer 0
|---------------------------------------------------------------------------|
|---Change value to 0 if you don't want macro to snare----------------------|
/declare snaring int outer 1
|---------------------------------------------------------------------------|
|---Change to what the mobs hp will be at when snare is cast (default 25)---|
/declare snarehp int outer 75
|---------------------------------------------------------------------------|
|---Change to how much time to wait after targets are all killed to loot----|
/declare timetowait int outer 5
|---------------------------------------------------------------------------|
|-----DONT CHANGE THIS------|
/declare mobsnared int outer 0
|---------------------------|
/call SetupAdvLootVars
:Main
/if (${Spawn[gm].ID}) /call GM
/varset mobsnared 0
/if (${Target.ID} && ${Me.CombatState.Equal[COMBAT]}) {
/echo Have target that I'm fighting
/call Event_Killthis
}
/doevents
/goto :Main
/return
Sub Event_Killthis
/attack
:Killoop
/if (!${Target.ID} || ${Target.Type.Equal[Corpse]}) {
/echo Target is dead
/keypress esc
/attack off
/delay ${timetowait}s
/if (${Target.ID}) {
/attack
/goto :Killoop
}
/echo Going to loot corpses now
/call Lootmobs
/echo Done Looting
/cleanup
/return
}
/if (${Target.PctHPs} < ${snarehp} && ${snaring}==1) /call Snare
/goto :Killoop
/return
Sub Snare
/if (${mobsnared}==1) /return
/if (${AAEntrap}==1 && ${Me.AltAbilityReady[entrap]}) /call cast "Entrap" alt
/call cast ${snarespell} gem${snarespellgem} 7s
/delay 5
/doevents
/varset mobsnared 1
/popup ${Target.CleanName} is snared
/return
Sub Event_Snareresist
/popup Snare was resisted, retrying!
/call Snare
/return
Sub GM
:GMCheck
/echo GM is in zone! Going AFK and pausing macro for 3 minutes and then will check again for GM
/beep
/beep
/afk
/delay 3m
/if (!${Spawn[gm].ID}) {
/echo GM is gone, resuming macro
/afk
/return
}
/goto GMCheck
/return