|-Udated Highend Pull/Kill SK Style v1.12 by Unbeknownst2002
|-Pull/Kill Macro SK Style v1.11 by Lord_Vyper
|-Based on Pull/Kill Macro v1.1 by DigitalMocking
|-
|------------------------------------------------------------------------------------------|
|- Read all of the usage and intructions before complaining something is wrong. This is -|
|- not foolproof, but is much more user friendly than before. Please post if any errors -|
|- arise. Thanks, Unbeknownst2002. -|
|------------------------------------------------------------------------------------------|
|-
|- *Organizational thoughts:* Before starting the macro, you will want to make sure that your spells are
|- all memmed correctly. To keep it simple, I'll label each gem and what spell type you should have
|- in it for a quick reference.
|- Gem1: Pull Spell
|- Gem2: DebuffSpell w/ Recourse (default is Touch of Draygun)
|- Gem3: Lifetap
|- Gem4: unused
|- Gem5: unused
|- Gem6: AggroSpell
|- Gem7: DarknessSpell
|- Gem8: Selfbuff (default is Dark Bargain)
|- Gem9: Selfbuff (default is Cloak of Corruption)
|- *Gems 8 and 9 will be memmed and dememmed as appropriate for spells needed, but having Dark
|- Bargain and Cloak of Corruption up first will save you time*
|-
|- USAGE: /macro skpull.mac <pathfile> <Camp Radius> <Pull Range> <Home X Location> <Home Y Location>
|- the macro will set your anchor point to wherever you started it at. So run
|- to your camp, get set up and start pulling. If you define a home X/Y location
|- you will run immediately to that camp, and providing you haven't been hit by
|- any mobs, start pulling to the defined spot.
|- WARNING:Only use X and Y loc when NOT using a pathfile! Or, you will die.
|- If you provide a pathing file, the macro will run along the advpath file until it finds
|- a mob, run close enough to tag then return to the path and run back to camp. There is
|- currently NO CHECK for the amountof mobs that may come as adds... make sure you pick reasonable
|- paths. Don't bitch if you die. BEWARE: While using a pathfile, make sure your starting camp
|- is within radius of the first loc in your pathfile, i.e. start the sk pull macro where you begin
|- to record your path file. Also, do not loop your pathfile - travel one direction, not in circles
|-
|-
|- The macro will run towards a mob and pull with spell.
|- Currently it's set up for a shadow knight level 70+, run out, tag, run back to camp,
|- wait for the mob to come to you, and engage.
|-
|-
|- WARNING: If you use an intricate path and you are hit several times during your pull, you will die.
|- After being hit several times, the macro will automatically head back to your camp spot on a straight
|- line. Even if there is a wall between you and your camp spot. ALSO: Do not set camp in close quarter
|- areas. The stuck logic WILL go nuts. Pathing through tight areas is not so much a problem. However,
|- camping in a tight room, or with obstacles around - will cause problems. You will die.
|-
|-
|- .ini file settings. Name of the ini file is <charname>_pullbot.ini
|- Example file:
|- [Pathfiles]
|- The Plane of Tranquility=potqpath
|- The Lavastorm Mountains=lspath
|- The Plane of Disease=podpath
|- Wall of Slaughter=wosnwpath
|- [Excludes.The Plane of Disease]
|- Grimgor Plaguebringer=Exclude
|- an arachae crawler=Exclude
|- a feeble rat=Exclude
|- [Excludes.The Plane of Tranquility]
|- Adler Fuirstel=Exclude
|-
|-requirements: MQ2Moveutils plugin, advpath.inc, advpath2.inc
|- ** In case you missed that: You must have MQ2Moveutils installed and loaded
|- ** prior to running this macro, or its just not going to work for you at all
|-
|- Included in this file is an autolooter shamelessly stolen from mystikule.
|- (http://macroquest2.com/phpBB2/viewtopic.php?t=11022) See the attached thread
|- for information on the loot.ini file in your Release directory, but it really
|- is self explanitory.
|-
|- ChangeLog:
|- 10/10/06: Added GM check, more user friendly settings (i.e. LifeTaps, Epic, Leech
|- Touch), and mob fleeing logic (since it was removed from MQ2 Moveutils)
|- Also added OOC Regen logic.
|- 9/1/05: Tweaked add aggro management
|- 8/31/05: Added in med logic to sit for as long as it'd take to regen 100% mana. Worked on Got_Add timings (hopefully fixed)
|- 8/30/05: Variable-ized spells
|- 8/28/05: Changed around wait times, added in spell casting, made the damn bot stay when waiting for a mob to come in.
|-
|-Special thanks for code examples and snips from the following developers:
|- wizzyman, unknownerrors, override, a_druid_00, Cr4zyb4rd, Quagmire and others.
|- without their code, examples and postings, I never would have been able to write this.
|-
|-TODO
|- Better Pull checking for adds, ie: another target within X radius of your intended pull
#event MobDead "#*#You have slain#*#"
#event MobDead "#*#has been slain by#*#"
#event GotHit "#*#hits YOU for#*#"
#event GotHit "#*#slashes YOU for#*#"
#event GotHit "#*#crushes YOU for#*#"
#event GotHit "#*#bashes YOU for#*#"
#event GotHit "#*#kicks YOU for#*#"
#event GotHit "#*#smashes YOU for#*#"
#event GotHit "#*#mauls YOU for#*#"
#event GotHit "#*#gores YOU for#*#"
#event GotHit "#*#pierces YOU for#*#"
#event GotHit "#*#kicks YOU for#*#"
#event GotHit "#*#bashes YOU for#*#"
#event NotStanding "#*#You must be standing to attack!#*#"
#event NoSeeTarget "#*#You cannot see your target.#*#
#event NoSeeTarget "#*#You can't hit them from here#*#
#include advpath.inc
#include advloot.inc
#include spell_routines.inc
#Define DEBUG_1 "/squelch /echo"
#Define DEBUG_2 "/squelch /echo"
Sub Main
|- Set this for how far out you want your puller to check for mobs, anything beyond
|- this distance will be ignored
/declare CampRadius int outer 3000
|- This is the range of your Bow or ranged item.
/declare PullDistance int outer 65
|- If your choice of pulling has a minimum needed distance, set this. If you're using
|- spells, 0 is fine.
/declare MinPDistance int outer 0
|- Max and Min Z are variables relative to your starting camp.
/declare MaxZ int outer 350
/declare MinZ int outer -350
/declare AnnounceChannel string outer /echo
|- Set RoaminPulls to true and your pathfile is defined in the .ini file.
|- You can also call the macro with the pathfile being the first argument.
/declare RoamingPulls outer TRUE
|- If you want various spammy messages sent to you, set this to TRUE
/declare Verbose outer TRUE
/declare DEBUG outer FALSE
/declare DEBUG_GT outer FALSE
/declare LootMobs int outer 1
/declare CorpseList string outer 0
/declare CorpseRadius int outer 70
/declare MobsTooClose int outer 50
/declare CorpseAlertList int outer 70
/declare CorpseRotTime string outer 440s
/declare CorpseRotTimer timer outer
/declare CorpseRotSetTimer string outer FALSE
/declare LootINIFile string outer "${Me.Name}_loot.ini"
/declare useAutoLoot string outer FALSE
|- Pet. Not in use atm, but can be edited in further down. Pet implementation needs to be updated.
/declare PetSpell string outer "Shambling Minion"
/declare PetGem string outer gem7
/declare PetBuff string outer "Amplify Death Rk. II"
/declare PetBuffGem string outer gem7
/declare PetBuffName string outer Amplify Death Rk. II
|This is the percent at which you will use your Leech Touch ability to save your ass.
/declare LeechTouchPct string outer 25
|- Spells
|This is the percent and spell you will use as a life tap while fighting.
/declare LifeTapSpell string outer "Touch of Severan Rk. II"
/declare LifeTapGem string outer gem1
/declare LifeTapPct string outer 35
|This is for 2.0 usage when soloing. Comment out if you don't have it.
|/declare SKepic string outer "Innoruuk's Dark Blessing"
|/declare SKepicGem string outer item
|/declare SKepicPct string outer 38
|This is the darkness spell you want to use to keep your mob still when trying to flee, and the
| percentage to begin the check i.e. Mob Health < 20%, Fleeing, and Speed>20 - Festering Darkness
| will be cast
/declare DarknessSpell string outer "Festering Darkness"
/declare DarknessGem string outer gem4
/declare DarknessPct string outer 20
|What you're pulling with - not usually smart to use a higher snare, unless you like adds.
/declare PullSpell string outer "Challenge for Power Rk. II"
/declare PullGem string outer gem2
|What aggro spell you use when mob is great than 45 distance away. The distance variable can be
| changed below, but I like using AE Aggro for when I bot with cleric, enchanter and other classes
/declare AggroSpell string outer "Vilify"
/declare AggroGem string outer gem6
|-Debuff Spells during fight. First is name of spell in book, then gem you will use, and then the name
| of the buff it places in your buff box. You can add more of these in by copying and pasting them
| down below. Just rename to Debuff2 etc.
|/declare Debuff1 string outer "Touch of Draygun"
|/declare Debuff1Gem string outer gem2
|/declare Debuff1IconName string outer Gift of Draygun
|-Buffs. These will not be cast during combat, and include your clicky items. There is a check before and after
| combat for rebuffing.
/declare Buff1 string outer "Dark Bargain Rk. II"
/declare Buff1Gem string outer gem7
/declare Buff1IconName string outer Dark Bargain Rk. II
/declare Buff2 string outer "Cloak of Corruption"
/declare Buff2Gem string outer gem8
/declare Buff2IconName string outer Cloak of Corruption
/declare Buff3 string outer "Shroud of the Nightborn Rk. II"
/declare Buff3Gem string outer gem8
/declare Buff3IconName string outer Shroud of the Nightborn Rk. II
/declare Buff4 string outer "Bobbing Corpse"
/declare Buff4Gem string outer gem9
/declare Buff4IconName string outer Bobbing Corpse
/declare Buff5 string outer "Remorseless Demeanor Rk. II"
/declare Buff5Gem string outer gem8
/declare Buff5IconName string outer Remorseless Demeanor Rk. II
/declare Buff6 string outer "Stonewall Pauldrons"
/declare Buff6Gem string outer item
/declare Buff6IconName string outer Form of Defense I
|- Program Variables, not important.
/declare IniFile string outer ${Me.Name}_pullbot.ini
/declare HomeXLoc int outer ${Me.X}
/declare HomeYLoc int outer ${Me.Y}
/declare CRadius int outer 0
/declare TRadius int outer 0
/declare PRadius int outer 0
/declare HomeY int outer 0
/declare HomeX int outer 0
/declare StuckXLoc float outer 0.0
/declare StuckYLoc float outer 0.0
/declare Engaged outer FALSE
/declare DeadTarget outer FALSE
/declare RunHome outer FALSE
/declare Tagged outer FALSE
/declare PathFile string outer
/declare WaitTimer timer outer
/declare Pulling outer FALSE
/declare Berated outer FALSE
/declare OldItem string outer
/declare PetTaunt bool outer FALSE
/declare Darkness bool outer FALSE
/declare SitTime int outer 0
/if (${Defined[Param0]}) {
/varset PathFile ${Param0}
} else {
/varset PathFile ${Ini[${IniFile},Pathfiles,${Zone}]}
}
/if (${Defined[Param1]}) /varset CampRadius ${Param1}
/if (${Defined[Param2]}) /varset PullDistance ${Param2}
/if (${Defined[Param3]} && ${Defined[Param4]}) {
/if (${DEBUG}) /echo in the homex homey loop
/varset HomeXLoc ${Param3}
/varset HomeYLoc ${Param4}
/call ReturnHome
}
/call InitAPFVars 1 15 20
:Main_Loop
/call CheckForGMs
/echo GM Check
/doevents
DEBUG_1 Calling PullMob from :Main_Loop
/call PullMob
DEBUG_1 Calling KillTarget from :Main_Loop
/call KillTarget
DEBUG_1 Calling ReadyForNext from :Main_Loop
/call ReadyForNext
DEBUG_1 Calling ResetVars from :Main_Loop
/call ResetVars
/goto :Main_Loop
/return
Sub PullMob
DEBUG_1 Entered PullMob
|- Normal buffs to keep up. This is for buffing outside of combat
/if (!${Me.Buff[${Buff1IconName}].ID} && !${Me.Combat}) /call cast ${Buff1} ${Buff1Gem}
/if (!${Me.Buff[${Buff2IconName}].ID} && !${Me.Combat}) /call cast ${Buff2} ${Buff2Gem}
/if (!${Me.Buff[${Buff3IconName}].ID} && !${Me.Combat}) /call cast ${Buff3} ${Buff3Gem}
/if (!${Me.Buff[${Buff4IconName}].ID} && !${Me.Combat}) /call cast ${Buff4} ${Buff4Gem}
/if (!${Me.Buff[${Buff5IconName}].ID} && !${Me.Combat}) /call cast ${Buff5} ${Buff5Gem}
| /if (!${Me.Buff[${Buff6IconName}].ID} && !${Me.Combat}) /call cast ${Buff6} ${Buff6Gem}
| /if (!${Me.Buff[${Buff7IconName}].ID} && !${Me.Combat}) /call cast ${Buff7} ${Buff7Gem}
| /if (!${Me.Buff[${Buff8IconName}].ID} && !${Me.Combat}) /call cast ${Buff8} ${Buff8Gem}
| /if (!${Me.Buff[${Buff9IconName}].ID} && !${Me.Combat}) /call cast ${Buff9} ${Buff9Gem}
| /if (!${Me.Buff[${Buff10IconName}].ID} && !${Me.Combat}) /call cast ${Buff10} ${Buff10Gem}
| /if (!${Me.Buff[${Buff11IconName}].ID} && !${Me.Combat}) /call cast ${Buff11} ${Buff11Gem}
:Pull_Loop
/call AdvPathPoll
/call GetTarget
/if (${Target.ID} && ${Target.Distance} < ${PullDistance}) {
/if (${Target.CurrentHPs} >= 100) {
/call TagTarget
}
} else /if (${Target.Distance} > ${PullDistance} && ${Target.Distance} < ${CampRadius}) {
/if (${Target.CurrentHPs} >= 100) {
/call MoveToTarget
}
}
/if (${Tagged} && ${Math.Distance[${HomeYLoc},${HomeXLoc}]} > 25) {
/call ReturnHome
DEBUG_1 Leaving PullMob 1
/return
} else /if (${Tagged}) {
DEBUG_1 Leaving PullMob 2
/return
}
/if (${PathingFlag}==0 && ${RoamingPulls}) /call StartPullPath
/goto :Pull_Loop
DEBUG_1 Leaving PullMob 3
/return
Sub StartPullPath
DEBUG_1 Entering StartPullPath
/delay 3
/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]} < 50) /call PlayFunction "${PathFile} 1 nf pp noz"
DEBUG_1 Leaving StartPullPath
/return
Sub ReturnHome
DEBUG_1 Entered ReturnHome
/if (${RoamingPulls} && ${PathingFlag}==1) {
/call AdvPathPoll
/if (${PathingFlag}==1) {
/echo stop
/doevents
/call AdvPathPoll
/call PlayFunction "${PathFile} 1 cr nopp noz"
}
:LoopTilThere
/if (${PathingFlag}==1) {
/call AdvPathPoll
/delay 1
/doevents
/goto :LoopTilThere
}
/if (${Target.ID}) /face fast nolook
DEBUG_1 Leaving PullPath 1
/return
}
:MoveHome
/doevents
/face fast nolook loc ${HomeYLoc},${HomeXLoc}
/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}>10) /keypress forward hold
/call AreWeStuck
/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}<10) {
/keypress forward
/keypress back
DEBUG_1 Leaving PullPath 2
/return
}
/goto :MoveHome
/delay 1
/if (${Target.ID}) /face fast nolook
/varset RunHome FALSE
DEBUG_1 Leaving PullPath 3
/return
Sub GetTarget(int TRadius)
DEBUG_1 Entering GetTarget
/if (${DEBUG_GT}) /echo In Sub GetTarget
/declare s int local
/declare i int local 1
/for i 1 to 4
/varset s ${NearestSpawn[${i},npc radius ${CampRadius}].ID}
/if (${Debug}) /echo Inifile value for ${Spawn[${s}].CleanName}: ${Ini[${IniFile},"Excludes.${Zone}","${Spawn[${s}].CleanName}"]}
/if (${Ini[${IniFile},"Excludes.${Zone}","${Spawn[${s}].CleanName}"].Equal[Exclude]}) {
/if (${DEBUG_GT}) /echo Ignoring ${Spawn[${s}].CleanName} because of ini file inclusion.
/next i
}
/if (${Spawn[${s}].Type.Equal["Corpse"]} || !${Spawn[${s}].LineOfSight} || ${Math.Distance[${Me.Z}:${Spawn[${s}].Z}]} >${MaxZ} || ${Math.Distance[${Me.Z}:${Spawn[${s}].Z}]}<${MinZ}) {
/if (${DEBUG_GT}) /echo Ignoring ${Spawn[${s}].CleanName} because LoS, Corpse or Z axis
/next i
}
/if (${s} && ${Spawn[${s}].Distance} < ${CampRadius} && ${Spawn[${s}].LineOfSight} && ${Math.Distance[${Me.Z}:${Spawn[${s}].Z}]} < ${MaxZ} && ${Math.Distance[${Me.Z}:${Spawn[${s}].Z}]} > ${MinZ} && !${Spawn[${s}].Type.Equal["Corpse"]}) {
/if (${DEBUG_GT}) /echo Leaving GetTarget because spawn is at: ${Spawn[${s}].Distance}
/if (${DEBUG_GT}) /echo Targeting ID ${s}
/delay 1
/squelch /target id ${s}
/if (${Verbose}) /echo ${Target.Name} Has been aquired at distance ${Target.Distance}
/if (${Verbose}) ${AnnounceChannel} Incoming with [ %t ]
DEBUG_1 Leaving GetTarget 1
/return
}
/next i
DEBUG_1 Leaving GetTarget 2
/return
Sub MoveToTarget
DEBUG_1 Entering MoveToTarget
/declare px int local ${Me.X}
/declare py int local ${Me.Y}
/if (!${Target.ID}) /return
/if (${Target.Distance} < ${PullDistance} ) /return
:Moving
/doevents
/face fast nolook
/keypress forward hold
|/call AreWeStuck
/if (${Target.Distance} >= ${PullDistance}) /goto :Moving
/keypress forward
/keypress back
/call TagTarget
:Moving2
/doevents
/face fast nolook loc ${py},${px}
/if (${Math.Distance[${py},${px}]}>10) /keypress forward hold
/call AreWeStuck
/if (${Math.Distance[${py},${px}]}<10) /goto :DoneMoving2
/goto :Moving2
:DoneMoving2
DEBUG_1 Leaving MoveToTarget 1
/return
Sub AreWeStuck
DEBUG_1 Entering AreWeStuck
/doevents
/declare counter int local 0
/declare i int local 0
/varset StuckXLoc ${Me.X}
/varset StuckYLoc ${Me.Y}
/delay 2
/if (${StuckXLoc}==${Me.X} && ${StuckYLoc}==${Me.Y}) {
/if (${DEBUG}) /echo Calling MoveAround from inside of AreWeStuck /if statement
/call MoveAround
}
DEBUG_1 Leaving AreWeStuck 1
/return
Sub MoveAround
DEBUG_1 Entering MoveAround
/keypress forward
/keypress back hold
/delay 3
/keypress back
/if (${Math.Rand[2]}) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay 10
/keypress strafe_right
/keypress strafe_left
DEBUG_1 Leaving MoveAround 1
/return
Sub TagTarget
DEBUG_1 Entering TagTarget
/doevents
/if (${Target.Distance} >= ${PullDistance}) {
/if (${DEBUG}) /echo Not Close enough, even though we're Supposed to be!
/call ResetVars
DEBUG_1 Leaving TagTarget 1
/return
}
|- What you use to pull, and whatever you want to happen during the pulling sequence
|- This setup casts your pull spell and sics your pet (previously casted darkness,
|- which is not the best pulling spell for most sks)
/face fast nolook
/delay 2s
/keypress back
/keypress left
/call Cast ${PullSpell} ${PullGem}
/varset Tagged TRUE
DEBUG_1 Leaving TagTarget 2
/return
Sub KillTarget
DEBUG_1 Entered KillTarget
/pet attack
/delay 1
/if (!${Target.ID}) {
DEBUG_1 Leaving KillTarget 1
/return
}
/face fast nolook
/declare counter int local 0
DEBUG_1 Moving to :WaitForMob in Sub KillTarget
:WaitForMob
/if (${Target.Distance} > 50) {
/keypress back
/delay 5
/varcalc counter ${counter}+1
/if (${counter} > 100) {
/call cast ${DarknessSpell} ${DarknessGem}
/goto :Combat
}
/goto :WaitForMob
}
DEBUG_1 Moving to :Combat in Sub KillTarget
:Combat
/call cast ${AggroSpell} ${AggroGem}
/if (${Target.ID}) {
/face fast nolook
}
|- SK's weird buff/debuffs covered here
/if (${Target.Fleeing} && ${Target.Speed} > 20) {
/keypress back
/call cast ${DarknessSpell} ${DarknessGem}
/stick behind 8
}
/if (${Me.Combat}) {
:premc
| /if (${Me.PctHPs}<91 && ${Me.Buff[Mortal Coil].ID}) /goto :premc
/if (${Me.PctHPs}<=${LeechTouchPct}) /alt activate 87
/if (${Me.PctHPs}<=${LifeTapPct}) /call cast ${LifeTapSpell} ${LifeTapGem}
| /if (${Me.PctHPs}<${SKepicPct}) /call cast ${SKepic} ${SKepicGem}
/if (${Me.PctHPs}<78 && ${Me.Song[Remorselessness].ID}) /call cast ${LifeTapSpell} ${LifeTapGem}
| /if (!${Me.Buff[${Debuff1IconName}].ID}) /call cast ${Debuff1} ${Debuff1Gem}
}
/if (${Target.Distance} > 140) {
/if (${DEBUG_GT}) /echo Target Clear 1 in KillTarget
/target clear
/varset Engaged FALSE
DEBUG_1 Leaving KillTarget 3
/return
}
/if (!${Me.Combat} && ${Target.Distance} < 70 && !${RaidMode}) /squelch /stick 8 moveback
/if (!${Me.Combat} && ${Target.Distance} < ${Target.MaxRangeTo}) /attack on
/if (!${Me.TargetOfTarget.Name.Equal[${Me}]}) /if (${Target.Distance} < 25 && ${Me.AbilityReady["Taunt"]} && !${RaidMode}) {
/doability "Taunt"
/call cast ${AggroSpell} ${AggroGem}
}
/if (!${Target.ID} || ${Target.Type.Equal[Corpse]}) {
/if (${DEBUG_GT}) /echo Target Clear 2 in KillTarget
/squelch /target clear
/delay 3
/attack off
/delay 3
/call CheckForAdd
/if (${Target.ID}) /call KillTarget
/doevents MobDead
DEBUG_1 Leaving KillTarget 4
/return
}
/doevents NotStanding
/doevents NoSeeTarget
/goto :Combat
DEBUG_1 Leaving KillTarget 5
/return
Sub CheckForGMs
/if ( ( ${Spawn[gm].ID} ) || ( ${Spawn[GM].ID} ) || ( ${Spawn[guide].ID} ) || ( ${Spawn[Guide].ID} ) ) {
/delay 10s !${Me.Casting.ID}
/beep
/beep
/echo GM or Guide detected in zone.
/echo Macro Terminating...
/who all GM
/delay 1s
/camp desktop
/delay 1s
/who GM
/delay 1s
/keypress Num_-
/delay 2s
/end
}
/return
Sub ReadyForNext
DEBUG_1 Entered ReadyForNext
|- Normal buffs to keep up. This is for buffing after the main kill loop.
/if (!${Me.Buff[${Buff1IconName}].ID} && !${Me.Combat}) /call cast ${Buff1} ${Buff1Gem}
/if (!${Me.Buff[${Buff2IconName}].ID} && !${Me.Combat}) /call cast ${Buff2} ${Buff2Gem}
/if (!${Me.Buff[${Buff3IconName}].ID} && !${Me.Combat}) /call cast ${Buff3} ${Buff3Gem}
/if (!${Me.Buff[${Buff4IconName}].ID} && !${Me.Combat}) /call cast ${Buff4} ${Buff4Gem}
/if (!${Me.Buff[${Buff5IconName}].ID} && !${Me.Combat}) /call cast ${Buff5} ${Buff5Gem}
| /if (!${Me.Buff[${Buff6IconName}].ID} && !${Me.Combat}) /call cast ${Buff6} ${Buff6Gem}
| /if (!${Me.Buff[${Buff7IconName}].ID} && !${Me.Combat}) /call cast ${Buff7} ${Buff7Gem}
| /if (!${Me.Buff[${Buff8IconName}].ID} && !${Me.Combat}) /call cast ${Buff8} ${Buff8Gem}
| /if (!${Me.Buff[${Buff9IconName}].ID} && !${Me.Combat}) /call cast ${Buff9} ${Buff9Gem}
| /if (!${Me.Buff[${Buff10IconName}].ID} && !${Me.Combat}) /call cast ${Buff10} ${Buff10Gem}
| /if (!${Me.Buff[${Buff11IconName}].ID} && !${Me.Combat}) /call cast ${Buff11} ${Buff11Gem}
}
:medloop
/if (${Me.PctMana}>20) /return
/if (${Me.PctMana}<20 && ${Me.CombatState.Equal[COOLDOWN]}) {
/sit on
/delay 31s
}
/if (${Me.PctMana}<35 && ${Me.CombatState.Equal[RESTING]}) {
/echo OOC Regen for 2 minutes...
/delay 120s
/stand
/return
} else {
/echo Not able to OOC Regen yet...
/goto :medloop
}
DEBUG_1 Leaving ReadyForNext
/return
Sub ResetVars
/doevents
/delay 1
/attack off
/if (${DEBUG_GT}) /echo Target Clear 1 in ResetVars
/squelch /target clear
/squelch /keypress esc
/varset Engaged FALSE
/varset DeadTarget FALSE
/varset Pulling FALSE
/varset Tagged FALSE
/varset TRadius 0
/varset Darkness FALSE
/varset SitTime 0
/return
Sub Event_GotHit
/if (${RunHome}) /return
/if (!${Engaged}) {
/doevents
/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}>50) {
/call ReturnHome
}
/if (${DEBUG_GT}) /echo Target npc in Event_gotHit
/call CheckForAdd
/if (${Target.ID}) {
/varset Engaged TRUE
/call KillTarget
}
}
/return
Sub Event_NotStanding
/if (${RunHome} || !${Engaged}) /return
/if (${DEBUG}) /echo Calling MoveAround and ResetVars from inside of Event_NotStanding
/call MoveAround
/if (${Engaged}) {
/call MoveAround
/squelch /stick 8 ${Target.ID} moveback
/return
}
/if (${Pulling}) {
/call MoveAround
/call GetTarget
/return
}
/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}>10) {
/if (${DEBUG}) /echo Calling ReturnHome from inside of Event_NotStanding
/call ReturnHome
}
/return
Sub Event_NoSeeTarget
/if (${RunHome} || !${Engaged} || ${Pulling}) /return
/if (${Engaged} && ${Target.ID}) {
/face nolook fast
/squelch /stick 8 moveback
/call PullMOb
/return
}
/if (${BadSpawn}) {
/varcalc PullAttempts (${PullAttempts}+1)
/if (${PullAttempts} > 2) {
/call ResetVars
/call ReturnHome
/return
}
}
/varset BadSpawn TRUE
/varset IgnoreSpawn ${Target.ID}
/if (${DEBUG}) /echo Calling MoveAround and TagTarget from inside of Event_NoSeeTarget
/if (${DEBUG}) /echo IgnoreSpawn set: ${IgnoreSpawn}
/call MoveAround
/call MoveToTarget
/call TagTarget
/if (${Math.Distance[${HomeYLoc},${HomeXLoc}]}>50) {
/if (${DEBUG}) /echo Calling ReturnHome from inside of NoSeeTarget
/call ReturnHome
}
/return
Sub CheckForAdd
DEBUG_1 In Sub CheckForAdd
/declare s int local
/declare i int local
/for i 1 to 3
/varset s ${NearestSpawn[${i},npc].ID}
/if (${Spawn[${s}].Type.Equal["Corpse"]} || !${Spawn[${s}].LineOfSight}) /next i
/if (${Spawn[${s}].Distance} < 80 && ${Spawn[${s}].LineOfSight}) {
/if (${DEBUG_GT}) /echo Target id ${s} in CheckForAdd
/squelch /target id ${s}
/goto :Got_Add
}
/next i
DEBUG_1 Leaving Sub CheckForAdd 1
/return
:Got_Add
/varset Engaged TRUE
/face nolook fast
/squelch /stick 8 moveback
/delay 1s
/Doability "Taunt"
/call cast ${AggroSpell} ${AggroGem}
/delay 3s
DEBUG_1 LeavingSub CheckForAdd 2
/return
Sub Event_MobDead
|- Lets make sure to clear any adds or pets that may not have hit us before we loot
|- We'll call GetTarget with a very small radius, for just our camp
/call CheckForAdd
/if (${Target.ID}) {
/call TagTarget
/call KillTarget
/return
}
/delay 3
/if (${LootMobs}==1 && !${Me.Moving}) /call LootMobs
/return