diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/world/item_scripts.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/bindings/scripts/scripts/world/item_scripts.cpp b/src/bindings/scripts/scripts/world/item_scripts.cpp index e1b3d96ed03..86d78b28176 100644 --- a/src/bindings/scripts/scripts/world/item_scripts.cpp +++ b/src/bindings/scripts/scripts/world/item_scripts.cpp @@ -287,6 +287,35 @@ bool ItemUse_item_pile_fake_furs(Player *pPlayer, Item *pItem, SpellCastTargets return false; } +/*##### +# item_petrov_cluster_bombs +#####*/ + +enum ePetrovClusterBombs +{ + SPELL_PETROV_BOMB = 42406, + AREA_ID_SHATTERED_STRAITS = 4064, + ZONE_ID_HOWLING = 495 +}; + +bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets) +{ + if (pPlayer->GetZoneId() != ZONE_ID_HOWLING) + return false; + + if (!pPlayer->GetTransport() || pPlayer->GetAreaId() != AREA_ID_SHATTERED_STRAITS) + { + pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + + if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_PETROV_BOMB)) + Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_HERE); + + return true; + } + + return false; +} + void AddSC_item_scripts() { Script *newscript; @@ -340,5 +369,9 @@ void AddSC_item_scripts() newscript->Name = "item_pile_fake_furs"; newscript->pItemUse = &ItemUse_item_pile_fake_furs; newscript->RegisterSelf(); -} + newscript = new Script; + newscript->Name = "item_petrov_cluster_bombs"; + newscript->pItemUse = &ItemUse_item_petrov_cluster_bombs; + newscript->RegisterSelf(); +} |