[8191] Drop code related to use long time empty spell_affect table. Author: XTZGZoReX

After switch to 3.x.x all data get explcitly from ClassMask fields in spell.dbc
    and no need in custom values.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-23 09:30:05 +08:00
parent e79656b75a
commit f481e7b14d
11 changed files with 9 additions and 145 deletions
-8
View File
@@ -1923,14 +1923,6 @@ INSERT INTO `spell_elixir` (`entry`, `mask`) VALUES
(60347, 0x2),
(62380, 0x3);
-- --------
-- SPELL AFFECT
-- --------
TRUNCATE TABLE `spell_affect`;
INSERT INTO `spell_affect` (`entry`, `effectId`, `SpellClassMask0`, `SpellClassMask1`, `SpellClassMask2`) VALUES
(44544,0,685904631,1151048,0); -- Fingers of frost
-- --------
-- Death Knight
-- --------
+1 -24
View File
@@ -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';
--
@@ -13541,29 +13541,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`
--
@@ -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`;
-1
View File
@@ -479,7 +479,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_required", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellRequiredCommand, "", NULL },
{ "spell_area", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellAreaCommand, "", NULL },
{ "spell_bonus_data", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellBonusesCommand, "", NULL },
-1
View File
@@ -399,7 +399,6 @@ class ChatHandler
bool HandleReloadSkillDiscoveryTemplateCommand(const char* args);
bool HandleReloadSkillExtraItemTemplateCommand(const char* args);
bool HandleReloadSkillFishingBaseLevelCommand(const char* args);
bool HandleReloadSpellAffectCommand(const char* args);
bool HandleReloadSpellRequiredCommand(const char* args);
bool HandleReloadSpellAreaCommand(const char* args);
bool HandleReloadSpellElixirCommand(const char* args);
-9
View File
@@ -644,7 +644,6 @@ bool ChatHandler::HandleReloadAllSpellCommand(const char*)
{
HandleReloadSkillDiscoveryTemplateCommand("a");
HandleReloadSkillExtraItemTemplateCommand("a");
HandleReloadSpellAffectCommand("a");
HandleReloadSpellRequiredCommand("a");
HandleReloadSpellAreaCommand("a");
HandleReloadSpellElixirCommand("a");
@@ -992,14 +991,6 @@ bool ChatHandler::HandleReloadSkillFishingBaseLevelCommand(const char* /*args*/)
return true;
}
bool ChatHandler::HandleReloadSpellAffectCommand(const char*)
{
sLog.outString( "Re-Loading SpellAffect definitions..." );
spellmgr.LoadSpellAffects();
SendGlobalGMSysMessage("DB table `spell_affect` (spell mods apply requirements) reloaded.");
return true;
}
bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
{
sLog.outString( "Re-Loading SpellArea Data..." );
+1 -5
View File
@@ -17387,11 +17387,7 @@ void Player::RemoveSpellMods(Spell * spell)
checkedSpells.find(aur->GetParentAura()) != checkedSpells.end())
continue;
flag96 const * mask = spellmgr.GetSpellAffect(aur->GetId(), aur->GetEffIndex());
if (!mask)
mask = &spellInfo->EffectSpellClassMask[aur->GetEffIndex()];
if (spell->m_spellInfo->SpellFamilyFlags & *mask)
if (spell->m_spellInfo->SpellFamilyFlags & spellInfo->EffectSpellClassMask[aur->GetEffIndex()])
{
checkedSpells.insert(aur->GetParentAura());
spell->m_appliedMods.erase(aur->GetParentAura());
+3 -10
View File
@@ -1718,12 +1718,8 @@ bool AuraEffect::isAffectedOnSpell(SpellEntry const *spell) const
if (spell->SpellFamilyName != m_spellProto->SpellFamilyName)
return false;
// Check EffectClassMask and Spell_Affect table
flag96 const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex);
if (!spellAffect)
spellAffect = &m_spellProto->EffectSpellClassMask[m_effIndex];
if (*spellAffect & spell->SpellFamilyFlags)
// Check EffectClassMask
if (m_spellProto->EffectSpellClassMask[m_effIndex] & spell->SpellFamilyFlags)
return true;
return false;
}
@@ -1768,10 +1764,7 @@ void AuraEffect::HandleAddModifier(bool apply, bool Real, bool changeAmount)
mod->type = SpellModType(m_auraName); // SpellModType value == spell aura types
mod->spellId = GetId();
flag96 const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex);
if (!spellAffect)
spellAffect = &m_spellProto->EffectSpellClassMask[m_effIndex];
mod->mask = *spellAffect;
mod->mask = m_spellProto->EffectSpellClassMask[m_effIndex];
mod->charges = GetParentAura()->GetAuraCharges();
m_spellmod = mod;
+1 -71
View File
@@ -1065,77 +1065,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;
}
flag96 affect(fields[2].GetUInt32(), fields[3].GetUInt32(), fields[4].GetUInt32());
// Spell.dbc have own data
if (effectId>3)
continue;
flag96 dbc_affect;
dbc_affect = spellInfo->EffectSpellClassMask[effectId];
if(dbc_affect[0] == affect[0] && dbc_affect[1] == affect[1] && dbc_affect[2] == affect[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 );
}
bool SpellMgr::IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const
{
// false for spellInfo == NULL
@@ -3815,6 +3744,7 @@ void SpellMgr::LoadSpellCustomAttr()
break;
case 44544: // Fingers of Frost
spellInfo->procCharges=2;
spellInfo->EffectSpellClassMask[0] = flag96(685904631,1151048,0);
break;
case 28200: // Ascendance (Talisman of Ascendance trinket)
spellInfo->procCharges=6;
-13
View File
@@ -391,9 +391,6 @@ bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group);
DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group);
int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellEntry const* spellproto);
// Spell affects related declarations (accessed using SpellMgr functions)
typedef UNORDERED_MAP<uint32, flag96> SpellAffectMap;
// Spell proc event related declarations (accessed using SpellMgr functions)
enum ProcFlags
{
@@ -735,14 +732,6 @@ class SpellMgr
// Accessors (const or static functions)
public:
// Spell affects
flag96 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;
@@ -1061,7 +1050,6 @@ class SpellMgr
void LoadSpellLearnSkills();
void LoadSpellLearnSpells();
void LoadSpellScriptTarget();
void LoadSpellAffects();
void LoadSpellElixirs();
void LoadSpellProcEvents();
void LoadSpellBonusess();
@@ -1087,7 +1075,6 @@ class SpellMgr
SpellLearnSkillMap mSpellLearnSkills;
SpellLearnSpellMap mSpellLearnSpells;
SpellTargetPositionMap mSpellTargetPositions;
SpellAffectMap mSpellAffectMap;
SpellElixirMap mSpellElixirs;
SpellProcEventMap mSpellProcEventMap;
SpellBonusMap mSpellBonusMap;
-3
View File
@@ -1364,9 +1364,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();