Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From f058f8e065cf21c539189a9265d11d5733968e21 Mon Sep 17 00:00:00 2001
- From: unknown <cristi@cristis-PC.(none)>
- Date: Thu, 26 Jul 2012 17:59:39 +0300
- Subject: [PATCH] Fix spell Dark Intent - Warlock
- ---
- src/server/game/Entities/Unit/Unit.cpp | 25 +++++++++++++++++-
- src/server/scripts/Spells/spell_warlock.cpp | 37 +++++++++++++++++++++++++++
- 2 files changed, 61 insertions(+), 1 deletion(-)
- diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
- index 21e69b1..46207ff 100644
- --- a/src/server/game/Entities/Unit/Unit.cpp
- +++ b/src/server/game/Entities/Unit/Unit.cpp
- @@ -11423,7 +11423,7 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage
- {
- // Calculate critical bonus
- int32 crit_bonus;
- - Player* modOwner = GetSpellModOwner();
- + Player* modOwner = GetSpellModOwner();
- switch (spellProto->DmgClass)
- {
- @@ -11532,6 +11532,18 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage
- else
- crit_bonus = damage;
- }
- +
- + if(spellProto->Effects[0].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE)
- + {
- + Aura* aura;
- + Unit* unit;
- + if (HasAura(85767) && (aura = GetAura(85767))) //DarkIntent
- + {
- + if(unit = aura->GetCaster())
- + unit->CastSpell(unit,85759);
- + }
- + }
- +
- return damage;
- }
- @@ -11562,6 +11574,17 @@ uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damag
- damage = int32(float(damage) * GetTotalAuraMultiplier(SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT));
- + if(spellProto->Effects[0].ApplyAuraName == SPELL_AURA_PERIODIC_HEAL)
- + {
- + Aura* aura;
- + Unit* unit;
- + if (HasAura(85767) && (aura = GetAura(85767))) //DarkIntent
- + {
- + if(unit = aura->GetCaster())
- + unit->CastSpell(unit,85759);
- + }
- + }
- +
- return damage;
- }
- diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
- index a142dee..63c3dea 100644
- --- a/src/server/scripts/Spells/spell_warlock.cpp
- +++ b/src/server/scripts/Spells/spell_warlock.cpp
- @@ -43,6 +43,7 @@ enum WarlockSpells
- WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020,
- WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
- WARLOCK_NETHER_WARD = 91713,
- + WARLOCK_DARK_INTENT_EFFECT = 85767
- };
- class spell_warl_banish : public SpellScriptLoader
- @@ -556,6 +557,41 @@ public:
- }
- };
- +//spell dark intent
- +
- +class spell_warlock_dark_intent: public SpellScriptLoader
- +{
- +public:
- + spell_warlock_dark_intent () : SpellScriptLoader("spell_warlock_dark_intent"){}
- +
- + class spell_warlock_dark_intent_SpellScript: public SpellScript
- + {
- + PrepareSpellScript(spell_warlock_dark_intent_SpellScript)
- +
- + void HandleScriptEffect(SpellEffIndex /*EffIndex*/)
- + {
- + Unit* caster = GetCaster();
- + Unit* target = GetExplTargetUnit();
- +
- + if (!caster || !target)
- + return;
- +
- + caster->CastSpell(target, WARLOCK_DARK_INTENT_EFFECT, true);
- + target->CastSpell(caster, WARLOCK_DARK_INTENT_EFFECT, true);
- + }
- +
- + void Register ()
- + {
- + OnEffectHit += SpellEffectFn(spell_warlock_dark_intent_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_TRIGGER_SPELL);
- + }
- + };
- +
- + SpellScript* GetSpellScript () const
- + {
- + return new spell_warlock_dark_intent_SpellScript();
- + }
- +};
- +
- void AddSC_warlock_spell_scripts()
- {
- new spell_warl_banish();
- @@ -570,4 +606,5 @@ void AddSC_warlock_spell_scripts()
- new spell_warl_demonic_circle_summon();
- new spell_warl_demonic_circle_teleport();
- new spell_warl_nether_ward_swap_supressor();
- + new spell_warlock_dark_intent();
- }
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment