diff options
-rw-r--r-- | sql/updates/world/2013_07_25_00_world_spell_script_names.sql | 22 | ||||
-rw-r--r-- | sql/updates/world/2013_07_25_01_world_conditions.sql | 2 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.h | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 222 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 8 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 1 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 11 |
7 files changed, 251 insertions, 17 deletions
diff --git a/sql/updates/world/2013_07_25_00_world_spell_script_names.sql b/sql/updates/world/2013_07_25_00_world_spell_script_names.sql new file mode 100644 index 00000000000..14e6d16df44 --- /dev/null +++ b/sql/updates/world/2013_07_25_00_world_spell_script_names.sql @@ -0,0 +1,22 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ( +'spell_warl_banish', +'spell_dru_enrage', +'spell_pri_mana_burn', +'spell_pri_guardian_spirit', +'spell_dk_improved_blood_presence', +'spell_dk_improved_frost_presence', +'spell_dk_improved_unholy_presence', +'spell_dk_presence' +); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-710, 'spell_warl_banish'), +(5229, 'spell_dru_enrage'), +(8129, 'spell_pri_mana_burn'), +(47788, 'spell_pri_guardian_spirit'), +(-50365,'spell_dk_improved_blood_presence'), +(-50384,'spell_dk_improved_frost_presence'), +(-50391,'spell_dk_improved_unholy_presence'), +(48266, 'spell_dk_presence'), +(48263, 'spell_dk_presence'), +(48265, 'spell_dk_presence'); diff --git a/sql/updates/world/2013_07_25_01_world_conditions.sql b/sql/updates/world/2013_07_25_01_world_conditions.sql new file mode 100644 index 00000000000..1990fe3094b --- /dev/null +++ b/sql/updates/world/2013_07_25_01_world_conditions.sql @@ -0,0 +1,2 @@ +-- Fix gossip condition for Bat Handler Camille <Bat Handler> +UPDATE `conditions` SET `ConditionTypeOrReference`=28 WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8894 AND `SourceEntry`=0 AND `ConditionValue1`=11229; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 013f55d6fa9..070faba1b4f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -201,7 +201,7 @@ class SpellImplicitTargetInfo private: Targets _target; public: - SpellImplicitTargetInfo() : _target(Targets(0)) {} + SpellImplicitTargetInfo() : _target(Targets(0)) { } SpellImplicitTargetInfo(uint32 target); bool IsArea() const; diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 3094d0b236e..54c3401f747 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -41,7 +41,13 @@ enum DeathKnightSpells SPELL_DK_DEATH_COIL_HEAL = 47633, SPELL_DK_DEATH_STRIKE_HEAL = 45470, SPELL_DK_DEATH_STRIKE_ENABLER = 89832, + SPELL_DK_FROST_PRESENCE = 48263, + SPELL_DK_FROST_PRESENCE_TRIGGERED = 61261, + SPELL_DK_GHOUL_EXPLODE = 47496, SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE = 58625, + SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1 = 50365, + SPELL_DK_IMPROVED_FROST_PRESENCE_R1 = 50384, + SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1 = 50391, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, SPELL_DK_IMPROVED_DEATH_STRIKE = 62905, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, @@ -51,8 +57,14 @@ enum DeathKnightSpells SPELL_DK_RUNE_TAP = 48982, SPELL_DK_SCENT_OF_BLOOD = 50422, SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890, - SPELL_DK_WILL_OF_THE_NECROPOLIS = 96171, - SPELL_DK_UNHOLY_PRESENCE = 48265 + SPELL_DK_UNHOLY_PRESENCE = 48265, + SPELL_DK_UNHOLY_PRESENCE_TRIGGERED = 49772, + SPELL_DK_WILL_OF_THE_NECROPOLIS = 96171 +}; + +enum DeathKnightSpellIcons +{ + DK_ICON_ID_IMPROVED_DEATH_STRIKE = 2751 }; // 50462 - Anti-Magic Shell (on raid member) @@ -750,7 +762,7 @@ class spell_dk_icebound_fortitude : public SpellScriptLoader } }; -// 50365, 50371 - Improved Blood Presence +// -50365 - Improved Blood Presence class spell_dk_improved_blood_presence : public SpellScriptLoader { public: @@ -762,7 +774,10 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) return false; return true; } @@ -770,10 +785,10 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - if (!target->HasAura(SPELL_DK_BLOOD_PRESENCE) && !target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + if ((target->HasAura(SPELL_DK_FROST_PRESENCE) || target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) && !target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) { int32 basePoints1 = aurEff->GetAmount(); - target->CastCustomSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, NULL, &basePoints1, NULL, true, 0, aurEff); + target->CastCustomSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, NULL, &basePoints1, NULL, true, NULL, aurEff); } } @@ -797,7 +812,54 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader } }; -// 50391, 50392 - Improved Unholy Presence +// -50384 - Improved Frost Presence +class spell_dk_improved_frost_presence : public SpellScriptLoader +{ + public: + spell_dk_improved_frost_presence() : SpellScriptLoader("spell_dk_improved_frost_presence") { } + + class spell_dk_improved_frost_presence_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_improved_frost_presence_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE_TRIGGERED)) + return false; + return true; + } + + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if ((target->HasAura(SPELL_DK_BLOOD_PRESENCE) || target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) && !target->HasAura(SPELL_DK_FROST_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_FROST_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff); + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (!target->HasAura(SPELL_DK_FROST_PRESENCE)) + target->RemoveAura(SPELL_DK_FROST_PRESENCE_TRIGGERED); + } + + void Register() OVERRIDE + { + AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_frost_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_frost_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_dk_improved_frost_presence_AuraScript(); + } +}; + +// -50391 - Improved Unholy Presence class spell_dk_improved_unholy_presence : public SpellScriptLoader { public: @@ -809,7 +871,11 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED)) return false; return true; } @@ -821,13 +887,21 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader { // Not listed as any effect, only base points set in dbc int32 basePoints0 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0, &basePoints0, &basePoints0, true, 0, aurEff); + target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0, &basePoints0, &basePoints0, true, NULL, aurEff); } + + if ((target->HasAura(SPELL_DK_BLOOD_PRESENCE) || target->HasAura(SPELL_DK_FROST_PRESENCE)) && !target->HasAura(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + Unit* target = GetTarget(); + + target->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + + if (!target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) + target->RemoveAura(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED); } void Register() OVERRIDE @@ -843,6 +917,132 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader } }; +// 48266 - Blood Presence +// 48263 - Frost Presence +// 48265 - Unholy Presence +class spell_dk_presence : public SpellScriptLoader +{ + public: + spell_dk_presence() : SpellScriptLoader("spell_dk_presence") { } + + class spell_dk_presence_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_presence_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_FROST_PRESENCE_R1) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED) + || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED) + || !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE_TRIGGERED) + || !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED)) + return false; + + return true; + } + + void CheckImprovedBloodPresence() + { + Unit* target = GetTarget(); + if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1, EFFECT_0)) + if (!target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT1, aurEff->GetAmount(), target, true, NULL, aurEff); + } + + void CheckImprovedFrostPresence() + { + Unit* target = GetTarget(); + if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_R1, EFFECT_0)) + if (!target->HasAura(SPELL_DK_FROST_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_FROST_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff); + } + + void CheckImprovedUnholyPresence(bool inUnholy = false) + { + Unit* target = GetTarget(); + if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1, EFFECT_0)) + { + if (inUnholy) + { + // Not listed as any effect, only base points set + int32 bp = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &bp, &bp, &bp, true, 0, aurEff); + } + else if (!target->HasAura(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED)) + target->CastCustomSpell(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff); + } + } + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + + switch (GetSpellInfo()->Id) + { + case SPELL_DK_BLOOD_PRESENCE: + target->CastSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, true); + CheckImprovedFrostPresence(); + CheckImprovedUnholyPresence(); + break; + case SPELL_DK_FROST_PRESENCE: + target->CastSpell(target, SPELL_DK_FROST_PRESENCE_TRIGGERED, true); + CheckImprovedBloodPresence(); + CheckImprovedUnholyPresence(); + break; + case SPELL_DK_UNHOLY_PRESENCE: + target->CastSpell(target, SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, true); + CheckImprovedBloodPresence(); + CheckImprovedFrostPresence(); + CheckImprovedUnholyPresence(true); + break; + default: + return; + } + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->RemoveAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED); + target->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + target->RemoveAura(SPELL_DK_FROST_PRESENCE_TRIGGERED); + target->RemoveAura(SPELL_DK_UNHOLY_PRESENCE_TRIGGERED); + } + + void Register() OVERRIDE + { + uint32 auraType = 0; + + switch (m_scriptSpellId) + { + case SPELL_DK_BLOOD_PRESENCE: + auraType = SPELL_AURA_MOD_DAMAGE_PERCENT_DONE; + break; + case SPELL_DK_FROST_PRESENCE: + auraType = SPELL_AURA_MOD_BASE_RESISTANCE_PCT; + break; + case SPELL_DK_UNHOLY_PRESENCE: + auraType = SPELL_AURA_MOD_MELEE_HASTE; + break; + default: + return; + } + AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleEffectApply, EFFECT_0, auraType, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dk_presence_AuraScript::HandleEffectRemove, EFFECT_0, auraType, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_dk_presence_AuraScript(); + } +}; + // 59754 Rune Tap - Party class spell_dk_rune_tap_party : public SpellScriptLoader { @@ -1064,7 +1264,9 @@ void AddSC_deathknight_spell_scripts() new spell_dk_ghoul_explode(); new spell_dk_icebound_fortitude(); new spell_dk_improved_blood_presence(); + new spell_dk_improved_frost_presence(); new spell_dk_improved_unholy_presence(); + new spell_dk_presence(); new spell_dk_rune_tap_party(); new spell_dk_scent_of_blood(); new spell_dk_scourge_strike(); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 26b50b4b3b4..d8e48862a15 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -205,6 +205,14 @@ class spell_dru_enrage : public SpellScriptLoader { PrepareSpellScript(spell_dru_enrage_SpellScript); + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_KING_OF_THE_JUNGLE) + || !sSpellMgr->GetSpellInfo(SPELL_DRUID_ENRAGE_MOD_DAMAGE)) + return false; + return true; + } + void OnHit() { if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_0)) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 354db0ae864..c931b309e82 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -130,7 +130,6 @@ class spell_warl_aftermath : public SpellScriptLoader }; // 710 - Banish -/// Updated 4.3.4 class spell_warl_banish : public SpellScriptLoader { public: diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index c2b7c1950bd..d0008d1e674 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -60,6 +60,12 @@ enum WarriorSpells SPELL_WARRIOR_VENGEANCE = 76691 }; +enum WarriorSpellIcons +{ + WARRIOR_ICON_ID_SUDDEN_DEATH = 1989 +}; + + enum MiscSpells { SPELL_PALADIN_BLESSING_OF_SANCTUARY = 20911, @@ -67,11 +73,6 @@ enum MiscSpells SPELL_PRIEST_RENEWED_HOPE = 63944 }; -enum WarriorSpellIcons -{ - WARRIOR_ICON_ID_SUDDEN_DEATH = 1989 -}; - /// Updated 4.3.4 class spell_warr_bloodthirst : public SpellScriptLoader { |