• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

FH - Necro Rot mac (1 Viewer)

armysoldier

Well-known member
Joined
Jun 26, 2005
RedCents
101¢
Mandrack's necro thread

posted this on that thread.. but hopefully i can get some help here

essentially it casts the 4 dots over and over.. even if it does not need to be

how do i set conditions so it will read to see if there is the appropriate dot on the mob?


OK i have a 66 necro with a minor problem... I can not get low enough mobs to fear... Tones macro worked fine... I just could not fear the mobs. (level 62-65)

Until I hit 67.. and load the new fear spell... fear kiting FH is not gonna work.

The orignial Root Rot does not work. and the Root Rot sorenbro has .. had issues also.

So i figured let me take a stab at editing the macros...

Using tones fear mac... and sonenbro mac This is what i came up with.

It works BUT.. I do not know how to put a condition in there so that the DOTS only cast every X minutes or when the DOT message is not shown.

I also organized the spell definitions in here a bit.

PLEASE coders take a peak and let me know what i can do to fix this.


Line 484 is where i added dots casting.

Line 1049 is a copy of DoTheFear but with Root instead



thanks

Rich (BB code):
| Useage      : /macro necroroot
| Description : This macro will root Rot mobs of
|               The Forgotten Halls. It assumes you have an instance
|               And are inside already.
|------------------------------------------------------------------------------
#turbo 40

|edits are at 145 to change warp (push Control G in notepad and 144)
|line 19 and 20 to edit monsters level.
|spells to edit 79 to 116
|Edit Spell Set names Line 532 is PET Spells buffs and Line 342 is Dot Spells

| Define the ranges of mobs you can handle kiting here.
| If no mobs in this range exist in the instance, the macro
| will freeze.
#define MIN_MOB_LVL 63
#define MAX_MOB_LVL 66
|this is the place you need to edit the monsters level you are hunting.
#define CAST_SUCCESS 0
#define CAST_OUTOFRANGE 1
#define CAST_CANNOTSEE 2
#define CAST_RETRY 3
#define CAST_IN_PROGRESS 4
#define CAST_ABORT -1

#define PLUGIN_NEEDED "/call CheckPlug"
#define DELAY "/noparse /call Delay"

#event Blocked "The way is blocked to you.#*#"
#event NoMount "#*#You can not summon a mount#*#"
#event OOR "#*#too far away to loot#*#"
#event Retry "#*#Your spell fizzles#*#"
#event Retry "#*#Your casting has been interrupted#*#"
#event Retry "#*#Your spell is interrupted.#*#"
#event Retry "#*#You haven't recovered yet...#*#"
#event Retry "#*#Spell recovery time not yet met.#*#"
#event Retry "#*#Your target resisted the #*#"
#event Abort "#*#Insufficient Mana to cast this spell!#*#"
#event OutOfRange "#*#Your target is out of range, get closer!#*#"
#event NoLOS "#*#You cannot see your target.#*#"
#event Stunned "#*#You cannot cast while stunned#*#"
#event Stunned "#*#You *CANNOT* cast spells, you have been silenced!#*#"
#event Standing "#*#You must be standing to cast a spell#*#"
#event Standing "#*#has fallen to the ground.#*#"
#event Collapse "#*#Your gate is too unstable, and collapses.#*#"
#event Abort "#*#Your target is immune to changes in its attack speed.#*#"
#event Retry "#*#too distracted to cast#*#"
#event Zoned "You have entered#*#"
#event PetAggro "#*#pet is the focus of something#*#"

|Events for counting the money we loot.
#event CashLoot "You receive #1#"

|Event for re-rooting
#event root "#*#root spell has worn off#*#"

#event ImHit "|${Target.CleanName}|#*#YOU for#*#"

|-- The normal debug - for normal play.
| Enable: "/echo", Disable: "/squelch /echo"
#define DEBUG_1 /echo
|-- Deeper debugging - enable when trying to find bugs.
#define DEBUG_2 /echo
|-- The Deepest debugging - will spam a lot.
#define DEBUG_3 "/squelch /echo"

|-- Destroys Silver if you have more than the given amount! 0=disable
#define DESTROY_GOLD_IF_ABOVE 0
|-- Destroys Silver if you have more than the given amount! 0=disable
#define DESTROY_SILVER_IF_ABOVE 500
|-- Destroys Copper if you have more than the given amount! 0=disable
#define DESTROY_COPPER_IF_ABOVE 500

|-- At what range do we snare/send in pet?
#define INITIALIZE_ATTACK_RANGE 100
|here and down you need to edit the spell list, and the pet you want to use.
|-- What pet do we want?
#define PET_SPELL "Child of Bertoxxulous"
|-- Favorite gem spot for the pet (1-8)
#define PET_GEM 6
|-- How far off should the pet be before we summon it?
#define MAX_PET_RANGE_BEFORE_SUMMON 150
|-- How low on health should the pet be before we heal it (noncombat)
#define HEAL_PET_BELOW_PCT 70

|SPELL DEFINITION AREA
|Define Spell name
|Define Spell Gem Slot (1-8)

#define SUMMON_SPELL "Summon Companion"
#define SUMMON_GEM 1

| Change SPLURT_GEM to 0 if you lack it.
#define SPLURT_SPELL "Splurt"
#define SPLURT_GEM 1

|-- What snare spell
#define SNARE_SPELL "Insidious Retrogression"
#define SNARE_GEM 2

#define HEAT_DOT "Funeral Pyre of Kelador"
#define HEAT_DOT_GEM 3

|-- Name of pet healing spell
#define HEAL_PET_SPELL "Touch of Death"
#define HEAL_PET_GEM 4

|-- Name of LICH spell
#define LIFE_DOT "Saryrn's Kiss"
#define LIFE_DOT_GEM 5

#define DISEASE_DOT "Chaos Plague"
#define DISEASE_DOT_GEM 5

|What is our feign death spell of choice? (Requires it be already mem'd, memorizing before feigning = death)
#define FEIGN_SPELL "Feign Death"
#define FEIGN_GEM 6

#define POISON_DOT "Blood of Thule"
#define POISON_DOT_GEM 7

|-- Name of Conversion spell
#define LICH_SPELL "Seduction of Saryrn"
#define LICH_GEM 8

|-- Name of root spell
#define root_SPELL "Petrifying Earth"
#define root_GEM 8

|-- Name of pet haste spell
#define PET_HASTE "Rune of Death"
#define PET_HASTE_GEM 9

|-- Save a spell set called dots With Spells in this order
|-- Splurt / Insidious Retrogression / Funeral Pyre of Kelador
|-- Touch of Death / Chaos Plague / Feign Death
|-- Blood of Thule / Petrifying Earth / Rune of Death

|-- Save a spell set called afk-root With Spells in this order
|-- Shadow Guard Slot 1/DMF Slot 6/ Force Shield Slot 7 /Seduction of Saryrn Slot 8

|-- Name of Clickies
|#define ROD_NAME "Summoned: Modulating Rod"

|-- If your health gets below this lvl start /beep'ing and FD
#define ALARM_HEALTH_BELOW_PCT 40

|-- What is the minimum mana I should have, wait if below
#define MIN_MANA_BEFORE_MEDITATE 25

|--How many waypoints exist on the kiting path for the rats.
#define WP_SIZE 37
#define Y_COORD 1
#define X_COORD 2
#define Z_COORD 3

Sub CheckPlug(who)
   /if (${Plugin[${who}].Name.Length}==NULL) {
       /echo This requires the ${who} plugin to work.
       /echo Install and/or /plugin ${who} and try again.
       /beep
       /endmacro
   }
/return

|----------------------------------------------------------------------------
|SUB: Main - Declarations and Initialization
|----------------------------------------------------------------------------
Sub Main
   PLUGIN_NEEDED MQ2Ultrawarp
   |you have to edit the name of your warp in here.
   |Buffs to be kept up on self (max 15) - "Buff" or "Buff|GemSlot"
   /declare MyBuffs[3] string outer
   /varset MyBuffs[1] "Shadow Guard|1"
   /varset MyBuffs[2] "Dead Man Floating|6"
   /varset MyBuffs[3] "Force Shield|7"
  
   |Buffs to be kept up on pet (max 15) - "Buff" or "Buff|GemSlot"
   /declare PetBuffs[1] string outer
   |/varset PetBuffs[1] "Spirit Armor|8"
   /varset PetBuffs[1] "PET_HASTE|PET_HASTE_GEM"

   /declare weZoned bool outer FALSE
   /declare wayBlocked bool outer FALSE
   /declare mountFlag bool outer TRUE
   /declare result int outer
   /declare startingPP int outer ${Me.Platinum}
   /declare startingXP int outer ${Me.Exp}
   /declare wpY float outer
   /declare wpX float outer
   /declare wpZ float outer
   /declare waypoint[WP_SIZE,3] int outer
   /varset waypoint[1,Y_COORD] -598
   /varset waypoint[1,X_COORD] 101
   /varset waypoint[1,Z_COORD] 4
   /varset waypoint[2,Y_COORD] -596
   /varset waypoint[2,X_COORD] 108
   /varset waypoint[2,Z_COORD] 4
   /varset waypoint[3,Y_COORD] -597
   /varset waypoint[3,X_COORD] -40
   /varset waypoint[3,Z_COORD] 4
   /varset waypoint[4,Y_COORD] -556
   /varset waypoint[4,X_COORD] -50
   /varset waypoint[4,Z_COORD] 4
   /varset waypoint[5,Y_COORD] -556
   /varset waypoint[5,X_COORD] -160
   /varset waypoint[5,Z_COORD] 4
   /varset waypoint[6,Y_COORD] -473
   /varset waypoint[6,X_COORD] -41
   /varset waypoint[6,Z_COORD] 4
   /varset waypoint[7,Y_COORD] -398
   /varset waypoint[7,X_COORD] -45
   /varset waypoint[7,Z_COORD] 4
   /varset waypoint[8,Y_COORD] -402
   /varset waypoint[8,X_COORD] 1
   /varset waypoint[8,Z_COORD] 4
   /varset waypoint[9,Y_COORD] -329
   /varset waypoint[9,X_COORD] 0
   /varset waypoint[9,Z_COORD] 13
   /varset waypoint[10,Y_COORD] -596
   /varset waypoint[10,X_COORD] 157
   /varset waypoint[10,Z_COORD] 2
   /varset waypoint[11,Y_COORD] -600
   /varset waypoint[11,X_COORD] 198
   /varset waypoint[11,Z_COORD] 4
   /varset waypoint[12,Y_COORD] -721
   /varset waypoint[12,X_COORD] 45
   /varset waypoint[12,Z_COORD] -10
   /varset waypoint[13,Y_COORD] -664
   /varset waypoint[13,X_COORD] 45
   /varset waypoint[13,Z_COORD] -4
   /varset waypoint[14,Y_COORD] -635
   /varset waypoint[14,X_COORD] 45
   /varset waypoint[14,Z_COORD] 4
   /varset waypoint[15,Y_COORD] -814
   /varset waypoint[15,X_COORD] 45
   /varset waypoint[15,Z_COORD] -10
   /varset waypoint[16,Y_COORD] -814
   /varset waypoint[16,X_COORD] 190
   /varset waypoint[16,Z_COORD] -11
   /varset waypoint[17,Y_COORD] -814
   /varset waypoint[17,X_COORD] 335
   /varset waypoint[17,Z_COORD] -10
   /varset waypoint[18,Y_COORD] -814
   /varset waypoint[18,X_COORD] 488
   /varset waypoint[18,Z_COORD] -35
   /varset waypoint[19,Y_COORD] -473
   /varset waypoint[19,X_COORD] -6
   /varset waypoint[19,Z_COORD] 4
   /varset waypoint[20,Y_COORD] -473
   /varset waypoint[20,X_COORD] 20
   /varset waypoint[20,Z_COORD] -2
   /varset waypoint[21,Y_COORD] -473
   /varset waypoint[21,X_COORD] 56
   /varset waypoint[21,Z_COORD] -10
   /varset waypoint[22,Y_COORD] -473
   /varset waypoint[22,X_COORD] 135
   /varset waypoint[22,Z_COORD] -11
   /varset waypoint[23,Y_COORD] -405
   /varset waypoint[23,X_COORD] 135
   /varset waypoint[23,Z_COORD] -11
   /varset waypoint[24,Y_COORD] -405
   /varset waypoint[24,X_COORD] 93
   /varset waypoint[24,Z_COORD] -11
   /varset waypoint[25,Y_COORD] -290
   /varset waypoint[25,X_COORD] 93
   /varset waypoint[25,Z_COORD] -11
   /varset waypoint[26,Y_COORD] -290
   /varset waypoint[26,X_COORD] 183
   /varset waypoint[26,Z_COORD] -11
   /varset waypoint[27,Y_COORD] -290
   /varset waypoint[27,X_COORD] 275
   /varset waypoint[27,Z_COORD] -11
   /varset waypoint[28,Y_COORD] -409
   /varset waypoint[28,X_COORD] 275
   /varset waypoint[28,Z_COORD] -11
   /varset waypoint[29,Y_COORD] -397
   /varset waypoint[29,X_COORD] -40
   /varset waypoint[29,Z_COORD] 4
   /varset waypoint[30,Y_COORD] -397
   /varset waypoint[30,X_COORD] 0
   /varset waypoint[30,Z_COORD] 4
   /varset waypoint[31,Y_COORD] -337
   /varset waypoint[31,X_COORD] 1
   /varset waypoint[31,Z_COORD] 12
   /varset waypoint[32,Y_COORD] -235
   /varset waypoint[32,X_COORD] 0
   /varset waypoint[32,Z_COORD] 20
   /varset waypoint[33,Y_COORD] -167
   /varset waypoint[33,X_COORD] 0
   /varset waypoint[33,Z_COORD] 20
   /varset waypoint[34,Y_COORD] -127
   /varset waypoint[34,X_COORD] 0
   /varset waypoint[34,Z_COORD] 14
   /varset waypoint[35,Y_COORD] -86
   /varset waypoint[35,X_COORD] 0
   /varset waypoint[35,Z_COORD] 4
   /varset waypoint[36,Y_COORD] 4
   /varset waypoint[36,X_COORD] 0
   /varset waypoint[36,Z_COORD] -6
   /varset waypoint[37,Y_COORD] 53
   /varset waypoint[37,X_COORD] 0
   /varset waypoint[37,Z_COORD] 4

   DEBUG_1 Starting macro
   |Group of locked target data
   /declare TargetName string outer
   /declare TargetID int outer
   /declare fightTimer timer outer

   /call MainSub
   DEBUG_1 Exited normally!
/return


|----------------------------------------------------------------------------
|SUB: MainSub - The main sub
|----------------------------------------------------------------------------
Sub MainSub
   |The main loop. After an attack we go here to acquire a new target
   /cleanup
:NewTarget
   /varset TargetID
   /if (${Corpse.Open}) {
       /notify LootWnd DoneButton leftmouseup
       /cleanup
   }
   /call AlwaysCheck
   /if (${Macro.Return}) /return
   /call DowntimeWork
   /if (${Macro.Return}==0) /goto :NewTarget

   /call AcquireTarget
   /if (${Macro.Return}) /goto :NewTarget
   /call BackOffFromTarget 40
   |/mqpause
   /if (${Target.Distance}>INITIALIZE_ATTACK_RANGE) /goto :NewTarget
   /if (${Me.Pet.Distance}>MAX_PET_RANGE_BEFORE_SUMMON) /call SummonPet TRUE
   |/call MyCast "SNARE_SPELL" SNARE_GEM
   |/pet attack
   /memspellset dots
/delay 1m ${Window[SpellBookWnd]}==FALSE
   /call DoTheroot
   /if (${Int[SPLURT_GEM]}>0) /call MyCast "SPLURT_SPELL" SPLURT_GEM
   /call MyCast "LIFE_DOT" LIFE_DOT_GEM
   /call MainAttack
   /if (${Me.Pet.ID}) {
       /if (${Me.Pet.Distance}>20) /warp loc ${Me.Pet.Y} ${Me.Pet.X} ${Me.Pet.Z}
   } else {
       /warp succor
   }
   /goto :NewTarget
/return

| AlwaysCheck - health, aggro, zone, etc. ALSO CALLED FROM EVENTS.
| "/call AlwaysCheck nocast" to never perform casting (eg event calls)
| 0=no problem; 1=panic
Sub AlwaysCheck(string casting)
   /doevents Zoned
   /if (${Cursor.ID}) /autoinventory
   /if (${Me.PctHPs}<ALARM_HEALTH_BELOW_PCT) {
       /call NoLich
       /if (${Me.PctHPs}<=20) {
           /instacamp
           /endmacro
       }
       /if (${Spawn[${TargetID}].Type.Equal[NPC]} && ${Zone.Name.Find[forgotten]}!=0) {
           /call BailOut
           /return 1
       }
   }
   /if (${Me.PctMana}>90 || ${Me.PctHPs}<50) {
       /call NoLich
   }
   /if (${casting.Equal[nocast]}==FALSE) {
       /if (${Me.Pet.ID}!=0 && ${Me.PetBuff[PET_HASTE]}==0) /call MyCast "PET_HASTE" PET_HASTE_GEM
       /if (${Me.PctMana}<90 && ${Me.Buff[LICH_SPELL].ID}==NULL && ${Me.PctHPs}>50) /call MyCast "LICH_SPELL" LICH_GEM
       /if (${FindItem[ROD_NAME].ID}!=0) /cast item "ROD_NAME"
   }
   /if (${weZoned}) {
       /declare zoneDelay timer 3m
       /varset weZoned FALSE
       /varset wayBlocked FALSE
       /doevents flush
       /if (${Zone.Name.Find[forgotten]}==NULL) {
           /if (${Zone.Name.Find[nedaria]}==NULL) {
:quit
               /dismount
               /camp desktop
               /endmacro
           }
           /warp loc 1543 -670 96
           /keypress back
           /keypress forward
           /delay 1
           /sit
           /popup Waiting for health>50%...
           /delay 5m ${Me.PctHPs}>50
           /face fast loc 1543,-670
:zoning
           /delay 1s
           /click left 400 300
           /delay 5
           /click left 500 400
           /delay 5
           /click left 600 500
           /doevents Zoned
           /doevents Blocked
           /delay 1s ${weZoned}||${wayBlocked}
           /if (${wayBlocked}) /goto :quit
           /if (${weZoned}==FALSE && ${zoneDelay.Value}>0) /goto :zoning
           /if (${Zone.Name.Find[forgotten]}==NULL) /goto :quit
       }
   }
/return 0

Sub NoLich
   /declare slot int local
   /varcalc slot ${Me.Buff[LICH_SPELL].ID}-1
   /if (${slot}>=0) /notify BuffWindow Buff${slot} leftmouseup
/return

Sub BailOut
   /dismount
   /attack off
    /warp succor
   /delay 1
   /target npc a_harindi_guide
   |/warp loc -827 -30 -11
   /warp target 
   /delay 2
   /face fast nolook
:panic
   /say I am ready to leave!
   /delay 1
   /doevents Zoned
   /delay 5 ${weZoned}
   /if (${Zone.Name.Find[forgotten]}) {
       /keypress forward hold
       /delay 4
       /keypress forward
       /if (${Target.ID}) {
           /face fast nolook
       } else {
           /return
       }
       /goto :panic
   }
/return

|----------------------------------------------------------------------------
|SUB: MainAttack - Handles the kiting/killing
|----------------------------------------------------------------------------
Sub MainAttack
:attackAgain
   /if (${Zone.Name.Find[forgotten]}==NULL) /return
   /doevents
   /target id ${TargetID}
   DELAY 1
   /if (${Target.ID}==0 || ${Target.Type.Equal[Corpse]}) /goto :looties
   /call AlwaysCheck
   /if (${Macro.Return}) /return
   /if (${Target.ID}==${Me.Pet.ID}) {
       /assist
       DELAY 3 ${Target.ID}!=${Me.Pet.ID}
   }
   /if (${Zone.Name.Find[forgotten]}==NULL) /return
   /if (${Target.ID}==0 || ${Target.Type.Equal[Corpse]}) /goto :looties
   /if (${Me.PctHPs}>ALARM_HEALTH_BELOW_PCT && ${Me.Buff[LICH_SPELL].ID}==NULL) {
       DEBUG_3 Me.Buff[LICH_SPELL].ID==${Me.Buff[LICH_SPELL].ID}
       /call MyCast "LICH_SPELL" LICH_GEM
    }
   /call HealPet
   /if (${Zone.Name.Find[forgotten]}==NULL) /return
   /if (${Target.ID}==0 || ${Target.Type.Equal[Corpse]}) /goto :looties
   /face
   /if (${Target.Distance}>INITIALIZE_ATTACK_RANGE) /call WarpCloser
   /if (${Me.Sitting}==FALSE && ${Me.Mount.ID}==0) /call Mount
   /if (${Zone.Name.Find[forgotten]}==NULL) /return
   /if (${Target.ID}==0 || ${Target.Type.Equal[Corpse]}) /goto :looties
   /if (${fightTimer.Value}==0 && ${Target.PctHPs}>20) {
       /call DoTheroot
       /call MyCast "LIFE_DOT" LIFE_DOT_GEM
       /call MyCast "HEAT_DOT" HEAT_DOT_GEM
       /call MyCast "POISON_DOT" POISON_DOT_GEM
       /call MyCast "DISEASE_DOT" DISEASE_DOT_GEM
}
   /if (${Zone.Name.Find[forgotten]}==NULL) /return
   /if (${Target.ID}==0 || ${Target.Type.Equal[Corpse]}) /goto :looties
   /if (${Target.PctHPs}>20 && ${Target.Speed}>50) {
       /warp target
       DELAY 1
       /call MyCast "SNARE_SPELL" SNARE_GEM
   }
   /if (${Zone.Name.Find[forgotten]}==NULL) /return
   /if (${Target.ID}>0 && ${Target.Type.NotEqual[Corpse]}) /goto :attackAgain
:looties
   /call AlwaysCheck
   /if (${Zone.Name.Find[forgotten]}==NULL || ${Macro.Return}) /return
   /call DoTheLooting
   /varset TargetID
/return

|----------------------------------------------------------------------------
|SUB: DowntimeWork - Between fight rebuffs, etc.
|----------------------------------------------------------------------------
Sub DowntimeWork
| Check if we are low on mana or health. Heal or sit down if low
   /call CheckMana
   /if ( ${Macro.Return}==0 ) /return 0
   DEBUG_2 1. Mana Checked

| Make sure pet is up + all its buffs are on it
   /call HealPet
   /if ( ${Macro.Return}==0 ) /return 0
   DEBUG_2 2. Pet Health Checked

   /call MaintainPetBuffs
   /if ( ${Macro.Return}==0 ) /return 0
   DEBUG_2 3. Pet Buffs Checked

| Make sure all buffs on self are up
   /call MaintainSelfBuffs
   /if ( ${Macro.Return}==0 ) /return 0
   DEBUG_2 4. Buffs Checked

   /call AlwaysCheck
   /if (${Macro.Return}) /return 0

|-- SPELL SET for FH
   /memspellset afk-root
   /delay 1m ${Window[SpellBookWnd]}==FALSE
/return 1

Sub instaClicky
   /if (${FindItem[=Journeyman's Boots].ID}) /cast item "Journeyman's Boots"
   /if (${FindItem[=Shrunken Goblin Skull Earring].ID}) /cast item "Shrunken Goblin Skull Earring"
/return

|----------------------------------------------------------------------------
|SUB: AcquireTarget - Finding a target 0=success; 1=n/a
|----------------------------------------------------------------------------
Sub AcquireTarget
   /declare s int local
   /declare lvl int local
   /declare spn int local
   /squelch /target clear
   /varset TargetID
   /varset TargetName
:scan
   /varcalc s ${s}+1
   /varset spn ${LastSpawn[${s}].ID}
   /if (${spn}==0) /goto :acquired
   /if ((${Spawn[${spn}].CleanName.Find[squeaking]} || ${Spawn[${spn}].CleanName.Find[swooping]} || ${Spawn[${spn}].CleanName.Find[reject]}) && ${Spawn[${spn}].Type.Equal[Corpse]}==FALSE && ${Spawn[${spn}].Level}>=MIN_MOB_LVL && ${Spawn[${spn}].Level}<=MAX_MOB_LVL && ${Spawn[${spn}].Level}>${lvl}) {
       /if (${Spawn[${spn}].Y}<=-265 && ${Spawn[${spn}].Y}>=-429 && ${Spawn[${spn}].X}>=74 && ${Spawn[${spn}].X}<=298 && ${Spawn[${spn}].Level}>=47) {
           DEBUG_1 Ignoring mob in add area: ${Spawn[${spn}].CleanName}(L${Spawn[${spn}].Level})
       } else {
           /varset lvl ${Spawn[${spn}].Level}
           /varset TargetID ${Spawn[${spn}].ID}
       }
   }
   /goto :scan
:acquired
   /if (${TargetID}) {
       /target id ${TargetID}
       DELAY 2 ${Target.ID}!=0
       /if (${Target.CleanName.Find[${Me.CleanName}]}) {
           DEBUG_1 WTF? I got targeted!
           /return 1
       }
       /varset TargetID ${Target.ID}
       /varset TargetName ${Target.CleanName}
       /popup ${TargetName} (L${Target.Level})
       DEBUG_1 ${TargetName} (L${Target.Level})
       /return 0
   }
   DEBUG_3 AcquireTarget FAILED!
   /popup Waiting for mobs in range MIN_MOB_LVL-MAX_MOB_LVL...
   /call Mount
   /delay 5s
/return 1

| Find the closest WP in line-of-sight to our target
Sub FindWP
   /declare wp int local
   /declare Y int local
   /declare X int local
   /declare Z int local
   /declare dist float local 10000
   /varset wpY
   /varset wpX
   /varset wpZ
   /for wp 1 to WP_SIZE
       /varset Y ${waypoint[${wp},Y_COORD]}
       /varset X ${waypoint[${wp},X_COORD]}
       /varset Z ${waypoint[${wp},Z_COORD]}
       /if (${LineOfSight[${Y},${X},${Z}:${Target.Y},${Target.X},${Target.Z}    ]} && ${Math.Distance[${Y},${X},${Z}:${Target.Y},${Target.X},${Target.Z}    ]}<${dist}) {
           /varset wpY ${Y}
           /varset wpX ${X}
           /varset wpZ ${Z}
           /varset dist ${Math.Distance[${Y},${X},${Z}:${Target.Y},${Target.X},${Target.Z}    ]}
       }
   /next wp
/return

|warp closer to target, via WP if mob, or direct otherwise.
Sub WarpCloser
   /call AlwaysCheck nocast
   /if (${Macro.Return}) /return
   /if (${Target.ID}==0 || ${Target.ID}==${Me.ID}) {
       /target id ${TargetID}
       DELAY 2 ${Target.ID}>0
   }
   /if (${Target.ID}==0 || ${Target.Type.Equal[Corpse]}) /return
   /if (${Target.Type.Equal[Pet]}) {
       /warp target
   } else {
       /call FindWP
       /if (${wpY}!=0||${wpX}!=0||${wpZ}!=0) {
           /warp loc ${wpY} ${wpX} ${wpZ}
       } else {
           /if (${Me.Pet.ID}) /warp loc ${Me.Pet.Y} ${Me.Pet.X} ${Me.Pet.Z}
       }
   }
   DELAY 1
   /if (${Target.ID}) /face fast
/return

| DO NOT CALL DELAY FROM EVENTS!
| Parameters: delay timer setting + early exit condition
Sub Delay(string delayTime, string exitCond)
   /declare tmr timer local ${delayTime}
:moreDelay
   /call AlwaysCheck nocast
   /if (${tmr.Value}==0) /return
   /if (${exitCond}) {
       DEBUG_3 Early exit on condition: ${exitCond.Right[-1]}
       /return
   }
   /if (${Me.PctHPs}<ALARM_HEALTH_BELOW_PCT) {
       DEBUG_1 Delay abort, ${tmr.Value} ticks left, LOW HEALTH!
       /return
   }
   /delay 1 ${exitCond}
   |/if (${Math.Calc[${tmr.Value}%10].Int}==0) DEBUG_3 /delay ${tmr.Value} ${exitCond.Right[-1]}:${exitCond}
   /doevents ImHit
   /doevents Retry
   /doevents Abort
   /doevents OutOfRange
   /doevents NoLOS
   /doevents Standing
   /doevents OOR
   /doevents CashLoot
   /doevents Zoned
   /doevents PetAggro
   /doevents NoMount
   /doevents Stunned
   /if (${Target.Type.Equal[NPC]}) /face
   /goto :moreDelay
/return

Sub MyCast(string spname, string gname)
   /if (${Zone.Name.Find[forgotten]}==NULL) /return
   /if (${Corpse.Open}) /notify LootWnd DoneButton leftmouseup
   /if (!${Defined[spellName]}) /declare spellName string outer
   /varset spellName ${spname}
   /call DoCast ${gname}
   /doevents
   /if (${Target.ID}!=${TargetID} && ${TargetID}!=0) {
       /target id ${TargetID}
       DELAY 3 ${Target.ID}==${TargetID}
   }
   /if (${Target.Type.Equal[NPC]}) /face fast
/return

| Cast something with status return and event processing
| assumes outer variable spellName and TargetID
Sub DoCast(string gem)
   /declare tartype string local ${Spell[${spellName}].TargetType}
   /if (${gem.Equal[item]}) /varset tartype ${FindItem[=${spellName}].Spell.TargetType}
:recast
   /if (${tartype.Equal[Pet]} && ${Target.ID}!=${Me.Pet.ID}) {
       /if (${Me.Pet.ID}==0) /return
       /target id ${Me.Pet.ID}
       /delay 1
   } else /if (${tartype.Equal[Self]} && ${Target.ID}!=${Me.ID}) {
       /target myself
       /delay 1
   } else /if (${Target.Type.Equal[NPC]} && ${Target.ID}!=${TargetID}) {
       /target id ${TargetID}
       /delay 1
   }
   /if (${Target.Type.Equal[NPC]} && ${Target.PctHPs}<25) {
       DEBUG_3 Confusing/low health target (${Target.PctHPs}%)
       /return
   }
   /if (${Target.ID}==0 || ${Target.Type.Equal[Corpse]}) {
       DEBUG_3 Target${Target.CleanName}(${Target.ID}) Dead?
       /return
   }
   /if (${Target.ID}!=${Me.ID}) {
       /face fast
       /if (!${LineOfSight[${Me.Y},${Me.X},${Me.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /call WarpCloser
   }
   /if (${gem.Equal[item]}) {
       DEBUG_2 Casting ${spellName}:${gem}>${Target.CleanName}
       /cast item "${spellName}"
   } else {
       /if (${Me.Gem[${spellName}]}==NULL) {
           /memspell ${gem} "${spellName}"
           DEBUG_3 book:${Window[SpellBookWnd]}; ${spellName}:${Me.SpellReady[${spellName}]}
           /delay 10s ${Window[SpellBookWnd]}==FALSE
           DELAY 15s ${Me.SpellReady[${spellName}]}
       } else {
           DEBUG_3 ${spellName}:${Me.SpellReady[${spellName}]}
           /if (!${Me.SpellReady[${spellName}]}) {
               DELAY 15s ${Me.SpellReady[${spellName}]}
           }
       }
       DEBUG_2 Casting ${spellName}:${gem}>${Target.CleanName}
       /cast "${spellName}"
   }
   /varset result CAST_IN_PROGRESS
   DELAY 2
   /doevents
   /if (${result}==CAST_IN_PROGRESS && ${Me.Casting.ID}==0) /goto :recast
   DELAY 30s ${Me.Casting.ID}==NULL
   /delay 1
   /doevents
   /if (${result}==CAST_IN_PROGRESS) /varset result CAST_SUCCESS
   DEBUG_3 Casting of ${spellName} complete, result=${result}
   /if (${result}==CAST_OUTOFRANGE || ${result}==CAST_CANNOTSEE) {
       /call WarpCloser
       /goto :recast
   } else /if (${result}==CAST_RETRY) {
       /if (!${Me.SpellReady[${spellName}]}) {
           /call instaClicky
           /varcalc result ${Spell[${spellName}].RecoveryTime}*10
           DELAY ${result} ${Me.SpellReady[${spellName}]}
       }
       /goto :recast
   }
/return

|----------------------------------------------------------------------------
|SUB: SummonPet - Summon pet if farther away than the defined range
|----------------------------------------------------------------------------
Sub SummonPet(bool force)
   /if (${force} || (MAX_PET_RANGE_BEFORE_SUMMON>0 && ${Me.Pet.Distance}>MAX_PET_RANGE_BEFORE_SUMMON)) {
       DELAY 5s (${Me.Pet.Distance}<MAX_PET_RANGE_BEFORE_SUMMON||${force})
       /if (${Int[SUMMON_GEM]}<1 || ${Me.Pet.Distance}<MAX_PET_RANGE_BEFORE_SUMMON) /return
       DEBUG_1 Summoning pet. Its range is ${Me.Pet.Distance}
       /call MyCast "SUMMON_SPELL" SUMMON_GEM
   }
/return


|----------------------------------------------------------------------------
|SUB: HealPet - Heal pet if needed 0=just healed; 1=no problem
|----------------------------------------------------------------------------
Sub HealPet
   |Heal pet?
   /if ( ${Me.Pet.PctHPs}<HEAL_PET_BELOW_PCT && ${Me.PetBuff[HEAL_PET_SPELL]}==0 ) {
       /if ( ${Me.Pet.ID} ) {
           /target id ${Me.Pet.ID}
           DELAY 1
           /call MyCast "HEAL_PET_SPELL" HEAL_PET_GEM
           /return 0
       }
   }
/return 1

Sub Mount
   /if (${mountFlag}) {
       /if (${InvSlot[ammo].Item.Name.Find[Drum]}!=NULL && ${Me.Buff[Summon Drogmor].ID}==0) {
           /cast item "${InvSlot[ammo].Item.Name}"
       } else /if (${InvSlot[ammo].Item.Name.Find[Bridle]}!=NULL && ${Me.Buff[Summon Horse].ID}==0) {
           /cast item "${InvSlot[ammo].Item.Name}"
       } else {
           /if (!${Me.Sitting}) /sit
       }
   } else {
       /if (!${Me.Sitting}) /sit
   }
/return

|----------------------------------------------------------------------------
|SUB: CheckMana 0= need more med; 1=mana ok
| Now with histeresis - exit condition is above entry condition.
|----------------------------------------------------------------------------
Sub CheckMana
   /declare exitMana int local
   /declare exitHealth int local
   /varcalc exitMana MIN_MANA_BEFORE_MEDITATE+15
   /varcalc exitHealth ALARM_HEALTH_BELOW_PCT+20
   |Meditate?
   /if (${Me.PctMana}<MIN_MANA_BEFORE_MEDITATE || ${Me.PctHPs}<ALARM_HEALTH_BELOW_PCT) {
       DEBUG_1 Meditating.
       /popup Meditating...
       /call Mount
       /declare i int local
       /if ( ${Target.ID} ) /squelch /target clear
       /for i 1 to 10
           DELAY 1s
           /if ( ${Target.ID} ) /return 1
       /next i
       /if ( ${Me.PctMana}<${exitMana} || ${Me.PctHPs}<${exitHealth} ) {
           /return 0
       }
       DEBUG_2 Mana/health OK now.
   }
/return 1


|----------------------------------------------------------------------------
|SUB: MaintainPetBuffs - Heal pet and keep its buffs up
|   0= still busy; 1=all done
|----------------------------------------------------------------------------
Sub MaintainPetBuffs
   |If we have pet
   /if ( ${Me.Pet.ID}==0 ) {
       DEBUG_1 Creating new pet
       /call MyCast "PET_SPELL" PET_GEM
       /return 0
   }
   /call SummonPet
   /declare iCount int local
   /declare t string local
   /for iCount 1 to ${PetBuffs.Size}
       /call SplitString tmp_tmp ${PetBuffs[${iCount}]} "|"
       /varset t ${Me.PetBuff[${tmp_tmp[1]}]}
       /if ( ${t.Equal[NULL]} ) {
            /if ( !${Target.ID}!=${Me.Pet.ID} ) {
               /target id ${Me.Pet.ID}
            }
            |Cast with gemselection or default
            /if ( ${tmp_tmp.Size}>1 ) {
                /if (!${Me.SpellReady[${tmp_tmp[2]}]}) {
                   DELAY 15s ${Me.SpellReady[${tmp_tmp[2]}]}
               }
                DEBUG_3 Trying to cast "${tmp_tmp[1]}" ${tmp_tmp[2]}
                /call MyCast "${tmp_tmp[1]}" ${tmp_tmp[2]}
            } else {
                /if (!${Me.SpellReady[${tmp_tmp[1]}]}) {
                   DELAY 15s ${Me.SpellReady[${tmp_tmp[1]}]} 8 force
               }
                DEBUG_3 Trying to cast "${tmp_tmp[1]}"
                /call MyCast "${tmp_tmp[1]}" 8
            }
            |Return to top - so we dont keep buffing if being attacked
            /return 0
         }
   /next iCount
/return 1


|----------------------------------------------------------------------------
|SUB: MaintainSelfBuffs - Keep buffs up
|       0=still buffing; 1=all done
|----------------------------------------------------------------------------
Sub MaintainSelfBuffs
   /declare iCount int local
   /declare t string local
   /for iCount 1 to ${MyBuffs.Size}
       /call SplitString tmp_tmp ${MyBuffs[${iCount}]} "|"
       /varset t ${Me.Buff[${tmp_tmp[1]}]}
       /if ( ${t.Equal[NULL]} ) {
           /if ( !${Target.ID}!=${Me.ID} ) {
               /target myself
           }
           |Cast with gemselection or default
           /if ( ${tmp_tmp.Size}>1 ) {
               DEBUG_3 Attempting to cast "${tmp_tmp[1]}" ${tmp_tmp[2]}
               /call MyCast "${tmp_tmp[1]}" ${tmp_tmp[2]}
           } else {
               DEBUG_3 Attempting to cast "${tmp_tmp[1]}"
               /call MyCast "${tmp_tmp[1]}" 8
           }
           |Return to top - so we dont keep buffing if being attacked
           /return 0
       }
   /next iCount
/return 1

| Back off from current target so many units.
| Finds first line of sight on a horizontal, vertical, or
| diagonals that are at least as distant as desired.
Sub BackOffFromTarget(float dist)
   /declare by float local ${Target.Y}
   /declare bx float local ${Target.X}
   /varcalc by ${by}-${dist}
   /if (${LineOfSight[${by},${bx},${Target.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /goto :backoff
   /varset by ${Target.Y}
   /varcalc bx ${bx}-${dist}
   /if (${LineOfSight[${by},${bx},${Target.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /goto :backoff
   /varcalc by ${by}+${dist}
   /varset bx ${Target.X}
   /if (${LineOfSight[${by},${bx},${Target.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /goto :backoff
   /varset by ${Target.Y}
   /varcalc bx ${bx}+${dist}
   /if (${LineOfSight[${by},${bx},${Target.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /goto :backoff
   /varcalc by ${by}+${dist}
   /if (${LineOfSight[${by},${bx},${Target.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /goto :backoff
   /varcalc by ${Target.Y}-${dist}
   /varcalc bx ${Target.X}-${dist}
   /if (${LineOfSight[${by},${bx},${Target.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /goto :backoff
   /varcalc by ${Target.Y}+${dist}
   /if (${LineOfSight[${by},${bx},${Target.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /goto :backoff
   /varcalc by ${Target.Y}-${dist}
   /varcalc bx ${Target.X}+${dist}
   /if (${LineOfSight[${by},${bx},${Target.Z}:${Target.Y},${Target.X},${    Target.Z}]}) /goto :backoff
   /face fast
   /keypress forward hold
   /delay 3s ${Target.Distance}>=${dist}
   /keypress forward
   /face fast
   /return
:backoff
   /warp loc ${by} ${bx} ${Target.Z}
   /delay 1
   /if (${Target.ID}) /face fast
/return


|----------------------------------------------------------------------------
|SUB: DoTheLooting
|----------------------------------------------------------------------------
Sub DoTheLooting
   /if (!${Defined[looted]}) /declare looted bool outer
   /target id ${TargetID}
   DELAY 1
   DEBUG_1 Going to loot
   DEBUG_3 DoTheLooting Target: ${Target.CleanName}, ID:${Target.ID}
   /warp target
   DELAY 1
   /loot
   /varset looted FALSE
   DELAY 6s (${Corpse.Open}&&${looted})
   /call LootMob
   /notify LootWnd DoneButton leftmouseup
   DELAY 1
   /doevents
   /declare xp int local
   /declare pp int local
   /declare level float local ${Me.Level}
   /varcalc level ${level}+${Math.Calc[${Me.Exp}/330.0].Milli}
   /varcalc xp ${Me.Exp}-${startingXP}
   /if (${xp}<0) /varcalc xp ${xp}+330
   /varcalc pp ${Me.Platinum}-${startingPP}
   /popup L${level.Milli}, XP up ${Math.Calc[${xp}/3.3]}% - PP up ${pp}
   DEBUG_1 L${level.Milli}, XP up ${Math.Calc[${xp}/3.3]}% - PP up ${pp}
   DELAY 5s
/return


|----------------------------------------------------------------------------
|SUB: LootMob
|----------------------------------------------------------------------------
Sub LootMob
   /declare LootSlot int local
   /if (!${Target.ID}) {
       /target npc corpse
       DELAY 1s ${Target.ID}>0
   }
   /loot
   DELAY 1s ${Corpse.Open}
   /if (${Corpse.Items}) {
       /for LootSlot 1 to ${Corpse.Items}
           /itemnotify loot${LootSlot} leftmouseup
           DELAY 1s ${Cursor.ID}>0
           /destroy
       /next LootSlot
   }
   /cleanup
/return


|----------------------------------------------------------------------------
|SUB: SplitString - A generic string splitter.
|----------------------------------------------------------------------------
Sub SplitString(string varname, string inputstring, string splitter)
   |/echo varname: "${varname}", inputstring: "${inputstring}", splitter: "${splitter}"
   /declare i int local
   /declare stringcnt int local

   |The normal splitter. Splitter string is just 1 in length.
   /if (${splitter.Length}==1) {
       /varcalc stringcnt ${inputstring.Count["${splitter}"]} + 1
       /if (!${Defined[${varname}]}) {
           /declare ${varname}[${stringcnt}] string outer
       } else {
           /deletevar ${varname}
           /declare ${varname}[${stringcnt}] string outer
       }
       /for i 1 to ${stringcnt}
           /varset ${varname}[${i}] ${inputstring.Token[${i},"${splitter}"]}
       /next i
   }
/return


|----------------------------------------------------------------------------
|SUB: DestroyCopper - Destroy all the copper
|----------------------------------------------------------------------------
Sub DestroyCopper
  /squelch /windowstate InventoryWindow open
  /shift /notify InventoryWindow IW_Money3 leftmouseup
  /delay 1s ${Cursor.ID}>0
  /destroy
  /cleanup
/return

|----------------------------------------------------------------------------
|SUB: DestroySilver - Destroy all the silver
|----------------------------------------------------------------------------
Sub DestroySilver
  /squelch /windowstate InventoryWindow open
  /shift /notify InventoryWindow IW_Money2 leftmouseup
  /delay 1s ${Cursor.ID}>0
  /destroy
  /cleanup
/return

|----------------------------------------------------------------------------
|SUB: DestroyGold - Destroy all the gold
|----------------------------------------------------------------------------
Sub DestroyGold
  /squelch /windowstate InventoryWindow open
  /shift /notify InventoryWindow IW_Money1 leftmouseup
  /delay 1s ${Cursor.ID}>0
  /destroy
  /cleanup
/return


|----------------------------------------------------------------------------
|SUB: DoTheFear - Fear target
|----------------------------------------------------------------------------
|Sub DoTheroot
|   /if ( ${Me.PctMana}>10 && ${Target.Type.Equal[NPC]} && ${Target.PctHPs}>19) {
|       /call MyCast "FEAR_SPELL" FEAR_GEM
|       /varset fightTimer 31s
|   }
|/return
|----------------------------------------------------------------------------
|SUB: DoTheRoot - Root target
|----------------------------------------------------------------------------
Sub DoTheRoot
   /if ( ${Me.PctMana}>10 && ${Target.Type.Equal[NPC]} && ${Target.PctHPs}>19) {
       /call MyCast "root_SPELL" root_GEM
       /varset fightTimer 31s
   }
/return

|----------------------------------------------------------------------------
|SUB: Event_CashLoot - Will count the loot so far running the macro
|----------------------------------------------------------------------------
Sub Event_CashLoot(string Line, string cash)
   /if ( DESTROY_GOLD_IF_ABOVE>0 && ${Me.Gold}>DESTROY_GOLD_IF_ABOVE ) /call DestroyGold

   /if ( DESTROY_SILVER_IF_ABOVE>0 && ${Me.Silver}>DESTROY_SILVER_IF_ABOVE )  /call DestroySilver

   /if ( DESTROY_COPPER_IF_ABOVE>0 && ${Me.Copper}>DESTROY_COPPER_IF_ABOVE )  /call DestroyCopper
   /varset looted TRUE
/return

Sub Event_root
   DEBUG_2 root me!
   /call DoTheroot
/return

Sub Event_ImHit
   /call AlwaysCheck nocast
   /if (${Macro.Return}) {
       /varset result CAST_ABORT
       /return
   }
   /if (${Me.Casting.ID}!=0) /return
   /call BackOffFromTarget 80
/return

Sub Event_Retry
   /delay 2
   /varset result CAST_RETRY
/return

Sub Event_Abort
   /varset result CAST_ABORT
/return

Sub Event_OutOfRange
   /varset result CAST_OUTOFRANGE
/return

Sub Event_NoLOS
   /varset result CAST_CANNOTSEE
/return

Sub Event_Standing
   /stand
   /varset result CAST_RETRY
/return

Sub Event_OOR
   /warp target
   /delay 2
   /loot
   /delay 3
   /delay 3s ${Corpse.Open}
   /doevents OOR
/return

Sub Event_Blocked
   /varset wayBlocked TRUE
/return

Sub Event_Zoned
   /varset weZoned TRUE
/return

Sub Event_PetAggro
   /target id ${Me.Pet.ID}
   /warp target
   /delay 1
   /assist
   /delay 1
/return

Sub Event_NoMount
   /varset mountFlag FALSE
/return

Sub Event_Stunned
:gdStunned
   /call AlwaysCheck nocast
   /if (${Macro.Return}) {
       /varset result CAST_ABORT
       /return
   }
   /delay 1
   /if (${Me.Stunned}) /goto :gdStunned
   /varset result CAST_RETRY
/return


thanks
 
FH - Necro Rot mac

Users who are viewing this thread

Back
Top