casucristy

Untitled

Jul 26th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.80 KB | None | 0 0
  1. From f058f8e065cf21c539189a9265d11d5733968e21 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Thu, 26 Jul 2012 17:59:39 +0300
  4. Subject: [PATCH] Fix spell Dark Intent - Warlock
  5.  
  6. ---
  7.  src/server/game/Entities/Unit/Unit.cpp      |   25 +++++++++++++++++-
  8.  src/server/scripts/Spells/spell_warlock.cpp |   37 +++++++++++++++++++++++++++
  9.  2 files changed, 61 insertions(+), 1 deletion(-)
  10.  
  11. diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
  12. index 21e69b1..46207ff 100644
  13. --- a/src/server/game/Entities/Unit/Unit.cpp
  14. +++ b/src/server/game/Entities/Unit/Unit.cpp
  15. @@ -11423,7 +11423,7 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage
  16.  {
  17.      // Calculate critical bonus
  18.      int32 crit_bonus;
  19. -    Player* modOwner = GetSpellModOwner();
  20. +   Player* modOwner = GetSpellModOwner();
  21.  
  22.      switch (spellProto->DmgClass)
  23.      {
  24. @@ -11532,6 +11532,18 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage
  25.          else
  26.              crit_bonus = damage;
  27.      }
  28. +
  29. +   if(spellProto->Effects[0].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE)
  30. +   {
  31. +       Aura* aura;
  32. +       Unit* unit;
  33. +       if (HasAura(85767) && (aura = GetAura(85767)))  //DarkIntent
  34. +       {
  35. +           if(unit = aura->GetCaster())
  36. +               unit->CastSpell(unit,85759);
  37. +       }
  38. +   }
  39. +
  40.      return damage;
  41.  }
  42.  
  43. @@ -11562,6 +11574,17 @@ uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damag
  44.  
  45.      damage = int32(float(damage) * GetTotalAuraMultiplier(SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT));
  46.  
  47. +   if(spellProto->Effects[0].ApplyAuraName == SPELL_AURA_PERIODIC_HEAL)
  48. +   {
  49. +       Aura* aura;
  50. +       Unit* unit;
  51. +       if (HasAura(85767) && (aura = GetAura(85767)))  //DarkIntent
  52. +       {
  53. +           if(unit = aura->GetCaster())
  54. +               unit->CastSpell(unit,85759);
  55. +       }
  56. +   }
  57. +
  58.      return damage;
  59.  }
  60.  
  61. diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
  62. index a142dee..63c3dea 100644
  63. --- a/src/server/scripts/Spells/spell_warlock.cpp
  64. +++ b/src/server/scripts/Spells/spell_warlock.cpp
  65. @@ -43,6 +43,7 @@ enum WarlockSpells
  66.      WARLOCK_DEMONIC_CIRCLE_TELEPORT         = 48020,
  67.      WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST       = 62388,
  68.      WARLOCK_NETHER_WARD                     = 91713,
  69. +   WARLOCK_DARK_INTENT_EFFECT              = 85767
  70.  };
  71.  
  72.  class spell_warl_banish : public SpellScriptLoader
  73. @@ -556,6 +557,41 @@ public:
  74.      }
  75.  };
  76.  
  77. +//spell dark intent
  78. +
  79. +class spell_warlock_dark_intent: public SpellScriptLoader
  80. +{
  81. +public:
  82. +    spell_warlock_dark_intent () : SpellScriptLoader("spell_warlock_dark_intent"){}
  83. +
  84. +    class spell_warlock_dark_intent_SpellScript: public SpellScript
  85. +    {
  86. +        PrepareSpellScript(spell_warlock_dark_intent_SpellScript)
  87. +
  88. +        void HandleScriptEffect(SpellEffIndex /*EffIndex*/)
  89. +        {
  90. +            Unit* caster = GetCaster();
  91. +            Unit* target = GetExplTargetUnit();
  92. +
  93. +            if (!caster || !target)
  94. +                return;
  95. +
  96. +            caster->CastSpell(target, WARLOCK_DARK_INTENT_EFFECT, true);
  97. +            target->CastSpell(caster, WARLOCK_DARK_INTENT_EFFECT, true);
  98. +        }
  99. +
  100. +        void Register ()
  101. +        {
  102. +            OnEffectHit += SpellEffectFn(spell_warlock_dark_intent_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_TRIGGER_SPELL);
  103. +        }
  104. +    };
  105. +
  106. +    SpellScript* GetSpellScript () const
  107. +    {
  108. +        return new spell_warlock_dark_intent_SpellScript();
  109. +    }
  110. +};
  111. +
  112.  void AddSC_warlock_spell_scripts()
  113.  {
  114.      new spell_warl_banish();
  115. @@ -570,4 +606,5 @@ void AddSC_warlock_spell_scripts()
  116.      new spell_warl_demonic_circle_summon();
  117.      new spell_warl_demonic_circle_teleport();
  118.      new spell_warl_nether_ward_swap_supressor();
  119. +   new spell_warlock_dark_intent();
  120.  }
  121. --
  122. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment