mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-13 03:22:40 -04:00
Scripts/Commands: Fixed remaining crashes caused by removal of dbc locales
This commit is contained in:
@@ -2538,7 +2538,7 @@ void Player::RegenerateAll()
|
||||
|
||||
m_regenTimerCount -= 2000;
|
||||
}
|
||||
|
||||
|
||||
if (m_holyPowerRegenTimerCount >= 10000 && getClass() == CLASS_PALADIN)
|
||||
{
|
||||
Regenerate(POWER_HOLY_POWER);
|
||||
@@ -13107,7 +13107,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param)
|
||||
void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 /*param*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_BUY_FAILED");
|
||||
WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1));
|
||||
@@ -13332,8 +13332,6 @@ void Player::ApplyReforgeEnchantment(Item* item, bool apply)
|
||||
if (!reforge)
|
||||
return;
|
||||
|
||||
ItemTemplate const* proto = item->GetTemplate();
|
||||
|
||||
float removeValue = item->GetReforgableStat(ItemModType(reforge->SourceStat)) * reforge->SourceMultiplier;
|
||||
float addValue = removeValue * reforge->FinalMultiplier;
|
||||
|
||||
|
||||
@@ -444,7 +444,7 @@ public:
|
||||
|
||||
if (map->Instanceable())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name[handler->GetSessionDbcLocale()], map->GetId(), map->GetMapName());
|
||||
handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name, map->GetId(), map->GetMapName());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -394,33 +394,14 @@ public:
|
||||
!skillInfo->canLink) // only prof with recipes have set
|
||||
continue;
|
||||
|
||||
int locale = handler->GetSessionDbcLocale();
|
||||
name = skillInfo->name[locale];
|
||||
name = skillInfo->name;
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
if (!Utf8FitTo(name, namePart))
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < TOTAL_LOCALES; ++locale)
|
||||
{
|
||||
if (locale == handler->GetSessionDbcLocale())
|
||||
continue;
|
||||
continue;
|
||||
|
||||
name = skillInfo->name[locale];
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
if (Utf8FitTo(name, namePart))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < TOTAL_LOCALES)
|
||||
{
|
||||
targetSkillInfo = skillInfo;
|
||||
break;
|
||||
}
|
||||
targetSkillInfo = skillInfo;
|
||||
}
|
||||
|
||||
if (!targetSkillInfo)
|
||||
|
||||
@@ -1505,7 +1505,7 @@ public:
|
||||
|
||||
if (!target->GetSkillValue(skill))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]);
|
||||
handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1516,7 +1516,7 @@ public:
|
||||
return false;
|
||||
|
||||
target->SetSkill(skill, target->GetSkillStep(skill), level, max);
|
||||
handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max);
|
||||
handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, tNameLink.c_str(), level, max);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1754,7 +1754,6 @@ public:
|
||||
handler->PSendSysMessage(LANG_PINFO_LEVEL, raceStr.c_str(), ClassStr.c_str(), timeStr.c_str(), level, gold, silv, copp);
|
||||
|
||||
// Add map, zone, subzone and phase to output
|
||||
int locale = handler->GetSessionDbcLocale();
|
||||
std::string areaName = "<unknown>";
|
||||
std::string zoneName = "";
|
||||
|
||||
@@ -1763,22 +1762,22 @@ public:
|
||||
AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
|
||||
if (area)
|
||||
{
|
||||
areaName = area->area_name[locale];
|
||||
areaName = area->area_name;
|
||||
|
||||
AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
|
||||
if (zone)
|
||||
zoneName = zone->area_name[locale];
|
||||
zoneName = zone->area_name;
|
||||
}
|
||||
|
||||
if (target)
|
||||
{
|
||||
if (!zoneName.empty())
|
||||
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase);
|
||||
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, zoneName.c_str(), areaName.c_str(), phase);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "<unknown>", phase);
|
||||
handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, areaName.c_str(), "<unknown>", phase);
|
||||
}
|
||||
else
|
||||
handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str());
|
||||
handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name, areaName.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1231,7 +1231,7 @@ public:
|
||||
|
||||
if (factionEntry->reputationListID < 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name[handler->GetSessionDbcLocale()], factionId);
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name, factionId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
target->SetTitle(titleInfo); // to be sure that title now known
|
||||
target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index);
|
||||
|
||||
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name[handler->GetSessionDbcLocale()], tNameLink.c_str());
|
||||
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name, tNameLink.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user