Suggestions please - necro mac
Posted: Mon Oct 25, 2004 11:46 am
This is not my macro, I have edited in things that suit my character - but I take no credit for the main structure...
http://www.macroquest2.com/phpBB2/viewtopic.php?t=9042
Originally posted by Terramantian
My problem is with failed feign deaths, the event isnt handling properly, and if my necro does actually FD, when he stands he isnt returning to his home position.
In addition, the mac has my necro pulling and killing mobs that are under the world, but when it comes to the lootnpc it spams an assload of target out of range, any suggestion for adding in an #event farloot "#*#You are to far to loot#*#" (and yes, i wrote that in, but it wont reconize, or call to the event) ..
-Twisted82-
Im just a noob, trying to get a nut.
http://www.macroquest2.com/phpBB2/viewtopic.php?t=9042
Originally posted by Terramantian
Code: Select all
#turbo
#include spell_routines.inc
#include move.inc
#define PetSpell "Haunting Corpse"
#define PetHaste "Intensify Death"
#define SnareDOT "Engulfing Darkness"
#define DamageDOT "Heat Blood"
#define DamageDOT2 "Heart Flutter"
#define Lifetap "Siphon Life"
#define LichSpell "Allure of Death"
#event Fail "#*#has fallen to the ground#*#"
#event FarLoot "#*#You are to far away to loot that corpse.#*#"
#event Hit "#*#YOU for#*#"
Sub Main
/declare HomeX int outer ${Me.X}
/declare HomeY int outer ${Me.Y}
/declare PetHastT timer outer
/declare SnareT timer outer
/declare DamageT timer outer
/declare Damage2T timer outer
/declare MOB int outer
/declare EndX int outer
/declare EndY int outer
/declare PetAttacking bool outer
/declare MoveDelay int outer
/declare LootSlot int outer 1
/if ((${String[${Me.Heading}].Equal[N]}) || (${String[${Me.Heading}].Equal[NNW]}) || (${String[${Me.Heading}].Equal[NNE]})) {
/varset EndY ${Math.Calc[${Me.Y} + 350]}
/varset EndX ${Me.X}
} else /if (${String[${Me.Heading}].Equal[NE]}) {
/varset EndY ${Math.Calc[${Me.Y} + 240]}
/varset EndX ${Math.Calc[${Me.X} - 240]}
} else /if ((${String[${Me.Heading}].Equal[E]}) || (${String[${Me.Heading}].Equal[ENE]}) || (${String[${Me.Heading}].Equal[ESE]})) {
/varset EndY ${Me.Y}
/varset EndX ${Math.Calc[${Me.X} - 350]}
} else /if (${String[${Me.Heading}].Equal[SE]}) {
/varset EndY ${Math.Calc[${Me.Y} - 240]}
/varset EndX ${Math.Calc[${Me.X} - 240]}
} else /if ((${String[${Me.Heading}].Equal[S]}) || (${String[${Me.Heading}].Equal[SSW]}) || (${String[${Me.Heading}].Equal[SSE]})) {
/varset EndY ${Math.Calc[${Me.Y} - 350]}
/varset EndX ${Me.X}
} else /if (${String[${Me.Heading}].Equal[SW]}) {
/varset EndY ${Math.Calc[${Me.Y} - 240]}
/varset EndX ${Math.Calc[${Me.X} + 240]}
} else /if ((${String[${Me.Heading}].Equal[W]}) || (${String[${Me.Heading}].Equal[WNW]}) || (${String[${Me.Heading}].Equal[WSW]})){
/varset EndY ${Me.Y}
/varset EndX ${Math.Calc[${Me.X} + 350]}
} else /if (${String[${Me.Heading}].Equal[NW]}) {
/varset EndY ${Math.Calc[${Me.Y} - 240]}
/varset EndX ${Math.Calc[${Me.X} + 240]}
}
/call Initialize
:Loop
/call PullMob
/call KiteMob
/varset PetAttacking 0
/call Downtime
/goto :Loop
/return
Sub Initialize
/if (!${Me.Pet.ID}) /call Cast "PetSpell"
/pet guard here
/pet taunt off
/call Cast "PetHaste"
/varset PetHastT ${Math.Calc[${Spell[PetHaste].Duration} * 6]}s
/call Cast "LichSpell"
:MedCheck
/if (${Me.PctMana} < 70) {
/if (!${Me.Sitting}) /sit
/delay 1m (${Me.PctMana} > 90)
/goto :MedCheck
}
/return
Sub PullMob
:PullBegin
/doevents
/varset MOB ${Spawn[nopcnear 400 npc range ${Math.Calc[${Me.Level} * .75]} ${Me.Level} radius 1000].ID}
:TarLoop
/if ((${Spawn[id ${MOB}].PctHPs} < 100) || (!${String[${Spawn[${MOB}].Type}].Compare["Pet"]})) {
/varset MOB ${Spawn[nopcnear 400 npc id ${MOB} range ${Math.Calc[${Me.Level} * .75]} ${Me.Level} radius 1000 next].ID}
/goto :TarLoop
}
/call MoveToSpawn ${MOB} 120
/target id ${MOB}
/assist
/delay 1s
/doevents
/if ((${Target.ID} != ${MOB}) && (${Target.ID} != ${Me.ID})) {
/call MoveToLoc ${HomeY} ${HomeX}
/goto :PullBegin
}
/if (${Target.PctHPs} < 100) /goto :PullBegin
/doevents
/call Cast "SnareDOT"
/if (!${Macro.Return.Equal[CAST_SUCCESS]}) {
/call Cast "Feign Death"
/doevents
/delay 1m (${Target.Distance} > 100)
/call MoveToLoc ${HomeY} ${HomeX}
/goto :PullBegin
}
/varset SnareT ${Math.Calc[${Spell[SnareDOT].Duration} * 6]}s
/call MoveToLocF ${HomeY} ${HomeX} 150
/return
Sub KiteMob
:KiteLoop
/doevents
/call MoveToLocF ${EndY} ${EndX} 200
/call GMCheck
/if (!${Target.ID}) /return
/doevents
/if (${SnareT} <= 200) {
/call Cast "SnareDOT" 6s
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset SnareT ${Math.Calc[${Spell[SnareDOT].Duration} * 6]}s
}
/if (${SnareT} == 0) {
/echo Snare resisted, or not on target.
/call Cast "Feign Death"
/if (${Me.Buff[LichSpell].ID}) /notify BuffWindow Buff${Int[${Math.Calc[${Me.Buff[LichSpell].ID}-1]}]} leftmouseup
/doevents
/delay 1m (${Target.Distance} > 100)
/echo 1 Minute Passed.
/call MoveToLoc ${HomeY} ${HomeX}
}
/if ((${Target.Distance} > ${Math.Calc[${Target.Speed} / 4 * ${Spell[Lifetap].MyCastTime}]}) && (${Me.PctHPs} < 80)) {
/call Cast "Lifetap"
}
/if ((${Target.Distance} > ${Math.Calc[${Target.Speed} / 4 * ${Spell[DamageDOT].MyCastTime}]}) && (${DamageT} <= 150)) {
/call Cast "DamageDOT"
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset DamageT ${Math.Calc[${Spell[DamageDOT].Duration}* 6]}s
}
/if ((${Target.Distance} > ${Math.Calc[${Target.Speed} / 4 * ${Spell[DamageDOT2].MyCastTime}]}) && (${Damage2T} <= 150)) {
/call Cast "DamageDOT2"
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset Damage2T ${Math.Calc[${Spell[DamageDOT2].Duration}* 6]}s
}
/if ((!${PetAttacking}) && (${Target.PctHPs} < 65)) {
/pet attack
/varset PetAttacking 1
}
/delay 10s (${Target.Distance} <= 50)
/face fast nolook
/if (!${Target.ID}) /return
/keypress strafe_right hold
/delay 20
/keypress strafe_right
/call MoveToLocF ${HomeY} ${HomeX} 200
/if (!${Target.ID}) /return
/doevents
/if (${SnareT} <= 200) {
/call Cast "SnareDOT" 12s
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset SnareT ${Math.Calc[${Spell[SnareDOT].Duration} * 6]}s
}
/if (${SnareT} == 0) {
/echo Snare resisted, or not on target.
/call Cast "Feign Death"
/if (${Me.Buff[LichSpell].ID}) /notify BuffWindow Buff${Int[${Math.Calc[${Me.Buff[LichSpell].ID}-1]}]} leftmouseup
/doevents
/delay 1m (${Target.Distance} > 100)
/echo 1 Minute Passed.
/call MoveToLoc ${HomeY} ${HomeX}
}
/if ((${Target.Distance} > ${Math.Calc[${Target.Speed} / 4 * ${Spell[Lifetap].MyCastTime}]}) && (${Me.PctHPs} < 80)) {
/call Cast "Lifetap"
}
/if ((${Target.Distance} > ${Math.Calc[${Target.Speed} / 4 * ${Spell[DamageDOT].MyCastTime}]}) && (${DamageT} <= 150)) {
/call Cast "DamageDOT"
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset DamageT ${Math.Calc[${Spell[DamageDOT].Duration}* 6]}s
}
/if ((${Target.Distance} > ${Math.Calc[${Target.Speed} / 4 * ${Spell[DamageDOT2].MyCastTime}]}) && (${Damage2T} <= 150)) {
/call Cast "DamageDOT2"
/if (${Macro.Return.Equal[CAST_SUCCESS]}) /varset Damage2T ${Math.Calc[${Spell[DamageDOT2].Duration}* 6]}s
}
/if ((!${PetAttacking}) && (${Target.PctHPs} < 65)) {
/pet attack
/varset PetAttacking 1
}
/delay 10s (${Target.Distance} <= 50)
/face fast nolook
/if (!${Target.ID}) /return
/keypress strafe_right hold
/delay 15
/keypress strafe_right
/if (!${Target.ID}) /return
/doevents
/goto :KiteLoop
/return
Sub Downtime
/call lootnpc
/call GMCheck
/call MoveToLoc ${HomeY} ${HomeX}
/if (!${Me.Pet.ID}) {
/call Cast "PetSpell"
/pet guard here
/pet taunt
}
/call Cast "LichSpell"
/call ClickIt pack3
/pet sit
:MedCheck
/if (${Me.PctHPs} < 80) {
/if (${Me.Buff[LichSpell].ID}) /notify BuffWindow Buff${Int[${Math.Calc[${Me.Buff[LichSpell].ID}-1]}]} leftmouseup
}
/if (${Me.PctMana} < 70) {
/if (!${Me.Sitting}) /sit
/doevents
/delay 300 (${Me.PctMana} > 90)
/goto :MedCheck
}
/call Cast "LichSpell"
/if (${PetHastT} < 300) {
/call Cast "PetHaste"
/varset PetHastT ${Math.Calc[${Spell[PetHaste].Duration} * 6]}s
}
/doevents
/return
Sub MoveToLocF(MoveToY, MoveToX, FDistance)
/declare FailureTimer timer local 0
/declare StrafeFailure int local
/declare running int local
/declare MaxSpeed int local
/declare StopDistance int local
/declare distanceNow float local
/declare distanceBefore float local
/declare distanceModifier int local
/varset running 0
/declare distanceTimer timer 15
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceModifier 1
/varset MaxSpeed 0
:moveToLocation
/if (${Me.Speed}>=${MaxSpeed}) /varset MaxSpeed ${Me.Speed}
/if (${MaxSpeed}<=166) {
/varset StopDistance 10
} else {
/varset StopDistance 10
}
/face fast nolook loc ${MoveToY},${MoveToX}
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<${StopDistance}) {
/keypress forward
/return
}
/if (${distanceTimer}==0) {
/if (${Me.Sneaking}) {
/varset distanceModifier 2
} else {
/varset distanceModifier 1
}
/varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
/if (${FailureTimer}==0) {
/varset StrafeFailure 0
/varset FailureTimer 600
}
/if (${FailureTimer}>0) {
/varset StrafeFailure ${Math.Calc[${StrafeFailure} + 1]}
}
/if (${StrafeFailure}>=10 && ${FailureTimer}>0) {
/keypress forward
/keypress back hold
/delay 5
/keypress back
/afk Be back later, leave a message
/echo Your movement failed more than 10 times in 30 seconds and most likely looked macroed. Ending macro. . .
/endmacro
/quit
}
/call strafePastObstacle ${StrafeFailure}
}
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceTimer 15
}
/if (${running}==0) {
/keypress forward
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>${StopDistance}) {
/varset running 1
/keypress forward hold
}
} else {
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<${StopDistance}) {
/varset running 0
/keypress forward
}
}
/if (${Target.Distance} > ${FDistance}) {
/keypress forward
/delay 5s (${Target.Distance} < ${Math.Calc[${FDistance} * .75]})
/if (${running}) /keypress forward hold
}
/if (${Me.PctHPs} < 60) {
/echo Low health on pull, FDING
/call Cast "Feign Death"
/if (${Me.Buff[LichSpell].ID}) /notify BuffWindow Buff${Int[${Math.Calc[${Me.Buff[LichSpell].ID}-1]}]} leftmouseup
/doevents
/delay 1m
/echo 1 Minute Passed.
/call downtime
}
/goto :moveToLocation
/return
Sub ClickIt(SlotList)
/if (!${SlotList.Length}) {
/echo ClickIt- Required Parameter Missing
/return
}
/declare cSlotName string local
/declare nCount int local 1
:ClickLoop
/varset cSlotName ${SlotList.Arg[${nCount},;]}
/itemnotify ${cSlotName} rightmouseup
/delay 3
:WaitForCast
/if (${Me.Casting.ID}) /goto :WaitForCast
/varcalc nCount ${nCount}+1
/delay 5
/if (${SlotList.Arg[${nCount},;].Length}) /goto :ClickLoop
/return
sub Lootnpc
:Top
/sit
/target corpse
/delay 2
/if (${Target.Distance}<15) {
/face fast
} else /if (${Target.Distance}>=15 && ${Target.Distance}<350) {
/face fast
/keypress forward hold
/varset MoveDelay ${Math.Calc[(${Target.Distance})/3.9]}
/keypress forward hold
/delay ${MoveDelay}
/keypress forward
/goto :Top
} else {
/echo Corpse is too far away
/keypress ESC
/return
}
:LootWnd
/loot
/delay 1
/if (!${Window[LootWnd].Open}) /goto :LootWnd
:lootloop
/if (${Me.State.Equal["STAND"]}) /goto :doneloot
/if (${Corpse.Items}==0) {
/goto :doneloot
}
/if (${LootSlot}>=32) /goto :doneloot
:Loot
/itemnotify Loot${LootSlot} leftmouseup
/delay 1s
/if (${Window[ConfirmationDialogBox].Open}) {
/notify ConfirmationDialogBox Yes_Button leftmouseup
/delay 1s
}
/autoinventory
/delay 2
/varcalc LootSlot ${LootSlot}+1
/goto :lootloop
:doneloot
/notify LootWnd DoneButton leftmouseup
/varset LootSlot 0
/return
Sub GMCheck
/if (${Spawn[gm].ID}) {
/beep
/delay 2s
/beep
/delay 2s
/beep
/delay 2s
/beep
/delay 2s
/beep
/echo GM has entered the zone!
/echo Fucking Slut - HATE THE MAN !!!
/keypress forward
/keypress back
/quit
/endmacro
}
/return
Sub Event_Farloot
/call DownTime
/return
Sub Event_Fail
/sit
/echo Feign Death Failed !!!
/call Cast "Feign Death"
/doevents
/delay 1m (${Target.Distance} > 100)
/echo 1 Minute Passed.
/call MoveToLoc ${HomeY} ${HomeX}
/return
Sub Event_Hit
/if (!${PetAttacking}) /pet back off
/if (${Me.PctHPs} < 60) {
/echo Low health, FDING
/call Cast "Feign Death"
/if (${Me.Buff[LichSpell].ID}) /notify BuffWindow Buff${Int[${Math.Calc[${Me.Buff[LichSpell].ID}-1]}]} leftmouseup
/delay 1m
/echo 1 Minute Passed.
}
/return
My problem is with failed feign deaths, the event isnt handling properly, and if my necro does actually FD, when he stands he isnt returning to his home position.
In addition, the mac has my necro pulling and killing mobs that are under the world, but when it comes to the lootnpc it spams an assload of target out of range, any suggestion for adding in an #event farloot "#*#You are to far to loot#*#" (and yes, i wrote that in, but it wont reconize, or call to the event) ..
-Twisted82-
Im just a noob, trying to get a nut.