aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author_manuel_ <none@none>2010-01-18 14:07:59 -0300
committer_manuel_ <none@none>2010-01-18 14:07:59 -0300
commit1c9f2186ab20917c7be84550f73959796c90d29d (patch)
tree1397599cd422a1eefcce7f9a7ab6298439822a75
parent8dc9140e1cd7baa0fc082494b4920b9b2dcfbf32 (diff)
Implemented script for item Petrov's Cluster Bombs, code from ScriptDev2.
--HG-- branch : trunk
-rw-r--r--sql/FULL/world_scripts_full.sql1
-rw-r--r--sql/updates/7090_world_scriptname.sql2
-rw-r--r--src/bindings/scripts/scripts/world/item_scripts.cpp35
3 files changed, 37 insertions, 1 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index ed74d459854..b5583dc5d44 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -93,6 +93,7 @@ UPDATE `item_template` SET `ScriptName`='item_incendiary_explosives' WHERE (`ent
UPDATE `item_template` SET `ScriptName`='item_mysterious_egg' WHERE `entry` IN(39878);
UPDATE `item_template` SET `ScriptName`='item_disgusting_jar' WHERE `entry` IN(44717);
UPDATE `item_template` SET `ScriptName`='item_harvesters_gift' WHERE `entry`=39253;
+UPDATE `item_template` SET `ScriptName`='item_petrov_cluster_bombs' WHERE `entry`=33098;
/* NPC (usually creatures to be found in more than one specific zone) */
UPDATE `creature_template` SET `ScriptName`='npc_air_force_bots' WHERE `entry` IN (2614,2615,21974,21993,21996,21997,21999,22001,22002,22003,22063,22065,22066,22068,22069,22070,22071,22078,22079,22080,22086,22087,22088,22090,22124,22125,22126);
diff --git a/sql/updates/7090_world_scriptname.sql b/sql/updates/7090_world_scriptname.sql
new file mode 100644
index 00000000000..a67bc5cbceb
--- /dev/null
+++ b/sql/updates/7090_world_scriptname.sql
@@ -0,0 +1,2 @@
+UPDATE `item_template` SET `ScriptName`='item_petrov_cluster_bombs' WHERE `entry`=33098;
+
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();
+}