mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 07:37:02 +00:00
[8060] Fix 56314 and ranks.
Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
parent
113a492e02
commit
7448aaa37e
9 changed files with 86 additions and 58 deletions
|
|
@ -3107,8 +3107,9 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_
|
|||
RemoveAurasDueToSpell(spell_id);
|
||||
|
||||
// remove pet auras
|
||||
if(PetAura const* petSpell = spellmgr.GetPetAura(spell_id))
|
||||
RemovePetAura(petSpell);
|
||||
for(int i = 0; i < 3; ++i)
|
||||
if(PetAura const* petSpell = spellmgr.GetPetAura(spell_id, i))
|
||||
RemovePetAura(petSpell);
|
||||
|
||||
// free talent points
|
||||
uint32 talentCosts = GetTalentSpellCost(spell_id);
|
||||
|
|
|
|||
|
|
@ -2429,7 +2429,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
|||
}
|
||||
|
||||
// pet auras
|
||||
if(PetAura const* petSpell = spellmgr.GetPetAura(GetId()))
|
||||
if(PetAura const* petSpell = spellmgr.GetPetAura(GetId(), m_effIndex))
|
||||
{
|
||||
if(apply)
|
||||
m_target->AddPetAura(petSpell);
|
||||
|
|
|
|||
|
|
@ -1769,7 +1769,7 @@ void Spell::EffectDummy(uint32 i)
|
|||
}
|
||||
|
||||
// pet auras
|
||||
if(PetAura const* petSpell = spellmgr.GetPetAura(m_spellInfo->Id))
|
||||
if(PetAura const* petSpell = spellmgr.GetPetAura(m_spellInfo->Id, i))
|
||||
{
|
||||
m_caster->AddPetAura(petSpell);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -2064,8 +2064,8 @@ void SpellMgr::LoadSpellPetAuras()
|
|||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2
|
||||
QueryResult *result = WorldDatabase.Query("SELECT spell, pet, aura FROM spell_pet_auras");
|
||||
// 0 1 2 3
|
||||
QueryResult *result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras");
|
||||
if( !result )
|
||||
{
|
||||
|
||||
|
|
@ -2087,10 +2087,11 @@ void SpellMgr::LoadSpellPetAuras()
|
|||
bar.step();
|
||||
|
||||
uint16 spell = fields[0].GetUInt16();
|
||||
uint16 pet = fields[1].GetUInt16();
|
||||
uint16 aura = fields[2].GetUInt16();
|
||||
uint8 eff = fields[1].GetUInt8();
|
||||
uint16 pet = fields[2].GetUInt16();
|
||||
uint16 aura = fields[3].GetUInt16();
|
||||
|
||||
SpellPetAuraMap::iterator itr = mSpellPetAuraMap.find(spell);
|
||||
SpellPetAuraMap::iterator itr = mSpellPetAuraMap.find((spell<<8) + eff);
|
||||
if(itr != mSpellPetAuraMap.end())
|
||||
{
|
||||
itr->second.AddAura(pet, aura);
|
||||
|
|
@ -2103,14 +2104,10 @@ void SpellMgr::LoadSpellPetAuras()
|
|||
sLog.outErrorDb("Spell %u listed in `spell_pet_auras` does not exist", spell);
|
||||
continue;
|
||||
}
|
||||
int i = 0;
|
||||
for(; i < 3; ++i)
|
||||
if((spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA &&
|
||||
spellInfo->EffectApplyAuraName[i] == SPELL_AURA_DUMMY) ||
|
||||
spellInfo->Effect[i] == SPELL_EFFECT_DUMMY)
|
||||
break;
|
||||
|
||||
if(i == 3)
|
||||
if (spellInfo->Effect[eff] != SPELL_EFFECT_DUMMY &&
|
||||
(spellInfo->Effect[eff] != SPELL_EFFECT_APPLY_AURA ||
|
||||
spellInfo->EffectApplyAuraName[eff] != SPELL_AURA_DUMMY))
|
||||
{
|
||||
sLog.outError("Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
|
||||
continue;
|
||||
|
|
@ -2123,8 +2120,8 @@ void SpellMgr::LoadSpellPetAuras()
|
|||
continue;
|
||||
}
|
||||
|
||||
PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_PET, spellInfo->CalculateSimpleValue(i));
|
||||
mSpellPetAuraMap[spell] = pa;
|
||||
PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[eff] == TARGET_PET, spellInfo->CalculateSimpleValue(eff));
|
||||
mSpellPetAuraMap[(spell<<8) + eff] = pa;
|
||||
}
|
||||
|
||||
++count;
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ class PetAura
|
|||
bool removeOnChangePet;
|
||||
int32 damage;
|
||||
};
|
||||
typedef std::map<uint16, PetAura> SpellPetAuraMap;
|
||||
typedef std::map<uint32, PetAura> SpellPetAuraMap;
|
||||
|
||||
struct SpellArea
|
||||
{
|
||||
|
|
@ -833,9 +833,9 @@ class SpellMgr
|
|||
return mSkillLineAbilityMap.upper_bound(spell_id);
|
||||
}
|
||||
|
||||
PetAura const* GetPetAura(uint16 spell_id)
|
||||
PetAura const* GetPetAura(uint16 spell_id, uint8 eff)
|
||||
{
|
||||
SpellPetAuraMap::const_iterator itr = mSpellPetAuraMap.find(spell_id);
|
||||
SpellPetAuraMap::const_iterator itr = mSpellPetAuraMap.find((spell_id<<8) + eff);
|
||||
if(itr != mSpellPetAuraMap.end())
|
||||
return &itr->second;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8059"
|
||||
#define REVISION_NR "8060"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue