void Item::Create(uint32 itemid, Player* owner) { SetEntry(itemid); if (owner) { uint64 OwnerGUID = owner->GetGUID(); SetOwnerGUID(OwnerGUID); SetContainerGUID(OwnerGUID); } SetStackCount(1); m_itemProto = ItemPrototypeStorage.LookupEntry(itemid); ARCEMU_ASSERT(m_itemProto != NULL); SetCharges(0, m_itemProto->Spells[0].Charges); SetCharges(1, m_itemProto->Spells[1].Charges); SetCharges(2, m_itemProto->Spells[2].Charges); SetCharges(3, m_itemProto->Spells[3].Charges); SetCharges(4, m_itemProto->Spells[4].Charges); SetDurability(m_itemProto->MaxDurability); SetDurabilityMax(m_itemProto->MaxDurability); m_owner = owner; locked = m_itemProto->LockId ? true : false; }
void Container::Create(uint32 itemid, Player* owner) { m_itemProto = ItemPrototypeStorage.LookupEntry(itemid); ARCEMU_ASSERT(m_itemProto != NULL); SetEntry(itemid); ///\todo this shouldn't get NULL form containers in mail fix me if (owner != NULL) { SetOwnerGUID(0); SetContainerGUID(owner->GetGUID()); } SetStackCount(1); SetNumSlots(m_itemProto->ContainerSlots); m_Slot = new Item*[m_itemProto->ContainerSlots]; memset(m_Slot, 0, sizeof(Item*) * (m_itemProto->ContainerSlots)); m_owner = owner; }