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

Public Member Functions

 item_incendiary_explosives ()
 
bool OnUse (Player *player, Item *item, SpellCastTargets 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_incendiary_explosives()

item_incendiary_explosives::item_incendiary_explosives ( )
inline
77: ItemScript("item_incendiary_explosives") { }
Definition: ItemScript.h:24

Member Function Documentation

◆ OnUse()

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

Reimplemented from ItemScript.

80 {
81 if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15))
82 return false;
83 else
84 {
85 player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, nullptr);
86 return true;
87 }
88 }
@ EQUIP_ERR_OUT_OF_RANGE
Definition: Item.h:72
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition: PlayerStorage.cpp:4027

References EQUIP_ERR_OUT_OF_RANGE, WorldObject::FindNearestCreature(), and Player::SendEquipError().