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
|
|
@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
|
|||
CREATE TABLE `db_version` (
|
||||
`version` varchar(120) default NULL,
|
||||
`creature_ai_version` varchar(120) default NULL,
|
||||
`required_8190_01_mangos_creature_template` bit(1) default NULL
|
||||
`required_8191_01_mangos_spell_affect` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||
|
||||
--
|
||||
|
|
@ -13542,29 +13542,6 @@ LOCK TABLES `skinning_loot_template` WRITE;
|
|||
/*!40000 ALTER TABLE `skinning_loot_template` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `spell_affect`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `spell_affect`;
|
||||
CREATE TABLE `spell_affect` (
|
||||
`entry` smallint(5) unsigned NOT NULL default '0',
|
||||
`effectId` tinyint(3) unsigned NOT NULL default '0',
|
||||
`SpellClassMask0` int(5) unsigned NOT NULL default '0',
|
||||
`SpellClassMask1` int(5) unsigned NOT NULL default '0',
|
||||
`SpellClassMask2` int(5) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`entry`,`effectId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `spell_affect`
|
||||
--
|
||||
|
||||
LOCK TABLES `spell_affect` WRITE;
|
||||
/*!40000 ALTER TABLE `spell_affect` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `spell_affect` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `spell_area`
|
||||
--
|
||||
|
|
|
|||
3
sql/updates/8191_01_mangos_spell_affect.sql
Normal file
3
sql/updates/8191_01_mangos_spell_affect.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_8190_01_mangos_creature_template required_8191_01_mangos_spell_affect bit;
|
||||
|
||||
DROP TABLE IF EXISTS `spell_affect`;
|
||||
|
|
@ -245,6 +245,7 @@ pkgdata_DATA = \
|
|||
8140_01_mangos_spell_proc_event.sql \
|
||||
8158_01_mangos_playercreateinfo_action.sql \
|
||||
8190_01_mangos_creature_template.sql \
|
||||
8191_01_mangos_spell_affect.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -470,4 +471,5 @@ EXTRA_DIST = \
|
|||
8140_01_mangos_spell_proc_event.sql \
|
||||
8158_01_mangos_playercreateinfo_action.sql \
|
||||
8190_01_mangos_creature_template.sql \
|
||||
8191_01_mangos_spell_affect.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -443,7 +443,6 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ "skill_extra_item_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSkillExtraItemTemplateCommand, "", NULL },
|
||||
{ "skill_fishing_base_level", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSkillFishingBaseLevelCommand, "", NULL },
|
||||
{ "skinning_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesSkinningCommand, "", NULL },
|
||||
{ "spell_affect", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellAffectCommand, "", NULL },
|
||||
{ "spell_area", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellAreaCommand, "", NULL },
|
||||
{ "spell_bonus_data", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellBonusesCommand, "", NULL },
|
||||
{ "spell_chain", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellChainCommand, "", NULL },
|
||||
|
|
|
|||
|
|
@ -370,7 +370,6 @@ class ChatHandler
|
|||
bool HandleReloadSkillDiscoveryTemplateCommand(const char* args);
|
||||
bool HandleReloadSkillExtraItemTemplateCommand(const char* args);
|
||||
bool HandleReloadSkillFishingBaseLevelCommand(const char* args);
|
||||
bool HandleReloadSpellAffectCommand(const char* args);
|
||||
bool HandleReloadSpellAreaCommand(const char* args);
|
||||
bool HandleReloadSpellChainCommand(const char* args);
|
||||
bool HandleReloadSpellElixirCommand(const char* args);
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ bool ChatHandler::HandleReloadAllSpellCommand(const char*)
|
|||
{
|
||||
HandleReloadSkillDiscoveryTemplateCommand("a");
|
||||
HandleReloadSkillExtraItemTemplateCommand("a");
|
||||
HandleReloadSpellAffectCommand("a");
|
||||
HandleReloadSpellAreaCommand("a");
|
||||
HandleReloadSpellChainCommand("a");
|
||||
HandleReloadSpellElixirCommand("a");
|
||||
|
|
@ -481,14 +480,6 @@ bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReloadSpellAffectCommand(const char*)
|
||||
{
|
||||
sLog.outString( "Re-Loading SpellAffect definitions..." );
|
||||
spellmgr.LoadSpellAffects();
|
||||
SendGlobalSysMessage("DB table `spell_affect` (spell mods apply requirements) reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
|
||||
{
|
||||
sLog.outString( "Re-Loading SpellArea Data..." );
|
||||
|
|
|
|||
|
|
@ -1282,19 +1282,13 @@ void Aura::HandleAddModifier(bool apply, bool Real)
|
|||
mod->spellId = GetId();
|
||||
|
||||
uint32 const *ptr;
|
||||
SpellAffectEntry const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex);
|
||||
if (spellAffect)
|
||||
ptr = &spellAffect->SpellClassMask[0];
|
||||
else
|
||||
switch (m_effIndex)
|
||||
{
|
||||
switch (m_effIndex)
|
||||
{
|
||||
case 0: ptr = &m_spellProto->EffectSpellClassMaskA[0]; break;
|
||||
case 1: ptr = &m_spellProto->EffectSpellClassMaskB[0]; break;
|
||||
case 2: ptr = &m_spellProto->EffectSpellClassMaskC[0]; break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
case 0: ptr = &m_spellProto->EffectSpellClassMaskA[0]; break;
|
||||
case 1: ptr = &m_spellProto->EffectSpellClassMaskB[0]; break;
|
||||
case 2: ptr = &m_spellProto->EffectSpellClassMaskC[0]; break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
mod->mask = (uint64)ptr[0] | (uint64)ptr[1]<<32;
|
||||
|
|
@ -1328,19 +1322,13 @@ void Aura::HandleAddTargetTrigger(bool apply, bool /*Real*/)
|
|||
mod->spellId = GetId();
|
||||
|
||||
uint32 const *ptr;
|
||||
SpellAffectEntry const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex);
|
||||
if (spellAffect)
|
||||
ptr = &spellAffect->SpellClassMask[0];
|
||||
else
|
||||
switch (m_effIndex)
|
||||
{
|
||||
switch (m_effIndex)
|
||||
{
|
||||
case 0: ptr = &m_spellProto->EffectSpellClassMaskA[0]; break;
|
||||
case 1: ptr = &m_spellProto->EffectSpellClassMaskB[0]; break;
|
||||
case 2: ptr = &m_spellProto->EffectSpellClassMaskC[0]; break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
case 0: ptr = &m_spellProto->EffectSpellClassMaskA[0]; break;
|
||||
case 1: ptr = &m_spellProto->EffectSpellClassMaskB[0]; break;
|
||||
case 2: ptr = &m_spellProto->EffectSpellClassMaskC[0]; break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
mod->mask = (uint64)ptr[0] | (uint64)ptr[1]<<32;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -342,13 +342,6 @@ bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group);
|
|||
DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group);
|
||||
int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellEntry const* spellproto);
|
||||
|
||||
// Spell affects related declarations (accessed using SpellMgr functions)
|
||||
struct SpellAffectEntry
|
||||
{
|
||||
uint32 SpellClassMask[3];
|
||||
};
|
||||
typedef UNORDERED_MAP<uint32, SpellAffectEntry> SpellAffectMap;
|
||||
|
||||
// Spell proc event related declarations (accessed using SpellMgr functions)
|
||||
enum ProcFlags
|
||||
{
|
||||
|
|
@ -639,14 +632,6 @@ class SpellMgr
|
|||
|
||||
// Accessors (const or static functions)
|
||||
public:
|
||||
// Spell affects
|
||||
SpellAffectEntry const*GetSpellAffect(uint32 spellId, uint8 effectId) const
|
||||
{
|
||||
SpellAffectMap::const_iterator itr = mSpellAffectMap.find((spellId<<8) + effectId);
|
||||
if( itr != mSpellAffectMap.end( ) )
|
||||
return &itr->second;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const;
|
||||
|
||||
|
|
@ -908,7 +893,6 @@ class SpellMgr
|
|||
void LoadSpellLearnSkills();
|
||||
void LoadSpellLearnSpells();
|
||||
void LoadSpellScriptTarget();
|
||||
void LoadSpellAffects();
|
||||
void LoadSpellElixirs();
|
||||
void LoadSpellProcEvents();
|
||||
void LoadSpellBonusess();
|
||||
|
|
@ -927,7 +911,6 @@ class SpellMgr
|
|||
SpellLearnSkillMap mSpellLearnSkills;
|
||||
SpellLearnSpellMap mSpellLearnSpells;
|
||||
SpellTargetPositionMap mSpellTargetPositions;
|
||||
SpellAffectMap mSpellAffectMap;
|
||||
SpellElixirMap mSpellElixirs;
|
||||
SpellProcEventMap mSpellProcEventMap;
|
||||
SpellBonusMap mSpellBonusMap;
|
||||
|
|
|
|||
|
|
@ -1253,9 +1253,6 @@ void World::SetInitialWorldSettings()
|
|||
sLog.outString( "Loading Spell target coordinates..." );
|
||||
spellmgr.LoadSpellTargetPositions();
|
||||
|
||||
sLog.outString( "Loading SpellAffect definitions..." );
|
||||
spellmgr.LoadSpellAffects();
|
||||
|
||||
sLog.outString( "Loading spell pet auras..." );
|
||||
spellmgr.LoadSpellPetAuras();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8190"
|
||||
#define REVISION_NR "8191"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue