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

Public Member Functions

 item_disgusting_jar ()
 
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
 
uint16 GetTotalAvailableHooks ()
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ item_disgusting_jar()

item_disgusting_jar::item_disgusting_jar ( )
inline
118: ItemScript("item_disgusting_jar") { }
Definition: ItemScript.h:24

Member Function Documentation

◆ OnExpire()

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

Reimplemented from ItemScript.

121 {
122 ItemPosCountVec dest;
123 uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 44718, 1); // Ripe Disgusting Jar
124 if (msg == EQUIP_ERR_OK)
125 player->StoreNewItem(dest, 44718, true);
126
127 return true;
128 }
std::uint8_t uint8
Definition: Define.h:109
std::vector< ItemPosCount > ItemPosCountVec
Definition: Player.h:771
@ EQUIP_ERR_OK
Definition: Item.h:47
@ NULL_BAG
Definition: Item.h:40
@ NULL_SLOT
Definition: Item.h:41
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0)
Definition: PlayerStorage.cpp:2530
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
Definition: Player.h:1272

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