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
 
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_petrov_cluster_bombs()

item_petrov_cluster_bombs::item_petrov_cluster_bombs ( )
inline
145: 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.

148 {
149 if (player->GetZoneId() != ZONE_ID_HOWLING)
150 return false;
151
152 if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
153 {
154 player->SendEquipError(EQUIP_ERR_NONE, item, nullptr);
155
156 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
157 Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
158
159 return true;
160 }
161
162 return false;
163 }
@ EQUIP_ERR_NONE
Definition: Item.h:106
#define sSpellMgr
Definition: SpellMgr.h:825
@ ZONE_ID_HOWLING
Definition: item_scripts.cpp:139
@ SPELL_PETROV_BOMB
Definition: item_scripts.cpp:137
@ AREA_ID_SHATTERED_STRAITS
Definition: item_scripts.cpp:138
@ SPELL_FAILED_NOT_HERE
Definition: SharedDefines.h:1009
Transport * GetTransport() const
Definition: Object.h:599
uint32 GetAreaId() const
Definition: Object.cpp:3152
uint32 GetZoneId() const
Definition: Object.cpp:3144
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition: PlayerStorage.cpp:4027
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
Definition: Spell.cpp:4661
Definition: SpellInfo.h:316

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.