aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorMitchesD <majklprofik@seznam.cz>2015-05-26 21:51:01 +0200
committerMitchesD <majklprofik@seznam.cz>2015-05-26 21:51:01 +0200
commitca5ea3c85d48327a121832c0f2c693faab112407 (patch)
treee078b6276713a5d90f75f2d6bea045bb66c133b1 /src/server/game/Entities/Unit
parent735606bc7329b63ffa950b9a5f4385763e238d52 (diff)
Core/PacketIO: updated structure of SMSG_SPELL_PERIODIC_AURA_LOG
* debug info is no implemented since we don't know the right usage
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp67
1 files changed, 27 insertions, 40 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 076275bf005..fd33151b37a 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -4818,50 +4818,37 @@ void Unit::ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVict
victim->ProcDamageAndSpellFor(true, this, procVictim, procExtra, attType, procSpell, amount, procAura);
}
-void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo)
+void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* info)
{
- AuraEffect const* aura = pInfo->auraEff;
+ AuraEffect const* aura = info->auraEff;
+ WorldPackets::CombatLog::SpellPeriodicAuraLog data;
+ data.TargetGUID = GetGUID();
+ data.CasterGUID = aura->GetCasterGUID();
+ data.SpellID = aura->GetId();
- WorldPacket data(SMSG_SPELL_PERIODIC_AURA_LOG, 30);
- data << GetPackGUID();
- data << aura->GetCasterGUID().WriteAsPacked();
- data << uint32(aura->GetId()); // spellId
- data << uint32(1); // count
- data << uint32(aura->GetAuraType()); // auraId
- switch (aura->GetAuraType())
- {
- case SPELL_AURA_PERIODIC_DAMAGE:
- case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
- data << uint32(pInfo->damage); // damage
- data << uint32(pInfo->overDamage); // overkill?
- data << uint32(aura->GetSpellInfo()->GetSchoolMask());
- data << uint32(pInfo->absorb); // absorb
- data << uint32(pInfo->resist); // resist
- data << uint8(pInfo->critical); // new 3.1.2 critical tick
- break;
- case SPELL_AURA_PERIODIC_HEAL:
- case SPELL_AURA_OBS_MOD_HEALTH:
- data << uint32(pInfo->damage); // damage
- data << uint32(pInfo->overDamage); // overheal
- data << uint32(pInfo->absorb); // absorb
- data << uint8(pInfo->critical); // new 3.1.2 critical tick
- break;
- case SPELL_AURA_OBS_MOD_POWER:
- case SPELL_AURA_PERIODIC_ENERGIZE:
- data << uint32(aura->GetMiscValue()); // power type
- data << uint32(pInfo->damage); // damage
- break;
- case SPELL_AURA_PERIODIC_MANA_LEECH:
- data << uint32(aura->GetMiscValue()); // power type
- data << uint32(pInfo->damage); // amount
- data << float(pInfo->multiplier); // gain multiplier
- break;
- default:
- TC_LOG_ERROR("entities.unit", "Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType()));
- return;
+ if (SpellInfo const* spellInfo = aura->GetSpellInfo())
+ {
+ for (SpellEffectInfoMap::const_iterator itr = spellInfo->_effects.begin(); itr != spellInfo->_effects.end(); ++itr)
+ {
+ for (SpellEffectInfo const* effect : itr->second)
+ {
+ WorldPackets::CombatLog::SpellPeriodicAuraLog::SpellLogEffect spellLogEffect;
+ spellLogEffect.Effect = effect->Effect;
+ spellLogEffect.Amount = info->damage;
+ spellLogEffect.OverHealOrKill = info->overDamage;
+ spellLogEffect.SchoolMaskOrPower = aura->GetMiscValue();
+ spellLogEffect.AbsorbedOrAmplitude = info->absorb;
+ spellLogEffect.Resisted = info->resist;
+ spellLogEffect.Crit = info->critical;
+ spellLogEffect.Multistrike = false; // NYI
+ /// @todo: implement debug info
+
+ data.Effects.push_back(spellLogEffect);
+ }
+ }
}
- SendMessageToSet(&data, true);
+ SendMessageToSet(data.Write(), true);
}
void Unit::SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo)