[6.x] Scripts/Spells: K'ure & Decimatus, SAI + spell scripts

* Core/DB Add SAI for Decimatus.

Add Decimatus SAI and Dark Siphon spell condition target.

* Decimatus spell script for 169869.

Decimatus Transformation Sickness.

* Replace caster on target. Compiling fine!

And then you never know what comes into head Blizzard.

* Add three spell scripts.

Add support spell scripts for 189549, 189512 and 189491.
This commit is contained in:
Ulduar
2016-07-05 23:27:59 +06:00
committed by Aokromes
parent b63346a25e
commit 48f0f47dd2
2 changed files with 195 additions and 0 deletions

View File

@@ -4228,6 +4228,164 @@ class spell_gen_clear_debuffs : public SpellScriptLoader
}
};
// 169869 - Transformation Sickness
class spell_gen_decimatus_transformation_sickness : public SpellScriptLoader
{
public:
spell_gen_decimatus_transformation_sickness() : SpellScriptLoader("spell_gen_decimatus_transformation_sickness") { }
class spell_gen_decimatus_transformation_sickness_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_decimatus_transformation_sickness_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
target->SetHealth(target->CountPctFromMaxHealth(10));
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_decimatus_transformation_sickness_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_decimatus_transformation_sickness_SpellScript();
}
};
// 189491 - Summon Towering Infernal.
class spell_gen_anetheron_summon_towering_infernal : public SpellScriptLoader
{
public:
spell_gen_anetheron_summon_towering_infernal() : SpellScriptLoader("spell_gen_anetheron_summon_towering_infernal") { }
class spell_gen_anetheron_summon_towering_infernal_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_anetheron_summon_towering_infernal_SpellScript);
void HandleDummy(SpellEffIndex /* effIndex */)
{
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_anetheron_summon_towering_infernal_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_anetheron_summon_towering_infernal_SpellScript();
}
};
enum KazrogalHellfireMark
{
SPELL_MARK_OF_KAZROGAL_HELLFIRE = 189512,
SPELL_MARK_OF_KAZROGAL_DAMAGE_HELLFIRE = 189515
};
class MarkTargetHellfireFilter
{
public:
bool operator()(WorldObject* target) const
{
if (Unit* unit = target->ToUnit())
return unit->getPowerType() != POWER_MANA;
return false;
}
};
class spell_gen_mark_of_kazrogal_hellfire : public SpellScriptLoader
{
public:
spell_gen_mark_of_kazrogal_hellfire() : SpellScriptLoader("spell_gen_mark_of_kazrogal_hellfire") { }
class spell_gen_mark_of_kazrogal_hellfire_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_mark_of_kazrogal_hellfire_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(MarkTargetHellfireFilter());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gen_mark_of_kazrogal_hellfire_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_gen_mark_of_kazrogal_hellfire_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_mark_of_kazrogal_hellfire_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_KAZROGAL_DAMAGE_HELLFIRE))
return false;
return true;
}
void OnPeriodic(AuraEffect const* aurEff)
{
Unit* target = GetTarget();
if (target->GetPower(POWER_MANA) == 0)
{
target->CastSpell(target, SPELL_MARK_OF_KAZROGAL_DAMAGE_HELLFIRE, true, NULL, aurEff);
// Remove aura
SetDuration(0);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_mark_of_kazrogal_hellfire_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_POWER_BURN);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_mark_of_kazrogal_hellfire_SpellScript();
}
AuraScript* GetAuraScript() const override
{
return new spell_gen_mark_of_kazrogal_hellfire_AuraScript();
}
};
class spell_gen_azgalor_rain_of_fire_hellfire_citadel : public SpellScriptLoader
{
public:
spell_gen_azgalor_rain_of_fire_hellfire_citadel() : SpellScriptLoader("spell_gen_azgalor_rain_of_fire_hellfire_citadel") { }
class spell_gen_azgalor_rain_of_fire_hellfire_citadel_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_azgalor_rain_of_fire_hellfire_citadel_SpellScript);
void HandleDummy(SpellEffIndex /* effIndex */)
{
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_azgalor_rain_of_fire_hellfire_citadel_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_azgalor_rain_of_fire_hellfire_citadel_SpellScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -4318,4 +4476,8 @@ void AddSC_generic_spell_scripts()
new spell_gen_mixology_bonus();
new spell_gen_landmine_knockback_achievement();
new spell_gen_clear_debuffs();
new spell_gen_decimatus_transformation_sickness();
new spell_gen_anetheron_summon_towering_infernal();
new spell_gen_mark_of_kazrogal_hellfire();
new spell_gen_azgalor_rain_of_fire_hellfire_citadel();
}