bad_captain
01-29-2010, 12:10 AM
I am working on pet focii, and have decided to go ahead and work through adding the equipment that automatically comes equipped on focused pets instead of just leaving it at equations for the pet's stats. This is my first time working with equipment, so I've been having a little trouble figuring out how to actually add the item. Since the item added is a summoned item, I see where the following code is used when a player summons an item gets the item_struct and creates an ItemInst from it.
ItemInst *SummonedItem=NULL;
const Item_Struct *item = database.GetItem(spell.base[i]);
SummonedItem=database.CreateItem(spell.base[i],charges);
However, the code that gives an item to a pet, either only requires the itemIDs (AddItem) or the Item_Struct (AddLootDrop), not the full ItemInst (and it appears the npc only stores the itemID for equipment). Would I be able to just use the itemID or item_struct to equip the pet, or would I need to make an ItemInst for the pet? And which function would be best to take itemIDs loaded from the database and turned into items that are equipped by the pet?
Also, I noticed that npcs (and therefore pets) only have 9 slots for equipment, but in doing research for working on pet focus items, I ran across multiple accounts of pets going rogue (such as after a charm), with the pet dying and showing a list of 15 or 16 items (the usual 9 plus 2 rings, face, waist, neck, back, and shoulders). I know pets can equip face, waist, and back, due to summoned pet equipment for those slots (Muzzle of Mardu, Girdle of Magi'kot, Elemental Defender), but I don't see anywhere those slots are being accounted for. Am I missing something, or do these slots need to be added for pets for them to equip these items?
ItemInst *SummonedItem=NULL;
const Item_Struct *item = database.GetItem(spell.base[i]);
SummonedItem=database.CreateItem(spell.base[i],charges);
However, the code that gives an item to a pet, either only requires the itemIDs (AddItem) or the Item_Struct (AddLootDrop), not the full ItemInst (and it appears the npc only stores the itemID for equipment). Would I be able to just use the itemID or item_struct to equip the pet, or would I need to make an ItemInst for the pet? And which function would be best to take itemIDs loaded from the database and turned into items that are equipped by the pet?
Also, I noticed that npcs (and therefore pets) only have 9 slots for equipment, but in doing research for working on pet focus items, I ran across multiple accounts of pets going rogue (such as after a charm), with the pet dying and showing a list of 15 or 16 items (the usual 9 plus 2 rings, face, waist, neck, back, and shoulders). I know pets can equip face, waist, and back, due to summoned pet equipment for those slots (Muzzle of Mardu, Girdle of Magi'kot, Elemental Defender), but I don't see anywhere those slots are being accounted for. Am I missing something, or do these slots need to be added for pets for them to equip these items?