and his code in this thread. http://macroquest2.com/phpBB2/viewtopic.php?t=1738
The warrior pet should act just like a magicians pet and accepts all the commands except gaurd atm. You will have to create hotbuttons to trigger the commands (very simple). Im still working on the looting procedure, though it isnt that important. This macro is best used with any priest class with the ability to heal.
Good luck
Code: Select all
|___________________________________________________________________
| petwarrior.mac
|___________________________________________________________________
| Normal commands
|________________
| Attack
| Example: /tell a_little_warrior_01 Attack the $target(id)
|
| Sit
| Example: /tell a_little_warrior_01 Sit
|
| Follow
| Example: /tell a_little_warrior_01 Follow
|
| Loot
| Example: /tell a_little_warrior_01 Loot the $target(id)
|
| Taunt
| Example: /tell a_little_warrior_01 Taunt the $target(id)
|___________________________________________________________________
| Commands for use while attacking
|__________________________________
| Pet Back Off
| Example: /tell a_little_warrior_01 Back
|
| Stop
| Example: /tell a_little_warrior_01 Stop Attacking the $target(id)
|___________________________________________________________________
|TO DO:
|Set the #define Parameters Owner and BotName
|___________________________________________________________________
|**#include core.mac I used this cause it was in prior authors code, i really dont think you need it but if its giving errors just uncomment it **|
#chat tell
#turbo
#Event Loading "LOADING, PLEASE WAIT..."
#Event Loading "LOADING, PLEASE WAIT..."
#Event Enrage "has become ENRAGED."
#Event UnEnrage "is no longer enraged."
#define owner OwnersName
#define BotName BotsName
#define Forward w
#define Backward s
|**----------------------------------------------------------------------------**|
|** Main Subroutine **|
|**----------------------------------------------------------------------------**|
Sub Main
/varset v0 $target(name)
/varset v1 $target(id)
/varset v2 0 |Variable used to determine wether or not to return to main loop
:MainLoop
/if $gm==TRUE /tell owner There is a GM in the Zone
/varset v2 0
/doevents
/delay 1 s
/goto :MainLoop
/return
|**----------------------------------------------------------------------------**|
|**----------------------------------------------------------------------------**|
Sub Event_Loading
/sendkey up Forward
/sendkey up Backward
/attack off
/varset v0 0
/varset v1 0
/varset v2 0
/return
|**----------------------------------------------------------------------------**|
|**----------------------------------------------------------------------------**|
Sub Event_Chat
/if $p1=="owner" {
| Normal commands
/if $arg(1,"$p2")==Attack {
/sit off
/target id $arg(3,"$p2")
/reply Attacking $target(name)
/call Attack
/varset v2 1
}
/if $arg(1,"$p2")==Sit {
/sit on
/reply I am now sitting
/varset v2 1
}
/if $arg(1,"$p2")==Follow {
/sit off
/target "owner"
/reply Now following you $target(name)
/follow
/varset v2 1
}
/if $arg(1,"$p2")==Loot {
/sit off
/target id $arg(3,"$p2")
/reply Im going to loot $target(name)
/call Loot
/varset v2 1
}
/if $arg(1,"$p2")==Taunt {
/target id $arg(3,"$p2")
/reply I am taunting $target(name)
/call Taunt
/varset v2 1
}
| Commands for use while attacking
/if $arg(1,"$p2")==Back {
/reply Im comming back to the group "owner"
/call Back
/varset v2 1
}
/if $arg(1,"$p2")==Stop {
/reply Im not attacking $target(name) anymore.
/attack off
/varset v2 1
}
}
/if $p1!="owner" /tell owner BotName has a private tell.
/return
|**----------------------------------------------------------------------------**|
|** Tell pet to attack **|
|**----------------------------------------------------------------------------**|
Sub Attack
/attack on
/sendkey down s
/sendkey up s
/varset v1 $target(id)
:TrackLoop
/doevents
/delay 0
/face afast
/if n $target(distance)>14 /sendkey down Forward
/if n $target(distance)<16 {
/sendkey up Forward
/goto :AttackLoop
}
/goto :TrackLoop
:AttackLoop
/if "$target(id)"!="$v1" /goto :EndAttack
/doevents
/if n $v2==1 /return
/if n $v3==1 /return
/delay 0
/face nopredict fast
/if n $target(distance)>10 /sendkey down Forward
/if n $target(distance)<11 /sendkey up Forward
/if n $char(ability,taunt)>0 /doability taunt
/if n $char(ability,bash)>0 /doability bash
/if n $char(ability,disarm)>0 /doability disarm
/if n $char(ability,kick)>0 /doability kick
/if $char(ability,begging)>0 {
/attack off
/doability "Begging"
/attack on
}
/goto :AttackLoop
:EndAttack
/target owner
/follow
/return
|**----------------------------------------------------------------------------**|
|** Similar to "pet back off" command **|
|**----------------------------------------------------------------------------**|
Sub Back
/attack off
/target "owner"
/follow
/return
|**----------------------------------------------------------------------------**|
|** Send pet warrior in to loot **|
|**----------------------------------------------------------------------------**|
Sub Loot
| yet to be implemented
/return
|**----------------------------------------------------------------------------**|
|** Tell pet warrior to taunt **|
|**----------------------------------------------------------------------------**|
Sub Taunt
/if n $char(ability,taunt)>0 /doability taunt
/return
|**----------------------------------------------------------------------------**|
|** Tell pet warrior stop attacking during enrage **|
|**----------------------------------------------------------------------------**|
Sub Event_Enrage
/if "$p0"~~"BotName" /return
/attack off
/varset v3 1
/return
|**----------------------------------------------------------------------------**|
|** Tell pet warrior to start attacking after enrage ends **|
|**----------------------------------------------------------------------------**|
Sub Event_UnEnrage
/attack on
/varset v3 0
/return

