mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7221] Add output player names as sift-links in more chat commands.
This commit is contained in:
parent
e83be70aca
commit
42e12136a8
7 changed files with 110 additions and 126 deletions
|
|
@ -1419,11 +1419,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();
|
||||
|
|
@ -1447,7 +1442,7 @@ void CliHandler::SendSysMessage(const char *str)
|
|||
m_print("\r\n");
|
||||
}
|
||||
|
||||
const char *CliHandler::GetName() const
|
||||
std::string CliHandler::GetNameLink() const
|
||||
{
|
||||
return GetMangosString(LANG_CONSOLE_COMMAND);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,8 +68,6 @@ class ChatHandler
|
|||
void PSendSysMessage( int32 entry, ... );
|
||||
|
||||
int ParseCommands(const char* text);
|
||||
|
||||
virtual char const* GetName() const;
|
||||
protected:
|
||||
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
|
||||
|
||||
|
|
@ -456,6 +454,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);
|
||||
|
||||
|
|
@ -486,7 +486,7 @@ class CliHandler : public ChatHandler
|
|||
const char *GetMangosString(int32 entry) const;
|
||||
bool isAvailable(ChatCommand const& cmd) const;
|
||||
void SendSysMessage(const char *str);
|
||||
char const* GetName() const;
|
||||
std::string GetNameLink() const;
|
||||
bool needReportToTarget(Player* chr) const;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
|
|||
first = false;
|
||||
}
|
||||
|
||||
SendSysMessage(itr->second->GetName());
|
||||
SendSysMessage(GetNameLink(itr->second).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -316,7 +316,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()) );
|
||||
|
||||
|
|
@ -349,7 +349,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;
|
||||
|
|
@ -463,7 +463,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())
|
||||
|
|
@ -471,14 +471,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;
|
||||
}
|
||||
|
|
@ -498,7 +498,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;
|
||||
}
|
||||
|
|
@ -508,7 +508,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;
|
||||
}
|
||||
|
|
@ -532,12 +532,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())
|
||||
|
|
@ -636,8 +633,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;
|
||||
}
|
||||
|
|
@ -728,9 +724,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 );
|
||||
|
|
@ -776,9 +772,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 );
|
||||
|
|
@ -825,9 +821,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 );
|
||||
|
|
@ -876,9 +872,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 );
|
||||
|
|
@ -910,9 +906,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 );
|
||||
|
|
@ -1038,9 +1034,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);
|
||||
|
|
@ -1104,18 +1100,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;
|
||||
}
|
||||
|
|
@ -1152,16 +1148,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);
|
||||
|
|
@ -1198,16 +1196,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);
|
||||
|
||||
|
|
@ -1241,16 +1241,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);
|
||||
|
||||
|
|
@ -1284,16 +1286,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);
|
||||
|
||||
|
|
@ -1327,9 +1331,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);
|
||||
|
||||
|
|
@ -1362,9 +1366,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);
|
||||
|
||||
|
|
@ -1609,9 +1613,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);
|
||||
|
|
@ -1661,25 +1665,25 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)
|
|||
sLog.outDetail(GetMangosString(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 );
|
||||
}
|
||||
|
||||
|
|
@ -1764,7 +1768,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;
|
||||
}
|
||||
|
|
@ -2095,21 +2099,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())
|
||||
|
|
@ -2168,7 +2169,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)
|
||||
|
|
@ -2189,7 +2190,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())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -711,7 +711,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;
|
||||
}
|
||||
|
||||
|
|
@ -2065,7 +2065,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);
|
||||
|
|
@ -3360,9 +3360,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());
|
||||
}
|
||||
|
|
@ -3420,9 +3418,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());
|
||||
}
|
||||
|
|
@ -4075,9 +4071,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;
|
||||
}
|
||||
|
||||
|
|
@ -4109,9 +4105,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -780,7 +780,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
|||
|
||||
if(targetPlayer)
|
||||
{
|
||||
ChatHandler(targetPlayer).PSendSysMessage(LANG_YOURS_SECURITY_CHANGED,GetName(), gm);
|
||||
ChatHandler(targetPlayer).PSendSysMessage(LANG_YOURS_SECURITY_CHANGED,GetNameLink().c_str(), gm);
|
||||
targetPlayer->GetSession()->SetSecurity(gm);
|
||||
}
|
||||
|
||||
|
|
@ -926,9 +926,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;
|
||||
}
|
||||
|
|
@ -939,7 +941,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;
|
||||
}
|
||||
|
|
@ -986,10 +988,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
|
||||
{
|
||||
|
|
@ -1000,7 +1004,7 @@ bool ChatHandler::HandleCooldownCommand(const char* args)
|
|||
|
||||
if(!sSpellStore.LookupEntry(spell_id))
|
||||
{
|
||||
PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : target->GetName());
|
||||
PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : tNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1010,7 +1014,7 @@ 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() ? GetMangosString(LANG_YOU) : target->GetName());
|
||||
PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : tNameLink.c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1814,9 +1818,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;
|
||||
}
|
||||
|
||||
|
|
@ -1852,7 +1854,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;
|
||||
}
|
||||
|
|
@ -1930,7 +1932,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;
|
||||
}
|
||||
|
||||
|
|
@ -3396,7 +3398,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;
|
||||
}
|
||||
|
|
@ -3692,15 +3694,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++)
|
||||
|
|
@ -3799,7 +3801,7 @@ bool ChatHandler::HandleLevelUpCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
name = chr->GetName();
|
||||
name = GetNameLink(chr);
|
||||
}
|
||||
|
||||
assert(chr || chr_guid);
|
||||
|
|
@ -4508,12 +4510,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
|
||||
{
|
||||
|
|
@ -4551,12 +4549,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)
|
||||
|
|
@ -4577,10 +4572,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;
|
||||
}
|
||||
|
|
@ -5472,9 +5464,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)
|
||||
|
|
@ -5486,10 +5478,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;
|
||||
}
|
||||
|
||||
|
|
@ -6590,10 +6582,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__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue