aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManuel Carrasco <manue.l@live.com.ar>2011-02-12 12:04:02 -0300
committerManuel Carrasco <manue.l@live.com.ar>2011-02-12 12:04:02 -0300
commit30916fd9ffaf198f4311cdd6fc0e0c05ddfc2f80 (patch)
tree64dc7331140a184ffd710478f7e91aaa9ffb5d33 /src
parentfcc57b2c9575df1f19d56787d5edd4da3cb573f6 (diff)
Scrips/Spell: Implemented script for spell 26678.
Signed-off-by: Manuel Carrasco <manue.l@live.com.ar>
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_item.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index d1d8620b028..43589c68180 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -804,6 +804,51 @@ enum eGenericData
SPELL_MITHRIL_MECHANICAL_DRAGONLING = 12749,
};
+enum CreateHeartCandy
+{
+ ITEM_HEART_CANDY_1 = 21818,
+ ITEM_HEART_CANDY_2 = 21817,
+ ITEM_HEART_CANDY_3 = 21821,
+ ITEM_HEART_CANDY_4 = 21819,
+ ITEM_HEART_CANDY_5 = 21816,
+ ITEM_HEART_CANDY_6 = 21823,
+ ITEM_HEART_CANDY_7 = 21822,
+ ITEM_HEART_CANDY_8 = 21820,
+};
+
+class spell_item_create_heart_candy : public SpellScriptLoader
+{
+ public:
+ spell_item_create_heart_candy() : SpellScriptLoader("spell_item_create_heart_candy") { }
+
+ class spell_item_create_heart_candy_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_create_heart_candy_SpellScript);
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ if (!GetHitUnit() || !GetHitUnit()->ToPlayer())
+ return;
+
+ Player* target = GetHitUnit()->ToPlayer();
+
+ static const uint32 items[] = {ITEM_HEART_CANDY_1,ITEM_HEART_CANDY_2,ITEM_HEART_CANDY_3,ITEM_HEART_CANDY_4,ITEM_HEART_CANDY_5,ITEM_HEART_CANDY_6,ITEM_HEART_CANDY_7,ITEM_HEART_CANDY_8};
+
+ target->AddItem(items[urand(0,7)],1);
+ }
+
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_item_create_heart_candy_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_create_heart_candy_SpellScript();
+ }
+};
+
void AddSC_item_spell_scripts()
{
// 23074 Arcanite Dragonling
@@ -827,4 +872,6 @@ void AddSC_item_spell_scripts()
new spell_item_underbelly_elixir();
new spell_item_shadowmourne();
new spell_item_red_rider_air_rifle();
+
+ new spell_item_create_heart_candy();
}