[7801] Apply damage mods from scripts or target state not in DealDamage but in new function before send data to client.

* Fixed bug with health decrease (client side visual bug) at spell damage by target with AI::DamageTaken damage set to 0
* Fixed bug with ignore .die command and instant kill damage in some cases.
This commit is contained in:
VladimirMangos 2009-05-08 16:43:52 +04:00
parent b9cd3ffd0d
commit f53d06ad70
8 changed files with 80 additions and 31 deletions

View file

@ -5806,6 +5806,8 @@ void Aura::PeriodicTick()
sLog.outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId(),absorb);
pCaster->DealDamageMods(m_target,pdamage,&absorb);
WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size
data.append(m_target->GetPackGUID());
data.appendPackGUID(GetCasterGUID());
@ -5984,10 +5986,13 @@ void Aura::PeriodicTick()
}
else
{
pCaster->SendSpellNonMeleeDamageLog(pCaster, GetId(), gain, GetSpellSchoolMask(GetSpellProto()), 0, 0, false, 0, false);
uint32 damage = gain;
uint32 absorb = 0;
pCaster->DealDamageMods(pCaster,damage,&absorb);
pCaster->SendSpellNonMeleeDamageLog(pCaster, GetId(), damage, GetSpellSchoolMask(GetSpellProto()), absorb, 0, false, 0, false);
CleanDamage cleanDamage = CleanDamage(0, BASE_ATTACK, MELEE_HIT_NORMAL );
pCaster->DealDamage(pCaster, gain, &cleanDamage, NODAMAGE, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), true);
pCaster->DealDamage(pCaster, damage, &cleanDamage, NODAMAGE, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), true);
}
}
@ -6169,6 +6174,9 @@ void Aura::PeriodicTick()
//maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG
SpellNonMeleeDamage damageInfo(pCaster, m_target, spellProto->Id, spellProto->SchoolMask);
pCaster->CalculateSpellDamage(&damageInfo, gain, spellProto);
pCaster->DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb);
pCaster->SendSpellNonMeleeDamageLog(&damageInfo);
// Set trigger flag