aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/CMakeLists.txt1
-rw-r--r--src/server/scripts/Commands/cs_account.cpp6
-rw-r--r--src/server/scripts/Commands/cs_character.cpp4
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp20
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp11
-rw-r--r--src/server/scripts/Commands/cs_lfg.cpp134
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp2
-rw-r--r--src/server/scripts/Commands/cs_message.cpp2
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp12
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp84
-rw-r--r--src/server/scripts/Commands/cs_ticket.cpp10
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp20
12 files changed, 221 insertions, 85 deletions
diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt
index e799cf20633..e7e2e430f81 100644
--- a/src/server/scripts/Commands/CMakeLists.txt
+++ b/src/server/scripts/Commands/CMakeLists.txt
@@ -27,6 +27,7 @@ set(scripts_STAT_SRCS
Commands/cs_honor.cpp
Commands/cs_instance.cpp
Commands/cs_learn.cpp
+ Commands/cs_lfg.cpp
Commands/cs_list.cpp
Commands/cs_lookup.cpp
Commands/cs_message.cpp
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 1024a3acf15..15a724e69d1 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -111,9 +111,9 @@ public:
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
if (handler->GetSession())
{
- sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password."
- , handler->GetSession()->GetAccountId(),handler->GetSession()->GetRemoteAddress().c_str()
- , handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.",
+ handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(),
+ handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow());
}
break;
case AOR_NAME_TOO_LONG:
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index 1f32368adfd..2202edbe4aa 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -265,7 +265,7 @@ public:
return false;
LocaleConstant loc = handler->GetSessionDbcLocale();
- char const* targetName = target->GetName();
+ char const* targetName = target->GetName().c_str();
char const* knownStr = handler->GetTrinityString(LANG_KNOWN);
// Search in CharTitles.dbc
@@ -681,7 +681,7 @@ public:
uint64 characterGuid;
uint32 accountId;
- Player* player = sObjectAccessor->FindPlayerByName(characterName.c_str());
+ Player* player = sObjectAccessor->FindPlayerByName(characterName);
if (player)
{
characterGuid = player->GetGUID();
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 7f25a11bcdd..99ed8cc4301 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -417,7 +417,7 @@ public:
sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending opcode %u", data.GetOpcode());
data.hexlike();
player->GetSession()->SendPacket(&data);
- handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
+ handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName().c_str());
return true;
}
@@ -496,7 +496,9 @@ public:
if (!target)
return false;
- handler->PSendSysMessage("Loot recipient for creature %s (GUID %u, DB GUID %u) is %s", target->GetName(), target->GetGUIDLow(), target->GetDBTableGUIDLow(), target->hasLootRecipient() ? (target->GetLootRecipient() ? target->GetLootRecipient()->GetName() : "offline") : "no loot recipient");
+ handler->PSendSysMessage("Loot recipient for creature %s (GUID %u, DB GUID %u) is %s",
+ target->GetName().c_str(), target->GetGUIDLow(), target->GetDBTableGUIDLow(),
+ target->hasLootRecipient() ? (target->GetLootRecipient() ? target->GetLootRecipient()->GetName().c_str() : "offline") : "no loot recipient");
return true;
}
@@ -796,17 +798,17 @@ public:
if (!target || target->isTotem() || target->isPet())
return false;
- std::list<HostileReference*>& threatList = target->getThreatManager().getThreatList();
- std::list<HostileReference*>::iterator itr;
+ ThreatContainer::StorageType const &threatList = target->getThreatManager().getThreatList();
+ ThreatContainer::StorageType::const_iterator itr;
uint32 count = 0;
- handler->PSendSysMessage("Threat list of %s (guid %u)", target->GetName(), target->GetGUIDLow());
+ handler->PSendSysMessage("Threat list of %s (guid %u)", target->GetName().c_str(), target->GetGUIDLow());
for (itr = threatList.begin(); itr != threatList.end(); ++itr)
{
Unit* unit = (*itr)->getTarget();
if (!unit)
continue;
++count;
- handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", count, unit->GetName(), unit->GetGUIDLow(), (*itr)->getThreat());
+ handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", count, unit->GetName().c_str(), unit->GetGUIDLow(), (*itr)->getThreat());
}
handler->SendSysMessage("End of threat list.");
return true;
@@ -819,13 +821,13 @@ public:
target = handler->GetSession()->GetPlayer();
HostileReference* ref = target->getHostileRefManager().getFirst();
uint32 count = 0;
- handler->PSendSysMessage("Hostil reference list of %s (guid %u)", target->GetName(), target->GetGUIDLow());
+ handler->PSendSysMessage("Hostil reference list of %s (guid %u)", target->GetName().c_str(), target->GetGUIDLow());
while (ref)
{
if (Unit* unit = ref->getSource()->getOwner())
{
++count;
- handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", count, unit->GetName(), unit->GetGUIDLow(), ref->getThreat());
+ handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", count, unit->GetName().c_str(), unit->GetGUIDLow(), ref->getThreat());
}
ref = ref->next();
}
@@ -1047,7 +1049,7 @@ public:
static bool HandleDebugLoSCommand(ChatHandler* handler, char const* /*args*/)
{
if (Unit* unit = handler->getSelectedUnit())
- handler->PSendSysMessage("Unit %s (GuidLow: %u) is %sin LoS", unit->GetName(), unit->GetGUIDLow(), handler->GetSession()->GetPlayer()->IsWithinLOSInMap(unit) ? "" : "not ");
+ handler->PSendSysMessage("Unit %s (GuidLow: %u) is %sin LoS", unit->GetName().c_str(), unit->GetGUIDLow(), handler->GetSession()->GetPlayer()->IsWithinLOSInMap(unit) ? "" : "not ");
return true;
}
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 3dfc6f9c7e8..4c6e36d3f71 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -133,16 +133,17 @@ public:
handler->SendSysMessage(LANG_GMS_ON_SRV);
handler->SendSysMessage("========================");
}
- char const* name = itr->second->GetName();
+ std::string const& name = itr->second->GetName();
+ uint8 size = name.size();
uint8 security = itrSec;
- uint8 max = ((16 - strlen(name)) / 2);
+ uint8 max = ((16 - size) / 2);
uint8 max2 = max;
- if ((max + max2 + strlen(name)) == 16)
+ if ((max + max2 + size) == 16)
max2 = max - 1;
if (handler->GetSession())
- handler->PSendSysMessage("| %s GMLevel %u", name, security);
+ handler->PSendSysMessage("| %s GMLevel %u", name.c_str(), security);
else
- handler->PSendSysMessage("|%*s%s%*s| %u |", max, " ", name, max2, " ", security);
+ handler->PSendSysMessage("|%*s%s%*s| %u |", max, " ", name.c_str(), max2, " ", security);
}
}
if (footer)
diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp
new file mode 100644
index 00000000000..5f1ed59176f
--- /dev/null
+++ b/src/server/scripts/Commands/cs_lfg.cpp
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "LFGMgr.h"
+#include "Group.h"
+
+void GetPlayerInfo(ChatHandler* handler, Player* player)
+{
+ if (!player)
+ return;
+
+ uint64 guid = player->GetGUID();
+ LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(guid);
+
+ std::string const& state = sLFGMgr->GetStateString(sLFGMgr->GetState(guid));
+ handler->PSendSysMessage(LANG_LFG_PLAYER_INFO, player->GetName().c_str(),
+ state.c_str(), uint8(dungeons.size()), sLFGMgr->ConcatenateDungeons(dungeons).c_str(),
+ sLFGMgr->GetRolesString(sLFGMgr->GetRoles(guid)).c_str(), sLFGMgr->GetComment(guid).c_str());
+}
+
+class lfg_commandscript : public CommandScript
+{
+public:
+ lfg_commandscript() : CommandScript("lfg_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand lfgCommandTable[] =
+ {
+ { "player", SEC_GAMEMASTER, false, &HandleLfgPlayerInfoCommand, "", NULL },
+ { "group", SEC_GAMEMASTER, false, &HandleLfgGroupInfoCommand, "", NULL },
+ { "queue", SEC_GAMEMASTER, false, &HandleLfgQueueInfoCommand, "", NULL },
+ { "clean", SEC_ADMINISTRATOR, false, &HandleLfgCleanCommand, "", NULL },
+ { "options", SEC_ADMINISTRATOR, false, &HandleLfgOptionsCommand, "", NULL },
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "lfg", SEC_GAMEMASTER, false, NULL, "", lfgCommandTable },
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleLfgPlayerInfoCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target = NULL;
+ std::string playerName;
+ if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
+ return false;
+
+ GetPlayerInfo(handler, target);
+ return true;
+ }
+
+ static bool HandleLfgGroupInfoCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target = NULL;
+ std::string playerName;
+ if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
+ return false;
+
+ Group* grp = target->GetGroup();
+ if (!grp)
+ {
+ handler->PSendSysMessage(LANG_LFG_NOT_IN_GROUP, playerName.c_str());
+ return true;
+ }
+
+ uint64 guid = grp->GetGUID();
+ std::string const& state = sLFGMgr->GetStateString(sLFGMgr->GetState(guid));
+ handler->PSendSysMessage(LANG_LFG_GROUP_INFO, grp->isLFGGroup(),
+ state.c_str(), sLFGMgr->GetDungeon(guid));
+
+ for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
+ GetPlayerInfo(handler, itr->getSource());
+
+ return true;
+ }
+
+ static bool HandleLfgOptionsCommand(ChatHandler* handler, char const* args)
+ {
+ int32 options = -1;
+ if (char* str = strtok((char*)args, " "))
+ {
+ int32 tmp = atoi(str);
+ if (tmp > -1)
+ options = tmp;
+ }
+
+ if (options != -1)
+ {
+ sLFGMgr->SetOptions(options);
+ handler->PSendSysMessage(LANG_LFG_OPTIONS_CHANGED);
+ }
+ handler->PSendSysMessage(LANG_LFG_OPTIONS, sLFGMgr->GetOptions());
+ return true;
+ }
+
+ static bool HandleLfgQueueInfoCommand(ChatHandler* handler, char const* args)
+ {
+ handler->SendSysMessage(sLFGMgr->DumpQueueInfo(*args).c_str());
+ return true;
+ }
+
+ static bool HandleLfgCleanCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->PSendSysMessage(LANG_LFG_CLEAN);
+ sLFGMgr->Clean();
+ return true;
+ }
+};
+
+void AddSC_lfg_commandscript()
+{
+ new lfg_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 951ebc7714b..8f7e3ed3247 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -1081,7 +1081,7 @@ public:
Player* target = handler->getSelectedPlayer();
// title name have single string arg for player name
- char const* targetName = target ? target->GetName() : "NAME";
+ char const* targetName = target ? target->GetName().c_str() : "NAME";
std::string namePart = args;
std::wstring wNamePart;
diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp
index d61abf34e2f..de2fcf26943 100644
--- a/src/server/scripts/Commands/cs_message.cpp
+++ b/src/server/scripts/Commands/cs_message.cpp
@@ -71,7 +71,7 @@ public:
Player* player = handler->GetSession()->GetPlayer();
Channel* channcel = NULL;
- if (ChannelMgr* cMgr = channelMgr(player->GetTeam()))
+ if (ChannelMgr* cMgr = ChannelMgr::forTeam(player->GetTeam()))
channcel = cMgr->GetChannel(channelStr, player);
if (strcmp(argStr, "on") == 0)
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index f7280cf906e..7e460c7482f 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -1923,9 +1923,9 @@ public:
if (!target)
handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
else if (target->GetTypeId() == TYPEID_PLAYER)
- handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUIDLow());
+ handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
else
- handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUIDLow());
+ handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
break;
}
case FOLLOW_MOTION_TYPE:
@@ -1939,9 +1939,9 @@ public:
if (!target)
handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
else if (target->GetTypeId() == TYPEID_PLAYER)
- handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUIDLow());
+ handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
else
- handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUIDLow());
+ handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
break;
}
case HOME_MOTION_TYPE:
@@ -2534,7 +2534,7 @@ public:
{
name = TargetName;
normalizePlayerName(name);
- player = sObjectAccessor->FindPlayerByName(name.c_str());
+ player = sObjectAccessor->FindPlayerByName(name);
}
if (!player)
@@ -2593,7 +2593,7 @@ public:
{
name = targetName;
normalizePlayerName(name);
- player = sObjectAccessor->FindPlayerByName(name.c_str());
+ player = sObjectAccessor->FindPlayerByName(name);
}
else // If no name was entered - use target
{
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 77fc2918e0b..ba7342caa80 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -47,19 +47,19 @@ public:
{ "weapon", SEC_ADMINISTRATOR, false, &HandleNpcAddWeaponCommand, "", NULL },
//}
{ "", SEC_GAMEMASTER, false, &HandleNpcAddCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand npcDeleteCommandTable[] =
{
{ "item", SEC_GAMEMASTER, false, &HandleNpcDeleteVendorItemCommand, "", NULL },
{ "", SEC_GAMEMASTER, false, &HandleNpcDeleteCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand npcFollowCommandTable[] =
{
{ "stop", SEC_GAMEMASTER, false, &HandleNpcUnFollowCommand, "", NULL },
{ "", SEC_GAMEMASTER, false, &HandleNpcFollowCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand npcSetCommandTable[] =
{
@@ -79,7 +79,7 @@ public:
{ "name", SEC_GAMEMASTER, false, &HandleNpcSetNameCommand, "", NULL },
{ "subname", SEC_GAMEMASTER, false, &HandleNpcSetSubNameCommand, "", NULL },
//}
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand npcCommandTable[] =
{
@@ -95,18 +95,18 @@ public:
{ "delete", SEC_GAMEMASTER, false, NULL, "", npcDeleteCommandTable },
{ "follow", SEC_GAMEMASTER, false, NULL, "", npcFollowCommandTable },
{ "set", SEC_GAMEMASTER, false, NULL, "", npcSetCommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "npc", SEC_MODERATOR, false, NULL, "", npcCommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
return commandTable;
}
//add spawn of creature
- static bool HandleNpcAddCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcAddCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -229,7 +229,7 @@ public:
}
//add move for creature
- static bool HandleNpcAddMoveCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcAddMoveCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -293,7 +293,7 @@ public:
return true;
}
- static bool HandleNpcSetAllowMovementCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleNpcSetAllowMovementCommand(ChatHandler* handler, char const* /*args*/)
{
if (sWorld->getAllowMovement())
{
@@ -308,7 +308,7 @@ public:
return true;
}
- static bool HandleNpcSetEntryCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetEntryCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -333,7 +333,7 @@ public:
}
//change level of creature or pet
- static bool HandleNpcSetLevelCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetLevelCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -374,7 +374,7 @@ public:
return true;
}
- static bool HandleNpcDeleteCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcDeleteCommand(ChatHandler* handler, char const* args)
{
Creature* unit = NULL;
@@ -413,7 +413,7 @@ public:
}
//del item from vendor list
- static bool HandleNpcDeleteVendorItemCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcDeleteVendorItemCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -449,7 +449,7 @@ public:
}
//set faction of creature
- static bool HandleNpcSetFactionIdCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetFactionIdCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -496,7 +496,7 @@ public:
}
//set npcflag of creature
- static bool HandleNpcSetFlagCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetFlagCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -527,7 +527,7 @@ public:
}
//set data of creature for testing scripting
- static bool HandleNpcSetDataCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetDataCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -555,12 +555,12 @@ public:
creature->AI()->SetData(data_1, data_2);
std::string AIorScript = creature->GetAIName() != "" ? "AI type: " + creature->GetAIName() : (creature->GetScriptName() != "" ? "Script Name: " + creature->GetScriptName() : "No AI or Script Name Set");
- handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID(), creature->GetEntry(), creature->GetName(), data_1, data_2, AIorScript.c_str());
+ handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID(), creature->GetEntry(), creature->GetName().c_str(), data_1, data_2, AIorScript.c_str());
return true;
}
//npc follow handling
- static bool HandleNpcFollowCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleNpcFollowCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
Creature* creature = handler->getSelectedCreature();
@@ -575,11 +575,11 @@ public:
// Follow player - Using pet's default dist and angle
creature->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, creature->GetFollowAngle());
- handler->PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName());
+ handler->PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName().c_str());
return true;
}
- static bool HandleNpcInfoCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleNpcInfoCommand(ChatHandler* handler, char const* /*args*/)
{
Creature* target = handler->getSelectedCreature();
@@ -625,7 +625,7 @@ public:
}
//move selected creature
- static bool HandleNpcMoveCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcMoveCommand(ChatHandler* handler, char const* args)
{
uint32 lowguid = 0;
@@ -713,7 +713,7 @@ public:
}
//play npc emote
- static bool HandleNpcPlayEmoteCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcPlayEmoteCommand(ChatHandler* handler, char const* args)
{
uint32 emote = atoi((char*)args);
@@ -742,7 +742,7 @@ public:
}
//set model of creature
- static bool HandleNpcSetModelCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetModelCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -778,7 +778,7 @@ public:
* additional parameter: NODEL - so no waypoints are deleted, if you
* change the movement type
*/
- static bool HandleNpcSetMoveTypeCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetMoveTypeCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -914,7 +914,7 @@ public:
//npc phasemask handling
//change phasemask of creature or pet
- static bool HandleNpcSetPhaseCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetPhaseCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -944,7 +944,7 @@ public:
}
//set spawn dist of creature
- static bool HandleNpcSetSpawnDistCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetSpawnDistCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -990,7 +990,7 @@ public:
}
//spawn time handling
- static bool HandleNpcSetSpawnTimeCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetSpawnTimeCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -1030,7 +1030,7 @@ public:
return true;
}
- static bool HandleNpcSayCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSayCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -1058,7 +1058,7 @@ public:
}
//show text emote by creature in chat
- static bool HandleNpcTextEmoteCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcTextEmoteCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -1078,7 +1078,7 @@ public:
}
//npc unfollow handling
- static bool HandleNpcUnFollowCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleNpcUnFollowCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
Creature* creature = handler->getSelectedCreature();
@@ -1093,7 +1093,7 @@ public:
if (/*creature->GetMotionMaster()->empty() ||*/
creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FOLLOW_MOTION_TYPE)
{
- handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName());
+ handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName().c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -1102,7 +1102,7 @@ public:
if (mgen->GetTarget() != player)
{
- handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName());
+ handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName().c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -1110,12 +1110,12 @@ public:
// reset movement
creature->GetMotionMaster()->MovementExpired(true);
- handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName());
+ handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName().c_str());
return true;
}
// make npc whisper to player
- static bool HandleNpcWhisperCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcWhisperCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -1142,7 +1142,7 @@ public:
return true;
}
- static bool HandleNpcYellCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcYellCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -1164,7 +1164,7 @@ public:
}
// add creature, temp only
- static bool HandleNpcAddTempSpawnCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcAddTempSpawnCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -1184,7 +1184,7 @@ public:
}
//npc tame handling
- static bool HandleNpcTameCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleNpcTameCommand(ChatHandler* handler, char const* /*args*/)
{
Creature* creatureTarget = handler->getSelectedCreature();
if (!creatureTarget || creatureTarget->isPet())
@@ -1250,7 +1250,7 @@ public:
return true;
}
- static bool HandleNpcAddFormationCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcAddFormationCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -1302,7 +1302,7 @@ public:
return true;
}
- static bool HandleNpcSetLinkCommand(ChatHandler* handler, const char* args)
+ static bool HandleNpcSetLinkCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -1337,7 +1337,7 @@ public:
}
//TODO: NpcCommands that need to be fixed :
- static bool HandleNpcAddWeaponCommand(ChatHandler* /*handler*/, const char* /*args*/)
+ static bool HandleNpcAddWeaponCommand(ChatHandler* /*handler*/, char const* /*args*/)
{
/*if (!*args)
return false;
@@ -1405,7 +1405,7 @@ public:
return true;
}
- static bool HandleNpcSetNameCommand(ChatHandler* /*handler*/, const char* /*args*/)
+ static bool HandleNpcSetNameCommand(ChatHandler* /*handler*/, char const* /*args*/)
{
/* Temp. disabled
if (!*args)
@@ -1452,7 +1452,7 @@ public:
return true;
}
- static bool HandleNpcSetSubNameCommand(ChatHandler* /*handler*/, const char* /*args*/)
+ static bool HandleNpcSetSubNameCommand(ChatHandler* /*handler*/, char const* /*args*/)
{
/* Temp. disabled
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp
index baaa5d2bd43..c99931a90fb 100644
--- a/src/server/scripts/Commands/cs_ticket.cpp
+++ b/src/server/scripts/Commands/cs_ticket.cpp
@@ -156,7 +156,7 @@ public:
sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : -1);
sTicketMgr->UpdateLastChange();
- std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName() : "Console", NULL, NULL, NULL);
+ std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", NULL, NULL, NULL);
handler->SendGlobalGMSysMessage(msg.c_str());
// Inform player, who submitted this ticket, that it is closed
@@ -206,7 +206,7 @@ public:
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL);
- msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName() : "Console", comment);
+ msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName().c_str() : "Console", comment);
handler->SendGlobalGMSysMessage(msg.c_str());
return true;
@@ -258,7 +258,7 @@ public:
return true;
}
- std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName() : "Console");
+ std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console");
handler->SendGlobalGMSysMessage(msg.c_str());
sTicketMgr->RemoveTicket(ticket->GetId());
@@ -389,7 +389,7 @@ public:
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(),
- handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName() : "Console", NULL);
+ handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL);
handler->SendGlobalGMSysMessage(msg.c_str());
return true;
@@ -427,7 +427,7 @@ public:
// Detect target's GUID
uint64 guid = 0;
- if (Player* player = sObjectAccessor->FindPlayerByName(name.c_str()))
+ if (Player* player = sObjectAccessor->FindPlayerByName(name))
guid = player->GetGUID();
else
guid = sObjectMgr->GetPlayerGUIDByName(name);
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index f35f6baca98..e1b30d122de 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -36,7 +36,7 @@ public:
static ChatCommand titlesSetCommandTable[] =
{
{ "mask", SEC_GAMEMASTER, false, &HandleTitlesSetMaskCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand titlesCommandTable[] =
{
@@ -44,17 +44,17 @@ public:
{ "current", SEC_GAMEMASTER, false, &HandleTitlesCurrentCommand, "", NULL },
{ "remove", SEC_GAMEMASTER, false, &HandleTitlesRemoveCommand, "", NULL },
{ "set", SEC_GAMEMASTER, false, NULL, "", titlesSetCommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "titles", SEC_GAMEMASTER, false, NULL, "", titlesCommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
};
return commandTable;
}
- static bool HandleTitlesCurrentCommand(ChatHandler* handler, const char* args)
+ static bool HandleTitlesCurrentCommand(ChatHandler* handler, char const* args)
{
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
char* id_p = handler->extractKeyFromLink((char*)args, "Htitle");
@@ -99,7 +99,7 @@ public:
return true;
}
- static bool HandleTitlesAddCommand(ChatHandler* handler, const char* args)
+ static bool HandleTitlesAddCommand(ChatHandler* handler, char const* args)
{
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
char* id_p = handler->extractKeyFromLink((char*)args, "Htitle");
@@ -136,9 +136,8 @@ public:
std::string tNameLink = handler->GetNameLink(target);
- char const* targetName = target->GetName();
char titleNameStr[80];
- snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName);
+ snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], target->GetName().c_str());
target->SetTitle(titleInfo);
handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str());
@@ -146,7 +145,7 @@ public:
return true;
}
- static bool HandleTitlesRemoveCommand(ChatHandler* handler, const char* args)
+ static bool HandleTitlesRemoveCommand(ChatHandler* handler, char const* args)
{
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
char* id_p = handler->extractKeyFromLink((char*)args, "Htitle");
@@ -185,9 +184,8 @@ public:
std::string tNameLink = handler->GetNameLink(target);
- char const* targetName = target->GetName();
char titleNameStr[80];
- snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName);
+ snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], target->GetName().c_str());
handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str());
@@ -201,7 +199,7 @@ public:
}
//Edit Player KnownTitles
- static bool HandleTitlesSetMaskCommand(ChatHandler* handler, const char* args)
+ static bool HandleTitlesSetMaskCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;