diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-18 12:05:57 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-18 12:05:57 +0200 |
| commit | 98c8dc346ad5c84e548a966daba77a5e0098ee59 (patch) | |
| tree | b7df37fbc541d5c3b7949367c3fceaae07db8bdb | |
| parent | 177ecd6dace5622e207b407b23aea537d6c3a4aa (diff) | |
Core/Spells: Convert/Update more spells in spell script for 4.3.4
| -rw-r--r-- | sql/updates/world/2013_07_18_00_world_spell_script_misc_434.sql | 15 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 39 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 48 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 37 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 56 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 2 |
6 files changed, 152 insertions, 45 deletions
diff --git a/sql/updates/world/2013_07_18_00_world_spell_script_misc_434.sql b/sql/updates/world/2013_07_18_00_world_spell_script_misc_434.sql new file mode 100644 index 00000000000..9eed10846cb --- /dev/null +++ b/sql/updates/world/2013_07_18_00_world_spell_script_misc_434.sql @@ -0,0 +1,15 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (-31641,50421,-30881); +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(-31641,'spell_mage_blazing_speed'), +(50421,'spell_dk_scent_of_blood'), +(-30881,'spell_sha_nature_guardian'); + +DELETE FROM `spell_ranks` WHERE `first_spell_id` IN (31641,30881); +INSERT INTO `spell_ranks` (`first_spell_id`, `spell_id`, `rank`) VALUES +(31641, 31641, 1), +(31641, 31642, 2), +(30881, 30881, 1), +(30881, 30883, 2), +(30881, 30884, 3); + +DELETE FROM `spell_proc_event` WHERE `entry` IN (30881,30883,30884); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cb7c02d894c..52f624f0f30 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7086,29 +7086,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg } } break; - case SPELLFAMILY_MAGE: - if (auraSpellInfo->SpellIconID == 2127) // Blazing Speed - { - switch (auraSpellInfo->Id) - { - case 31641: // Rank 1 - case 31642: // Rank 2 - trigger_spell_id = 31643; - break; - default: - TC_LOG_ERROR(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id); - return false; - } - } - break; - case SPELLFAMILY_WARRIOR: - if (auraSpellInfo->Id == 50421) // Scent of Blood - { - CastSpell(this, 50422, true); - RemoveAuraFromStack(auraSpellInfo->Id); - return false; - } - break; case SPELLFAMILY_PRIEST: { // Greater Heal Refund @@ -7288,22 +7265,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg target = this; break; } - case 30881: // Nature's Guardian Rank 1 - case 30883: // Nature's Guardian Rank 2 - case 30884: // Nature's Guardian Rank 3 - { - if (!HealthBelowPctDamaged(30, damage)) - { - basepoints0 = int32(CountPctFromMaxHealth(triggerAmount)); - target = this; - trigger_spell_id = 31616; - if (victim && victim->IsAlive()) - victim->getThreatManager().modifyThreatPercent(this, -10); - } - else - return false; - break; - } } break; } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 2aa919d388c..f0dca9a8a82 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -32,6 +32,7 @@ enum DeathKnightSpells SPELL_DK_BLACK_ICE_R1 = 49140, SPELL_DK_BLOOD_BOIL_TRIGGERED = 65658, SPELL_DK_BLOOD_GORGED_HEAL = 50454, + SPELL_DK_BLOOD_PRESENCE = 48266, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999, SPELL_DK_CORPSE_EXPLOSION_VISUAL = 51270, SPELL_DK_DEATH_COIL_DAMAGE = 47632, @@ -39,16 +40,16 @@ enum DeathKnightSpells SPELL_DK_DEATH_STRIKE_HEAL = 45470, SPELL_DK_GHOUL_EXPLODE = 47496, SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE = 58625, + SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, + SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, + SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962, + SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736, SPELL_DK_RUNIC_POWER_ENERGIZE = 49088, + SPELL_DK_SCENT_OF_BLOOD = 50422, SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890, SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284, - SPELL_DK_BLOOD_PRESENCE = 48266, - SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, SPELL_DK_UNHOLY_PRESENCE = 48265, - SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, - SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962, - SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736 }; enum DeathKnightSpellIcons @@ -807,6 +808,42 @@ class spell_dk_rune_tap_party : public SpellScriptLoader } }; +// 50421 - Scent of Blood +class spell_dk_scent_of_blood : public SpellScriptLoader +{ + public: + spell_dk_scent_of_blood() : SpellScriptLoader("spell_dk_scent_of_blood") { } + + class spell_dk_scent_of_blood_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_scent_of_blood_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCENT_OF_BLOOD)) + return false; + return true; + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_DK_SCENT_OF_BLOOD, true, NULL, aurEff); + GetTarget()->RemoveAuraFromStack(GetSpellInfo()->Id); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_dk_scent_of_blood_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_dk_scent_of_blood_AuraScript(); + } +}; + // 55090 - Scourge Strike (55265, 55270, 55271) class spell_dk_scourge_strike : public SpellScriptLoader { @@ -1023,6 +1060,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_improved_blood_presence(); new spell_dk_improved_unholy_presence(); new spell_dk_rune_tap_party(); + new spell_dk_scent_of_blood(); new spell_dk_scourge_strike(); new spell_dk_spell_deflection(); new spell_dk_vampiric_blood(); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 8fe628b6ba8..6a62e5178e0 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -29,6 +29,7 @@ enum MageSpells { + SPELL_MAGE_BLAZING_SPEED = 31643, SPELL_MAGE_BURNOUT = 29077, SPELL_MAGE_COLD_SNAP = 11958, SPELL_MAGE_FOCUS_MAGIC_PROC = 54648, @@ -162,6 +163,41 @@ class spell_mage_blast_wave : public SpellScriptLoader } }; +// -31641 - Blazing Speed +class spell_mage_blazing_speed : public SpellScriptLoader +{ + public: + spell_mage_blazing_speed() : SpellScriptLoader("spell_mage_blazing_speed") { } + + class spell_mage_blazing_speed_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_blazing_speed_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_BLAZING_SPEED)) + return false; + return true; + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_BLAZING_SPEED, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_mage_blazing_speed_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_mage_blazing_speed_AuraScript(); + } +}; + // -44449 - Burnout class spell_mage_burnout : public SpellScriptLoader { @@ -1189,6 +1225,7 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); + new spell_mage_blazing_speed(); new spell_mage_blizzard(); new spell_mage_burnout(); new spell_mage_cold_snap(); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 51901dc47c5..c26f9b360dc 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -49,6 +49,7 @@ enum ShamanSpells SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 65264, SPELL_SHAMAN_LAVA_SURGE = 77762, SPELL_SHAMAN_LIGHTNING_SHIELD = 324, + SPELL_SHAMAN_NATURE_GUARDIAN = 31616, SPELL_SHAMAN_SATED = 57724, SPELL_SHAMAN_STORM_EARTH_AND_FIRE = 51483, SPELL_SHAMAN_TELLURIC_CURRENTS = 82987, @@ -770,6 +771,60 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader } }; +// -30881 - Nature's Guardian +class spell_sha_nature_guardian : public SpellScriptLoader +{ + public: + spell_sha_nature_guardian() : SpellScriptLoader("spell_sha_nature_guardian") { } + + class spell_sha_nature_guardian_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_nature_guardian_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_NATURE_GUARDIAN)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + //! HACK due to currenct proc system implementation + if (Player* player = GetTarget()->ToPlayer()) + if (player->HasSpellCooldown(GetSpellInfo()->Id)) + return false; + + return GetTarget()->HealthBelowPctDamaged(30, eventInfo.GetDamageInfo()->GetDamage()); + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 basePoints0 = GetTarget()->CountPctFromMaxHealth(aurEff->GetAmount()); + + GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_NATURE_GUARDIAN, &basePoints0, NULL, NULL, true); + + if (eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive()) + eventInfo.GetProcTarget()->getThreatManager().modifyThreatPercent(GetTarget(), -10); + + if (Player* player = GetTarget()->ToPlayer()) + player->AddSpellCooldown(GetSpellInfo()->Id, 0, time(NULL) + aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); + } + + void Register() OVERRIDE + { + DoCheckProc += AuraCheckProcFn(spell_sha_nature_guardian_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_sha_nature_guardian_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_sha_nature_guardian_AuraScript(); + } +}; + // 88756 - Rolling Thunder class spell_sha_rolling_thunder : public SpellScriptLoader { @@ -930,6 +985,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_lava_surge(); new spell_sha_lava_surge_proc(); new spell_sha_mana_tide_totem(); + new spell_sha_nature_guardian(); new spell_sha_rolling_thunder(); new spell_sha_telluric_currents(); new spell_sha_thunderstorm(); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 2eff86bcfdd..b46dc7ef80a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -899,7 +899,7 @@ class spell_warl_seduction : public SpellScriptLoader } } - void Register() + void Register() OVERRIDE { OnEffectHitTarget += SpellEffectFn(spell_warl_seduction_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA); } |
