AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
item_mysterious_egg Class Reference
Inheritance diagram for item_mysterious_egg:
ItemScript ScriptObject

Public Member Functions

 item_mysterious_egg ()
 
bool OnExpire (Player *player, ItemTemplate const *) override
 
- Public Member Functions inherited from ItemScript
bool IsDatabaseBound () const override
 
virtual bool OnQuestAccept (Player *, Item *, Quest const *)
 
virtual bool OnUse (Player *, Item *, SpellCastTargets const &)
 
virtual bool OnRemove (Player *, Item *)
 
virtual bool OnCastItemCombatSpell (Player *, Unit *, SpellInfo const *, Item *)
 
virtual bool OnExpire (Player *, ItemTemplate const *)
 
virtual void OnGossipSelect (Player *, Item *, uint32, uint32)
 
virtual void OnGossipSelectCode (Player *, Item *, uint32, uint32, const char *)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from ItemScript
 ItemScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ item_mysterious_egg()

item_mysterious_egg::item_mysterious_egg ( )
inline
130: ItemScript("item_mysterious_egg") { }
Definition: ItemScript.h:24

Member Function Documentation

◆ OnExpire()

bool item_mysterious_egg::OnExpire ( Player player,
ItemTemplate const *   
)
inlineoverridevirtual

Reimplemented from ItemScript.

133 {
134 ItemPosCountVec dest;
135 uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 39883, 1); // Cracked Egg
136 if (msg == EQUIP_ERR_OK)
137 player->StoreNewItem(dest, 39883, true);
138
139 return true;
140 }
std::uint8_t uint8
Definition: Define.h:110
@ EQUIP_ERR_OK
Definition: Item.h:41
std::vector< ItemPosCount > ItemPosCountVec
Definition: Player.h:772
@ NULL_BAG
Definition: Unit.h:210
@ NULL_SLOT
Definition: Unit.h:211
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0)
Definition: PlayerStorage.cpp:2546
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
Definition: Player.h:1260

References Player::CanStoreNewItem(), EQUIP_ERR_OK, NULL_BAG, NULL_SLOT, and Player::StoreNewItem().