Page 1 of 1

buffing someone else's pet

Posted: Mon May 24, 2004 9:17 pm
by Rhagz
I am trying to add an event in my ranger's macro that will cast Spirit of Eagles on a pet when the pet owner sends a tell. I can make it work with any buff on the owner themself, but it wont do the pet.

I have tried it this way

Code: Select all

#Event castpet "#*#soe pet#*#

.
.
.


Sub_Event castpet
       {
         /rt
         /target ${Target.Pet}
         /call cast "Spirit of Eagles" gem1
       }
/return
and also like :

Code: Select all

Sub_Event castpet
       {
         /target ${Sender}
         /target ${Target.Pet}
         /call cast "Spirit of Eagles" gem1
        }
/return

Neither one will work, but my events that buff a player when asked work fine. Example:

Code: Select all

#Event rathe "#*#rathe me#*#"

.
.
.

Sub_Event rathe 
            {
              /rt
              /call cast "Call of the Rathe"
             }
/return

This works perfectly..

So can anyone show me how to make it cast on the pet of someone sending a tell for a Pet Buff?

I am using spellcast.inc also btw

Thanks[

Posted: Mon May 24, 2004 9:21 pm
by Drumstix42
Isn't it just Spirit of Eagle with No 'S'

Posted: Mon May 24, 2004 9:28 pm
by Rhagz
yeah maybe so, thats just a typo here.. thats not the problem im having, but the problem is it wont change targets, or target anything if i have none.

Posted: Mon May 24, 2004 9:31 pm
by Drumstix42
/target NPC ${Target.Pet}

?? :?

Posted: Mon May 24, 2004 9:42 pm
by Rhagz
In the .mac file, it is spelled "Spirit of Eagle" so thats not the problem.. and when I type /target ${Target.Pet} with my necro targetted, it will switch the target to the pet. But when I try to trigger the event via chat/tells.. it doesnt respond, almost like it never picks up the event at all.

Posted: Mon May 24, 2004 9:52 pm
by Drumstix42
Well I tested teh /target ${Target.Pet} onmyself and that works, but I can't help on the event thing if I can only see so much of whats going on in your code.

Posted: Mon May 24, 2004 10:01 pm
by Rhagz
This is the whole thing, its a modified version of the archery macro i found here, and I expanded it to be a buff-bitch as well.

Code: Select all

|** 
arch.mac Auto-Archery 

ABOUT: 
just run this macro, target a mob, and turn on auto attack 
The macro will detect autoattack, turn it back off, and begin firing arrows 
or as I do, just /assist your MA =P 

In some situations, you know what I'm talking about, you need to melee.. 
No Problem!  this macro will auto melee also! When in close range to the target 
the macro automatically turns on autoattack, it auto kicks, and auto disarms. 
then just step back out of range and it will start firing arrows again!!! 
Auto taunt now added as a toggle.  

Added auto-reroot, good for soloing when root breaks. it does NOT auto root, 
it just re roots your already rooted target.(wouldnt want it to auto root, 
as it would root your target at its spawn location) 

the macro will recast self haste of "eyepatch of plunder"     CHANGE THIS 
the macro will recast the spell "Eagle Eye"                  CHANGE THIS 
REQUIREMENT Spellcast.inc for reliable spell casting which can be found here: 
http://macroquest2.com/phpBB2/viewtopic.php?t=6748 

It will display the experience gain as an echo and popup. 

HISTORY: 
UNKNOWN DATE Created by loadingpleasewait  

May 5, 2004 Modified by Kasodo  updated to MQ2Data /MQ2Datavars Autosnare at 70% 

May 17, 2004 Modified by loadingpleasewait to swat bugs, make automelee 
work automatically, make the autosnare a toggle and all around make it better  

May 18,2004 Modified by loadingpleasewait added an autotaunt when within closecombat 
also added root toggle to toggle weather or not to ReRoot your target 

May 21, 2004 Modified by loadingpleasewait more bugs swatted, added check for mobs immune to snare 
so the macro doesnt keep trying to cast on the mob, over and over and over and over and over... etc.. 
fixxed the forage looping issue when you would have to wait longer to forage..  

USAGE: 
/mac arch <forage|snare|taunt|root>  
Use all, or none, in any order seperated by spaces to do specified action 
**| 

#include spellcast.inc 
#turbo 40
#Event attack "#*#assist#*#"
#Event rathe "#*#need rathe#*#"
#Event predator "#*#need sop#*#"
#Event tunare "#*#need sot#*#"
#Event eagles "#*#need soe#*#"
#Event skin "#*#need skin#*#"
#Event exp "#*#You gain#*#"
#Event haste "The quickening spirit departs#*#" 
#Event eagle "The avian presence departs#*#" 
#Event precision "The precision fades#*#"
#Event resist "Your target resisted the Ensnare spell#*#" 
#Event resist "Your Ensnare spell has worn off#*#" 
#Event reroot "Your Earthen Roots spell has worn off#*#" 
#Event reroot "Your target resisted the Earthen Roots spell#*#" 
#Event Casting "#*#You begin casting#*#" 
#Event waitforage "#*#before you can forage#*#" 
#Event CantSee "#*#cannot see your#*#" 
#Event soepet "#*#soe pet#*#"


Sub Main 
   /echo "Auto-Arch Macro has begun." 
   /declare i int local 
   /declare foragetoggle outer 
   /declare waitforage outer 
   /declare snaretoggle outer 
   /declare taunttoggle outer 
   /declare roottoggle outer 
   /declare needsnare outer 
   /declare immunetosnare outer 
   /declare startexp outer 
   /declare startaaxp outer 
   /declare currentxp outer 
   /declare xpgain outer 
   /declare currentaa outer 
   /declare aagain outer 
   /declare targetarray[4] string outer 

   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 

/for i 0 to 3 
  /if (${Defined[Param${i}]}) { 
     /if (${Param${i}.Equal[snare]}) { 
         /echo "Auto-Snare enabled" 
         /varset snaretoggle 1 
         /varset needsnare 1 
         /varset immunetosnare 0 
         } 
      /if (${Param${i}.Equal[taunt]}) { 
         /echo "Auto-Taunt enabled" 
         /varset taunttoggle 1 
         } 
      /if (${Param${i}.Equal[forage]}) { 
         /echo "Auto-Forage enabled" 
         /varset foragetoggle 1 
         /varset waitforage 0 
         } 
      /if (${Param${i}.Equal[root]}) { 
         /echo "Auto-ReRoot enabled" 
         /varset roottoggle 1 
         } 
   } 


/if (!${Me.Buff[Eagle Eye].ID}) { 
    /call cast "Eagle Eye" gem6
} 

/if (!${Me.Buff[Nature's Precision].ID}) { 
    /call cast "Nature's Precision" gem7
} 

/if (!${Me.Buff[Captain Nalots Quickening].ID}) { 
    /call cast "Eyepatch of Plunder" item
} 


/next i 

:mainloop 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage 
        /doevents
       /goto :mainloop 
/return 

Sub Archery 
  /attack off 
  /varset targetarray[1] ${Target.CleanName} 
  /varset targetarray[2] ${Target.Level} 
  /varset targetarray[3] ${Target.Name} 
  /varset targetarray[4] ${Target.ID} 
    
   /echo Fighting a ${targetarray[2]} ${targetarray[1]} 
    :CloserAF    
       /if (${Me.Combat}) /attack off 
/if (${Target.Distance}>30 && ${Me.RangedReady}) /ranged 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage 
/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70) { 
      /call Cast "Ensnare" gem4 
      /varset needsnare 0 
     }  
    /doevents 
    /if (${Target.Distance}<25) /call closecombat 
    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
    /goto :CloserAF 
:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /if (${snaretoggle}==1) /varset needsnare 1 
    /if (${snaretoggle}==1) /varset immunetosnare 0 
    /keypress Num_5 
/return 

Sub closecombat 
   /attack on 
   :stillclose 
            /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
               /attack off 
               /delay 5 
            /call forage 
            /attack on 
         } 
      /face ${targetarray[1]}  
      /if (${Target.Distance}<11 && ${Me.AbilityReady["Disarm"]}) /doability "Disarm" 
      /if (${Target.Distance}<11 && ${Me.AbilityReady["Kick"]}) /doability "Kick" 
      /if (${taunttoggle}==1 && ${Target.Distance}<11 && ${Me.AbilityReady["Taunt"]}) /doability "Taunt" 
      /doevents 
      /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70) { 
         /call Cast "Ensnare" gem4 
         /varset needsnare 0 
      } 
    /if (${Target.Distance}<25 && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose 
    /attack off 
   /return 

Sub Event_exp 
   /varset currentxp ${Me.PctExp} 
   /varset xpgain ${Math.Calc[${currentxp}-${startexp}]} 
   /varset currentaa ${Me.PctAAExp} 
   /varset aagain ${Math.Calc[${currentaa}-${startaaxp}]} 
      /popup "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 
/return 



Sub event_eagle 
      /call Cast "Eagle Eye"
/return 



Sub event_haste 
      /call Cast "Eyepatch of Plunder" item 
/return    



Sub event_precision
      /call Cast "Nature's Precision"
/return



Sub Event_CantSee 
     /face fast nolook 
/return 


Sub Event_attack
     /keypress 3
/return


Sub Event_rathe
    { 
       /rt 
       /delay 1s 
       /call Cast "Call of the Rathe" gem5
    }
/return


Sub Event_skin
    {
      /rt
      /delay 1s
      /call cast "Natureskin" gem4
    }
/return

Sub Event_tunare
    { 
       /rt 
       /delay 1s 
       /call Cast "Strength of Tunare" gem3
    }
/return

Sub Event_predator
    { 
       /rt 
       /delay 1s 
       /call Cast "Spirit of the Predator" gem2
    }
/return

Sub Event_eagles
    { 
       /rt 
       /delay 1s 
       /call Cast "Spirit of Eagle" gem1
    }
/return


Sub event_reroot 
      /if (${roottoggle}==1) { 
         /target id ${targetarray[4]} 
         /call Cast "Earthen Roots" gem2 
      } 
/return 

Sub Event_resist 
/doevents 
   /if (${snaretoggle}==1 && ${immunetosnare}==0) /varset needsnare 1 
/return 

Sub Event_Immune 
   /if (${snaretoggle}==1) { 
      /varset needsnare 0 
      /varset immunetosnare 1 
   } 
/return 

sub Event_Casting 
   :checkcast 
    /delay 1 
    /if (${Me.Casting.ID}) /goto :checkcast 
/return 

sub forage 
   /doability Forage 
:waitforage 
   /delay 3 
   /doevents 
   /if (!${Cursor.ID} && ${waitforage}==0) /goto :waitforage 
   /delay 3 
   /varset waitforage 0 
   /autoinv 
/return 

sub Event_waitforage 
   /if (${foragetoggle}==1) /varset waitforage 1 

sub Event_soepet
       { 
         /rt 
         /target ${Target.Pet} 
         /call cast "Spirit of Eagle" gem1 
       } 
  /return

Everything in it works perfect, my necro has a hotkey that assists the groups maintank and also sends a tell to the ranger bot saying "assist". He starts firing arrows right away, melees when necessary, adjusts his position to always face the mob. Rebuffs his attacking buffs. Buffs the group when they ask for a certain buff (tanks love CoR heh). SoE's the puller etc.. its really nice. But when there is another mage/necro in the group, I want them to be able to ask the buff bot to soe their pet also.


I tried it another way.. I made a hotkey, set to 0.

Code: Select all

/rt
/pause 3
/target ${Target.Pet}
/pause 3
/cast 1
I then changed my Event to

Code: Select all

/Keypress 0
When I press the 0 key manually, it works. When I try and trigger it via chat/tell, it doesnt. I am at a loss, but seeing i am very new to this whole thing, i am not surprised :lol:

Posted: Mon May 24, 2004 10:01 pm
by Rhagz
oh and big thanks to the original coder, and to the spellcast coders as well :)

Posted: Tue May 25, 2004 1:48 am
by Goofmester1
I know sometimes /rt can be slow to get a target. Try adding a delay 1s just like your other subs to be sure /rt gets the targetting done. If you try to /target ${Target.Pet} before you actually have a target then your going to get no target other than your /rt when it catches up. Macros run very fast so this might help.

Posted: Tue May 25, 2004 2:25 am
by Rhagz
Tried that too, still didnt help.. hmm tomorrow when i get time, ill try adding the delay BEFORE the /rt.. other than that, I am not sure what else to try.

Posted: Tue May 25, 2004 12:10 pm
by Preocts
Just a curious question for ya. Have you tried something like this?

Code: Select all

Sub Event_castpet(sLine)
|       {   <--- Don't need these
         /target ${sLine.Arg[1]} 
         /delay 3
         /target ${Target.Pet} 
         /delay 3
         /call cast "Spirit of Eagles" gem1 
|        } <--- Don't need this one either
/return
If I'm just rehashing old-ground sorry. :)

Posted: Tue May 25, 2004 2:25 pm
by Rusty~
or even just something like...

Code: Select all

Sub Event_castpet(sLine) 
         /target npc ${Spawn[pc ${sLine.Arg[1]}].Pet}
         /call cast "Spirit of Eagles" gem1 
/return 

Posted: Wed May 26, 2004 7:50 pm
by Rhagz
Gonna try that as soon as MQ2 is updated, will let ya know how it goes!