[10747] Some other aura caster object guid use cases.

This commit is contained in:
VladimirMangos 2010-11-19 17:45:24 +03:00
parent f034a9bd0a
commit 12b80fec68
9 changed files with 67 additions and 67 deletions

View file

@ -4173,10 +4173,10 @@ bool Unit::RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder *holder)
uint32 i_spellId = i_spellProto->Id;
// early checks that spellId is passive non stackable spell
if(IsPassiveSpell(i_spellProto))
if (IsPassiveSpell(i_spellProto))
{
// passive non-stackable spells not stackable only for same caster
if(holder->GetCasterGUID()!=i->second->GetCasterGUID())
if (holder->GetCasterGuid() != i->second->GetCasterGuid())
continue;
// passive non-stackable spells not stackable only with another rank of same spell
@ -4597,9 +4597,9 @@ void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase)
// single target auras from other casters
for (SpellAuraHolderMap::iterator iter = m_spellAuraHolders.begin(); iter != m_spellAuraHolders.end(); )
{
if (iter->second->GetCasterGUID() != GetGUID() && iter->second->IsSingleTarget())
if (iter->second->GetCasterGuid() != GetObjectGuid() && iter->second->IsSingleTarget())
{
if(!newPhase)
if (!newPhase)
{
RemoveSpellAuraHolder(iter->second);
iter = m_spellAuraHolders.begin();
@ -4608,7 +4608,7 @@ void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase)
else
{
Unit* caster = iter->second->GetCaster();
if(!caster || !caster->InSamePhase(newPhase))
if (!caster || !caster->InSamePhase(newPhase))
{
RemoveSpellAuraHolder(iter->second);
iter = m_spellAuraHolders.begin();
@ -5100,7 +5100,7 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
WorldPacket data(SMSG_PERIODICAURALOG, 30);
data << aura->GetTarget()->GetPackGUID();
data.appendPackGUID(aura->GetCasterGUID());
data << aura->GetCasterGuid().WriteAsPacked();
data << uint32(aura->GetId()); // spellId
data << uint32(1); // count
data << uint32(mod->m_auraname); // auraId
@ -6472,7 +6472,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit *pCaster, SpellEntry const *spellProto,
AuraList const& mOwnerTaken = GetAurasByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER);
for(AuraList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i)
{
if ((*i)->GetCasterGUID() == pCaster->GetGUID() && (*i)->isAffectedOnSpell(spellProto))
if ((*i)->GetCasterGuid() == pCaster->GetObjectGuid() && (*i)->isAffectedOnSpell(spellProto))
TakenTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
}
@ -6663,7 +6663,7 @@ bool Unit::IsSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000040000000))
{
Aura *aura = pVictim->GetDummyAura(58597);
if (aura && aura->GetCasterGUID() == GetGUID())
if (aura && aura->GetCasterGuid() == GetObjectGuid())
crit_chance+=aura->GetModifier()->m_amount;
}
// Exorcism
@ -6852,7 +6852,7 @@ uint32 Unit::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto,
Unit::AuraList const& RejorRegr = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID &&
(*i)->GetCasterGUID() == GetGUID())
(*i)->GetCasterGuid() == GetObjectGuid())
++ownHotCount;
if (ownHotCount)
@ -6877,7 +6877,7 @@ uint32 Unit::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto,
Unit::AuraList const& RejorRegr = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID &&
(*i)->GetCasterGUID() == GetGUID())
(*i)->GetCasterGuid() == GetObjectGuid())
++ownHotCount;
if (ownHotCount)
@ -9843,9 +9843,9 @@ void Unit::StopMoving()
SendHeartBeat(false);
}
void Unit::SetFeared(bool apply, uint64 const& casterGUID, uint32 spellID, uint32 time)
void Unit::SetFeared(bool apply, ObjectGuid casterGuid, uint32 spellID, uint32 time)
{
if( apply )
if (apply)
{
if (HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
return;
@ -9853,9 +9853,9 @@ void Unit::SetFeared(bool apply, uint64 const& casterGUID, uint32 spellID, uint3
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
GetMotionMaster()->MovementExpired(false);
CastStop(GetGUID() == casterGUID ? spellID : 0);
CastStop(GetObjectGuid() == casterGuid ? spellID : 0);
Unit* caster = IsInWorld() ? GetMap()->GetUnit(casterGUID) : NULL;
Unit* caster = IsInWorld() ? GetMap()->GetUnit(casterGuid) : NULL;
GetMotionMaster()->MoveFleeing(caster, time); // caster==NULL processed in MoveFleeing
}
@ -9875,7 +9875,7 @@ void Unit::SetFeared(bool apply, uint64 const& casterGUID, uint32 spellID, uint3
GetMotionMaster()->Initialize();
// attack caster if can
if (Unit* caster = IsInWorld() ? GetMap()->GetUnit(casterGUID) : NULL)
if (Unit* caster = IsInWorld() ? GetMap()->GetUnit(casterGuid) : NULL)
if (c->AI())
c->AI()->AttackedBy(caster);
}
@ -9885,13 +9885,13 @@ void Unit::SetFeared(bool apply, uint64 const& casterGUID, uint32 spellID, uint3
((Player*)this)->SetClientControl(this, !apply);
}
void Unit::SetConfused(bool apply, uint64 const& casterGUID, uint32 spellID)
void Unit::SetConfused(bool apply, ObjectGuid casterGuid, uint32 spellID)
{
if( apply )
if (apply)
{
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
CastStop(GetGUID()==casterGUID ? spellID : 0);
CastStop(GetObjectGuid() == casterGuid ? spellID : 0);
GetMotionMaster()->MoveConfused();
}
@ -9915,9 +9915,9 @@ void Unit::SetConfused(bool apply, uint64 const& casterGUID, uint32 spellID)
((Player*)this)->SetClientControl(this, !apply);
}
void Unit::SetFeignDeath(bool apply, uint64 const& casterGUID, uint32 /*spellID*/)
void Unit::SetFeignDeath(bool apply, ObjectGuid casterGuid, uint32 /*spellID*/)
{
if( apply )
if (apply)
{
/*
WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9);
@ -9926,7 +9926,7 @@ void Unit::SetFeignDeath(bool apply, uint64 const& casterGUID, uint32 /*spellID*
SendMessageToSet(&data,true);
*/
if(GetTypeId() != TYPEID_PLAYER)
if (GetTypeId() != TYPEID_PLAYER)
StopMoving();
else
((Player*)this)->m_movementInfo.SetMovementFlags(MOVEFLAG_NONE);
@ -9943,7 +9943,7 @@ void Unit::SetFeignDeath(bool apply, uint64 const& casterGUID, uint32 /*spellID*
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
// prevent interrupt message
if (casterGUID == GetGUID())
if (casterGuid == GetObjectGuid())
FinishSpell(CURRENT_GENERIC_SPELL,false);
InterruptNonMeleeSpells(true);
getHostileRefManager().deleteReferences();