TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
item_petrov_cluster_bombs Class Reference

Public Member Functions

 item_petrov_cluster_bombs ()
 
bool OnUse (Player *player, Item *, const SpellCastTargets &) override
 
- Public Member Functions inherited from ItemScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Item *)
 
virtual bool OnQuestAccept (Player *, Item *, Quest const *)
 
virtual bool OnExpire (Player *, ItemTemplate const *)
 
virtual bool OnRemove (Player *, Item *)
 
- Public Member Functions inherited from ScriptObject
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 ()
 

Constructor & Destructor Documentation

item_petrov_cluster_bombs::item_petrov_cluster_bombs ( )
inline
269 : ItemScript("item_petrov_cluster_bombs") { }
ItemScript(const char *name)
Definition: ScriptMgr.cpp:1580

Member Function Documentation

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

Reimplemented from ItemScript.

272  {
273  if (player->GetZoneId() != ZONE_ID_HOWLING)
274  return false;
275 
276  if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
277  {
278  if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
279  Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
280 
281  return true;
282  }
283 
284  return false;
285  }
Definition: SpellInfo.h:326
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, OpcodeServer opcode=SMSG_CAST_FAILED, uint32 *misc=nullptr)
Definition: Spell.cpp:3732
Definition: item_scripts.cpp:262
Definition: item_scripts.cpp:261
Definition: item_scripts.cpp:263
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: SharedDefines.h:1346

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: