aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorSouler <soulerhyd@gmail.com>2012-01-29 03:49:55 +0100
committerSouler <soulerhyd@gmail.com>2012-01-29 03:49:55 +0100
commit50a6ec015eb1cfd7e55129026bd1e3e34d9603a0 (patch)
tree5b281e2f5e2abc6a5e80a661ddd718e2c98d0d0a /src/server/scripts/Spells
parente336c6ff57d751d4e395eb6c0bad3c9066765199 (diff)
Scripts/Spells: Fixed behaviour of Elune's Candle, Rockets and Rocket Clusters.
Scripts/NPC: Implemented AI for Omen and his summoning ritual.
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 2b31a50510d..d0307966795 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -412,6 +412,75 @@ class spell_gen_leeching_swarm : public SpellScriptLoader
}
};
+enum EluneCandle
+{
+ NPC_OMEN = 15467,
+
+ SPELL_ELUNE_CANDLE_OMEN_HEAD = 26622,
+ SPELL_ELUNE_CANDLE_OMEN_CHEST = 26624,
+ SPELL_ELUNE_CANDLE_OMEN_HAND_R = 26625,
+ SPELL_ELUNE_CANDLE_OMEN_HAND_L = 26649,
+ SPELL_ELUNE_CANDLE_NORMAL = 26636,
+};
+
+class spell_gen_elune_candle : public SpellScriptLoader
+{
+ public:
+ spell_gen_elune_candle() : SpellScriptLoader("spell_gen_elune_candle") {}
+
+ class spell_gen_elune_candle_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_elune_candle_SpellScript);
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ {
+ uint32 spellId = 0;
+
+ if (target->GetEntry() == NPC_OMEN)
+ {
+ switch (urand(0, 3))
+ {
+ case 0: spellId = SPELL_ELUNE_CANDLE_OMEN_HEAD; break;
+ case 1: spellId = SPELL_ELUNE_CANDLE_OMEN_CHEST; break;
+ case 2: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_R; break;
+ case 3: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_L; break;
+ }
+ }
+ else
+ spellId = SPELL_ELUNE_CANDLE_NORMAL;
+
+ GetCaster()->CastSpell(target, spellId, true, NULL);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_elune_candle_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_elune_candle_SpellScript();
+ }
+};
+
// 24750 Trick
enum eTrickSpells
{
@@ -1592,4 +1661,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_luck_of_the_draw();
new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise");
new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise");
+ new spell_gen_elune_candle();
}