Core/Auras: Implemented SPELL_AURA_MOD_COOLDOWN

Closes #9671
This commit is contained in:
Shauren committed 2014-02-05 13:00:42 +01:00
1 parent 30924211a3
commit 0d51fd55a1
5 files changed
+91 -37

No files matched your search

+26 -2
View File
@@ -4484,10 +4484,13 @@ uint32 Unit::GetDoTsByCaster(uint64 casterGUID) const
int32 Unit::GetTotalAuraModifier(AuraType auratype) const
{
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
if (mTotalAuraList.empty())
return 0;
std::map<SpellGroup, int32> SameEffectSpellGroup;
int32 modifier = 0;
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup))
modifier += (*i)->GetAmount();
@@ -8720,7 +8723,7 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
Player const* targetPlayerOwner = target->GetAffectingPlayer();
// check forced reputation to support SPELL_AURA_FORCE_REACTION
if (selfPlayerOwner)
if (selfPlayerOwner)
{
if (FactionTemplateEntry const* targetFactionTemplateEntry = target->GetFactionTemplateEntry())
if (ReputationRank const* repRank = selfPlayerOwner->GetReputationMgr().GetForcedRankIfAny(targetFactionTemplateEntry))
@@ -17656,3 +17659,24 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
updateMask.AppendToPacket(data);
data->append(fieldBuffer);
}
void Unit::BuildCooldownPacket(WorldPacket& data, uint8 flags, uint32 spellId, uint32 cooldown)
{
data.Initialize(SMSG_SPELL_COOLDOWN, 8 + 1 + 4 + 4);
data << uint64(GetGUID());
data << uint8(flags);
data << uint32(spellId);
data << uint32(cooldown);
}
void Unit::BuildCooldownPacket(WorldPacket& data, uint8 flags, PacketCooldowns const& cooldowns)
{
data.Initialize(SMSG_SPELL_COOLDOWN, 8 + 1 + (4 + 4) * cooldowns.size());
data << uint64(GetGUID());
data << uint8(flags);
for (UNORDERED_MAP<uint32, uint32>::const_iterator itr = cooldowns.begin(); itr != cooldowns.end(); ++itr)
{
data << uint32(itr->first);
data << uint32(itr->second);
}
}