Moved SMSG_PERIODICAURALOG to single function, applied coding stype.

This commit is contained in:
tomrus88 2009-05-28 18:46:34 +04:00
parent b77696bf26
commit b0006cfbc0
3 changed files with 100 additions and 80 deletions

View file

@ -4250,10 +4250,10 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
SendMessageToSet( &data, true );
}
void Unit::SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, SpellSchoolMask damageSchoolMask,uint32 AbsorbedDamage, uint32 Resist,bool PhysicalDamage, uint32 Blocked, bool CriticalHit)
void Unit::SendSpellNonMeleeDamageLog(Unit *target, uint32 SpellID,uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist,bool PhysicalDamage, uint32 Blocked, bool CriticalHit)
{
SpellNonMeleeDamage log(this,target,SpellID,damageSchoolMask);
log.damage = Damage-AbsorbedDamage-Resist-Blocked;
SpellNonMeleeDamage log(this, target, SpellID, damageSchoolMask);
log.damage = Damage - AbsorbedDamage - Resist - Blocked;
log.absorb = AbsorbedDamage;
log.resist = Resist;
log.physicalLog = PhysicalDamage;
@ -4264,6 +4264,52 @@ void Unit::SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage,
SendSpellNonMeleeDamageLog(&log);
}
void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
{
Aura *aura = pInfo->aura;
Modifier *mod = aura->GetModifier();
WorldPacket data(SMSG_PERIODICAURALOG, 30);
data.append(aura->GetTarget()->GetPackGUID());
data.appendPackGUID(aura->GetCasterGUID());
data << uint32(aura->GetId()); // spellId
data << uint32(1); // count
data << uint32(mod->m_auraname); // auraId
switch(mod->m_auraname)
{
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
data << uint32(pInfo->damage); // damage
data << uint32(pInfo->overDamage); // overkill?
data << uint32(GetSpellSchoolMask(aura->GetSpellProto()));
data << uint32(pInfo->absorb); // absorb
data << uint32(pInfo->resist); // resist
data << uint8(0); // new 3.1.2
break;
case SPELL_AURA_PERIODIC_HEAL:
case SPELL_AURA_OBS_MOD_HEALTH:
data << uint32(pInfo->damage); // damage
data << uint32(pInfo->overDamage); // overheal?
data << uint8(0); // new 3.1.2
break;
case SPELL_AURA_OBS_MOD_MANA:
case SPELL_AURA_PERIODIC_ENERGIZE:
data << uint32(mod->m_miscvalue); // power type
data << uint32(pInfo->damage); // damage
break;
case SPELL_AURA_PERIODIC_MANA_LEECH:
data << uint32(mod->m_miscvalue); // power type
data << uint32(pInfo->damage); // amount
data << float(pInfo->multiplier); // gain multiplier
break;
default:
sLog.outError("Unit::SendPeriodicAuraLog: unknown aura %u", uint32(mod->m_auraname));
return;
}
aura->GetTarget()->SendMessageToSet(&data, true);
}
void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellEntry const *procSpell)
{
// Not much to do if no flags are set.