Thread Tools Display Modes
10-07-08, 06:36 AM   #1
BDelacroix
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
PetAttack/Defend/Stay/Passive bla bla bla

Ok, so my next project, and I've already started it when I ran into this brick wall is a better pet bar.

I've done some research and it isn't looking good. So far, I've found that all the pet manipulation commands are protected. That is, I probably can't call them while in combat..... Which is precisely when I'd want to.

Now, I'm not trying to make a pet ai or anything. I am just making buttons that do the various actions.

The first thing someone finds when researching this is that there is an attribute type you can give to a secure button of "pet". However, the action is then only a number that corresponds to the pet action bar. That's no good. The best I can do with that is make a copy of the already existing and inadequate pet action bar.

If this is the case, the ability to cast pet abilities is very limiting.

I have not yet tried to CastSpell(xxx,BOOKTYPE_PET) from a pet spellbook. That may or may not work. However, the attack/stay/aggressivemode/passivemode et. al. are not in the spellbook (so far as I have been able to find. Someone may show me that I'm wrong).

Should I work this out, and I'll keep researching until I have to go out to work again, the new bar will be one that has the 6 standard buttons (for stance and attack mode) followed by a variable length bar of buttons that correspond to the pet's activate-able abilities. No setup required, just like all the rest of my mods.

***

Well crap, its Tuesday. I can't do any testing.

Last edited by BDelacroix : 10-07-08 at 07:26 AM.
  Reply With Quote
10-07-08, 09:07 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,711
You can use alpha in combat lockdown
  Reply With Quote
10-07-08, 11:18 AM   #3
Taroven
A Cyclonian
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 49
Best way I can think of pulling it off would be to iterate the pet's spells and use CastSpell(xxx). As for attack/stay/defend/etc, macro commands exist for every pet function and should be easy to attach to a button.

The only problem is button highlighting using that approach, but it should be easy enough to figure out.
  Reply With Quote
10-08-08, 11:16 AM   #4
BDelacroix
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
An update for posterity...

CastSpell(bla bla) does indeed work. So, for secure buttons you can just give the action buttons an attribute of "type","spell" and "spell","petspellname"

In my case, I enumerated all the spells from the player's spellbook and those that passed an IsPassiveSpell() were counted and added to the array (table).

Pet stance changes and attack modes do not appear in the pet spell book (hidden or otherwise). So I'm working on that. The functions exist, and you can call macros using secure buttons but I don't want to have to create macros just to use an addon. Its such a bandaid.

Off to work on it some more. Its really pretty simple except for dealing with PetAttack() et. al.
  Reply With Quote
10-09-08, 12:27 PM   #5
BDelacroix
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Another day....

I'll post this but probably not come back for a time as I think I'm now stuck.

I've managed to make a duplicate pet bar with a variable number of pet ability buttons (more than 4 if need be).

I did so by making the first six buttons a secure button with attribute "pet" and "action","#" corresponding to the built in action buttons for the basic pet activities. That works.

For the actual abilities, I use CastSpell(). That's fine, too.

What isn't fine is that using ToggleSpellAutocast() is apparently verboten. Since the abilities aren't necessarily also on the build in pet bar, I can't use Maul's suggestion of tying a macro to a pet action bar button. Though it was a good idea.

So, I am giving it a rest for a while until I come up with something. While I can't turn on and off the autocast ability, I can show if its on or not and I can actually have my pet cast spells.

One more thing. I told the built in pet bar to hide but its a tenacious beast and won't go away. So for now I have two bars... not what I want at all, but that's a different battle.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » PetAttack/Defend/Stay/Passive bla bla bla


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off