mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-21 23:27:14 -04:00
[7221] Add output player names as sift-links in more chat commands. Author: VladimirMangos
Did not merge the part of HandleAccountSetGmLevelCommand. --HG-- branch : trunk
This commit is contained in:
+1
-6
@@ -1500,11 +1500,6 @@ std::string ChatHandler::extractPlayerNameFromLink(char* text)
|
||||
return name;
|
||||
}
|
||||
|
||||
const char *ChatHandler::GetName() const
|
||||
{
|
||||
return m_session->GetPlayer()->GetName();
|
||||
}
|
||||
|
||||
bool ChatHandler::needReportToTarget(Player* chr) const
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
@@ -1528,7 +1523,7 @@ void CliHandler::SendSysMessage(const char *str)
|
||||
m_print("\r\n");
|
||||
}
|
||||
|
||||
const char *CliHandler::GetName() const
|
||||
std::string CliHandler::GetNameLink() const
|
||||
{
|
||||
return GetTrinityString(LANG_CONSOLE_COMMAND);
|
||||
}
|
||||
|
||||
+7
-8
@@ -71,9 +71,6 @@ class ChatHandler
|
||||
std::string PGetParseString(int32 entry, ...);
|
||||
|
||||
int ParseCommands(const char* text);
|
||||
|
||||
virtual char const* GetName() const;
|
||||
|
||||
protected:
|
||||
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
|
||||
|
||||
@@ -514,6 +511,8 @@ class ChatHandler
|
||||
std::string extractPlayerNameFromLink(char* text);
|
||||
|
||||
std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; }
|
||||
virtual std::string GetNameLink() const { return GetNameLink(m_session->GetPlayer()); }
|
||||
std::string GetNameLink(Player* chr) const { return playerLink(chr->GetName()); }
|
||||
|
||||
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry);
|
||||
|
||||
@@ -540,11 +539,11 @@ class CliHandler : public ChatHandler
|
||||
typedef void Print(char const*);
|
||||
explicit CliHandler(Print* zprint) : m_print(zprint) {}
|
||||
|
||||
// overwrite functions
|
||||
const char *GetTrinityString(int32 entry) const;
|
||||
bool isAvailable(ChatCommand const& cmd) const;
|
||||
void SendSysMessage(const char *str);
|
||||
char const* GetName() const;
|
||||
// overwrite functions
|
||||
const char *GetTrinityString(int32 entry) const;
|
||||
bool isAvailable(ChatCommand const& cmd) const;
|
||||
void SendSysMessage(const char *str);
|
||||
std::string GetNameLink() const;
|
||||
bool needReportToTarget(Player* chr) const;
|
||||
|
||||
private:
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
|
||||
first = false;
|
||||
}
|
||||
|
||||
SendSysMessage(itr->second->GetName());
|
||||
SendSysMessage(GetNameLink(itr->second).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+65
-64
@@ -719,7 +719,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
zone_x, zone_y, ground_z, floor_z, have_map, have_vmap );
|
||||
|
||||
sLog.outDebug("Player %s GPS call for %s '%s' (%s: %u):",
|
||||
GetName(),
|
||||
m_session ? GetNameLink().c_str() : GetMangosString(LANG_CONSOLE_COMMAND),
|
||||
(obj->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), obj->GetName(),
|
||||
(obj->GetTypeId() == TYPEID_PLAYER ? "GUID" : "Entry"), (obj->GetTypeId() == TYPEID_PLAYER ? obj->GetGUIDLow(): obj->GetEntry()) );
|
||||
sLog.outDebug(GetTrinityString(LANG_MAP_POSITION),
|
||||
@@ -751,7 +751,7 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||
if (chr)
|
||||
{
|
||||
std::string nameLink = playerLink(chr->GetName());
|
||||
std::string nameLink = playerLink(name);
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
@@ -865,7 +865,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
std::string nameLink = playerLink(name);
|
||||
std::string chrNameLink = playerLink(name);
|
||||
|
||||
Map* cMap = chr->GetMap();
|
||||
if(cMap->IsBattleGroundOrArena())
|
||||
@@ -873,14 +873,14 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
// only allow if gm mode is on
|
||||
if (!_player->isGameMaster())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,nameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
// if already in a bg, don't let port to other
|
||||
else if (_player->GetBattleGroundId())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,nameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -900,7 +900,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
// we are in group, we can go only if we are in the player group
|
||||
if (_player->GetGroup() != chr->GetGroup())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY,nameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -910,7 +910,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
// we are not in group, let's verify our GM mode
|
||||
if (!_player->isGameMaster())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM,chr->GetName());
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -934,12 +934,9 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
_player->SetDifficulty(chr->GetDifficulty());
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
|
||||
|
||||
std::string plNameLink = playerLink(_player->GetName());
|
||||
|
||||
PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
|
||||
if (_player->IsVisibleGloballyFor(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_APPEARING_TO, plNameLink.c_str());
|
||||
ChatHandler(chr).PSendSysMessage(LANG_APPEARING_TO, GetNameLink().c_str());
|
||||
|
||||
// stop flight if need
|
||||
if(_player->isInFlight())
|
||||
@@ -1038,8 +1035,7 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
||||
|
||||
if(chr->IsBeingTeleported())
|
||||
{
|
||||
std::string nameLink = playerLink(chr->GetName());
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str());
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, GetNameLink(chr).c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1130,9 +1126,9 @@ bool ChatHandler::HandleModifyHPCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_HP, chr->GetName(), hp, hpm);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_HP, GetNameLink(chr).c_str(), hp, hpm);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetName(), hp, hpm);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetNameLink().c_str(), hp, hpm);
|
||||
|
||||
chr->SetMaxHealth( hpm );
|
||||
chr->SetHealth( hp );
|
||||
@@ -1178,9 +1174,9 @@ bool ChatHandler::HandleModifyManaCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_MANA, chr->GetName(), mana, manam);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_MANA, GetNameLink(chr).c_str(), mana, manam);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MANA_CHANGED, GetName(), mana, manam);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MANA_CHANGED, GetNameLink().c_str(), mana, manam);
|
||||
|
||||
chr->SetMaxPower(POWER_MANA,manam );
|
||||
chr->SetPower(POWER_MANA, mana );
|
||||
@@ -1227,9 +1223,9 @@ bool ChatHandler::HandleModifyEnergyCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_ENERGY, chr->GetName(), energy/10, energym/10);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_ENERGY, GetNameLink(chr).c_str(), energy/10, energym/10);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, GetName(), energy/10, energym/10);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, GetNameLink().c_str(), energy/10, energym/10);
|
||||
|
||||
chr->SetMaxPower(POWER_ENERGY,energym );
|
||||
chr->SetPower(POWER_ENERGY, energy );
|
||||
@@ -1278,9 +1274,9 @@ bool ChatHandler::HandleModifyRageCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_RAGE, chr->GetName(), rage/10, ragem/10);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_RAGE, GetNameLink(chr).c_str(), rage/10, ragem/10);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, GetName(), rage/10, ragem/10);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, GetNameLink().c_str(), rage/10, ragem/10);
|
||||
|
||||
chr->SetMaxPower(POWER_RAGE,ragem );
|
||||
chr->SetPower(POWER_RAGE, rage );
|
||||
@@ -1312,9 +1308,9 @@ bool ChatHandler::HandleModifyRunicPowerCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, chr->GetName(), rune/10, runem/10);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, GetNameLink(chr).c_str(), rune/10, runem/10);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, GetName(), rune/10, runem/10);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, GetNameLink().c_str(), rune/10, runem/10);
|
||||
|
||||
chr->SetMaxPower(POWER_RUNIC_POWER,runem );
|
||||
chr->SetPower(POWER_RUNIC_POWER, rune );
|
||||
@@ -1440,9 +1436,9 @@ bool ChatHandler::HandleModifySpellCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, GetName(), spellflatid, val, mark);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, GetNameLink().c_str(), spellflatid, val, mark);
|
||||
|
||||
WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1+1+2+2));
|
||||
data << uint8(spellflatid);
|
||||
@@ -1506,18 +1502,18 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args)
|
||||
if (argstr == "on")
|
||||
{
|
||||
chr->SetTaxiCheater(true);
|
||||
PSendSysMessage(LANG_YOU_GIVE_TAXIS, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_GIVE_TAXIS, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, GetName());
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, GetNameLink().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argstr == "off")
|
||||
{
|
||||
chr->SetTaxiCheater(false);
|
||||
PSendSysMessage(LANG_YOU_REMOVE_TAXIS, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_REMOVE_TAXIS, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, GetName());
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, GetNameLink().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1554,16 +1550,18 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
std::string chrNameLink = GetNameLink(chr);
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_ASPEED, ASpeed, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_CHANGE_ASPEED, ASpeed, chrNameLink.c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, GetName(), ASpeed);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, GetNameLink().c_str(), ASpeed);
|
||||
|
||||
chr->SetSpeed(MOVE_WALK, ASpeed,true);
|
||||
chr->SetSpeed(MOVE_RUN, ASpeed,true);
|
||||
@@ -1600,16 +1598,18 @@ bool ChatHandler::HandleModifySpeedCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
std::string chrNameLink = GetNameLink(chr);
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SPEED, Speed, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SPEED, Speed, chrNameLink.c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, GetName(), Speed);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, GetNameLink().c_str(), Speed);
|
||||
|
||||
chr->SetSpeed(MOVE_RUN,Speed,true);
|
||||
|
||||
@@ -1643,16 +1643,18 @@ bool ChatHandler::HandleModifySwimCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
std::string chrNameLink = GetNameLink(chr);
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SWIM_SPEED, Swim, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SWIM_SPEED, Swim, chrNameLink.c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, GetName(), Swim);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, GetNameLink().c_str(), Swim);
|
||||
|
||||
chr->SetSpeed(MOVE_SWIM,Swim,true);
|
||||
|
||||
@@ -1686,16 +1688,18 @@ bool ChatHandler::HandleModifyBWalkCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
std::string chrNameLink = GetNameLink(chr);
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_BACK_SPEED, BSpeed, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_CHANGE_BACK_SPEED, BSpeed, chrNameLink.c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, GetName(), BSpeed);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, GetNameLink().c_str(), BSpeed);
|
||||
|
||||
chr->SetSpeed(MOVE_RUN_BACK,BSpeed,true);
|
||||
|
||||
@@ -1729,9 +1733,9 @@ bool ChatHandler::HandleModifyFlyCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetName(), FSpeed);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetNameLink().c_str(), FSpeed);
|
||||
|
||||
chr->SetSpeed(MOVE_FLIGHT,FSpeed,true);
|
||||
|
||||
@@ -1764,9 +1768,9 @@ bool ChatHandler::HandleModifyScaleCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetName(), Scale);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetNameLink().c_str(), Scale);
|
||||
|
||||
chr->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale);
|
||||
|
||||
@@ -2011,9 +2015,9 @@ bool ChatHandler::HandleModifyMountCommand(const char* args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_GIVE_MOUNT, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_GIVE_MOUNT, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetName());
|
||||
ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetNameLink().c_str());
|
||||
|
||||
chr->SetUInt32Value( UNIT_FIELD_FLAGS , 0x001000 );
|
||||
chr->Mount(mId);
|
||||
@@ -2063,25 +2067,25 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)
|
||||
sLog.outDetail(GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney);
|
||||
if(newmoney <= 0 )
|
||||
{
|
||||
PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, GetName());
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, GetNameLink().c_str());
|
||||
|
||||
chr->SetMoney(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(addmoney), chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(addmoney), GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, GetName(), abs(addmoney));
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, GetNameLink().c_str(), abs(addmoney));
|
||||
chr->SetMoney( newmoney );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage(LANG_YOU_GIVE_MONEY, addmoney, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_GIVE_MONEY, addmoney, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, GetName(), addmoney);
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, GetNameLink().c_str(), addmoney);
|
||||
chr->ModifyMoney( addmoney );
|
||||
}
|
||||
|
||||
@@ -2166,7 +2170,7 @@ bool ChatHandler::HandleModifyHonorCommand (const char* args)
|
||||
|
||||
target->ModifyHonorPoints(amount);
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, target->GetName(), target->GetHonorPoints());
|
||||
PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, GetNameLink(target).c_str(), target->GetHonorPoints());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2513,21 +2517,18 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
std::string nameLink = playerLink(name);
|
||||
std::string chrNameLink = playerLink(name);
|
||||
|
||||
if(chr->IsBeingTeleported()==true)
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str());
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_TELEPORTING_TO, chr->GetName(),"", tele->name.c_str());
|
||||
PSendSysMessage(LANG_TELEPORTING_TO, chrNameLink.c_str(),"", tele->name.c_str());
|
||||
if (needReportToTarget(chr))
|
||||
{
|
||||
std::string plNameLink = playerLink(GetName());
|
||||
ChatHandler(chr).PSendSysMessage(LANG_TELEPORTED_TO_BY, plNameLink.c_str());
|
||||
}
|
||||
ChatHandler(chr).PSendSysMessage(LANG_TELEPORTED_TO_BY, GetNameLink().c_str());
|
||||
|
||||
// stop flight if need
|
||||
if(chr->isInFlight())
|
||||
@@ -2594,7 +2595,7 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string nameLink = playerLink(player->GetName());
|
||||
std::string nameLink = GetNameLink(player);
|
||||
|
||||
Group *grp = player->GetGroup();
|
||||
if(!grp)
|
||||
@@ -2615,7 +2616,7 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
|
||||
if (HasLowerSecurity(pl, 0))
|
||||
return false;
|
||||
|
||||
std::string plNameLink = playerLink(pl->GetName());
|
||||
std::string plNameLink = GetNameLink(pl);
|
||||
|
||||
if(pl->IsBeingTeleported())
|
||||
{
|
||||
|
||||
+8
-12
@@ -713,7 +713,7 @@ bool ChatHandler::HandleModifyRepCommand(const char * args)
|
||||
}
|
||||
|
||||
target->SetFactionReputation(factionEntry,amount);
|
||||
PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[m_session->GetSessionDbcLocale()], factionId, target->GetName(), target->GetReputation(factionId));
|
||||
PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[m_session->GetSessionDbcLocale()], factionId, GetNameLink(target).c_str(), target->GetReputation(factionId));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2098,7 +2098,7 @@ bool ChatHandler::HandleDelTicketCommand(const char *args)
|
||||
if(Player* pl = objmgr.GetPlayer(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)))
|
||||
{
|
||||
pl->GetSession()->SendGMTicketGetTicket(0x0A, 0);
|
||||
PSendSysMessage(LANG_COMMAND_TICKETPLAYERDEL, pl->GetName());
|
||||
PSendSysMessage(LANG_COMMAND_TICKETPLAYERDEL, GetNameLink(pl).c_str());
|
||||
}
|
||||
else
|
||||
PSendSysMessage(LANG_COMMAND_TICKETDEL);
|
||||
@@ -3252,9 +3252,7 @@ bool ChatHandler::HandleRenameCommand(const char* args)
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
std::string tNameLink = playerLink(target->GetName());
|
||||
|
||||
PSendSysMessage(LANG_RENAME_PLAYER, tNameLink.c_str());
|
||||
PSendSysMessage(LANG_RENAME_PLAYER, GetNameLink(target).c_str());
|
||||
target->SetAtLoginFlag(AT_LOGIN_RENAME);
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", target->GetGUIDLow());
|
||||
}
|
||||
@@ -3312,9 +3310,7 @@ bool ChatHandler::HandleCustomizeCommand(const char* args)
|
||||
|
||||
if(target)
|
||||
{
|
||||
std::string tNameLink = playerLink(target->GetName());
|
||||
|
||||
PSendSysMessage(LANG_CUSTOMIZE_PLAYER, tNameLink.c_str());
|
||||
PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
|
||||
target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = '%u'", target->GetGUIDLow());
|
||||
}
|
||||
@@ -3969,9 +3965,9 @@ bool ChatHandler::HandleRepairitemsCommand(const char* /*args*/)
|
||||
// Repair items
|
||||
target->DurabilityRepairAll(false, 0, false);
|
||||
|
||||
PSendSysMessage(LANG_YOU_REPAIR_ITEMS, target->GetName());
|
||||
PSendSysMessage(LANG_YOU_REPAIR_ITEMS, GetNameLink(target).c_str());
|
||||
if(needReportToTarget(target))
|
||||
ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, GetName());
|
||||
ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, GetNameLink().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4003,9 +3999,9 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_YOU_SET_WATERWALK, args, player->GetName());
|
||||
PSendSysMessage(LANG_YOU_SET_WATERWALK, args, GetNameLink(player).c_str());
|
||||
if(needReportToTarget(player))
|
||||
ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, GetName());
|
||||
ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, GetNameLink().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+31
-39
@@ -1342,9 +1342,11 @@ bool ChatHandler::HandleSetSkillCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string tNameLink = GetNameLink(target);
|
||||
|
||||
if(!target->GetSkillValue(skill))
|
||||
{
|
||||
PSendSysMessage(LANG_SET_SKILL_ERROR, target->GetName(), skill, sl->name[0]);
|
||||
PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, sl->name[0]);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1355,7 +1357,7 @@ bool ChatHandler::HandleSetSkillCommand(const char* args)
|
||||
return false;
|
||||
|
||||
target->SetSkill(skill, level, max);
|
||||
PSendSysMessage(LANG_SET_SKILL, skill, sl->name[0], target->GetName(), level, max);
|
||||
PSendSysMessage(LANG_SET_SKILL, skill, sl->name[0], tNameLink.c_str(), level, max);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1402,10 +1404,12 @@ bool ChatHandler::HandleCooldownCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string tNameLink = GetNameLink(target);
|
||||
|
||||
if (!*args)
|
||||
{
|
||||
target->RemoveAllSpellCooldown();
|
||||
PSendSysMessage(LANG_REMOVEALL_COOLDOWN, target->GetName());
|
||||
PSendSysMessage(LANG_REMOVEALL_COOLDOWN, tNameLink.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1416,7 +1420,7 @@ bool ChatHandler::HandleCooldownCommand(const char* args)
|
||||
|
||||
if(!sSpellStore.LookupEntry(spell_id))
|
||||
{
|
||||
PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : target->GetName());
|
||||
PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : tNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1426,8 +1430,8 @@ bool ChatHandler::HandleCooldownCommand(const char* args)
|
||||
data << uint64(target->GetGUID());
|
||||
target->GetSession()->SendPacket(&data);
|
||||
target->RemoveSpellCooldown(spell_id);
|
||||
PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : target->GetName());
|
||||
}
|
||||
PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : tNameLink.c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2230,9 +2234,7 @@ bool ChatHandler::HandleLearnAllDefaultCommand(const char* args)
|
||||
player->learnDefaultSpells();
|
||||
player->learnQuestRewardedSpells();
|
||||
|
||||
std::string nameLink = playerLink(player->GetName());
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST,nameLink.c_str());
|
||||
PSendSysMessage(LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST,GetNameLink(player).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2268,7 +2270,7 @@ bool ChatHandler::HandleLearnCommand(const char* args)
|
||||
if(targetPlayer == m_session->GetPlayer())
|
||||
SendSysMessage(LANG_YOU_KNOWN_SPELL);
|
||||
else
|
||||
PSendSysMessage(LANG_TARGET_KNOWN_SPELL,targetPlayer->GetName());
|
||||
PSendSysMessage(LANG_TARGET_KNOWN_SPELL,GetNameLink(targetPlayer).c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -2346,7 +2348,7 @@ bool ChatHandler::HandleAddItemCommand(const char* args)
|
||||
if (count < 0)
|
||||
{
|
||||
plTarget->DestroyItemCount(itemId, -count, true, false);
|
||||
PSendSysMessage(LANG_REMOVEITEM, itemId, -count, plTarget->GetName());
|
||||
PSendSysMessage(LANG_REMOVEITEM, itemId, -count, GetNameLink(plTarget).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3851,7 +3853,7 @@ bool ChatHandler::HandleModifyArenaCommand(const char * args)
|
||||
|
||||
target->ModifyArenaPoints(amount);
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, target->GetName(), target->GetArenaPoints());
|
||||
PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, GetNameLink(target).c_str(), target->GetArenaPoints());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -4147,15 +4149,15 @@ bool ChatHandler::HandleExploreCheatCommand(const char* args)
|
||||
|
||||
if (flag != 0)
|
||||
{
|
||||
PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL,GetName());
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL,GetNameLink().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, chr->GetName());
|
||||
PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, GetNameLink(chr).c_str());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING,GetName());
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING,GetNameLink().c_str());
|
||||
}
|
||||
|
||||
for (uint8 i=0; i<128; i++)
|
||||
@@ -4254,7 +4256,7 @@ bool ChatHandler::HandleLevelUpCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
name = chr->GetName();
|
||||
name = GetNameLink(chr);
|
||||
}
|
||||
|
||||
assert(chr || chr_guid);
|
||||
@@ -4963,12 +4965,8 @@ bool ChatHandler::HandleResetSpellsCommand(const char * args)
|
||||
player->resetSpells();
|
||||
|
||||
ChatHandler(player).SendSysMessage(LANG_RESET_SPELLS);
|
||||
|
||||
if(m_session->GetPlayer()!=player)
|
||||
{
|
||||
std::string nameLink = playerLink(player->GetName());
|
||||
PSendSysMessage(LANG_RESET_SPELLS_ONLINE,nameLink.c_str());
|
||||
}
|
||||
PSendSysMessage(LANG_RESET_SPELLS_ONLINE,GetNameLink(player).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5006,12 +5004,9 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args)
|
||||
player->resetTalents(true);
|
||||
|
||||
ChatHandler(player).SendSysMessage(LANG_RESET_TALENTS);
|
||||
|
||||
if(m_session->GetPlayer()!=player)
|
||||
{
|
||||
std::string nameLink = playerLink(player->GetName());
|
||||
PSendSysMessage(LANG_RESET_TALENTS_ONLINE,nameLink.c_str());
|
||||
}
|
||||
PSendSysMessage(LANG_RESET_TALENTS_ONLINE,GetNameLink(player).c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (playerGUID)
|
||||
@@ -5032,10 +5027,7 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args)
|
||||
player = (Player *)owner;
|
||||
ChatHandler(player).SendSysMessage(LANG_RESET_TALENTS);
|
||||
if(m_session->GetPlayer()!=player)
|
||||
{
|
||||
std::string nameLink = playerLink(player->GetName());
|
||||
PSendSysMessage(LANG_RESET_TALENTS_ONLINE,nameLink.c_str());
|
||||
}
|
||||
PSendSysMessage(LANG_RESET_TALENTS_ONLINE,GetNameLink(player).c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -5927,9 +5919,9 @@ bool ChatHandler::HandleFlyModeCommand(const char* args)
|
||||
if(!args)
|
||||
return false;
|
||||
|
||||
Unit *unit = getSelectedUnit();
|
||||
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
|
||||
unit = m_session->GetPlayer();
|
||||
Player *target = getSelectedPlayer();
|
||||
if (!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
WorldPacket data(12);
|
||||
if (strncmp(args, "on", 3) == 0)
|
||||
@@ -5941,10 +5933,10 @@ bool ChatHandler::HandleFlyModeCommand(const char* args)
|
||||
SendSysMessage(LANG_USE_BOL);
|
||||
return false;
|
||||
}
|
||||
data.append(unit->GetPackGUID());
|
||||
data.append(target->GetPackGUID());
|
||||
data << uint32(0); // unknown
|
||||
unit->SendMessageToSet(&data, true);
|
||||
PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, unit->GetName(), args);
|
||||
target->SendMessageToSet(&data, true);
|
||||
PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, GetNameLink(target).c_str(), args);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7051,10 +7043,10 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
|
||||
|
||||
char const* gender_full = gender ? "female" : "male";
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_GENDER, player->GetName(), gender_full);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_GENDER, GetNameLink(player).c_str(), gender_full);
|
||||
|
||||
if (needReportToTarget(player))
|
||||
ChatHandler(player).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, GetName());
|
||||
ChatHandler(player).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, GetNameLink().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7220"
|
||||
#define REVISION_NR "7221"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
||||
Reference in New Issue
Block a user