aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlduar <Ulduar@users.noreply.github.com>2016-07-05 23:27:59 +0600
committerAokromes <Aokromes@users.noreply.github.com>2016-07-05 19:27:59 +0200
commit48f0f47dd2c83eeb4bceff53fdb7c94bc0ce5190 (patch)
treea3cf2246361646e95f63c5934a8beeedc8ae7b5a
parentb63346a25e2b7942bc618e91aa2b3d1690d6687a (diff)
[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.
-rw-r--r--sql/updates/world/6.x/2016_06_11_00_world.sql33
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp162
2 files changed, 195 insertions, 0 deletions
diff --git a/sql/updates/world/6.x/2016_06_11_00_world.sql b/sql/updates/world/6.x/2016_06_11_00_world.sql
new file mode 100644
index 00000000000..e81a39afd96
--- /dev/null
+++ b/sql/updates/world/6.x/2016_06_11_00_world.sql
@@ -0,0 +1,33 @@
+-- Dark Siphon
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=0 AND `SourceEntry`=165059;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,165059,0,0,31,0,3,81556 ,0,0,"","Dark Siphon – Cast only on K'ure.");
+
+-- Decimatus SAI
+SET @ENTRY := 81989;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,11,169869,34,0,0,0,0,1,0,0,0,0,0,0,0,"Decimatus - On Respawn - Cast Transformation Sickness on Self (Need Core Handler for Spell)"),
+(@ENTRY,0,1,0,0,0,100,0,9000,11000,9000,11000,11,174011,0,0,0,0,0,5,0,0,0,0,0,0,0,"Decimatus - In Combat - Cast Neutralize - Need Core Handler."),
+(@ENTRY,0,2,0,0,0,100,0,27000,27000,27000,27000,11,174016,1,0,0,0,0,1,0,0,0,0,0,0,0,"Decimatus - In Combat - Cast Decimate.");
+
+-- spell_gen_decimatus_transformation_sickness
+ DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_decimatus_transformation_sickness';
+ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+ (169869,'spell_gen_decimatus_transformation_sickness');
+
+-- spell_gen_azgalor_rain_of_fire_hellfire_citadel
+ DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_azgalor_rain_of_fire_hellfire_citadel';
+ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+ (189549,'spell_gen_azgalor_rain_of_fire_hellfire_citadel');
+
+-- spell_gen_mark_of_kazrogal_hellfire
+ DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_mark_of_kazrogal_hellfire';
+ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+ (189512,'spell_gen_mark_of_kazrogal_hellfire');
+
+-- spell_gen_anetheron_summon_towering_infernal
+ DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_anetheron_summon_towering_infernal';
+ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+ (189491,'spell_gen_anetheron_summon_towering_infernal');
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index cf9ff3ef28b..f0ebfb23427 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -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();
}