Core/Misc: Refactor SendPlaySpellVisual and SendPlaySpellImpact and move them to Unit (from Spell)

This commit is contained in:
Nay
2011-07-04 14:46:48 +01:00
parent 40b17fd862
commit d6782fa826
6 changed files with 23 additions and 24 deletions
+1 -1
View File
@@ -2035,7 +2035,7 @@ void Unit::BuildHeartBeatMsg(WorldPacket *data) const
BuildMovementPacket(data);
}
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/)
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*self*/)
{
Trinity::MessageDistDeliverer notifier(this, data, dist);
VisitNearbyWorldObject(dist, notifier);
+16
View File
@@ -16282,6 +16282,22 @@ void Unit::SetAuraStack(uint32 spellId, Unit* target, uint32 stack)
aura->SetStackAmount(stack);
}
void Unit::SendPlaySpellVisual(uint32 id)
{
WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 8 + 4);
data << uint64(GetGUID());
data << uint32(id); // SpellVisualKit.dbc index
SendMessageToSet(&data, false);
}
void Unit::SendPlaySpellImpact(uint64 guid, uint32 id)
{
WorldPacket data(SMSG_PLAY_SPELL_IMPACT, 8 + 4);
data << uint64(guid); // target
data << uint32(id); // SpellVisualKit.dbc index
SendMessageToSet(&data, false);
}
void Unit::ApplyResilience(Unit const* victim, float* crit, int32* damage, bool isCrit, CombatRating type) const
{
// player mounted on multi-passenger mount is also classified as vehicle
+2
View File
@@ -1485,6 +1485,8 @@ class Unit : public WorldObject
Aura * AddAura(uint32 spellId, Unit* target);
Aura * AddAura(SpellEntry const *spellInfo, uint8 effMask, Unit* target);
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
void SendPlaySpellVisual(uint32 id);
void SendPlaySpellImpact(uint64 guid, uint32 id);
bool IsDamageToThreatSpell(SpellEntry const* spellInfo) const;