*Send to client periodic heal absorbtion.

*Heal over time spells are updating healing achievement progress now.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-08-27 01:13:27 +02:00
parent 1bb14ba578
commit 1d3deae555
5 changed files with 30 additions and 27 deletions
+14 -10
View File
@@ -5142,8 +5142,7 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
data << uint32(log->SpellID);
data << uint32(log->damage); // damage amount
int32 overkill = log->damage - log->target->GetHealth();
data << uint32(overkill > 0 ? overkill : 0);
//data << uint32(log->overkill); // overkill
data << uint32(overkill > 0 ? overkill : 0); // overkill
data << uint8 (log->schoolMask); // damage school
data << uint32(log->absorb); // AbsorbedDamage
data << uint32(log->resist); // resist
@@ -5205,7 +5204,7 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
case SPELL_AURA_OBS_MOD_HEALTH:
data << uint32(pInfo->damage); // damage
data << uint32(pInfo->overDamage); // overheal
data << uint32(0); // absorb
data << uint32(pInfo->absorb); // absorb
data << uint8(pInfo->critical); // new 3.1.2 critical tick
break;
case SPELL_AURA_OBS_MOD_POWER:
@@ -9924,11 +9923,8 @@ void Unit::SetCharm(Unit* charm, bool apply)
}
}
int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical)
int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth)
{
uint32 absorb = 0;
// calculate heal absorb and reduce healing
CalcHealAbsorb(pVictim, spellProto, addhealth, absorb);
int32 gain = 0;
if (addhealth)
@@ -9941,9 +9937,6 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro
if (unit->GetTypeId() == TYPEID_PLAYER)
{
// overheal = addhealth - gain
unit->SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth - gain, absorb, critical);
if (Battleground *bg = unit->ToPlayer()->GetBattleground())
bg->UpdatePlayerScore((Player*)unit, SCORE_HEALING_DONE, gain);
@@ -10161,6 +10154,17 @@ void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32
SendMessageToSet(&data, true);
}
int32 Unit::HealBySpell(Unit * pVictim, SpellEntry const * spellInfo, uint32 addHealth, bool critical)
{
uint32 absorb = 0;
// calculate heal absorb and reduce healing
CalcHealAbsorb(pVictim, spellInfo, addHealth, absorb);
int32 gain = DealHeal(pVictim, addHealth);
SendHealSpellLog(pVictim, spellInfo->Id, addHealth, uint32(addHealth - gain), absorb, critical);
return gain;
}
void Unit::SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype)
{
WorldPacket data(SMSG_SPELLENERGIZELOG, (8+8+4+4+4+1));
+2 -1
View File
@@ -1300,7 +1300,7 @@ class Unit : public WorldObject
void DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb);
uint32 DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellEntry const *spellProto = NULL, bool durabilityLoss = true);
void Kill(Unit *pVictim, bool durabilityLoss = true);
int32 DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical = false);
int32 DealHeal(Unit *pVictim, uint32 addhealth);
void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const *procSpell = NULL, SpellEntry const * procAura = NULL);
void ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage , SpellEntry const * procAura = NULL);
@@ -1418,6 +1418,7 @@ class Unit : public WorldObject
bool isInAccessiblePlaceFor(Creature const* c) const;
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false);
int32 HealBySpell(Unit * pVictim, SpellEntry const * spellInfo, uint32 addHealth, bool critical = false);
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage);