Core/Misc: First part of renaming to Blizzard's names
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
ALTER TABLE `locales_page_text` CHANGE `entry` `ID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `entry` `ID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `icon_name_loc1` `Name_loc1` TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `icon_name_loc2` `Name_loc2` TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `icon_name_loc3` `Name_loc3` TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `icon_name_loc4` `Name_loc4` TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `icon_name_loc5` `Name_loc5` TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `icon_name_loc6` `Name_loc6` TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `icon_name_loc7` `Name_loc7` TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE `locales_points_of_interest` CHANGE `icon_name_loc8` `Name_loc8` TEXT NOT NULL DEFAULT '';
|
||||
|
||||
ALTER TABLE `npc_trainer` CHANGE `entry` `ID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `npc_trainer` CHANGE `spell` `SpellID` MEDIUMINT(8) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `npc_trainer` CHANGE `spellcost` `MoneyCost` INT(10) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `npc_trainer` CHANGE `reqskill` `ReqSkillLine` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `npc_trainer` CHANGE `reqskillvalue` `ReqSkillRank` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `npc_trainer` CHANGE `reqLevel` `ReqLevel` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';
|
||||
|
||||
ALTER TABLE `page_text` CHANGE `entry` `ID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `page_text` CHANGE `text` `Text` LONGTEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE `page_text` CHANGE `next_page` `NextPageID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
|
||||
ALTER TABLE `points_of_interest` CHANGE `entry` `ID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `points_of_interest` CHANGE `x` `PositionX` FLOAT NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `points_of_interest` CHANGE `y` `PositionY` FLOAT NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `points_of_interest` CHANGE `icon` `Icon` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `points_of_interest` CHANGE `flags` `Flags` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `points_of_interest` CHANGE `data` `Importance` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `points_of_interest` CHANGE `icon_name` `Name` TEXT NOT NULL DEFAULT '';
|
||||
@@ -392,21 +392,21 @@ typedef std::list<VendorItemCount> VendorItemCounts;
|
||||
|
||||
struct TrainerSpell
|
||||
{
|
||||
TrainerSpell() : spell(0), spellCost(0), reqSkill(0), reqSkillValue(0), reqLevel(0)
|
||||
TrainerSpell() : SpellID(0), MoneyCost(0), ReqSkillLine(0), ReqSkillRank(0), ReqLevel(0)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
learnedSpell[i] = 0;
|
||||
ReqAbility[i] = 0;
|
||||
}
|
||||
|
||||
uint32 spell;
|
||||
uint32 spellCost;
|
||||
uint32 reqSkill;
|
||||
uint32 reqSkillValue;
|
||||
uint32 reqLevel;
|
||||
uint32 learnedSpell[3];
|
||||
uint32 SpellID;
|
||||
uint32 MoneyCost;
|
||||
uint32 ReqSkillLine;
|
||||
uint32 ReqSkillRank;
|
||||
uint32 ReqLevel;
|
||||
uint32 ReqAbility[3];
|
||||
|
||||
// helpers
|
||||
bool IsCastable() const { return learnedSpell[0] != spell; }
|
||||
bool IsCastable() const { return ReqAbility[0] != SpellID; }
|
||||
};
|
||||
|
||||
typedef std::unordered_map<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap;
|
||||
|
||||
@@ -263,18 +263,18 @@ void PlayerMenu::SendPointOfInterest(uint32 poiId) const
|
||||
return;
|
||||
}
|
||||
|
||||
std::string iconText = poi->icon_name;
|
||||
std::string iconText = poi->Name;
|
||||
int32 locale = _session->GetSessionDbLocaleIndex();
|
||||
if (locale >= 0)
|
||||
if (PointOfInterestLocale const* localeData = sObjectMgr->GetPointOfInterestLocale(poiId))
|
||||
ObjectMgr::GetLocaleString(localeData->IconName, locale, iconText);
|
||||
|
||||
WorldPacket data(SMSG_GOSSIP_POI, 4 + 4 + 4 + 4 + 4 + 10); // guess size
|
||||
data << uint32(poi->flags);
|
||||
data << float(poi->x);
|
||||
data << float(poi->y);
|
||||
data << uint32(poi->icon);
|
||||
data << uint32(poi->data);
|
||||
data << uint32(poi->Flags);
|
||||
data << float(poi->PositionX);
|
||||
data << float(poi->PositionY);
|
||||
data << uint32(poi->Icon);
|
||||
data << uint32(poi->Importance);
|
||||
data << iconText;
|
||||
|
||||
_session->SendPacket(&data);
|
||||
|
||||
@@ -4570,10 +4570,10 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
|
||||
bool hasSpell = true;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (!trainer_spell->learnedSpell[i])
|
||||
if (!trainer_spell->ReqAbility[i])
|
||||
continue;
|
||||
|
||||
if (!HasSpell(trainer_spell->learnedSpell[i]))
|
||||
if (!HasSpell(trainer_spell->ReqAbility[i]))
|
||||
{
|
||||
hasSpell = false;
|
||||
break;
|
||||
@@ -4584,30 +4584,30 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
|
||||
return TRAINER_SPELL_GRAY;
|
||||
|
||||
// check skill requirement
|
||||
if (trainer_spell->reqSkill && GetBaseSkillValue(trainer_spell->reqSkill) < trainer_spell->reqSkillValue)
|
||||
if (trainer_spell->ReqSkillLine && GetBaseSkillValue(trainer_spell->ReqSkillLine) < trainer_spell->ReqSkillRank)
|
||||
return TRAINER_SPELL_RED;
|
||||
|
||||
// check level requirement
|
||||
if (getLevel() < trainer_spell->reqLevel)
|
||||
if (getLevel() < trainer_spell->ReqLevel)
|
||||
return TRAINER_SPELL_RED;
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (!trainer_spell->learnedSpell[i])
|
||||
if (!trainer_spell->ReqAbility[i])
|
||||
continue;
|
||||
|
||||
// check race/class requirement
|
||||
if (!IsSpellFitByClassAndRace(trainer_spell->learnedSpell[i]))
|
||||
if (!IsSpellFitByClassAndRace(trainer_spell->ReqAbility[i]))
|
||||
return TRAINER_SPELL_RED;
|
||||
|
||||
if (uint32 prevSpell = sSpellMgr->GetPrevSpellInChain(trainer_spell->learnedSpell[i]))
|
||||
if (uint32 prevSpell = sSpellMgr->GetPrevSpellInChain(trainer_spell->ReqAbility[i]))
|
||||
{
|
||||
// check prev.rank requirement
|
||||
if (prevSpell && !HasSpell(prevSpell))
|
||||
return TRAINER_SPELL_RED;
|
||||
}
|
||||
|
||||
SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(trainer_spell->learnedSpell[i]);
|
||||
SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(trainer_spell->ReqAbility[i]);
|
||||
for (SpellsRequiringSpellMap::const_iterator itr = spellsRequired.first; itr != spellsRequired.second; ++itr)
|
||||
{
|
||||
// check additional spell requirement
|
||||
@@ -4620,9 +4620,9 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
|
||||
// first rank of primary profession spell when there are no proffesions avalible is disabled
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (!trainer_spell->learnedSpell[i])
|
||||
if (!trainer_spell->ReqAbility[i])
|
||||
continue;
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(trainer_spell->learnedSpell[i]);
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(trainer_spell->ReqAbility[i]);
|
||||
if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank() && (GetFreePrimaryProfessionPoints() == 0))
|
||||
return TRAINER_SPELL_GREEN_DISABLED;
|
||||
}
|
||||
|
||||
@@ -404,7 +404,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
|
||||
|
||||
_pointOfInterestLocaleStore.clear(); // need for reload case
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, icon_name_loc1, icon_name_loc2, icon_name_loc3, icon_name_loc4, icon_name_loc5, icon_name_loc6, icon_name_loc7, icon_name_loc8 FROM locales_points_of_interest");
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, Name_loc1, Name_loc2, Name_loc3, Name_loc4, Name_loc5, Name_loc6, Name_loc7, Name_loc8 FROM locales_points_of_interest");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
@@ -5174,8 +5174,8 @@ void ObjectMgr::LoadPageTexts()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, text, next_page FROM page_text");
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, Text, NextPageID FROM page_text");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -5190,8 +5190,8 @@ void ObjectMgr::LoadPageTexts()
|
||||
|
||||
PageText& pageText = _pageTextStore[fields[0].GetUInt32()];
|
||||
|
||||
pageText.Text = fields[1].GetString();
|
||||
pageText.NextPage = fields[2].GetUInt32();
|
||||
pageText.Text = fields[1].GetString();
|
||||
pageText.NextPageID = fields[2].GetUInt32();
|
||||
|
||||
++count;
|
||||
}
|
||||
@@ -5199,11 +5199,11 @@ void ObjectMgr::LoadPageTexts()
|
||||
|
||||
for (PageTextContainer::const_iterator itr = _pageTextStore.begin(); itr != _pageTextStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second.NextPage)
|
||||
if (itr->second.NextPageID)
|
||||
{
|
||||
PageTextContainer::const_iterator itr2 = _pageTextStore.find(itr->second.NextPage);
|
||||
PageTextContainer::const_iterator itr2 = _pageTextStore.find(itr->second.NextPageID);
|
||||
if (itr2 == _pageTextStore.end())
|
||||
TC_LOG_ERROR("sql.sql", "Page text (Id: %u) has not existing next page (Id: %u)", itr->first, itr->second.NextPage);
|
||||
TC_LOG_ERROR("sql.sql", "Page text (ID: %u) has non-existing `NextPageID` (%u)", itr->first, itr->second.NextPageID);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5224,9 +5224,9 @@ void ObjectMgr::LoadPageTextLocales()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_pageTextLocaleStore.clear(); // need for reload case
|
||||
_pageTextLocaleStore.clear(); // needed for reload case
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_page_text");
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, Text_loc1, Text_loc2, Text_loc3, Text_loc4, Text_loc5, Text_loc6, Text_loc7, Text_loc8 FROM locales_page_text");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
@@ -7247,8 +7247,8 @@ void ObjectMgr::LoadPointsOfInterest()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest");
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, PositionX, PositionY, Icon, Flags, Importance, Name FROM points_of_interest");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7263,17 +7263,17 @@ void ObjectMgr::LoadPointsOfInterest()
|
||||
uint32 point_id = fields[0].GetUInt32();
|
||||
|
||||
PointOfInterest POI;
|
||||
POI.entry = point_id;
|
||||
POI.x = fields[1].GetFloat();
|
||||
POI.y = fields[2].GetFloat();
|
||||
POI.icon = fields[3].GetUInt32();
|
||||
POI.flags = fields[4].GetUInt32();
|
||||
POI.data = fields[5].GetUInt32();
|
||||
POI.icon_name = fields[6].GetString();
|
||||
POI.ID = point_id;
|
||||
POI.PositionX = fields[1].GetFloat();
|
||||
POI.PositionY = fields[2].GetFloat();
|
||||
POI.Icon = fields[3].GetUInt32();
|
||||
POI.Flags = fields[4].GetUInt32();
|
||||
POI.Importance = fields[5].GetUInt32();
|
||||
POI.Name = fields[6].GetString();
|
||||
|
||||
if (!Trinity::IsValidMapCoord(POI.x, POI.y))
|
||||
if (!Trinity::IsValidMapCoord(POI.PositionX, POI.PositionY))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y);
|
||||
TC_LOG_ERROR("sql.sql", "Table `points_of_interest` (ID: %u) have invalid coordinates (PositionX: %f PositionY: %f), ignored.", point_id, POI.PositionX, POI.PositionY);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8191,76 +8191,76 @@ void ObjectMgr::LoadMailLevelRewards()
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel)
|
||||
void ObjectMgr::AddSpellToTrainer(uint32 ID, uint32 SpellID, uint32 MoneyCost, uint32 ReqSkillLine, uint32 ReqSkillRank, uint32 ReqLevel)
|
||||
{
|
||||
if (entry >= TRINITY_TRAINER_START_REF)
|
||||
if (ID >= TRINITY_TRAINER_START_REF)
|
||||
return;
|
||||
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate(entry);
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate(ID);
|
||||
if (!cInfo)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains entries for a non-existing creature template (Entry: %u), ignoring", entry);
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains entries for a non-existing creature template (ID: %u), ignoring", ID);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains entries for a creature template (Entry: %u) without trainer flag, ignoring", entry);
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains entries for a creature template (ID: %u) without any trainer flag, ignoring", ID);
|
||||
return;
|
||||
}
|
||||
|
||||
SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(spell);
|
||||
SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(SpellID);
|
||||
if (!spellinfo)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell);
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains an ID (%u) for a non-existing spell (Spell: %u), ignoring", ID, SpellID);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SpellMgr::IsSpellValid(spellinfo))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains an entry (Entry: %u) for a broken spell (Spell: %u), ignoring", entry, spell);
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains an ID (%u) for a broken spell (Spell: %u), ignoring", ID, SpellID);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetTalentSpellCost(spell))
|
||||
if (GetTalentSpellCost(SpellID))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell);
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` contains an ID (%u) for a non-existing spell (Spell: %u) which is a talent, ignoring", ID, SpellID);
|
||||
return;
|
||||
}
|
||||
|
||||
TrainerSpellData& data = _cacheTrainerSpellStore[entry];
|
||||
TrainerSpellData& data = _cacheTrainerSpellStore[ID];
|
||||
|
||||
TrainerSpell& trainerSpell = data.spellList[spell];
|
||||
trainerSpell.spell = spell;
|
||||
trainerSpell.spellCost = spellCost;
|
||||
trainerSpell.reqSkill = reqSkill;
|
||||
trainerSpell.reqSkillValue = reqSkillValue;
|
||||
trainerSpell.reqLevel = reqLevel;
|
||||
TrainerSpell& trainerSpell = data.spellList[SpellID];
|
||||
trainerSpell.SpellID = SpellID;
|
||||
trainerSpell.MoneyCost = MoneyCost;
|
||||
trainerSpell.ReqSkillLine = ReqSkillLine;
|
||||
trainerSpell.ReqSkillRank = ReqSkillRank;
|
||||
trainerSpell.ReqLevel = ReqLevel;
|
||||
|
||||
if (!trainerSpell.reqLevel)
|
||||
trainerSpell.reqLevel = spellinfo->SpellLevel;
|
||||
if (!trainerSpell.ReqLevel)
|
||||
trainerSpell.ReqLevel = spellinfo->SpellLevel;
|
||||
|
||||
// calculate learned spell for profession case when stored cast-spell
|
||||
trainerSpell.learnedSpell[0] = spell;
|
||||
trainerSpell.ReqAbility[0] = SpellID;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spellinfo->Effects[i].Effect != SPELL_EFFECT_LEARN_SPELL)
|
||||
continue;
|
||||
if (trainerSpell.learnedSpell[0] == spell)
|
||||
trainerSpell.learnedSpell[0] = 0;
|
||||
if (trainerSpell.ReqAbility[0] == SpellID)
|
||||
trainerSpell.ReqAbility[0] = 0;
|
||||
// player must be able to cast spell on himself
|
||||
if (spellinfo->Effects[i].TargetA.GetTarget() != 0 && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_TARGET_ALLY
|
||||
&& spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_TARGET_ANY && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry);
|
||||
TC_LOG_ERROR("sql.sql", "Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", SpellID, ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
trainerSpell.learnedSpell[i] = spellinfo->Effects[i].TriggerSpell;
|
||||
trainerSpell.ReqAbility[i] = spellinfo->Effects[i].TriggerSpell;
|
||||
|
||||
if (trainerSpell.learnedSpell[i])
|
||||
if (trainerSpell.ReqAbility[i])
|
||||
{
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(trainerSpell.learnedSpell[i]);
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(trainerSpell.ReqAbility[i]);
|
||||
if (learnedSpellInfo && learnedSpellInfo->IsProfession())
|
||||
data.trainerType = 2;
|
||||
}
|
||||
@@ -8276,9 +8276,9 @@ void ObjectMgr::LoadTrainerSpell()
|
||||
// For reload case
|
||||
_cacheTrainerSpellStore.clear();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT b.entry, a.spell, a.spellcost, a.reqskill, a.reqskillvalue, a.reqlevel FROM npc_trainer AS a "
|
||||
"INNER JOIN npc_trainer AS b ON a.entry = -(b.spell) "
|
||||
"UNION SELECT * FROM npc_trainer WHERE spell > 0");
|
||||
QueryResult result = WorldDatabase.Query("SELECT b.ID, a.SpellID, a.MoneyCost, a.ReqSkillLine, a.ReqSkillRank, a.Reqlevel FROM npc_trainer AS a "
|
||||
"INNER JOIN npc_trainer AS b ON a.ID = -(b.SpellID) "
|
||||
"UNION SELECT * FROM npc_trainer WHERE SpellID > 0");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -8293,14 +8293,14 @@ void ObjectMgr::LoadTrainerSpell()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
uint32 spell = fields[1].GetUInt32();
|
||||
uint32 spellCost = fields[2].GetUInt32();
|
||||
uint32 reqSkill = fields[3].GetUInt16();
|
||||
uint32 reqSkillValue = fields[4].GetUInt16();
|
||||
uint32 reqLevel = fields[5].GetUInt8();
|
||||
uint32 ID = fields[0].GetUInt32();
|
||||
uint32 SpellID = fields[1].GetUInt32();
|
||||
uint32 MoneyCost = fields[2].GetUInt32();
|
||||
uint32 ReqSkillLine = fields[3].GetUInt16();
|
||||
uint32 ReqSkillRank = fields[4].GetUInt16();
|
||||
uint32 ReqLevel = fields[5].GetUInt8();
|
||||
|
||||
AddSpellToTrainer(entry, spell, spellCost, reqSkill, reqSkillValue, reqLevel);
|
||||
AddSpellToTrainer(ID, SpellID, MoneyCost, ReqSkillLine, ReqSkillRank, ReqLevel);
|
||||
|
||||
++count;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ struct PlayerLevelInfo;
|
||||
struct PageText
|
||||
{
|
||||
std::string Text;
|
||||
uint16 NextPage;
|
||||
uint16 NextPageID;
|
||||
};
|
||||
|
||||
/// Key for storing temp summon data in TempSummonDataContainer
|
||||
@@ -575,13 +575,13 @@ struct RepSpilloverTemplate
|
||||
|
||||
struct PointOfInterest
|
||||
{
|
||||
uint32 entry;
|
||||
float x;
|
||||
float y;
|
||||
uint32 icon;
|
||||
uint32 flags;
|
||||
uint32 data;
|
||||
std::string icon_name;
|
||||
uint32 ID;
|
||||
float PositionX;
|
||||
float PositionY;
|
||||
uint32 Icon;
|
||||
uint32 Flags;
|
||||
uint32 Importance;
|
||||
std::string Name;
|
||||
};
|
||||
|
||||
struct GossipMenuItems
|
||||
|
||||
@@ -169,14 +169,14 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
|
||||
bool primary_prof_first_rank = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (!tSpell->learnedSpell[i])
|
||||
if (!tSpell->ReqAbility[i])
|
||||
continue;
|
||||
if (!_player->IsSpellFitByClassAndRace(tSpell->learnedSpell[i]))
|
||||
if (!_player->IsSpellFitByClassAndRace(tSpell->ReqAbility[i]))
|
||||
{
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(tSpell->learnedSpell[i]);
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(tSpell->ReqAbility[i]);
|
||||
if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank())
|
||||
primary_prof_first_rank = true;
|
||||
}
|
||||
@@ -185,27 +185,27 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
|
||||
|
||||
TrainerSpellState state = _player->GetTrainerSpellState(tSpell);
|
||||
|
||||
data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case)
|
||||
data << uint32(tSpell->SpellID); // learned spell (or cast-spell in profession case)
|
||||
data << uint8(state == TRAINER_SPELL_GREEN_DISABLED ? TRAINER_SPELL_GREEN : state);
|
||||
data << uint32(floor(tSpell->spellCost * fDiscountMod));
|
||||
data << uint32(floor(tSpell->MoneyCost * fDiscountMod));
|
||||
|
||||
data << uint8(tSpell->reqLevel);
|
||||
data << uint32(tSpell->reqSkill);
|
||||
data << uint32(tSpell->reqSkillValue);
|
||||
data << uint8(tSpell->ReqLevel);
|
||||
data << uint32(tSpell->ReqSkillLine);
|
||||
data << uint32(tSpell->ReqSkillRank);
|
||||
//prev + req or req + 0
|
||||
uint8 maxReq = 0;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (!tSpell->learnedSpell[i])
|
||||
if (!tSpell->ReqAbility[i])
|
||||
continue;
|
||||
if (uint32 prevSpellId = sSpellMgr->GetPrevSpellInChain(tSpell->learnedSpell[i]))
|
||||
if (uint32 prevSpellId = sSpellMgr->GetPrevSpellInChain(tSpell->ReqAbility[i]))
|
||||
{
|
||||
data << uint32(prevSpellId);
|
||||
++maxReq;
|
||||
}
|
||||
if (maxReq == 2)
|
||||
break;
|
||||
SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(tSpell->learnedSpell[i]);
|
||||
SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(tSpell->ReqAbility[i]);
|
||||
for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequired.first; itr2 != spellsRequired.second && maxReq < 3; ++itr2)
|
||||
{
|
||||
data << uint32(itr2->second);
|
||||
@@ -277,7 +277,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
// apply reputation discount
|
||||
uint32 nSpellCost = uint32(floor(trainer_spell->spellCost * _player->GetReputationPriceDiscount(unit)));
|
||||
uint32 nSpellCost = uint32(floor(trainer_spell->MoneyCost * _player->GetReputationPriceDiscount(unit)));
|
||||
|
||||
// check money requirement
|
||||
if (!_player->HasEnoughMoney(uint64(nSpellCost)))
|
||||
@@ -293,7 +293,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
|
||||
|
||||
// learn explicitly or cast explicitly
|
||||
if (trainer_spell->IsCastable())
|
||||
_player->CastSpell(_player, trainer_spell->spell, true);
|
||||
_player->CastSpell(_player, trainer_spell->SpellID, true);
|
||||
else
|
||||
_player->LearnSpell(spellId, false);
|
||||
|
||||
|
||||
@@ -395,8 +395,8 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket& recvData)
|
||||
ObjectMgr::GetLocaleString(player->Text, loc_idx, Text);
|
||||
|
||||
data << Text;
|
||||
data << uint32(pageText->NextPage);
|
||||
pageID = pageText->NextPage;
|
||||
data << uint32(pageText->NextPageID);
|
||||
pageID = pageText->NextPageID;
|
||||
}
|
||||
SendPacket(&data);
|
||||
|
||||
|
||||
@@ -861,9 +861,9 @@ public:
|
||||
|
||||
static bool HandleReloadPageTextsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Page Texts...");
|
||||
TC_LOG_INFO("misc", "Re-Loading Page Text...");
|
||||
sObjectMgr->LoadPageTexts();
|
||||
handler->SendGlobalGMSysMessage("DB table `page_texts` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `page_text` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user