[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

@ -659,7 +659,7 @@ void Creature::DoFleeToGetAssistance()
UpdateSpeed(MOVE_RUN, false); UpdateSpeed(MOVE_RUN, false);
if(!pCreature) if(!pCreature)
SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_FLEE_DELAY)); SetFeared(true, getVictim()->GetObjectGuid(), 0 ,sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_FLEE_DELAY));
else else
GetMotionMaster()->MoveSeekAssistance(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ()); GetMotionMaster()->MoveSeekAssistance(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ());
} }

View file

@ -6887,7 +6887,7 @@ void Player::DuelComplete(DuelCompleteType type)
SpellAuraHolderMap const& vAuras = duel->opponent->GetSpellAuraHolderMap(); SpellAuraHolderMap const& vAuras = duel->opponent->GetSpellAuraHolderMap();
for (SpellAuraHolderMap::const_iterator i = vAuras.begin(); i != vAuras.end(); ++i) for (SpellAuraHolderMap::const_iterator i = vAuras.begin(); i != vAuras.end(); ++i)
{ {
if (!i->second->IsPositive() && i->second->GetCasterGUID() == GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime) if (!i->second->IsPositive() && i->second->GetCasterGuid() == GetObjectGuid() && i->second->GetAuraApplyTime() >= duel->startTime)
auras2remove.push_back(i->second->GetId()); auras2remove.push_back(i->second->GetId());
} }
@ -6898,7 +6898,7 @@ void Player::DuelComplete(DuelCompleteType type)
SpellAuraHolderMap const& auras = GetSpellAuraHolderMap(); SpellAuraHolderMap const& auras = GetSpellAuraHolderMap();
for (SpellAuraHolderMap::const_iterator i = auras.begin(); i != auras.end(); ++i) for (SpellAuraHolderMap::const_iterator i = auras.begin(); i != auras.end(); ++i)
{ {
if (!i->second->IsPositive() && i->second->GetCasterGUID() == duel->opponent->GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime) if (!i->second->IsPositive() && i->second->GetCasterGuid() == duel->opponent->GetObjectGuid() && i->second->GetAuraApplyTime() >= duel->startTime)
auras2remove.push_back(i->second->GetId()); auras2remove.push_back(i->second->GetId());
} }
for(size_t i=0; i<auras2remove.size(); ++i) for(size_t i=0; i<auras2remove.size(); ++i)

View file

@ -1071,7 +1071,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{ {
if(itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE && if(itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE &&
itr->second->GetCasterGUID() == caster->GetGUID()) itr->second->GetCasterGuid() == caster->GetObjectGuid())
++count; ++count;
} }

View file

@ -1911,17 +1911,17 @@ void Aura::TriggerSpell()
void Aura::TriggerSpellWithValue() void Aura::TriggerSpellWithValue()
{ {
const uint64& casterGUID = GetCasterGUID(); ObjectGuid casterGuid = GetCasterGuid();
Unit* target = GetTriggerTarget(); Unit* target = GetTriggerTarget();
if(!casterGUID || !target) if (casterGuid.IsEmpty() || !target)
return; return;
// generic casting code with custom spells and target/caster customs // generic casting code with custom spells and target/caster customs
uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex]; uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex];
int32 basepoints0 = GetModifier()->m_amount; int32 basepoints0 = GetModifier()->m_amount;
target->CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, NULL, this, casterGUID); target->CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, NULL, this, casterGuid);
} }
/*********************************************************/ /*********************************************************/
@ -2340,7 +2340,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
for (uint32 i = 0; i < spell->StackAmount; ++i) for (uint32 i = 0; i < spell->StackAmount; ++i)
caster->CastSpell(target, spellId, true, NULL, NULL, GetCasterGUID()); caster->CastSpell(target, spellId, true, NULL, NULL, GetCasterGuid());
return; return;
} }
@ -2358,7 +2358,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
for (uint32 i=0; i < spell->StackAmount; ++i) for (uint32 i=0; i < spell->StackAmount; ++i)
caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID()); caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGuid());
return; return;
} }
@ -2465,7 +2465,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
} }
case 47178: // Plague Effect Self case 47178: // Plague Effect Self
target->SetFeared(apply, GetCasterGUID(), GetId()); target->SetFeared(apply, GetCasterGuid(), GetId());
return; return;
case 58204: // LK Intro VO (1) case 58204: // LK Intro VO (1)
if (target->GetTypeId() == TYPEID_PLAYER) if (target->GetTypeId() == TYPEID_PLAYER)
@ -2606,12 +2606,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (target->IsInWorld() && GetStackAmount() > 0) if (target->IsInWorld() && GetStackAmount() > 0)
{ {
int32 amount = m_modifier.m_amount; int32 amount = m_modifier.m_amount;
target->CastCustomSpell(target, 33778, &amount, NULL, NULL, true, NULL, this, GetCasterGUID()); target->CastCustomSpell(target, 33778, &amount, NULL, NULL, true, NULL, this, GetCasterGuid());
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
{ {
int32 returnmana = (GetSpellProto()->ManaCostPercentage * caster->GetCreateMana() / 100) * GetStackAmount() / 2; int32 returnmana = (GetSpellProto()->ManaCostPercentage * caster->GetCreateMana() / 100) * GetStackAmount() / 2;
caster->CastCustomSpell(caster, 64372, &returnmana, NULL, NULL, true, NULL, this, GetCasterGUID()); caster->CastCustomSpell(caster, 64372, &returnmana, NULL, NULL, true, NULL, this, GetCasterGuid());
} }
} }
} }
@ -3215,7 +3215,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
{ {
// for players, start regeneration after 1s (in polymorph fast regeneration case) // for players, start regeneration after 1s (in polymorph fast regeneration case)
// only if caster is Player (after patch 2.4.2) // only if caster is Player (after patch 2.4.2)
if (IS_PLAYER_GUID(GetCasterGUID()) ) if (GetCasterGuid().IsPlayer())
((Player*)target)->setRegenTimer(1*IN_MILLISECONDS); ((Player*)target)->setRegenTimer(1*IN_MILLISECONDS);
//dismount polymorphed target (after patch 2.4.2) //dismount polymorphed target (after patch 2.4.2)
@ -3439,7 +3439,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
Unit *target = GetTarget(); Unit *target = GetTarget();
// not possess yourself // not possess yourself
if(GetCasterGUID() == target->GetGUID()) if (GetCasterGuid() == target->GetObjectGuid())
return; return;
Unit* caster = GetCaster(); Unit* caster = GetCaster();
@ -3623,7 +3623,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
Unit *target = GetTarget(); Unit *target = GetTarget();
// not charm yourself // not charm yourself
if(GetCasterGUID() == target->GetGUID()) if (GetCasterGuid() == target->GetObjectGuid())
return; return;
Unit* caster = GetCaster(); Unit* caster = GetCaster();
@ -3738,7 +3738,7 @@ void Aura::HandleModConfuse(bool apply, bool Real)
if(!Real) if(!Real)
return; return;
GetTarget()->SetConfused(apply, GetCasterGUID(), GetId()); GetTarget()->SetConfused(apply, GetCasterGuid(), GetId());
} }
void Aura::HandleModFear(bool apply, bool Real) void Aura::HandleModFear(bool apply, bool Real)
@ -3746,7 +3746,7 @@ void Aura::HandleModFear(bool apply, bool Real)
if (!Real) if (!Real)
return; return;
GetTarget()->SetFeared(apply, GetCasterGUID(), GetId()); GetTarget()->SetFeared(apply, GetCasterGuid(), GetId());
} }
void Aura::HandleFeignDeath(bool apply, bool Real) void Aura::HandleFeignDeath(bool apply, bool Real)
@ -3754,7 +3754,7 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
if(!Real) if(!Real)
return; return;
GetTarget()->SetFeignDeath(apply, GetCasterGUID(), GetId()); GetTarget()->SetFeignDeath(apply, GetCasterGuid(), GetId());
} }
void Aura::HandleAuraModDisarm(bool apply, bool Real) void Aura::HandleAuraModDisarm(bool apply, bool Real)
@ -3806,7 +3806,7 @@ void Aura::HandleAuraModStun(bool apply, bool Real)
target->SetTargetGuid(ObjectGuid()); target->SetTargetGuid(ObjectGuid());
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
target->CastStop(target->GetGUID() == GetCasterGUID() ? GetId() : 0); target->CastStop(target->GetObjectGuid() == GetCasterGuid() ? GetId() : 0);
// Creature specific // Creature specific
if(target->GetTypeId() != TYPEID_PLAYER) if(target->GetTypeId() != TYPEID_PLAYER)
@ -5100,7 +5100,7 @@ void Aura::HandleAuraModDispelResist(bool apply, bool Real)
return; return;
if(GetId() == 33206) if(GetId() == 33206)
GetTarget()->CastSpell(GetTarget(), 44416, true, NULL, this, GetCasterGUID()); GetTarget()->CastSpell(GetTarget(), 44416, true, NULL, this, GetCasterGuid());
} }
void Aura::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool /*Real*/) void Aura::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool /*Real*/)
@ -6393,10 +6393,10 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
switch(target->getPowerType()) switch(target->getPowerType())
{ {
case POWER_RUNIC_POWER: case POWER_RUNIC_POWER:
target->CastSpell(target, 63652, true, NULL, NULL, GetCasterGUID()); target->CastSpell(target, 63652, true, NULL, NULL, GetCasterGuid());
break; break;
case POWER_RAGE: case POWER_RAGE:
target->CastSpell(target, 63653, true, NULL, NULL, GetCasterGUID()); target->CastSpell(target, 63653, true, NULL, NULL, GetCasterGuid());
break; break;
case POWER_MANA: case POWER_MANA:
{ {
@ -6405,7 +6405,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
break; break;
} }
case POWER_ENERGY: case POWER_ENERGY:
target->CastSpell(target, 63655, true, NULL, NULL, GetCasterGUID()); target->CastSpell(target, 63655, true, NULL, NULL, GetCasterGuid());
break; break;
default: default:
break; break;
@ -6635,7 +6635,7 @@ void Aura::PeriodicTick()
// only from players // only from players
// FIXME: need use SpellDamageBonus instead? // FIXME: need use SpellDamageBonus instead?
if (IS_PLAYER_GUID(GetCasterGUID())) if (GetCasterGuid().IsPlayer())
pdamage -= target->GetSpellDamageReduction(pdamage); pdamage -= target->GetSpellDamageReduction(pdamage);
target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED)); target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED));
@ -7384,7 +7384,7 @@ void Aura::PeriodicDummyTick()
// Explosive Shot // Explosive Shot
if (spell->SpellFamilyFlags & UI64LIT(0x8000000000000000)) if (spell->SpellFamilyFlags & UI64LIT(0x8000000000000000))
{ {
target->CastCustomSpell(target, 53352, &m_modifier.m_amount, 0, 0, true, 0, this, GetCasterGUID()); target->CastCustomSpell(target, 53352, &m_modifier.m_amount, 0, 0, true, 0, this, GetCasterGuid());
return; return;
} }
switch (spell->Id) switch (spell->Id)
@ -7482,7 +7482,7 @@ void Aura::HandlePreventFleeing(bool apply, bool Real)
if( !fearAuras.empty() ) if( !fearAuras.empty() )
{ {
if (apply) if (apply)
GetTarget()->SetFeared(false, fearAuras.front()->GetCasterGUID()); GetTarget()->SetFeared(false, fearAuras.front()->GetCasterGuid());
else else
GetTarget()->SetFeared(true); GetTarget()->SetFeared(true);
} }

View file

@ -2566,7 +2566,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{ {
if (itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE && if (itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE &&
itr->second->GetCasterGUID() == m_caster->GetGUID()) itr->second->GetCasterGuid() == m_caster->GetObjectGuid())
{ {
++count; ++count;
// max. 15% // max. 15%
@ -5388,7 +5388,7 @@ void Spell::EffectWeaponDmg(SpellEffectIndex eff_idx)
for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{ {
if(itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE && if(itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE &&
itr->second->GetCasterGUID() == m_caster->GetGUID()) itr->second->GetCasterGuid() == m_caster->GetObjectGuid())
++count; ++count;
} }

View file

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

View file

@ -1893,9 +1893,9 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
bool IsStopped() const { return !(hasUnitState(UNIT_STAT_MOVING)); } bool IsStopped() const { return !(hasUnitState(UNIT_STAT_MOVING)); }
void StopMoving(); void StopMoving();
void SetFeared(bool apply, uint64 const& casterGUID = 0, uint32 spellID = 0, uint32 time = 0); void SetFeared(bool apply, ObjectGuid casterGuid = ObjectGuid(), uint32 spellID = 0, uint32 time = 0);
void SetConfused(bool apply, uint64 const& casterGUID = 0, uint32 spellID = 0); void SetConfused(bool apply, ObjectGuid casterGuid = ObjectGuid(), uint32 spellID = 0);
void SetFeignDeath(bool apply, uint64 const& casterGUID = 0, uint32 spellID = 0); void SetFeignDeath(bool apply, ObjectGuid casterGuid = ObjectGuid(), uint32 spellID = 0);
void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); } void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); }
void RemoveComboPointHolder(uint32 lowguid) { m_ComboPointHolders.erase(lowguid); } void RemoveComboPointHolder(uint32 lowguid) { m_ComboPointHolders.erase(lowguid); }

View file

@ -1203,7 +1203,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
if( mod->m_amount <= (int32)damage || GetHealth() <= damage ) if( mod->m_amount <= (int32)damage || GetHealth() <= damage )
{ {
// remember guid before aura delete // remember guid before aura delete
uint64 casterGuid = triggeredByAura->GetCasterGUID(); ObjectGuid casterGuid = triggeredByAura->GetCasterGuid();
// Remove aura (before cast for prevent infinite loop handlers) // Remove aura (before cast for prevent infinite loop handlers)
RemoveAurasDueToSpell(triggeredByAura->GetId()); RemoveAurasDueToSpell(triggeredByAura->GetId());
@ -1225,7 +1225,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
if( mod->m_amount <= (int32)damage ) if( mod->m_amount <= (int32)damage )
{ {
// remember guid before aura delete // remember guid before aura delete
uint64 casterGuid = triggeredByAura->GetCasterGUID(); ObjectGuid casterGuid = triggeredByAura->GetCasterGuid();
// Remove aura (before cast for prevent infinite loop handlers) // Remove aura (before cast for prevent infinite loop handlers)
RemoveAurasDueToSpell(triggeredByAura->GetId()); RemoveAurasDueToSpell(triggeredByAura->GetId());
@ -1313,15 +1313,15 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
// Vampiric Touch // Vampiric Touch
if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000040000000000)) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000040000000000))
{ {
if(!pVictim || !pVictim->isAlive()) if (!pVictim || !pVictim->isAlive())
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// pVictim is caster of aura // pVictim is caster of aura
if(triggeredByAura->GetCasterGUID() != pVictim->GetGUID()) if (triggeredByAura->GetCasterGuid() != pVictim->GetObjectGuid())
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// Energize 0.25% of max. mana // Energize 0.25% of max. mana
pVictim->CastSpell(pVictim,57669,true,castItem,triggeredByAura); pVictim->CastSpell(pVictim, 57669, true, castItem, triggeredByAura);
return SPELL_AURA_PROC_OK; // no hidden cooldown return SPELL_AURA_PROC_OK; // no hidden cooldown
} }
@ -1477,7 +1477,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
target = this; target = this;
// mana to caster // mana to caster
if (triggeredByAura->GetCasterGUID() == GetGUID()) if (triggeredByAura->GetCasterGuid() == GetObjectGuid())
{ {
if (SpellEntry const* manaCastEntry = sSpellStore.LookupEntry(60889)) if (SpellEntry const* manaCastEntry = sSpellStore.LookupEntry(60889))
{ {
@ -1900,7 +1900,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
AuraList const& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); AuraList const& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{ {
if( ((*itr)->GetId() == 31803) && (*itr)->GetCasterGUID()==GetGUID()) if (((*itr)->GetId() == 31803) && (*itr)->GetCasterGuid() == GetObjectGuid())
{ {
stacks = (*itr)->GetStackAmount(); stacks = (*itr)->GetStackAmount();
break; break;
@ -1956,7 +1956,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
case 53651: case 53651:
{ {
// not do bonus heal for explicit beacon focus healing // not do bonus heal for explicit beacon focus healing
if (GetGUID() == triggeredByAura->GetCasterGUID()) if (GetObjectGuid() == triggeredByAura->GetCasterGuid())
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// beacon // beacon
@ -1969,7 +1969,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
Unit::AuraList const& baa = beacon->GetAurasByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL); Unit::AuraList const& baa = beacon->GetAurasByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL);
for(Unit::AuraList::const_iterator i = baa.begin(); i != baa.end(); ++i) for(Unit::AuraList::const_iterator i = baa.begin(); i != baa.end(); ++i)
{ {
if ((*i)->GetId() == 53563 && (*i)->GetCasterGUID() == pVictim->GetGUID()) if ((*i)->GetId() == 53563 && (*i)->GetCasterGuid() == pVictim->GetObjectGuid())
{ {
dummy = (*i); dummy = (*i);
break; break;
@ -2002,7 +2002,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
AuraList const& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); AuraList const& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{ {
if( ((*itr)->GetId() == 53742) && (*itr)->GetCasterGUID()==GetGUID()) if (((*itr)->GetId() == 53742) && (*itr)->GetCasterGuid() == GetObjectGuid())
{ {
stacks = (*itr)->GetStackAmount(); stacks = (*itr)->GetStackAmount();
break; break;
@ -3618,7 +3618,7 @@ SpellAuraProcResult Unit::HandleMendingAuraProc( Unit* /*pVictim*/, uint32 /*dam
SpellEntry const* spellProto = triggeredByAura->GetSpellProto(); SpellEntry const* spellProto = triggeredByAura->GetSpellProto();
SpellEffectIndex effIdx = triggeredByAura->GetEffIndex(); SpellEffectIndex effIdx = triggeredByAura->GetEffIndex();
int32 heal = triggeredByAura->GetModifier()->m_amount; int32 heal = triggeredByAura->GetModifier()->m_amount;
uint64 caster_guid = triggeredByAura->GetCasterGUID(); ObjectGuid caster_guid = triggeredByAura->GetCasterGuid();
// jumps // jumps
int32 jumps = triggeredByAura->GetHolder()->GetAuraCharges()-1; int32 jumps = triggeredByAura->GetHolder()->GetAuraCharges()-1;
@ -3627,7 +3627,7 @@ SpellAuraProcResult Unit::HandleMendingAuraProc( Unit* /*pVictim*/, uint32 /*dam
triggeredByAura->GetHolder()->SetAuraCharges(1); // will removed at next charges decrease triggeredByAura->GetHolder()->SetAuraCharges(1); // will removed at next charges decrease
// next target selection // next target selection
if(jumps > 0 && GetTypeId()==TYPEID_PLAYER && IS_PLAYER_GUID(caster_guid)) if (jumps > 0 && GetTypeId()==TYPEID_PLAYER && caster_guid.IsPlayer())
{ {
float radius; float radius;
if (spellProto->EffectRadiusIndex[effIdx]) if (spellProto->EffectRadiusIndex[effIdx])
@ -3691,7 +3691,7 @@ SpellAuraProcResult Unit::HandleMechanicImmuneResistanceAuraProc(Unit* /*pVictim
SpellAuraProcResult Unit::HandleModDamageFromCasterAuraProc(Unit* pVictim, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) SpellAuraProcResult Unit::HandleModDamageFromCasterAuraProc(Unit* pVictim, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)
{ {
// Compare casters // Compare casters
return triggeredByAura->GetCasterGUID() == pVictim->GetGUID() ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED; return triggeredByAura->GetCasterGuid() == pVictim->GetObjectGuid() ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED;
} }
SpellAuraProcResult Unit::HandleMaelstromWeaponAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) SpellAuraProcResult Unit::HandleMaelstromWeaponAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10746" #define REVISION_NR "10747"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__