|- AFKMONK v3.1 -
|----------------
|Required Plugins: MQ2Melee Loaded (Dependant plugins MQ2Moveutils, MQ2Cast, MQ2Exchange, MQ2Bagwindow)
|Setup:
|-Set SpawnXLoc/YLoc for to pull spots
|-Set # of pull spots into locstospot
|-Set HealerName to any friend that wants to attend
|-Set Loot Array information on what you want
|---------------------------------------------------------------
|-Notes: MQ2Melee setup to do all combat and heals, and Feign Death on low health.
|
|-Version 3.0
|------------
|--Added NPC Pet Logic
|--Added Multi-Corpse Loot
|--Revamped Corpse Loot and added ON/OFF Functionality
|--Code Optimization (More ${Spawn}, less targets)
|--New Acquire Target Sub-Routine (Scrapped old one)
|--Removed Fight Timer
|--Added logic to sit after entire camp is cleared
|--Added Line of Sight Logic (Can be used in Dungeons now, not limited to open spaces)
|
|-Version 3.1 Monk Survivability package
|---------------------------------------
|--Added Mend after Fights
|--Defer Death at 40 percent
|--Epic 2.0 at 30 Percent
|--Impen at 20 Percent
|--Added Extended Line of Sight Logic with Event triggers
|--Minor Bug fixes
|--Item Clickies on downtime
#event Stunned "You are too distracted to use a skill.#*#"
#event Stunned "You are stunned#*#"
#event Stunned "You can't cast spells while stunned!#*#"
#event Stunned "You can't attack while stunned!#*#"
#event Stunned "You cannot use a skill while stunned!#*#"
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"
#event TargetSight "You cannot see your target.#*#"
Sub Main
/declare HealerName string outer healer
/declare myzone int outer ${Zone.ID}
/declare locstospot int outer 6 |***ENTER NUMBER OF SPAWN X,Y LOCs you put in***|
/declare dolootz int outer 1 |***Enter 1 to Enable Loot
|------------------------------------------------------------
|Loot Array Information.
|------------------------------------------------------------
/declare RV_LootArray[10] string outer
/varset RV_LootArray[1] "Diamond"
/varset RV_LootArray[2] "Spell"
/varset RV_LootArray[3] "Geode"
/varset RV_LootArray[4] "Powder"
/varset RV_LootArray[5] "Ore"
/varset RV_LootArray[6] "Paper"
/varset RV_LootArray[7] "Vellum"
/varset RV_LootArray[8] "Parchment"
/varset RV_LootArray[9] "Arcanum"
/varset RV_LootArray[10] "Taaffeite"
|------------------------------------------------------------
|DO NOT MODIFY VARIABLES DEFINED BELOW!!!
|------------------------------------------------------------
/declare targetspotted int outer 1
/declare currentspot int outer 1
|------------------------------------------------------------
|Declare Safe Players.
|------------------------------------------------------------
/alert add 2 pc ${HealerName}
/alert add 2 pc ${Me}
|>>>Sets up Waypoints that you will run to
/declare SpawnXloc[6] int outer
/varset SpawnXloc[1] -443
/varset SpawnXloc[2] -443
/varset SpawnXloc[3] -443
/varset SpawnXloc[4] -251
/varset SpawnXloc[5] -251
/varset SpawnXloc[6] -251
/declare SpawnYloc[6] string outer
/varset SpawnYloc[1] 1391
/varset SpawnYloc[2] 1515
/varset SpawnYloc[3] 1714
/varset SpawnYloc[4] 1714
/varset SpawnYloc[5] 1515
/varset SpawnYloc[6] 1391
|>>>Sets your camp at start of Macro
/declare RT_MyXLOC int outer ${Me.X}
/declare RT_MyyLOC int outer ${Me.Y}
/if (${Me.Pet}) /echo WARNING! Player Pet Detected... Please Dismiss
:mainwatch
/delay 10
/if (${Spell[Form of Endurance VIII].Stacks} && !${Me.Buff[Form of Endurance VIII].ID} && !${Me.Moving}) /casting "Mask of the Skinned Candy Hoarder"|face
/if (${Spell[Myrmidon's Skill IV].Stacks} && !${Me.Buff[Myrmidon's Skill IV].ID} && !${Me.Moving}) /casting "String of Candied Gems"|neck
/if (${Spell[Illusionary Spikes III].Stacks} && !${Me.Buff[Illusionary Spikes III].ID} && !${Me.Moving}) /casting "High Priest's Cloak"|back
/if (${Spell[Prismatic Ward IV].Stacks} && !${Me.Buff[Prismatic Ward IV].ID} && !${Me.Moving}) /casting "Daelai's Dandy Brush"|range
/if (${Spell[Master's Aura].Stacks[0]} && !${Me.Aura[Master's Aura].ID} && !${Me.Moving}) /casting "Master's Aura"
/if (${Me.Casting}) /delay 2s
/if (${myzone}!=${Zone.ID}) {
/doability "Feign Death"
/end
}
/call AquireTarget
/if (${Me.CombatState.Equal[COMBAT]}) /call Combatmelee
/call playercheck
/goto :mainwatch
/return
|--------------------------------------------------------------------------------
|SUB: Aquire Target
|--------------------------------------------------------------------------------
Sub AquireTarget
/if (${targetspotted}>${locstospot}) {
/varset targetspotted 1
/keypress esc
/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
/return
}
/call MoveToLoc ${SpawnYloc[${targetspotted}]} ${SpawnXloc[${targetspotted}]}
:Waitforspawn
/delay 1s
/if (${Me.State.Equal[STAND]}) /sit
/if (!${Spawn[NPC los targetable].ID}) /goto :Waitforspawn
/if (${NearestSpawn[NPC los targetable].Distance}<160) {
/target ${NearestSpawn[NPC los targetable]}
/varset currentspot ${targetspotted}
}
/if (${Target.ID}) {
/face
|/doability "Vigorous Shuriken Rk. III"
/ranged
:waitfortarget
/doevents
/delay 1s
/if (${Target.Distance}<30) {
/attack on
/return
}
/goto :waitfortarget
} else {
/varset targetspotted ${Math.Calc[${targetspotted}+1]}
}
/return
|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub Combatmelee
:combatstart
/doevents
/if (${Me.CombatState.Equal[COMBAT]} && !${Me.Combat}) {
/keypress esc
/delay 1s
/attack on
}
/if (${Target.Type.Equal[Corpse]}) /keypress esc
/if (${Target.Distance}>70) /keypress esc
|---------MONK STUFF------------------------|
/if ((${Me.CombatAbilityReady["Defer Death Rk. III"]}) && (${Me.PctHPs} < 40)) /doability "Defer Death Rk. III"
/if ((${Cast.Ready[Transcended Fistwraps of Immortality]}) && (${Me.PctHPs} < 30)) {
/casting "Transcended Fistwraps of Immortality" item
/delay 1s
}
/if ((${Me.CombatAbilityReady["Impenetrable Discipline"]}) && (${Me.PctHPs} < 20)) /doability "Impenetrable Discipline"
/if ((${Me.CombatAbilityReady["Fifth Wind Rk. II"]}) && (${Me.Endurance}<30000)) /doability "Fifth Wind Rk. II"
|---------END OF MONK STUFF-----------------|
/if (!${Target.ID}) {
/keypress esc
/if (${Spawn[NPC los targetable radius 50].ID}) {
/target ${NearestSpawn[NPC los targetable]}
/attack on
/goto :combatstart
}
/attack off
/if (${Me.AbilityReady["Mend"]}) /doability "Mend" |----DOES MEND IF UP AT END OF FIGHTS
/if (${dolootz}==1) /call Loot
/return
}
}
/goto :combatstart
/return
Sub Event_Stunned
/delay 1s
/return
Sub Event_TargetSight
/if (${Me.CombatState.NotEqual[COMBAT]}) {
/varset targetspotted ${Math.Calc[${targetspotted}+1]}
/call AquireTarget
}
/return
|--------------------------------------------------------------------------------
|SUB: Playercheck
|--------------------------------------------------------------------------------
Sub playercheck
/if (${Spawn[pc noalert 2 radius 400].ID}) {
:playerhold
/if (${Me.State.NotEqual[FEIGN]}) /doability "Feign Death"
/if (!${Spawn[pc noalert 2 radius 500].ID}) {
/stand
/return
}
/goto :playerhold
}
/return
Sub MoveToLoc(MoveToY, MoveToX)
/moveto loc ${MoveToY} ${MoveToX}|on
:moveToLocation
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} > 10) {
/delay 5
/goto :moveToLocation
}
/return
|--------------------------------------------------------------------------------
|SUB: Loot w/ Array
|--------------------------------------------------------------------------------
Sub Loot
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/target corpse radius 100
/stick 5 hold
:Moveto
/if (${Target.Distance} > 15) {
/delay 1s
/goto :Moveto
}
/stick off
/loot
/delay 1s
/if (!${Corpse.Items}) {
/goto :endofloot
}
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/nomodkey /shift /itemnotify ${Corpse.Item[${LootSlot}].InvSlot} leftmouseup
/delay 1s
|---------Keep Good Stuff---------------------
/for LootCheck 1 to ${RV_LootArray.Size}
/if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) {
/timed 5 /autoinventory
/delay 2s !${Cursor.ID}
}
/next LootCheck
|---------Destroy Bad Stuff-------------------
/if (${Cursor.ID}) {
/echo Destroying a ${Cursor.Name}...
/destroy
/delay 1s
}
/next LootSlot
:endofloot
/nomodkey /notify LootWnd LW_DoneButton leftmouseup
/delay 1s
/target corpse radius 100
/if (${Target.ID}) {
/stick 5 hold
/goto :Moveto
}
/return