necro kite mac

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

nako
decaying skeleton
decaying skeleton
Posts: 8
Joined: Sat Apr 24, 2004 12:35 am

necro kite mac

Post by nako » Sat Feb 05, 2005 1:36 am

i am really a nob when it comes to makeing macros and was wondering if anybody could modify this macro for me so that it will loot the cr and if bags full just return to kiteing please help



|Necrokite.mac
|By: Terramantian
|
|Simple auto-pulling and kiting macro for a necromancer.


#turbo
#include spell_routines.inc
#include move.inc

#define PetSpell "Summon Dead"
#define PetHaste "Intensify Death"
#define SnareDOT "Dooming Darkness"
#define DamageDOT "Boil Blood"
#define Lifetap "Spirit Tap"
#define LichSpell "Allure of Death"

#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 MOB int outer
/declare EndX int outer
/declare EndY int outer
/declare PetAttacking bool outer

/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 LootMob
/call Downtime
/goto :Loop

/return

Sub Initialize
/if (!${Me.Pet.ID}) /call Cast "PetSpell"
/pet guard here
/pet taunt
/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} > 80)
/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"
/delay 3m (${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
/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 DOT is not on... FDing and pausing
/call Cast "Feign Death" 10s
/if (${Me.Buff[LichSpell].ID}) /notify BuffWindow Buff${Int[${Math.Calc[${Me.Buff[LichSpell].ID}-1]}]} leftmouseup
/mqpause
}
/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 ((!${PetAttacking}) && (${Target.PctHPs} < 50)) {
/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 DOT is not on... FDing and pausing
/call Cast "Feign Death" 10s
/if (${Me.Buff[LichSpell].ID}) /notify BuffWindow Buff${Int[${Math.Calc[${Me.Buff[LichSpell].ID}-1]}]} leftmouseup
/mqpause
}
/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 ((!${PetAttacking}) && (${Target.PctHPs} < 50)) {
/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 MoveToLoc ${HomeY} ${HomeX}
/if (!${Me.Pet.ID}) {
/call Cast "PetSpell"
/pet guard here
/pet taunt
}
/call Cast "LichSpell"
:MedCheck
/if (${Me.PctHPs} < 70) {
/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} > 80)
/goto :MedCheck
}
/call Cast "LichSpell"
/if (${PetHastT} < 300) {
/call Cast "PetHaste"
/varset PetHastT ${Math.Calc[${Spell[PetHaste].Duration} * 6]}s
}
/doevents

/return


| Sub MoveToLoc F |
|---------------------------------------------------|
|This simply moves the player to within 1 unit of |
|the requested location, while avoiding obstacles |
| |
|This is beatnik007's original sub, with a few minor|
|changes and rewritten in MQ2Data format |
| |
| |
|F is for Follow. designed for pulling or kiting, |
|If the mob's distance exceeds Distance, it will
|pause and wait for the mob to catch up.
|
|SYNTAX: /call MoveToLocF Y X Distance |


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 3
} 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} < 30) {
/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
/mqpause
}
/goto :moveToLocation
/return

Sub Event_Hit

/if (!${PetAttacking}) /pet back off
/if (${Me.PctHPs} < 30) {
/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
/mqpause
}
/return

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Sat Feb 05, 2005 5:23 am

USE THE CODE BUTTON!
Once at the beginning and again at the end.
Otherwise no one is going to read it.

Also, asking to make AFK macros is a good way to get flamed.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

nako
decaying skeleton
decaying skeleton
Posts: 8
Joined: Sat Apr 24, 2004 12:35 am

Post by nako » Sat Feb 05, 2005 9:26 am

It is not ment t be a afk maco me and my wife just had a baby chrismas day u know how hard it is to kite a mob and loot it when he is cring and u have to get up for a min and help ??

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Sat Feb 05, 2005 9:32 am

nako wrote:It is not ment t be a afk maco me and my wife just had a baby chrismas day u know how hard it is to kite a mob and loot it when he is cring and u have to get up for a min and help ??
Didn't you just contradict yourself there?

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 4:53 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 6:06 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 6:07 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 6:09 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 6:11 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 6:12 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 6:13 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 7:26 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 7:27 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 7:28 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: necro kite mac

Post by xyilla » Sun Apr 06, 2025 7:29 pm