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

Public Member Functions

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

item_petrov_cluster_bombs::item_petrov_cluster_bombs ( )
inline
177: ItemScript("item_petrov_cluster_bombs") { }
Definition: ItemScript.h:24

Member Function Documentation

◆ OnUse()

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

Reimplemented from ItemScript.

180 {
181 if (player->GetZoneId() != ZONE_ID_HOWLING)
182 return false;
183
184 if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
185 {
186 player->SendEquipError(EQUIP_ERR_NONE, item, nullptr);
187
188 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
189 Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
190
191 return true;
192 }
193
194 return false;
195 }
@ EQUIP_ERR_NONE
Definition: Item.h:100
#define sSpellMgr
Definition: SpellMgr.h:825
@ ZONE_ID_HOWLING
Definition: item_scripts.cpp:171
@ SPELL_PETROV_BOMB
Definition: item_scripts.cpp:169
@ AREA_ID_SHATTERED_STRAITS
Definition: item_scripts.cpp:170
@ SPELL_FAILED_NOT_HERE
Definition: SharedDefines.h:1009
Transport * GetTransport() const
Definition: Object.h:585
uint32 GetAreaId() const
Definition: Object.cpp:3108
uint32 GetZoneId() const
Definition: Object.cpp:3100
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition: PlayerStorage.cpp:4043
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
Definition: Spell.cpp:4645
Definition: SpellInfo.h:314

References AREA_ID_SHATTERED_STRAITS, EQUIP_ERR_NONE, WorldObject::GetAreaId(), WorldObject::GetTransport(), WorldObject::GetZoneId(), Spell::SendCastResult(), Player::SendEquipError(), SPELL_FAILED_NOT_HERE, SPELL_PETROV_BOMB, sSpellMgr, and ZONE_ID_HOWLING.