diff options
author | Subv <s.v.h21@hotmail.com> | 2012-10-14 19:15:00 -0500 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-10-14 19:18:18 -0500 |
commit | 963aa5a159c5541b6c794b42a5f5809bc7a36192 (patch) | |
tree | c464298eb1a47faf2e077ce34410cb4135d1a1d9 /src | |
parent | 1b432405121527b92d91ed4843d5ebed9a56874d (diff) |
Scripts/Spells: Updated some warlock spellscripts to 4.3.4
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Unit/StatSystem.cpp | 10 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 74 |
2 files changed, 44 insertions, 40 deletions
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index f2266f03ae9..eac2b531805 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1101,8 +1101,8 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) //demons benefit from warlocks shadow or fire damage else if (isPet()) { - int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); - int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); + int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); int32 maximum = (fire > shadow) ? fire : shadow; if (maximum < 0) maximum = 0; @@ -1112,7 +1112,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) //water elementals benefit from mage's frost damage else if (GetEntry() == ENTRY_WATER_ELEMENTAL) { - int32 frost = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST); + int32 frost = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST); if (frost < 0) frost = 0; SetBonusDamage(int32(frost * 0.4f)); @@ -1145,14 +1145,14 @@ void Guardian::UpdateDamagePhysical(WeaponAttackType attType) //force of nature if (GetEntry() == ENTRY_TREANT) { - int32 spellDmg = int32(m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE)) - m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE); + int32 spellDmg = int32(m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE)) + m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE); if (spellDmg > 0) bonusDamage = spellDmg * 0.09f; } //greater fire elemental else if (GetEntry() == ENTRY_FIRE_ELEMENTAL) { - int32 spellDmg = int32(m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 spellDmg = int32(m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) + m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); if (spellDmg > 0) bonusDamage = spellDmg * 0.4f; } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e7cca8fed36..6bfa2419fdd 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -40,11 +40,16 @@ enum WarlockSpells WARLOCK_HAUNT = 48181, WARLOCK_HAUNT_HEAL = 48210, WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, - WARLOCK_CURSE_OF_DOOM_EFFECT = 18662, + WARLOCK_BANE_OF_DOOM_EFFECT = 18662, WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956, + WARLOCK_SOULSHATTER = 32835, + WARLOCK_LIFE_TAP_ENERGIZE = 31818, + WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553, + WARLOCK_IMPROVED_LIFE_TAP_ICON_ID = 208, + WARLOCK_MANA_FEED_ICON_ID = 1982, }; /// Updated 4.3.4 @@ -244,6 +249,7 @@ uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellS }; // 47422 Everlasting Affliction +/// Updated 4.3.4 class spell_warl_everlasting_affliction : public SpellScriptLoader { public: @@ -273,6 +279,8 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; +// 27285 Seed of Corruption +/// Updated 4.3.4 class spell_warl_seed_of_corruption : public SpellScriptLoader { public: @@ -300,11 +308,8 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader } }; -enum Soulshatter -{ - SPELL_SOULSHATTER = 32835, -}; - +// 29858 Soulshatter +/// Updated 4.3.4 class spell_warl_soulshatter : public SpellScriptLoader { public: @@ -316,7 +321,7 @@ class spell_warl_soulshatter : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_SOULSHATTER)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_SOULSHATTER)) return false; return true; } @@ -325,10 +330,8 @@ class spell_warl_soulshatter : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* target = GetHitUnit()) - { if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f) - caster->CastSpell(target, SPELL_SOULSHATTER, true); - } + caster->CastSpell(target, WARLOCK_SOULSHATTER, true); } void Register() @@ -343,14 +346,8 @@ class spell_warl_soulshatter : public SpellScriptLoader } }; -enum LifeTap -{ - SPELL_LIFE_TAP_ENERGIZE = 31818, - SPELL_LIFE_TAP_ENERGIZE_2 = 32553, - ICON_ID_IMPROVED_LIFE_TAP = 208, - ICON_ID_MANA_FEED = 1982, -}; - +// 1454 Life Tap +/// Updated 4.3.4 class spell_warl_life_tap : public SpellScriptLoader { public: @@ -367,7 +364,7 @@ class spell_warl_life_tap : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE_2)) return false; return true; } @@ -377,34 +374,31 @@ class spell_warl_life_tap : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); if (Unit* target = GetHitUnit()) { - int32 damage = GetEffectValue(); - int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f)); + int32 damage = caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue()); + int32 mana = CalculatePct(damage, GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Shouldn't Appear in Combat Log target->ModifyHealth(-damage); // Improved Life Tap mod - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, ICON_ID_IMPROVED_LIFE_TAP, 0)) + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_IMPROVED_LIFE_TAP_ICON_ID, 0)) AddPct(mana, aurEff->GetAmount()); - caster->CastCustomSpell(target, SPELL_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false); + caster->CastCustomSpell(target, WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false); // Mana Feed - int32 manaFeedVal = 0; - if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, ICON_ID_MANA_FEED, 0)) - manaFeedVal = aurEff->GetAmount(); - - if (manaFeedVal > 0) + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_MANA_FEED_ICON_ID, 0)) { + int32 manaFeedVal = aurEff->GetAmount(); ApplyPct(manaFeedVal, mana); - caster->CastCustomSpell(caster, SPELL_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL); + caster->CastCustomSpell(caster, WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL); } } } SpellCastResult CheckCast() { - if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel)))) + if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue()))) return SPELL_CAST_OK; return SPELL_FAILED_FIZZLE; } @@ -422,6 +416,8 @@ class spell_warl_life_tap : public SpellScriptLoader } }; +// 48018 Demonic Circle: Summon +/// Updated 4.3.4 class spell_warl_demonic_circle_summon : public SpellScriptLoader { public: @@ -473,6 +469,8 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader } }; +// 48020 Demonic Circle: Teleport +/// Updated 4.3.4 class spell_warl_demonic_circle_teleport : public SpellScriptLoader { public: @@ -506,6 +504,8 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader } }; +// 48181 Haunt +/// Updated 4.3.4 class spell_warl_haunt : public SpellScriptLoader { public: @@ -565,6 +565,7 @@ class spell_warl_haunt : public SpellScriptLoader } }; +/// Updated 4.3.4 class spell_warl_unstable_affliction : public SpellScriptLoader { public: @@ -604,10 +605,12 @@ class spell_warl_unstable_affliction : public SpellScriptLoader } }; -class spell_warl_curse_of_doom : public SpellScriptLoader +// 603 Bane of Doom +/// Updated 4.3.4 +class spell_warl_bane_of_doom : public SpellScriptLoader { public: - spell_warl_curse_of_doom() : SpellScriptLoader("spell_warl_curse_of_doom") { } + spell_warl_bane_of_doom() : SpellScriptLoader("spell_warl_bane_of_doom") { } class spell_warl_curse_of_doom_AuraScript : public AuraScript { @@ -615,7 +618,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(WARLOCK_CURSE_OF_DOOM_EFFECT)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_BANE_OF_DOOM_EFFECT)) return false; return true; } @@ -635,7 +638,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader return; if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget())) - GetCaster()->CastSpell(GetTarget(), WARLOCK_CURSE_OF_DOOM_EFFECT, true, NULL, aurEff); + GetCaster()->CastSpell(GetTarget(), WARLOCK_BANE_OF_DOOM_EFFECT, true, NULL, aurEff); } void Register() @@ -650,6 +653,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader } }; +// 755 Health Funnel class spell_warl_health_funnel : public SpellScriptLoader { public: @@ -705,6 +709,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_demonic_circle_teleport(); new spell_warl_haunt(); new spell_warl_unstable_affliction(); - new spell_warl_curse_of_doom(); + new spell_warl_bane_of_doom(); new spell_warl_health_funnel(); } |