mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 10:37:02 +00:00
[11459] More ObjectGuid using in Aura/SpellAuraHolder code.
Also fix build in PetAI code. Thanks to rsa for fix code.
This commit is contained in:
parent
151e5eae9c
commit
44f2c26389
15 changed files with 104 additions and 96 deletions
|
|
@ -527,7 +527,7 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx)
|
|||
|
||||
// Glyph of Conflagrate
|
||||
if (!m_caster->HasAura(56235))
|
||||
unitTarget->RemoveAurasByCasterSpell(aura->GetId(), m_caster->GetGUID());
|
||||
unitTarget->RemoveAurasByCasterSpell(aura->GetId(), m_caster->GetObjectGuid());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -627,7 +627,7 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx)
|
|||
}
|
||||
|
||||
if (needConsume)
|
||||
unitTarget->RemoveAuraHolderFromStack(spellId, doses, m_caster->GetGUID());
|
||||
unitTarget->RemoveAuraHolderFromStack(spellId, doses, m_caster->GetObjectGuid());
|
||||
|
||||
damage *= doses;
|
||||
damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.09f * doses);
|
||||
|
|
@ -3182,7 +3182,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
|
|||
}
|
||||
|
||||
// consume diseases
|
||||
unitTarget->RemoveAurasWithDispelType(DISPEL_DISEASE, m_caster->GetGUID());
|
||||
unitTarget->RemoveAurasWithDispelType(DISPEL_DISEASE, m_caster->GetObjectGuid());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -4868,7 +4868,7 @@ void Spell::EffectDispel(SpellEffectIndex eff_idx)
|
|||
bool foundDispelled = false;
|
||||
for (std::list<std::pair<SpellAuraHolder* ,uint32> >::iterator success_iter = success_list.begin(); success_iter != success_list.end(); ++success_iter)
|
||||
{
|
||||
if (success_iter->first->GetId() == holder->GetId() && success_iter->first->GetCasterGUID() == holder->GetCasterGUID())
|
||||
if (success_iter->first->GetId() == holder->GetId() && success_iter->first->GetCasterGuid() == holder->GetCasterGuid())
|
||||
{
|
||||
success_iter->second += 1;
|
||||
foundDispelled = true;
|
||||
|
|
@ -4894,7 +4894,7 @@ void Spell::EffectDispel(SpellEffectIndex eff_idx)
|
|||
SpellAuraHolder* dispelledHolder = j->first;
|
||||
data << uint32(dispelledHolder->GetId()); // Spell Id
|
||||
data << uint8(0); // 0 - dispelled !=0 cleansed
|
||||
unitTarget->RemoveAuraHolderDueToSpellByDispel(dispelledHolder->GetId(), j->second, dispelledHolder->GetCasterGUID(), m_caster);
|
||||
unitTarget->RemoveAuraHolderDueToSpellByDispel(dispelledHolder->GetId(), j->second, dispelledHolder->GetCasterGuid(), m_caster);
|
||||
}
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
|
||||
|
|
@ -7346,7 +7346,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
|
||||
if(spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
|
||||
(spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000002)) &&
|
||||
(*itr).second->GetCasterGUID() == m_caster->GetGUID())
|
||||
(*itr).second->GetCasterGuid() == m_caster->GetObjectGuid())
|
||||
(*itr).second->RefreshHolder();
|
||||
}
|
||||
return;
|
||||
|
|
@ -7378,7 +7378,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST &&
|
||||
(spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000008000)) &&
|
||||
(*itr).second->GetCasterGUID() == m_caster->GetGUID())
|
||||
(*itr).second->GetCasterGuid() == m_caster->GetObjectGuid())
|
||||
{
|
||||
(*itr).second->RefreshHolder();
|
||||
return;
|
||||
|
|
@ -7407,7 +7407,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
for(Unit::SpellAuraHolderMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
|
||||
{
|
||||
SpellAuraHolder *holder = i->second;
|
||||
if (holder->GetCasterGUID() != m_caster->GetGUID())
|
||||
if (holder->GetCasterGuid() != m_caster->GetObjectGuid())
|
||||
continue;
|
||||
|
||||
// Search only Serpent Sting, Viper Sting, Scorpid Sting auras
|
||||
|
|
@ -8821,7 +8821,8 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
|
|||
if(!unitTarget || unitTarget==m_caster) // can't steal from self
|
||||
return;
|
||||
|
||||
std::vector <SpellAuraHolder *> steal_list;
|
||||
typedef std::vector<SpellAuraHolder*> StealList;
|
||||
StealList steal_list;
|
||||
// Create dispel mask by dispel type
|
||||
uint32 dispelMask = GetDispellMask( DispelType(m_spellInfo->EffectMiscValue[eff_idx]) );
|
||||
Unit::SpellAuraHolderMap const& auras = unitTarget->GetSpellAuraHolderMap();
|
||||
|
|
@ -8838,7 +8839,8 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
|
|||
// Ok if exist some buffs for dispel try dispel it
|
||||
if (!steal_list.empty())
|
||||
{
|
||||
std::list < std::pair<uint32,uint64> > success_list;
|
||||
typedef std::list < std::pair<uint32, ObjectGuid> > SuccessList;
|
||||
SuccessList success_list;
|
||||
int32 list_size = steal_list.size();
|
||||
// Dispell N = damage buffs (or while exist buffs for dispel)
|
||||
for (int32 count=0; count < damage && list_size > 0; ++count)
|
||||
|
|
@ -8847,13 +8849,13 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
|
|||
SpellAuraHolder *holder = steal_list[urand(0, list_size-1)];
|
||||
// Not use chance for steal
|
||||
// TODO possible need do it
|
||||
success_list.push_back( std::pair<uint32,uint64>(holder->GetId(),holder->GetCasterGUID()));
|
||||
success_list.push_back(SuccessList::value_type(holder->GetId(),holder->GetCasterGuid()));
|
||||
|
||||
// Remove buff from list for prevent doubles
|
||||
for (std::vector<SpellAuraHolder *>::iterator j = steal_list.begin(); j != steal_list.end(); )
|
||||
for (StealList::iterator j = steal_list.begin(); j != steal_list.end(); )
|
||||
{
|
||||
SpellAuraHolder *stealed = *j;
|
||||
if (stealed->GetId() == holder->GetId() && stealed->GetCasterGUID() == holder->GetCasterGUID())
|
||||
if (stealed->GetId() == holder->GetId() && stealed->GetCasterGuid() == holder->GetCasterGuid())
|
||||
{
|
||||
j = steal_list.erase(j);
|
||||
--list_size;
|
||||
|
|
@ -8872,7 +8874,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
|
|||
data << uint32(m_spellInfo->Id); // Dispell spell id
|
||||
data << uint8(0); // not used
|
||||
data << uint32(count); // count
|
||||
for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j)
|
||||
for (SuccessList::iterator j = success_list.begin(); j != success_list.end(); ++j)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first);
|
||||
data << uint32(spellInfo->Id); // Spell Id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue