Scripts/Spells: Fixed behaviour of Elune's Candle, Rockets and Rocket Clusters.
Scripts/NPC: Implemented AI for Omen and his summoning ritual.
This commit is contained in:
1 parent
e336c6ff57
commit
50a6ec015e
4 files changed
+598
-1
No files matched your search
@@ -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();
|
||||
}
|
||||
Reference in new issue
Block a user