mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8191] Drop code related to use long time empty spell_affect table.
After switch to 3.x.x all data get explcitly from ClassMask fields in spell.dbc and no need in custom values. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
cbfbd13146
commit
a538fa621c
11 changed files with 19 additions and 200 deletions
|
|
@ -681,126 +681,6 @@ void SpellMgr::LoadSpellTargetPositions()
|
|||
sLog.outString( ">> Loaded %u spell teleport coordinates", count );
|
||||
}
|
||||
|
||||
void SpellMgr::LoadSpellAffects()
|
||||
{
|
||||
mSpellAffectMap.clear(); // need for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4
|
||||
QueryResult *result = WorldDatabase.Query("SELECT entry, effectId, SpellClassMask0, SpellClassMask1, SpellClassMask2 FROM spell_affect");
|
||||
if( !result )
|
||||
{
|
||||
|
||||
barGoLink bar( 1 );
|
||||
|
||||
bar.step();
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %u spell affect definitions", count );
|
||||
return;
|
||||
}
|
||||
|
||||
barGoLink bar( result->GetRowCount() );
|
||||
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
bar.step();
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
uint8 effectId = fields[1].GetUInt8();
|
||||
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(entry);
|
||||
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_affect` does not exist", entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (effectId >= 3)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_affect` have invalid effect index (%u)", entry,effectId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if( spellInfo->Effect[effectId] != SPELL_EFFECT_APPLY_AURA ||
|
||||
spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_FLAT_MODIFIER &&
|
||||
spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_PCT_MODIFIER &&
|
||||
spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_TARGET_TRIGGER )
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_affect` have not SPELL_AURA_ADD_FLAT_MODIFIER (%u) or SPELL_AURA_ADD_PCT_MODIFIER (%u) or SPELL_AURA_ADD_TARGET_TRIGGER (%u) for effect index (%u)", entry,SPELL_AURA_ADD_FLAT_MODIFIER,SPELL_AURA_ADD_PCT_MODIFIER,SPELL_AURA_ADD_TARGET_TRIGGER,effectId);
|
||||
continue;
|
||||
}
|
||||
|
||||
SpellAffectEntry affect;
|
||||
affect.SpellClassMask[0] = fields[2].GetUInt32();
|
||||
affect.SpellClassMask[1] = fields[3].GetUInt32();
|
||||
affect.SpellClassMask[2] = fields[4].GetUInt32();
|
||||
|
||||
// Spell.dbc have own data
|
||||
uint32 const *ptr = 0;
|
||||
switch (effectId)
|
||||
{
|
||||
case 0: ptr = &spellInfo->EffectSpellClassMaskA[0]; break;
|
||||
case 1: ptr = &spellInfo->EffectSpellClassMaskB[0]; break;
|
||||
case 2: ptr = &spellInfo->EffectSpellClassMaskC[0]; break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if(ptr[0] == affect.SpellClassMask[0] || ptr[1] == affect.SpellClassMask[1] || ptr[2] == affect.SpellClassMask[2])
|
||||
{
|
||||
char text[]="ABC";
|
||||
sLog.outErrorDb("Spell %u listed in `spell_affect` have redundant (same with EffectSpellClassMask%c) data for effect index (%u) and not needed, skipped.", entry, text[effectId], effectId);
|
||||
continue;
|
||||
}
|
||||
|
||||
mSpellAffectMap[(entry<<8) + effectId] = affect;
|
||||
|
||||
++count;
|
||||
} while( result->NextRow() );
|
||||
|
||||
delete result;
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %u custom spell affect definitions", count );
|
||||
|
||||
for (uint32 id = 0; id < sSpellStore.GetNumRows(); ++id)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(id);
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
|
||||
for (int effectId = 0; effectId < 3; ++effectId)
|
||||
{
|
||||
if( spellInfo->Effect[effectId] != SPELL_EFFECT_APPLY_AURA ||
|
||||
(spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_FLAT_MODIFIER &&
|
||||
spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_PCT_MODIFIER &&
|
||||
spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_TARGET_TRIGGER) )
|
||||
continue;
|
||||
|
||||
uint32 const *ptr = 0;
|
||||
switch (effectId)
|
||||
{
|
||||
case 0: ptr = &spellInfo->EffectSpellClassMaskA[0]; break;
|
||||
case 1: ptr = &spellInfo->EffectSpellClassMaskB[0]; break;
|
||||
case 2: ptr = &spellInfo->EffectSpellClassMaskC[0]; break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if(ptr[0] || ptr[1] || ptr[2])
|
||||
continue;
|
||||
|
||||
if(mSpellAffectMap.find((id<<8) + effectId) != mSpellAffectMap.end())
|
||||
continue;
|
||||
|
||||
sLog.outErrorDb("Spell %u (%s) misses spell_affect for effect %u",id,spellInfo->SpellName[sWorld.GetDefaultDbcLocale()], effectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SpellMgr::IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const
|
||||
{
|
||||
// false for spellInfo == NULL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue