mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
*Remove data from world.sql - it exists now only for structure documentation.
*Remove debug spell_check command - such things shouldn't belong to core. --HG-- branch : trunk
This commit is contained in:
@@ -15,26 +15,6 @@
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
/*
|
||||
--
|
||||
-- Table structure for table `realmd_db_version`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `realmd_db_version`;
|
||||
CREATE TABLE `realmd_db_version` (
|
||||
`required_7938_01_realmd_account` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||
|
||||
--
|
||||
-- Dumping data for table `realmd_db_version`
|
||||
--
|
||||
|
||||
LOCK TABLES `realmd_db_version` WRITE;
|
||||
INSERT INTO `realmd_db_version` VALUES
|
||||
(NULL);
|
||||
UNLOCK TABLES;
|
||||
*/
|
||||
|
||||
--
|
||||
-- Table structure for table `account`
|
||||
--
|
||||
|
||||
12108
sql/world.sql
12108
sql/world.sql
File diff suppressed because it is too large
Load Diff
@@ -163,7 +163,6 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "setaurastate", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetAuraStateCommand, "", NULL },
|
||||
{ "setitemflag", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemFlagCommand, "", NULL },
|
||||
{ "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValueCommand, "", NULL },
|
||||
{ "spellcheck", SEC_CONSOLE, true, &ChatHandler::HandleDebugSpellCheckCommand, "", NULL },
|
||||
{ "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicle, "", NULL },
|
||||
{ "setvid", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetVehicleId, "", NULL },
|
||||
{ "entervehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugEnterVehicle, "", NULL },
|
||||
|
||||
@@ -801,14 +801,6 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleDebugSpellCheckCommand(const char* /*args*/)
|
||||
{
|
||||
sLog.outString( "Check expected in code spell properties base at table 'spell_check' content...");
|
||||
spellmgr.CheckUsedSpells("spell_check");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ChatHandler::HandleDebugSendLargePacketCommand(const char* /*args*/)
|
||||
{
|
||||
const char* stuffingString = "This is a dummy string to push the packet's size beyond 128000 bytes. ";
|
||||
|
||||
@@ -2680,261 +2680,6 @@ void SpellMgr::LoadSkillLineAbilityMap()
|
||||
sLog.outString(">> Loaded %u SkillLineAbility MultiMap Data", count);
|
||||
}
|
||||
|
||||
void SpellMgr::CheckUsedSpells(char const* table)
|
||||
{
|
||||
uint32 countSpells = 0;
|
||||
uint32 countMasks = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
QueryResult *result = WorldDatabase.PQuery("SELECT spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMaskB,SpellIcon,SpellVisual,SpellCategory,EffectType,EffectAura,EffectIdx,Name,Code FROM %s",table);
|
||||
|
||||
if( !result )
|
||||
{
|
||||
barGoLink bar( 1 );
|
||||
|
||||
bar.step();
|
||||
|
||||
sLog.outString();
|
||||
sLog.outErrorDb("`%s` table is empty!",table);
|
||||
return;
|
||||
}
|
||||
|
||||
barGoLink bar( result->GetRowCount() );
|
||||
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
bar.step();
|
||||
|
||||
uint32 spell = fields[0].GetUInt32();
|
||||
int32 family = fields[1].GetInt32();
|
||||
uint64 familyMaskA = fields[2].GetUInt64();
|
||||
uint32 familyMaskB = fields[3].GetUInt32();
|
||||
flag96 familyMask(familyMaskA, familyMaskB);
|
||||
int32 spellIcon = fields[4].GetInt32();
|
||||
int32 spellVisual = fields[5].GetInt32();
|
||||
int32 category = fields[6].GetInt32();
|
||||
int32 effectType = fields[7].GetInt32();
|
||||
int32 auraType = fields[8].GetInt32();
|
||||
int32 effectIdx = fields[9].GetInt32();
|
||||
std::string name = fields[10].GetCppString();
|
||||
std::string code = fields[11].GetCppString();
|
||||
|
||||
// checks of correctness requirements itself
|
||||
|
||||
if (family < -1 || family > SPELLFAMILY_PET)
|
||||
{
|
||||
sLog.outError("Table '%s' for spell %u have wrong SpellFamily value(%u), skipped.",table,spell,family);
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: spellIcon check need dbc loading
|
||||
if (spellIcon < -1)
|
||||
{
|
||||
sLog.outError("Table '%s' for spell %u have wrong SpellIcon value(%u), skipped.",table,spell,spellIcon);
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: spellVisual check need dbc loading
|
||||
if (spellVisual < -1)
|
||||
{
|
||||
sLog.outError("Table '%s' for spell %u have wrong SpellVisual value(%u), skipped.",table,spell,spellVisual);
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: for spellCategory better check need dbc loading
|
||||
if (category < -1 || category >=0 && sSpellCategoryStore.find(category) == sSpellCategoryStore.end())
|
||||
{
|
||||
sLog.outError("Table '%s' for spell %u have wrong SpellCategory value(%u), skipped.",table,spell,category);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (effectType < -1 || effectType >= TOTAL_SPELL_EFFECTS)
|
||||
{
|
||||
sLog.outError("Table '%s' for spell %u have wrong SpellEffect type value(%u), skipped.",table,spell,effectType);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auraType < -1 || auraType >= TOTAL_AURAS)
|
||||
{
|
||||
sLog.outError("Table '%s' for spell %u have wrong SpellAura type value(%u), skipped.",table,spell,auraType);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (effectIdx < -1 || effectIdx >= 3)
|
||||
{
|
||||
sLog.outError("Table '%s' for spell %u have wrong EffectIdx value(%u), skipped.",table,spell,effectIdx);
|
||||
continue;
|
||||
}
|
||||
|
||||
// now checks of requirements
|
||||
|
||||
if(spell)
|
||||
{
|
||||
++countSpells;
|
||||
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spell);
|
||||
if(!spellEntry)
|
||||
{
|
||||
sLog.outError("Spell %u '%s' not exist but used in %s.",spell,name.c_str(),code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
if(family >= 0 && spellEntry->SpellFamilyName != family)
|
||||
{
|
||||
sLog.outError("Spell %u '%s' family(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellFamilyName,family,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
if(familyMaskA != UI64LIT(0xFFFFFFFFFFFFFFFF) || familyMaskB != 0xFFFFFFFF)
|
||||
{
|
||||
if(familyMaskA == UI64LIT(0x0000000000000000) && familyMaskB == 0x00000000)
|
||||
{
|
||||
if(spellEntry->SpellFamilyFlags)
|
||||
{
|
||||
sLog.outError("Spell %u '%s' not fit to (" I64FMT "," I32FMT ") but used in %s.",spell,name.c_str(),familyMaskA,familyMaskB,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(spellEntry->SpellFamilyFlags & familyMask))
|
||||
{
|
||||
sLog.outError("Spell %u '%s' not fit to (" I64FMT "," I32FMT ") but used in %s.",spell,name.c_str(),familyMaskA,familyMaskB,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(spellIcon >= 0 && spellEntry->SpellIconID != spellIcon)
|
||||
{
|
||||
sLog.outError("Spell %u '%s' icon(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellIconID,spellIcon,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
if(spellVisual >= 0 && spellEntry->SpellVisual[0] != spellVisual)
|
||||
{
|
||||
sLog.outError("Spell %u '%s' visual(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellVisual[0],spellVisual,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
if(category >= 0 && spellEntry->Category != category)
|
||||
{
|
||||
sLog.outError("Spell %u '%s' category(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->Category,category,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
if(effectIdx >= 0)
|
||||
{
|
||||
if(effectType >= 0 && spellEntry->Effect[effectIdx] != effectType)
|
||||
{
|
||||
sLog.outError("Spell %u '%s' effect%d <> %u but used in %s.",spell,name.c_str(),effectIdx+1,effectType,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
if(auraType >= 0 && spellEntry->EffectApplyAuraName[effectIdx] != auraType)
|
||||
{
|
||||
sLog.outError("Spell %u '%s' aura%d <> %u but used in %s.",spell,name.c_str(),effectIdx+1,auraType,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(effectType >= 0 && !IsSpellHaveEffect(spellEntry,SpellEffects(effectType)))
|
||||
{
|
||||
sLog.outError("Spell %u '%s' not have effect %u but used in %s.",spell,name.c_str(),effectType,code.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
if(auraType >= 0 && !IsSpellHaveAura(spellEntry,AuraType(auraType)))
|
||||
{
|
||||
sLog.outError("Spell %u '%s' not have aura %u but used in %s.",spell,name.c_str(),auraType,code.c_str());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
++countMasks;
|
||||
|
||||
bool found = false;
|
||||
for(uint32 spellId = 1; spellId < sSpellStore.GetNumRows(); ++spellId)
|
||||
{
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId);
|
||||
if(!spellEntry)
|
||||
continue;
|
||||
|
||||
if(family >=0 && spellEntry->SpellFamilyName != family)
|
||||
continue;
|
||||
|
||||
if(familyMaskA != UI64LIT(0xFFFFFFFFFFFFFFFF) || familyMaskB != 0xFFFFFFFF)
|
||||
{
|
||||
if(familyMaskA == UI64LIT(0x0000000000000000) && familyMaskB == 0x00000000)
|
||||
{
|
||||
if(spellEntry->SpellFamilyFlags)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(spellEntry->SpellFamilyFlags & familyMask))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(spellIcon >= 0 && spellEntry->SpellIconID != spellIcon)
|
||||
continue;
|
||||
|
||||
if(spellVisual >= 0 && spellEntry->SpellVisual[0] != spellVisual)
|
||||
continue;
|
||||
|
||||
if(category >= 0 && spellEntry->Category != category)
|
||||
continue;
|
||||
|
||||
if(effectIdx >= 0)
|
||||
{
|
||||
if(effectType >=0 && spellEntry->Effect[effectIdx] != effectType)
|
||||
continue;
|
||||
|
||||
if(auraType >=0 && spellEntry->EffectApplyAuraName[effectIdx] != auraType)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(effectType >=0 && !IsSpellHaveEffect(spellEntry,SpellEffects(effectType)))
|
||||
continue;
|
||||
|
||||
if(auraType >=0 && !IsSpellHaveAura(spellEntry,AuraType(auraType)))
|
||||
continue;
|
||||
}
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!found)
|
||||
{
|
||||
if(effectIdx >= 0)
|
||||
sLog.outError("Spells '%s' not found for family %i (" I64FMT "," I32FMT ") icon(%i) visual(%i) category(%i) effect%d(%i) aura%d(%i) but used in %s",
|
||||
name.c_str(),family,familyMaskA,familyMaskB,spellIcon,spellVisual,category,effectIdx+1,effectType,effectIdx+1,auraType,code.c_str());
|
||||
else
|
||||
sLog.outError("Spells '%s' not found for family %i (" I64FMT "," I32FMT ") icon(%i) visual(%i) category(%i) effect(%i) aura(%i) but used in %s",
|
||||
name.c_str(),family,familyMaskA,familyMaskB,spellIcon,spellVisual,category,effectType,auraType,code.c_str());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
} while( result->NextRow() );
|
||||
|
||||
delete result;
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Checked %u spells and %u spell masks", countSpells, countMasks );
|
||||
}
|
||||
|
||||
DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto, bool triggered)
|
||||
{
|
||||
// Explicit Diminishing Groups
|
||||
|
||||
@@ -1055,8 +1055,6 @@ class SpellMgr
|
||||
public:
|
||||
static SpellMgr& Instance();
|
||||
|
||||
void CheckUsedSpells(char const* table);
|
||||
|
||||
// Loading data at server startup
|
||||
void LoadSpellChains();
|
||||
void LoadSpellRequired();
|
||||
|
||||
Reference in New Issue
Block a user