mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/DBLayer: Correct few more wrong read types (No. 4)
DB/World: Some consistency in the ints "length" field (not really a length) All world dbs checked
This commit is contained in:
59
sql/updates/world/2012_03_27_03_world_misc.sql
Normal file
59
sql/updates/world/2012_03_27_03_world_misc.sql
Normal file
@@ -0,0 +1,59 @@
|
||||
ALTER TABLE `reference_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1';
|
||||
ALTER TABLE `reputation_spillover_template` CHANGE `faction` `faction` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction entry';
|
||||
ALTER TABLE `reputation_spillover_template` CHANGE `faction1` `faction1` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction to give spillover for';
|
||||
ALTER TABLE `reputation_spillover_template` CHANGE `faction2` `faction2` smallint(5) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `reputation_spillover_template` CHANGE `faction3` `faction3` smallint(5) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `reputation_spillover_template` CHANGE `faction4` `faction4` smallint(5) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `skinning_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1';
|
||||
ALTER TABLE `spell_area` CHANGE `quest_start_active` `quest_start_active` tinyint(3) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_area` CHANGE `gender` `gender` tinyint(3) unsigned NOT NULL DEFAULT '2';
|
||||
ALTER TABLE `spell_area` CHANGE `autocast` `autocast` tinyint(3) unsigned NOT NULL DEFAULT '0';
|
||||
-- All the fields in spell_dbc where changed to full int32 since the DBC structure is used
|
||||
ALTER TABLE `spell_dbc` CHANGE `Dispel` `Dispel` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `Mechanic` `Mechanic` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `CastingTimeIndex` `CastingTimeIndex` int(10) unsigned NOT NULL DEFAULT '1';
|
||||
ALTER TABLE `spell_dbc` CHANGE `DurationIndex` `DurationIndex` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `ProcChance` `ProcChance` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `ProcCharges` `ProcCharges` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `BaseLevel` `BaseLevel` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `MaxLevel` `MaxLevel` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `SpellLevel` `SpellLevel` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `RangeIndex` `RangeIndex` int(10) unsigned NOT NULL DEFAULT '1';
|
||||
ALTER TABLE `spell_dbc` CHANGE `Effect1` `Effect1` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `Effect2` `Effect2` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `Effect3` `Effect3` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectMechanic1` `EffectMechanic1` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectMechanic2` `EffectMechanic2` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectMechanic3` `EffectMechanic3` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA1` `EffectImplicitTargetA1` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA2` `EffectImplicitTargetA2` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA3` `EffectImplicitTargetA3` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB1` `EffectImplicitTargetB1` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB2` `EffectImplicitTargetB2` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB3` `EffectImplicitTargetB3` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex1` `EffectRadiusIndex1` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex2` `EffectRadiusIndex2` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex3` `EffectRadiusIndex3` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName1` `EffectApplyAuraName1` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName2` `EffectApplyAuraName2` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName3` `EffectApplyAuraName3` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `MaxTargetLevel` `MaxTargetLevel` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `SpellFamilyName` `SpellFamilyName` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `MaxAffectedTargets` `MaxAffectedTargets` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `DmgClass` `DmgClass` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_dbc` CHANGE `PreventionType` `PreventionType` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
--
|
||||
ALTER TABLE `spell_group` CHANGE `id` `id` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1';
|
||||
ALTER TABLE `spell_proc` CHANGE `spellPhaseMask` `spellPhaseMask` int(11) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_proc` CHANGE `hitMask` `hitMask` int(11) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_enchant_proc_data` CHANGE `procEx` `procEx` int(10) unsigned NOT NULL DEFAULT '0'; -- changed from float to int
|
||||
ALTER TABLE `spell_required` CHANGE `spell_id` `spell_id` mediumint(8) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_required` CHANGE `req_spell` `req_spell` mediumint(8) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `spell_threat` CHANGE `flatMod` `flatMod` int(11) NULL DEFAULT NULL;
|
||||
ALTER TABLE `vehicle_accessory` CHANGE `seat_id` `seat_id` tinyint(4) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `vehicle_accessory` CHANGE `minion` `minion` tinyint(3) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `vehicle_template_accessory` CHANGE `seat_id` `seat_id` tinyint(4) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `vehicle_template_accessory` CHANGE `minion` `minion` tinyint(3) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `version` CHANGE `cache_id` `cache_id` int(11) NULL DEFAULT '0';
|
||||
ALTER TABLE `waypoint_data` CHANGE `move_flag` `move_flag` tinyint(4) NOT NULL DEFAULT '0';
|
||||
@@ -198,7 +198,6 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
temp.event.raw.param4 = fields[11].GetUInt32();
|
||||
|
||||
temp.action.type = (SMART_ACTION)fields[12].GetUInt8();
|
||||
|
||||
temp.action.raw.param1 = fields[13].GetUInt32();
|
||||
temp.action.raw.param2 = fields[14].GetUInt32();
|
||||
temp.action.raw.param3 = fields[15].GetUInt32();
|
||||
|
||||
@@ -2804,6 +2804,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_template_accessory`");
|
||||
|
||||
if (!result)
|
||||
@@ -2860,6 +2861,7 @@ void ObjectMgr::LoadVehicleAccessories()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult result = WorldDatabase.Query("SELECT `guid`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_accessory`");
|
||||
|
||||
if (!result)
|
||||
@@ -6753,7 +6755,7 @@ void ObjectMgr::LoadReputationRewardRate()
|
||||
|
||||
_repRewardRateStore.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
uint32 count = 0; // 0 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT faction, quest_rate, creature_rate, spell_rate FROM reputation_reward_rate");
|
||||
|
||||
if (!result)
|
||||
@@ -6890,7 +6892,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
|
||||
|
||||
_repSpilloverTemplateStore.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template");
|
||||
|
||||
if (!result)
|
||||
@@ -6904,22 +6906,22 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 factionId = fields[0].GetUInt32();
|
||||
uint32 factionId = fields[0].GetUInt16();
|
||||
|
||||
RepSpilloverTemplate repTemplate;
|
||||
|
||||
repTemplate.faction[0] = fields[1].GetUInt32();
|
||||
repTemplate.faction[0] = fields[1].GetUInt16();
|
||||
repTemplate.faction_rate[0] = fields[2].GetFloat();
|
||||
repTemplate.faction_rank[0] = fields[3].GetUInt32();
|
||||
repTemplate.faction[1] = fields[4].GetUInt32();
|
||||
repTemplate.faction_rank[0] = fields[3].GetUInt8();
|
||||
repTemplate.faction[1] = fields[4].GetUInt16();
|
||||
repTemplate.faction_rate[1] = fields[5].GetFloat();
|
||||
repTemplate.faction_rank[1] = fields[6].GetUInt32();
|
||||
repTemplate.faction[2] = fields[7].GetUInt32();
|
||||
repTemplate.faction_rank[1] = fields[6].GetUInt8();
|
||||
repTemplate.faction[2] = fields[7].GetUInt16();
|
||||
repTemplate.faction_rate[2] = fields[8].GetFloat();
|
||||
repTemplate.faction_rank[2] = fields[9].GetUInt32();
|
||||
repTemplate.faction[3] = fields[10].GetUInt32();
|
||||
repTemplate.faction_rank[2] = fields[9].GetUInt8();
|
||||
repTemplate.faction[3] = fields[10].GetUInt16();
|
||||
repTemplate.faction_rate[3] = fields[11].GetFloat();
|
||||
repTemplate.faction_rank[3] = fields[12].GetUInt32();
|
||||
repTemplate.faction_rank[3] = fields[12].GetUInt8();
|
||||
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
|
||||
|
||||
@@ -7806,7 +7808,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
int32 skill = fields[1].GetInt32();
|
||||
int32 skill = fields[1].GetInt16();
|
||||
|
||||
AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry);
|
||||
if (!fArea)
|
||||
|
||||
@@ -43,6 +43,7 @@ void WaypointMgr::Load()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data ORDER BY id, point");
|
||||
|
||||
if (!result)
|
||||
|
||||
@@ -30,7 +30,8 @@ void SystemMgr::LoadScriptTexts()
|
||||
|
||||
sLog->outString("TSCR: Loading Script Texts additional data...");
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts");
|
||||
|
||||
if (!result)
|
||||
@@ -49,9 +50,9 @@ void SystemMgr::LoadScriptTexts()
|
||||
|
||||
int32 iId = pFields[0].GetInt32();
|
||||
temp.uiSoundId = pFields[1].GetUInt32();
|
||||
temp.uiType = pFields[2].GetUInt32();
|
||||
temp.uiLanguage = pFields[3].GetUInt32();
|
||||
temp.uiEmote = pFields[4].GetUInt32();
|
||||
temp.uiType = pFields[2].GetUInt8();
|
||||
temp.uiLanguage = pFields[3].GetUInt8();
|
||||
temp.uiEmote = pFields[4].GetUInt16();
|
||||
|
||||
if (iId >= 0)
|
||||
{
|
||||
@@ -164,6 +165,7 @@ void SystemMgr::LoadScriptWaypoints()
|
||||
|
||||
sLog->outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount);
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid");
|
||||
|
||||
if (!result)
|
||||
|
||||
@@ -71,7 +71,7 @@ void LoadSkillDiscoveryTable()
|
||||
|
||||
uint32 spellId = fields[0].GetUInt32();
|
||||
int32 reqSkillOrSpell = fields[1].GetInt32();
|
||||
uint32 reqSkillValue = fields[2].GetUInt32();
|
||||
uint32 reqSkillValue = fields[2].GetUInt16();
|
||||
float chance = fields[3].GetFloat();
|
||||
|
||||
if (chance <= 0) // chance
|
||||
|
||||
@@ -55,7 +55,7 @@ void LoadSkillExtraItemTable()
|
||||
|
||||
SkillExtraItemStore.clear(); // need for reload
|
||||
|
||||
// 0 1 2 3
|
||||
// 0 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template");
|
||||
|
||||
if (!result)
|
||||
|
||||
@@ -1163,7 +1163,7 @@ void SpellMgr::LoadSpellRanks()
|
||||
mSpellInfoMap[itr->first]->ChainEntry = NULL;
|
||||
}
|
||||
mSpellChains.clear();
|
||||
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT first_spell_id, spell_id, rank from spell_ranks ORDER BY first_spell_id, rank");
|
||||
|
||||
if (!result)
|
||||
@@ -1276,6 +1276,7 @@ void SpellMgr::LoadSpellRequired()
|
||||
mSpellsReqSpell.clear(); // need for reload case
|
||||
mSpellReq.clear(); // need for reload case
|
||||
|
||||
// 0 1
|
||||
QueryResult result = WorldDatabase.Query("SELECT spell_id, req_spell from spell_required");
|
||||
|
||||
if (!result)
|
||||
@@ -1386,10 +1387,10 @@ void SpellMgr::LoadSpellLearnSpells()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 spell_id = fields[0].GetUInt32();
|
||||
uint32 spell_id = fields[0].GetUInt16();
|
||||
|
||||
SpellLearnSpellNode node;
|
||||
node.spell = fields[1].GetUInt32();
|
||||
node.spell = fields[1].GetUInt16();
|
||||
node.active = fields[2].GetBool();
|
||||
node.autoLearned= false;
|
||||
|
||||
@@ -1475,7 +1476,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
|
||||
mSpellTargetPositions.clear(); // need for reload case
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position");
|
||||
if (!result)
|
||||
{
|
||||
@@ -1494,7 +1495,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
|
||||
SpellTargetPosition st;
|
||||
|
||||
st.target_mapId = fields[1].GetUInt32();
|
||||
st.target_mapId = fields[1].GetUInt16();
|
||||
st.target_X = fields[2].GetFloat();
|
||||
st.target_Y = fields[3].GetFloat();
|
||||
st.target_Z = fields[4].GetFloat();
|
||||
@@ -1599,7 +1600,7 @@ void SpellMgr::LoadSpellGroups()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1
|
||||
// 0 1
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group");
|
||||
if (!result)
|
||||
{
|
||||
@@ -1696,7 +1697,7 @@ void SpellMgr::LoadSpellGroupStackRules()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 group_id = fields[0].GetUInt32();
|
||||
uint8 stack_rule = fields[1].GetUInt32();
|
||||
uint8 stack_rule = fields[1].GetInt8();
|
||||
if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX)
|
||||
{
|
||||
sLog->outErrorDb("SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule);
|
||||
@@ -1753,8 +1754,8 @@ void SpellMgr::LoadSpellProcEvents()
|
||||
|
||||
SpellProcEventEntry spe;
|
||||
|
||||
spe.schoolMask = fields[1].GetUInt32();
|
||||
spe.spellFamilyName = fields[2].GetUInt32();
|
||||
spe.schoolMask = fields[1].GetInt8();
|
||||
spe.spellFamilyName = fields[2].GetUInt16();
|
||||
spe.spellFamilyMask[0] = fields[3].GetUInt32();
|
||||
spe.spellFamilyMask[1] = fields[4].GetUInt32();
|
||||
spe.spellFamilyMask[2] = fields[5].GetUInt32();
|
||||
@@ -1793,7 +1794,7 @@ void SpellMgr::LoadSpellProcs()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
||||
QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
|
||||
if (!result)
|
||||
{
|
||||
@@ -1833,8 +1834,8 @@ void SpellMgr::LoadSpellProcs()
|
||||
|
||||
SpellProcEntry baseProcEntry;
|
||||
|
||||
baseProcEntry.schoolMask = fields[1].GetUInt32();
|
||||
baseProcEntry.spellFamilyName = fields[2].GetUInt32();
|
||||
baseProcEntry.schoolMask = fields[1].GetInt8();
|
||||
baseProcEntry.spellFamilyName = fields[2].GetUInt16();
|
||||
baseProcEntry.spellFamilyMask[0] = fields[3].GetUInt32();
|
||||
baseProcEntry.spellFamilyMask[1] = fields[4].GetUInt32();
|
||||
baseProcEntry.spellFamilyMask[2] = fields[5].GetUInt32();
|
||||
@@ -1997,7 +1998,7 @@ void SpellMgr::LoadSpellThreats()
|
||||
}
|
||||
|
||||
SpellThreatEntry ste;
|
||||
ste.flatMod = fields[1].GetInt16();
|
||||
ste.flatMod = fields[1].GetInt32();
|
||||
ste.pctMod = fields[2].GetFloat();
|
||||
ste.apPctMod = fields[3].GetFloat();
|
||||
|
||||
@@ -2204,7 +2205,7 @@ void SpellMgr::LoadSpellLinked()
|
||||
|
||||
int32 trigger = fields[0].GetInt32();
|
||||
int32 effect = fields[1].GetInt32();
|
||||
int32 type = fields[2].GetInt32();
|
||||
int32 type = fields[2].GetUInt8();
|
||||
|
||||
SpellInfo const* spellInfo = GetSpellInfo(abs(trigger));
|
||||
if (!spellInfo)
|
||||
|
||||
Reference in New Issue
Block a user