Implemented script for item Petrov's Cluster Bombs, code from ScriptDev2.

--HG--
branch : trunk
This commit is contained in:
_manuel_
2010-01-18 14:07:59 -03:00
parent 8dc9140e1c
commit 1c9f2186ab
3 changed files with 37 additions and 1 deletions
@@ -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();
}