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

Public Member Functions

 item_gor_dreks_ointment ()
 
bool OnUse (Player *player, Item *item, SpellCastTargets const &targets) 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_gor_dreks_ointment()

item_gor_dreks_ointment::item_gor_dreks_ointment ( )
inline
89: ItemScript("item_gor_dreks_ointment") { }
Definition: ItemScript.h:24

Member Function Documentation

◆ OnUse()

bool item_gor_dreks_ointment::OnUse ( Player player,
Item item,
SpellCastTargets const &  targets 
)
inlineoverridevirtual

Reimplemented from ItemScript.

92 {
93 if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT &&
94 targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
95 return false;
96
97 player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, nullptr);
98 return true;
99 }
@ EQUIP_ERR_CANT_DO_RIGHT_NOW
Definition: Item.h:80
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition: PlayerStorage.cpp:4043

References EQUIP_ERR_CANT_DO_RIGHT_NOW, Object::GetEntry(), Object::GetTypeId(), SpellCastTargets::GetUnitTarget(), Unit::HasAura(), Player::SendEquipError(), and TYPEID_UNIT.