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
146: 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.

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