aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-17 19:28:36 -0800
committermaximius <none@none>2009-11-17 19:28:36 -0800
commitce0f37bed3d3a7a6b5a8415a247fad600b99b327 (patch)
tree13e7f9191abbbcd692936376ae72eee18a3e7539 /src/game/Unit.cpp
parent131b66c8b49a3dd4807bed5d29cdd8031fb7ac88 (diff)
*Correct Divine Storm heal, thanks lobuz
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 3961e4601bf..260e3127011 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -650,6 +650,22 @@ void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb)
uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss)
{
+ // if attacker is a player and spell is not empty/fail
+ if (GetTypeId() == TYPEID_PLAYER && spellProto)
+ {
+ // on divine storm dealed damage - heal
+ if (spellProto->SpellFamilyName == SPELLFAMILY_PALADIN && spellProto->SpellFamilyFlags[1] & 0x20000)
+ {
+ Unit *pRaidGrpMember = GetNextRandomRaidMemberOrPet(30.0f);
+ int32 divineDmg = damage / 4;
+
+ if (!pRaidGrpMember)
+ pRaidGrpMember = this;
+
+ CastCustomSpell(pRaidGrpMember, 54172, &divineDmg, 0, 0, true);
+ }
+ }
+
if(pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsAIEnabled)
((Creature*)pVictim)->AI()->DamageTaken(this, damage);
@@ -6256,7 +6272,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
triggered_spell_id = 54203;
break;
}
- switch(dummySpell->Id)
+ switch (dummySpell->Id)
{
// Heart of the Crusader
case 20335: // rank 1