aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorleak <leakzx@googlemail.com>2011-04-29 20:47:02 +0200
committerleak <leakzx@googlemail.com>2011-04-29 20:47:02 +0200
commit1003f30448f1f431ef091551ba5851cf7cd2b31a (patch)
tree9bebedb5b8bd6b4d6cf6d9daa83df90a86b1a786 /src/server/scripts/Commands
parent01a79947d56eae6ed9f47dc2b41897d77cc91f41 (diff)
Add spaces after commas
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_account.cpp68
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp36
-rw-r--r--src/server/scripts/Commands/cs_event.cpp22
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp2
-rw-r--r--src/server/scripts/Commands/cs_go.cpp64
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp74
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp30
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp60
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp84
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp24
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp156
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp16
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp20
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp48
14 files changed, 352 insertions, 352 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 59abb8fa3a4..e5981b649be 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -107,7 +107,7 @@ public:
switch(result)
{
case AOR_OK:
- handler->PSendSysMessage(LANG_ACCOUNT_CREATED,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_CREATED, account_name.c_str());
break;
case AOR_NAME_TOO_LONG:
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
@@ -118,11 +118,11 @@ public:
handler->SetSentErrorMessage(true);
return false;
case AOR_DB_INTERNAL_ERROR:
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED_SQL_ERROR,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED_SQL_ERROR, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
default:
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -138,14 +138,14 @@ public:
return false;
///- Get the account name from the command line
- char *account_name_str=strtok ((char*)args," ");
+ char *account_name_str=strtok ((char*)args, " ");
if (!account_name_str)
return false;
std::string account_name = account_name_str;
if (!AccountMgr::normalizeString(account_name))
{
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -153,7 +153,7 @@ public:
uint32 account_id = sAccountMgr->GetId(account_name);
if (!account_id)
{
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -161,25 +161,25 @@ public:
/// Commands not recommended call from chat, but support anyway
/// can delete only for account with less security
/// This is also reject self apply in fact
- if (handler->HasLowerSecurityAccount (NULL,account_id,true))
+ if (handler->HasLowerSecurityAccount (NULL, account_id, true))
return false;
AccountOpResult result = sAccountMgr->DeleteAccount(account_id);
switch(result)
{
case AOR_OK:
- handler->PSendSysMessage(LANG_ACCOUNT_DELETED,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_DELETED, account_name.c_str());
break;
case AOR_NAME_NOT_EXIST:
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
case AOR_DB_INTERNAL_ERROR:
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
default:
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -191,7 +191,7 @@ public:
static bool HandleAccountOnlineListCommand(ChatHandler* handler, const char* /*args*/)
{
///- Get the list of accounts ID logged to the realm
- QueryResult resultDB = CharacterDatabase.Query("SELECT name,account,map,zone FROM characters WHERE online > 0");
+ QueryResult resultDB = CharacterDatabase.Query("SELECT name, account, map, zone FROM characters WHERE online > 0");
if (!resultDB)
{
handler->SendSysMessage(LANG_ACCOUNT_LIST_EMPTY);
@@ -222,10 +222,10 @@ public:
{
Field *fieldsLogin = resultLogin->Fetch();
handler->PSendSysMessage(LANG_ACCOUNT_LIST_LINE,
- fieldsLogin[0].GetCString(),name.c_str(),fieldsLogin[1].GetCString(),fieldsDB[2].GetUInt16(),fieldsDB[3].GetUInt16(),fieldsLogin[3].GetUInt32(),fieldsLogin[2].GetUInt32());
+ fieldsLogin[0].GetCString(), name.c_str(), fieldsLogin[1].GetCString(), fieldsDB[2].GetUInt16(), fieldsDB[3].GetUInt16(), fieldsLogin[3].GetUInt32(), fieldsLogin[2].GetUInt32());
}
else
- handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR,name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str());
}while (resultDB->NextRow());
@@ -245,14 +245,14 @@ public:
std::string argstr = (char*)args;
if (argstr == "on")
{
- LoginDatabase.PExecute("UPDATE account SET locked = '1' WHERE id = '%d'",handler->GetSession()->GetAccountId());
+ LoginDatabase.PExecute("UPDATE account SET locked = '1' WHERE id = '%d'", handler->GetSession()->GetAccountId());
handler->PSendSysMessage(LANG_COMMAND_ACCLOCKLOCKED);
return true;
}
if (argstr == "off")
{
- LoginDatabase.PExecute("UPDATE account SET locked = '0' WHERE id = '%d'",handler->GetSession()->GetAccountId());
+ LoginDatabase.PExecute("UPDATE account SET locked = '0' WHERE id = '%d'", handler->GetSession()->GetAccountId());
handler->PSendSysMessage(LANG_COMMAND_ACCLOCKUNLOCKED);
return true;
}
@@ -330,8 +330,8 @@ public:
static bool HandleAccountSetAddonCommand(ChatHandler* handler, const char *args)
{
///- Get the command line arguments
- char *szAcc = strtok((char*)args," ");
- char *szExp = strtok(NULL," ");
+ char *szAcc = strtok((char*)args, " ");
+ char *szExp = strtok(NULL, " ");
if (!szAcc)
return false;
@@ -346,7 +346,7 @@ public:
return false;
account_id = player->GetSession()->GetAccountId();
- sAccountMgr->GetName(account_id,account_name);
+ sAccountMgr->GetName(account_id, account_name);
szExp = szAcc;
}
else
@@ -355,7 +355,7 @@ public:
account_name = szAcc;
if (!AccountMgr::normalizeString(account_name))
{
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -363,7 +363,7 @@ public:
account_id = sAccountMgr->GetId(account_name);
if (!account_id)
{
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -373,7 +373,7 @@ public:
// Let set addon state only for lesser (strong) security level
// or to self account
if (handler->GetSession() && handler->GetSession()->GetAccountId () != account_id &&
- handler->HasLowerSecurityAccount (NULL,account_id,true))
+ handler->HasLowerSecurityAccount (NULL, account_id, true))
return false;
int expansion = atoi(szExp); //get int anyway (0 if error)
@@ -381,8 +381,8 @@ public:
return false;
// No SQL injection
- LoginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'",expansion,account_id);
- handler->PSendSysMessage(LANG_ACCOUNT_SETADDON,account_name.c_str(),account_id,expansion);
+ LoginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'", expansion, account_id);
+ handler->PSendSysMessage(LANG_ACCOUNT_SETADDON, account_name.c_str(), account_id, expansion);
return true;
}
@@ -417,7 +417,7 @@ public:
targetAccountName = arg1;
if (!AccountMgr::normalizeString(targetAccountName))
{
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,targetAccountName.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, targetAccountName.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -478,7 +478,7 @@ public:
LoginDatabase.PExecute("DELETE FROM account_access WHERE id = '%u' AND (RealmID = '%d' OR RealmID = '-1')", targetAccountId, realmID);
if (gm != 0)
- LoginDatabase.PExecute("INSERT INTO account_access VALUES ('%u','%d','%d')", targetAccountId, gm, realmID);
+ LoginDatabase.PExecute("INSERT INTO account_access VALUES ('%u', '%d', '%d')", targetAccountId, gm, realmID);
handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm);
return true;
}
@@ -490,9 +490,9 @@ public:
return false;
///- Get the command line arguments
- char *szAccount = strtok ((char*)args," ");
- char *szPassword1 = strtok (NULL," ");
- char *szPassword2 = strtok (NULL," ");
+ char *szAccount = strtok ((char*)args, " ");
+ char *szPassword1 = strtok (NULL, " ");
+ char *szPassword2 = strtok (NULL, " ");
if (!szAccount||!szPassword1 || !szPassword2)
return false;
@@ -500,7 +500,7 @@ public:
std::string account_name = szAccount;
if (!AccountMgr::normalizeString(account_name))
{
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -508,17 +508,17 @@ public:
uint32 targetAccountId = sAccountMgr->GetId(account_name);
if (!targetAccountId)
{
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
}
/// can set password only for target with less security
/// This is also reject self apply in fact
- if (handler->HasLowerSecurityAccount (NULL,targetAccountId,true))
+ if (handler->HasLowerSecurityAccount (NULL, targetAccountId, true))
return false;
- if (strcmp(szPassword1,szPassword2))
+ if (strcmp(szPassword1, szPassword2))
{
handler->SendSysMessage (LANG_NEW_PASSWORDS_NOT_MATCH);
handler->SetSentErrorMessage (true);
@@ -533,7 +533,7 @@ public:
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
break;
case AOR_NAME_NOT_EXIST:
- handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
+ handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
handler->SetSentErrorMessage(true);
return false;
case AOR_PASS_TOO_LONG:
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 237fa210933..94174e9cb82 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -58,7 +58,7 @@ public:
{ "opcode", SEC_ADMINISTRATOR, false, &HandleDebugSendOpcodeCommand, "", NULL },
{ "poi", SEC_ADMINISTRATOR, false, &HandleDebugSendPoiCommand, "", NULL },
{ "qpartymsg", SEC_ADMINISTRATOR, false, &HandleDebugSendQuestPartyMsgCommand, "", NULL },
- { "qinvalidmsg", SEC_ADMINISTRATOR, false, &HandleDebugSendQuestInvalidMsgCommand,"", NULL },
+ { "qinvalidmsg", SEC_ADMINISTRATOR, false, &HandleDebugSendQuestInvalidMsgCommand, "", NULL },
{ "sellerror", SEC_ADMINISTRATOR, false, &HandleDebugSendSellErrorCommand, "", NULL },
{ "setphaseshift", SEC_ADMINISTRATOR, false, &HandleDebugSendSetPhaseShiftCommand, "", NULL },
{ "spellfail", SEC_ADMINISTRATOR, false, &HandleDebugSendSpellFailCommand, "", NULL },
@@ -73,7 +73,7 @@ public:
{ "arena", SEC_ADMINISTRATOR, false, &HandleDebugArenaCommand, "", NULL },
{ "bg", SEC_ADMINISTRATOR, false, &HandleDebugBattlegroundCommand, "", NULL },
{ "getitemstate", SEC_ADMINISTRATOR, false, &HandleDebugGetItemStateCommand, "", NULL },
- { "lootrecipient", SEC_GAMEMASTER, false, &HandleDebugGetLootRecipientCommand,"", NULL },
+ { "lootrecipient", SEC_GAMEMASTER, false, &HandleDebugGetLootRecipientCommand, "", NULL },
{ "getvalue", SEC_ADMINISTRATOR, false, &HandleDebugGetValueCommand, "", NULL },
{ "getitemvalue", SEC_ADMINISTRATOR, false, &HandleDebugGetItemValueCommand, "", NULL },
{ "Mod32Value", SEC_ADMINISTRATOR, false, &HandleDebugMod32ValueCommand, "", NULL },
@@ -85,7 +85,7 @@ public:
{ "spawnvehicle", SEC_ADMINISTRATOR, false, &HandleDebugSpawnVehicleCommand, "", NULL },
{ "setvid", SEC_ADMINISTRATOR, false, &HandleDebugSetVehicleIdCommand, "", NULL },
{ "entervehicle", SEC_ADMINISTRATOR, false, &HandleDebugEnterVehicleCommand, "", NULL },
- { "uws", SEC_ADMINISTRATOR, false, &HandleDebugUpdateWorldStateCommand,"", NULL },
+ { "uws", SEC_ADMINISTRATOR, false, &HandleDebugUpdateWorldStateCommand, "", NULL },
{ "update", SEC_ADMINISTRATOR, false, &HandleDebugUpdateCommand, "", NULL },
{ "itemexpire", SEC_ADMINISTRATOR, false, &HandleDebugItemExpireCommand, "", NULL },
{ "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL },
@@ -177,9 +177,9 @@ public:
}
if (handler->GetSession()->GetPlayer()->GetSelection())
- unit->PlayDistanceSound(dwSoundId,handler->GetSession()->GetPlayer());
+ unit->PlayDistanceSound(dwSoundId, handler->GetSession()->GetPlayer());
else
- unit->PlayDirectSound(dwSoundId,handler->GetSession()->GetPlayer());
+ unit->PlayDirectSound(dwSoundId, handler->GetSession()->GetPlayer());
handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, dwSoundId);
return true;
@@ -239,7 +239,7 @@ public:
uint32 icon = atol(icon_text);
uint32 flags = atol(flags_text);
- sLog->outDetail("Command : POI, NPC = %u, icon = %u flags = %u", target->GetGUIDLow(), icon,flags);
+ sLog->outDetail("Command : POI, NPC = %u, icon = %u flags = %u", target->GetGUIDLow(), icon, flags);
pPlayer->PlayerTalkClass->SendPointOfInterest(target->GetPositionX(), target->GetPositionY(), Poi_Icon(icon), flags, 30, "Test POI");
return true;
}
@@ -736,14 +736,14 @@ public:
std::list<HostileReference*>& tlist = target->getThreatManager().getThreatList();
std::list<HostileReference*>::iterator itr;
uint32 cnt = 0;
- handler->PSendSysMessage("Threat list of %s (guid %u)",target->GetName(), target->GetGUIDLow());
+ handler->PSendSysMessage("Threat list of %s (guid %u)", target->GetName(), target->GetGUIDLow());
for (itr = tlist.begin(); itr != tlist.end(); ++itr)
{
Unit* unit = (*itr)->getTarget();
if (!unit)
continue;
++cnt;
- handler->PSendSysMessage(" %u. %s (guid %u) - threat %f",cnt,unit->GetName(), unit->GetGUIDLow(), (*itr)->getThreat());
+ handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", cnt, unit->GetName(), unit->GetGUIDLow(), (*itr)->getThreat());
}
handler->SendSysMessage("End of threat list.");
return true;
@@ -756,13 +756,13 @@ public:
target = handler->GetSession()->GetPlayer();
HostileReference* ref = target->getHostileRefManager().getFirst();
uint32 cnt = 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(), target->GetGUIDLow());
while (ref)
{
if (Unit * unit = ref->getSource()->getOwner())
{
++cnt;
- handler->PSendSysMessage(" %u. %s (guid %u) - threat %f",cnt,unit->GetName(), unit->GetGUIDLow(), ref->getThreat());
+ handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", cnt, unit->GetName(), unit->GetGUIDLow(), ref->getThreat());
}
ref = ref->next();
}
@@ -1003,11 +1003,11 @@ public:
{
// reset all states
for (int i = 1; i <= 32; ++i)
- unit->ModifyAuraState(AuraState(i),false);
+ unit->ModifyAuraState(AuraState(i), false);
return true;
}
- unit->ModifyAuraState(AuraState(abs(state)),state > 0);
+ unit->ModifyAuraState(AuraState(abs(state)), state > 0);
return true;
}
@@ -1048,13 +1048,13 @@ public:
{
iValue = (uint32)atoi(py);
target->SetUInt32Value(Opcode , iValue);
- handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode,iValue);
+ handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode, iValue);
}
else
{
fValue = (float)atof(py);
target->SetFloatValue(Opcode , fValue);
- handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode,fValue);
+ handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue);
}
return true;
@@ -1132,7 +1132,7 @@ public:
CurrentValue += Value;
handler->GetSession()->GetPlayer()->SetUInt32Value(Opcode , (uint32)CurrentValue);
- handler->PSendSysMessage(LANG_CHANGE_32BIT_FIELD, Opcode,CurrentValue);
+ handler->PSendSysMessage(LANG_CHANGE_32BIT_FIELD, Opcode, CurrentValue);
return true;
}
@@ -1175,15 +1175,15 @@ public:
{
value=chr->GetUInt32Value(updateIndex);
- handler->PSendSysMessage(LANG_UPDATE, chr->GetGUIDLow(),updateIndex,value);
+ handler->PSendSysMessage(LANG_UPDATE, chr->GetGUIDLow(), updateIndex, value);
return true;
}
value=atoi(pvalue);
- handler->PSendSysMessage(LANG_UPDATE_CHANGE, chr->GetGUIDLow(),updateIndex,value);
+ handler->PSendSysMessage(LANG_UPDATE_CHANGE, chr->GetGUIDLow(), updateIndex, value);
- chr->SetUInt32Value(updateIndex,value);
+ chr->SetUInt32Value(updateIndex, value);
return true;
}
diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp
index 88feae9e561..20ade38d676 100644
--- a/src/server/scripts/Commands/cs_event.cpp
+++ b/src/server/scripts/Commands/cs_event.cpp
@@ -64,9 +64,9 @@ public:
GameEventData const& eventData = events[event_id];
if (handler->GetSession())
- handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,event_id,event_id,eventData.description.c_str(),active);
+ handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, event_id, event_id, eventData.description.c_str(), active);
else
- handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,event_id,eventData.description.c_str(),active);
+ handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, event_id, eventData.description.c_str(), active);
++counter;
}
@@ -84,7 +84,7 @@ public:
return false;
// id or [name] Shift-click form |color|Hgameevent:id|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameevent");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameevent");
if (!cId)
return false;
@@ -121,8 +121,8 @@ public:
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE);
std::string lengthStr = secsToTimeString(eventData.length * MINUTE);
- handler->PSendSysMessage(LANG_EVENT_INFO,event_id,eventData.description.c_str(),activeStr,
- startTimeStr.c_str(),endTimeStr.c_str(),occurenceStr.c_str(),lengthStr.c_str(),
+ handler->PSendSysMessage(LANG_EVENT_INFO, event_id, eventData.description.c_str(), activeStr,
+ startTimeStr.c_str(), endTimeStr.c_str(), occurenceStr.c_str(), lengthStr.c_str(),
nextStr.c_str());
return true;
}
@@ -133,7 +133,7 @@ public:
return false;
// id or [name] Shift-click form |color|Hgameevent:id|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameevent");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameevent");
if (!cId)
return false;
@@ -159,12 +159,12 @@ public:
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
if (activeEvents.find(event_id) != activeEvents.end())
{
- handler->PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE,event_id);
+ handler->PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE, event_id);
handler->SetSentErrorMessage(true);
return false;
}
- sGameEventMgr->StartEvent(event_id,true);
+ sGameEventMgr->StartEvent(event_id, true);
return true;
}
@@ -174,7 +174,7 @@ public:
return false;
// id or [name] Shift-click form |color|Hgameevent:id|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameevent");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameevent");
if (!cId)
return false;
@@ -201,12 +201,12 @@ public:
if (activeEvents.find(event_id) == activeEvents.end())
{
- handler->PSendSysMessage(LANG_EVENT_NOT_ACTIVE,event_id);
+ handler->PSendSysMessage(LANG_EVENT_NOT_ACTIVE, event_id);
handler->SetSentErrorMessage(true);
return false;
}
- sGameEventMgr->StopEvent(event_id,true);
+ sGameEventMgr->StopEvent(event_id, true);
return true;
}
};
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 1ed451ed50b..90fbe1d1549 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -153,7 +153,7 @@ public:
static bool HandleGMListFullCommand(ChatHandler* handler, const char* /*args*/)
{
///- Get the accounts with GM Level >0
- QueryResult result = LoginDatabase.Query("SELECT a.username,aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel > 0");
+ QueryResult result = LoginDatabase.Query("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel > 0");
if (result)
{
handler->SendSysMessage(LANG_GMLIST);
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index b4ca8af6d92..1dbc4236bff 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -76,7 +76,7 @@ public:
Player* _player = handler->GetSession()->GetPlayer();
// "id" or number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
- char* pParam1 = handler->extractKeyFromLink((char*)args,"Hcreature");
+ char* pParam1 = handler->extractKeyFromLink((char*)args, "Hcreature");
if (!pParam1)
return false;
@@ -89,10 +89,10 @@ public:
// Get the "creature_template.entry"
// number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
- char* tail = strtok(NULL,"");
+ char* tail = strtok(NULL, "");
if (!tail)
return false;
- char* cId = handler->extractKeyFromLink(tail,"Hcreature_entry");
+ char* cId = handler->extractKeyFromLink(tail, "Hcreature_entry");
if (!cId)
return false;
@@ -123,7 +123,7 @@ public:
}
//sLog->outError("DEBUG: %s", whereClause.c_str());
- QueryResult result = WorldDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map FROM creature %s", whereClause.str().c_str());
+ QueryResult result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map FROM creature %s", whereClause.str().c_str());
if (!result)
{
handler->SendSysMessage(LANG_COMMAND_GOCREATNOTFOUND);
@@ -140,9 +140,9 @@ public:
float ort = fields[3].GetFloat();
int mapid = fields[4].GetUInt16();
- if (!MapManager::IsValidMapCoord(mapid,x,y,z,ort))
+ if (!MapManager::IsValidMapCoord(mapid, x, y, z, ort))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,mapid);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapid);
handler->SetSentErrorMessage(true);
return false;
}
@@ -179,14 +179,14 @@ public:
WorldSafeLocsEntry const* gy = sWorldSafeLocsStore.LookupEntry(i_gyId);
if (!gy)
{
- handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST,i_gyId);
+ handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, i_gyId);
handler->SetSentErrorMessage(true);
return false;
}
- if (!MapManager::IsValidMapCoord(gy->map_id,gy->x,gy->y,gy->z))
+ if (!MapManager::IsValidMapCoord(gy->map_id, gy->x, gy->y, gy->z))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,gy->x,gy->y,gy->map_id);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->x, gy->y, gy->map_id);
handler->SetSentErrorMessage(true);
return false;
}
@@ -228,9 +228,9 @@ public:
float x = (grid_x-CENTER_GRID_ID+0.5f)*SIZE_OF_GRIDS;
float y = (grid_y-CENTER_GRID_ID+0.5f)*SIZE_OF_GRIDS;
- if (!MapManager::IsValidMapCoord(mapid,x,y))
+ if (!MapManager::IsValidMapCoord(mapid, x, y))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,mapid);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapid);
handler->SetSentErrorMessage(true);
return false;
}
@@ -260,7 +260,7 @@ public:
Player* _player = handler->GetSession()->GetPlayer();
// number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameobject");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameobject");
if (!cId)
return false;
@@ -287,9 +287,9 @@ public:
return false;
}
- if (!MapManager::IsValidMapCoord(mapid,x,y,z,ort))
+ if (!MapManager::IsValidMapCoord(mapid, x, y, z, ort))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,mapid);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapid);
handler->SetSentErrorMessage(true);
return false;
}
@@ -314,7 +314,7 @@ public:
if (!*args)
return false;
- char* cNodeId = handler->extractKeyFromLink((char*)args,"Htaxinode");
+ char* cNodeId = handler->extractKeyFromLink((char*)args, "Htaxinode");
if (!cNodeId)
return false;
@@ -325,15 +325,15 @@ public:
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i_nodeId);
if (!node)
{
- handler->PSendSysMessage(LANG_COMMAND_GOTAXINODENOTFOUND,i_nodeId);
+ handler->PSendSysMessage(LANG_COMMAND_GOTAXINODENOTFOUND, i_nodeId);
handler->SetSentErrorMessage(true);
return false;
}
if ((node->x == 0.0f && node->y == 0.0f && node->z == 0.0f) ||
- !MapManager::IsValidMapCoord(node->map_id,node->x,node->y,node->z))
+ !MapManager::IsValidMapCoord(node->map_id, node->x, node->y, node->z))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,node->x,node->y,node->map_id);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, node->x, node->y, node->map_id);
handler->SetSentErrorMessage(true);
return false;
}
@@ -370,14 +370,14 @@ public:
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(i_atId);
if (!at)
{
- handler->PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND,i_atId);
+ handler->PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND, i_atId);
handler->SetSentErrorMessage(true);
return false;
}
- if (!MapManager::IsValidMapCoord(at->mapid,at->x,at->y,at->z))
+ if (!MapManager::IsValidMapCoord(at->mapid, at->x, at->y, at->z))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,at->x,at->y,at->mapid);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->x, at->y, at->mapid);
handler->SetSentErrorMessage(true);
return false;
}
@@ -405,9 +405,9 @@ public:
char* px = strtok((char*)args, " ");
char* py = strtok(NULL, " ");
- char* tail = strtok(NULL,"");
+ char* tail = strtok(NULL, "");
- char* cAreaId = handler->extractKeyFromLink(tail,"Harea"); // string or [name] Shift-click form |color|Harea:area_id|h[name]|h|r
+ char* cAreaId = handler->extractKeyFromLink(tail, "Harea"); // string or [name] Shift-click form |color|Harea:area_id|h[name]|h|r
if (!px || !py)
return false;
@@ -425,7 +425,7 @@ public:
if (x < 0 || x > 100 || y < 0 || y > 100 || !areaEntry)
{
- handler->PSendSysMessage(LANG_INVALID_ZONE_COORD,x,y,areaid);
+ handler->PSendSysMessage(LANG_INVALID_ZONE_COORD, x, y, areaid);
handler->SetSentErrorMessage(true);
return false;
}
@@ -437,16 +437,16 @@ public:
if (map->Instanceable())
{
- handler->PSendSysMessage(LANG_INVALID_ZONE_MAP,areaEntry->ID,areaEntry->area_name[handler->GetSessionDbcLocale()],map->GetId(),map->GetMapName());
+ handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name[handler->GetSessionDbcLocale()], map->GetId(), map->GetMapName());
handler->SetSentErrorMessage(true);
return false;
}
- Zone2MapCoordinates(x,y,zoneEntry->ID);
+ Zone2MapCoordinates(x, y, zoneEntry->ID);
- if (!MapManager::IsValidMapCoord(zoneEntry->mapid,x,y))
+ if (!MapManager::IsValidMapCoord(zoneEntry->mapid, x, y))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,zoneEntry->mapid);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, zoneEntry->mapid);
handler->SetSentErrorMessage(true);
return false;
}
@@ -489,9 +489,9 @@ public:
else
mapid = _player->GetMapId();
- if (!MapManager::IsValidMapCoord(mapid,x,y))
+ if (!MapManager::IsValidMapCoord(mapid, x, y))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,mapid);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapid);
handler->SetSentErrorMessage(true);
return false;
}
@@ -538,9 +538,9 @@ public:
else
mapid = _player->GetMapId();
- if (!MapManager::IsValidMapCoord(mapid,x,y,z))
+ if (!MapManager::IsValidMapCoord(mapid, x, y, z))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,mapid);
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapid);
handler->SetSentErrorMessage(true);
return false;
}
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 857ee0fec85..726b937cf95 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -74,7 +74,7 @@ public:
if (!*args)
return false;
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameobject");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameobject");
if (!cId)
return false;
@@ -86,7 +86,7 @@ public:
// by DB guid
if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid))
- obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
+ obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, go_data->id);
if (!obj)
{
@@ -111,7 +111,7 @@ public:
return false;
// number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameobject_entry");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameobject_entry");
if (!cId)
return false;
@@ -125,7 +125,7 @@ public:
if (!gInfo)
{
- handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
+ handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, id);
handler->SetSentErrorMessage(true);
return false;
}
@@ -133,8 +133,8 @@ public:
if (gInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(gInfo->displayId))
{
// report to DB errors log as in loading case
- sLog->outErrorDb("Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.",id, gInfo->type, gInfo->displayId);
- handler->PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA,id);
+ sLog->outErrorDb("Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.", id, gInfo->type, gInfo->displayId);
+ handler->PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA, id);
handler->SetSentErrorMessage(true);
return false;
}
@@ -163,7 +163,7 @@ public:
}
// fill the gameobject data and save to the db
- pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()),chr->GetPhaseMaskForSpawn());
+ pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
// this will generate a new guid if the object is in an instance
if (!pGameObj->LoadFromDB(db_lowGUID, map))
@@ -177,7 +177,7 @@ public:
// TODO: is it really necessary to add both the real and DB table guid here ?
sObjectMgr->AddGameobjectToGrid(db_lowGUID, sObjectMgr->GetGOData(db_lowGUID));
- handler->PSendSysMessage(LANG_GAMEOBJECT_ADD,id,gInfo->name.c_str(),db_lowGUID,x,y,z);
+ handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, id, gInfo->name.c_str(), db_lowGUID, x, y, z);
return true;
}
@@ -208,7 +208,7 @@ public:
uint32 id = atoi(charID);
- chr->SummonGameObject(id,x,y,z,ang,0,0,rot2,rot3,spawntm);
+ chr->SummonGameObject(id, x, y, z, ang, 0, 0, rot2, rot3, spawntm);
return true;
}
@@ -221,7 +221,7 @@ public:
if (*args)
{
// number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameobject_entry");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameobject_entry");
if (!cId)
return false;
@@ -229,15 +229,15 @@ public:
if (id)
result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1",
- pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(),id);
+ pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(), id);
else
{
std::string name = cId;
WorldDatabase.escape_string(name);
result = WorldDatabase.PQuery(
"SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
- "FROM gameobject,gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'")" ORDER BY order_ ASC LIMIT 1",
- pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(),name.c_str());
+ "FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'")" ORDER BY order_ ASC LIMIT 1",
+ pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(), name.c_str());
}
}
else
@@ -254,7 +254,7 @@ public:
initString =false;
}
else
- eventFilter << "," << *itr;
+ eventFilter << ", " << *itr;
}
if (!initString)
@@ -266,7 +266,7 @@ public:
"(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject "
"LEFT OUTER JOIN game_event_gameobject on gameobject.guid = game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10",
handler->GetSession()->GetPlayer()->GetPositionX(), handler->GetSession()->GetPlayer()->GetPositionY(), handler->GetSession()->GetPlayer()->GetPositionZ(),
- handler->GetSession()->GetPlayer()->GetMapId(),eventFilter.str().c_str());
+ handler->GetSession()->GetPlayer()->GetMapId(), eventFilter.str().c_str());
}
if (!result)
@@ -299,7 +299,7 @@ public:
if (!found)
{
- handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
+ handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, id);
return false;
}
@@ -307,11 +307,11 @@ public:
if (!goI)
{
- handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
+ handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, id);
return false;
}
- GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid,id,HIGHGUID_GAMEOBJECT));
+ GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, id, HIGHGUID_GAMEOBJECT));
handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, lowguid, goI->name.c_str(), lowguid, id, x, y, z, mapid, o, phase);
@@ -321,10 +321,10 @@ public:
if (curRespawnDelay < 0)
curRespawnDelay = 0;
- std::string curRespawnDelayStr = secsToTimeString(curRespawnDelay,true);
- std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(),true);
+ std::string curRespawnDelayStr = secsToTimeString(curRespawnDelay, true);
+ std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true);
- handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(),curRespawnDelayStr.c_str());
+ handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str());
}
return true;
}
@@ -333,7 +333,7 @@ public:
static bool HandleGameObjectDeleteCommand(ChatHandler* handler, const char* args)
{
// number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameobject");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameobject");
if (!cId)
return false;
@@ -345,7 +345,7 @@ public:
// by DB guid
if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid))
- obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
+ obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, go_data->id);
if (!obj)
{
@@ -357,7 +357,7 @@ public:
uint64 owner_guid = obj->GetOwnerGUID();
if (owner_guid)
{
- Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(),owner_guid);
+ Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), owner_guid);
if (!owner || !IS_PLAYER_GUID(owner_guid))
{
handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, GUID_LOPART(owner_guid), obj->GetGUIDLow());
@@ -365,7 +365,7 @@ public:
return false;
}
- owner->RemoveGameObject(obj,false);
+ owner->RemoveGameObject(obj, false);
}
obj->SetRespawnTime(0); // not save respawn time
@@ -381,7 +381,7 @@ public:
static bool HandleGameObjectTurnCommand(ChatHandler* handler, const char* args)
{
// number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameobject");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameobject");
if (!cId)
return false;
@@ -393,7 +393,7 @@ public:
// by DB guid
if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid))
- obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
+ obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, go_data->id);
if (!obj)
{
@@ -432,7 +432,7 @@ public:
static bool HandleGameObjectMoveCommand(ChatHandler* handler, const char* args)
{
// number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameobject");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameobject");
if (!cId)
return false;
@@ -444,7 +444,7 @@ public:
// by DB guid
if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid))
- obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
+ obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, go_data->id);
if (!obj)
{
@@ -473,9 +473,9 @@ public:
float y = (float)atof(py);
float z = (float)atof(pz);
- if (!MapManager::IsValidMapCoord(obj->GetMapId(),x,y,z))
+ if (!MapManager::IsValidMapCoord(obj->GetMapId(), x, y, z))
{
- handler->PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,obj->GetMapId());
+ handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, obj->GetMapId());
handler->SetSentErrorMessage(true);
return false;
}
@@ -497,7 +497,7 @@ public:
static bool HandleGameObjectSetPhaseCommand(ChatHandler* handler, const char* args)
{
// number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hgameobject");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hgameobject");
if (!cId)
return false;
@@ -509,7 +509,7 @@ public:
// by DB guid
if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid))
- obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
+ obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, go_data->id);
if (!obj)
{
@@ -527,7 +527,7 @@ public:
return false;
}
- obj->SetPhaseMask(phasemask,true);
+ obj->SetPhaseMask(phasemask, true);
obj->SaveToDB();
return true;
}
@@ -542,7 +542,7 @@ public:
"(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ "
"FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_",
pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),
- pl->GetMapId(),pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),distance*distance);
+ pl->GetMapId(), pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), distance*distance);
if (result)
{
@@ -567,7 +567,7 @@ public:
} while (result->NextRow());
}
- handler->PSendSysMessage(LANG_COMMAND_NEAROBJMESSAGE,distance,count);
+ handler->PSendSysMessage(LANG_COMMAND_NEAROBJMESSAGE, distance, count);
return true;
}
@@ -659,7 +659,7 @@ public:
gobj->SetByteValue(GAMEOBJECT_BYTES_1, type, state);
else if (type == 4)
{
- WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4);
+ WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4);
data << gobj->GetGUID();
data << (uint32)(state);
gobj->SendMessageToSet(&data, true);
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index 5b88e83371f..347a527bead 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -37,7 +37,7 @@ public:
static ChatCommand learnAllMyCommandTable[] =
{
{ "class", SEC_ADMINISTRATOR, false, &HandleLearnAllMyClassCommand, "", NULL },
- { "pettalents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyPetTalentsCommand,"", NULL },
+ { "pettalents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyPetTalentsCommand, "", NULL },
{ "spells", SEC_ADMINISTRATOR, false, &HandleLearnAllMySpellsCommand, "", NULL },
{ "talents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyTalentsCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
@@ -83,13 +83,13 @@ public:
if (!spell || !sSpellStore.LookupEntry(spell))
return false;
- char const* allStr = strtok(NULL," ");
+ char const* allStr = strtok(NULL, " ");
bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
- if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo,handler->GetSession()->GetPlayer()))
+ if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer()))
{
- handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spell);
+ handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
handler->SetSentErrorMessage(true);
return false;
}
@@ -99,7 +99,7 @@ public:
if (targetPlayer == handler->GetSession()->GetPlayer())
handler->SendSysMessage(LANG_YOU_KNOWN_SPELL);
else
- handler->PSendSysMessage(LANG_TARGET_KNOWN_SPELL,handler->GetNameLink(targetPlayer).c_str());
+ handler->PSendSysMessage(LANG_TARGET_KNOWN_SPELL, handler->GetNameLink(targetPlayer).c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -172,7 +172,7 @@ public:
continue;
// skip broken spells
- if (!SpellMgr::IsSpellValid(spellInfo,handler->GetSession()->GetPlayer(),false))
+ if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
handler->GetSession()->GetPlayer()->learnSpell(i, false);
@@ -215,7 +215,7 @@ public:
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
- if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo,handler->GetSession()->GetPlayer(),false))
+ if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
// learn highest rank of talent and learn all non-talent spell ranks (recursive by tree)
@@ -294,7 +294,7 @@ public:
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid);
- if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo,handler->GetSession()->GetPlayer(),false))
+ if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
// learn highest rank of talent and learn all non-talent spell ranks (recursive by tree)
@@ -320,13 +320,13 @@ public:
static bool HandleLearnAllDefaultCommand(ChatHandler* handler, const char* args)
{
Player* target;
- if (!handler->extractPlayerTarget((char*)args,&target))
+ if (!handler->extractPlayerTarget((char*)args, &target))
return false;
target->learnDefaultSpells();
target->learnQuestRewardedSpells();
- handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST,handler->GetNameLink(target).c_str());
+ handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST, handler->GetNameLink(target).c_str());
return true;
}
@@ -342,7 +342,7 @@ public:
if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) &&
skillInfo->canLink) // only prof. with recipes have
{
- HandleLearnSkillRecipesHelper(handler->GetSession()->GetPlayer(),skillInfo->id);
+ HandleLearnSkillRecipesHelper(handler->GetSession()->GetPlayer(), skillInfo->id);
}
}
@@ -367,7 +367,7 @@ public:
std::wstring wnamepart;
- if (!Utf8toWStr(args,wnamepart))
+ if (!Utf8toWStr(args, wnamepart))
return false;
// converting string that we try to find to lower case
@@ -419,14 +419,14 @@ public:
if (!targetSkillInfo)
return false;
- HandleLearnSkillRecipesHelper(target,targetSkillInfo->id);
+ HandleLearnSkillRecipesHelper(target, targetSkillInfo->id);
uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->id);
target->SetSkill(targetSkillInfo->id, target->GetSkillStep(targetSkillInfo->id), maxLevel, maxLevel);
handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str());
return true;
}
- static void HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id)
+ static void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id)
{
uint32 classmask = player->getClassMask();
@@ -453,7 +453,7 @@ public:
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
- if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo,player,false))
+ if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false))
continue;
player->learnSpell(skillLine->spellId, false);
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 60944575d68..697129f2135 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -139,7 +139,7 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_MANA_CHANGED, handler->GetNameLink().c_str(), mana, manam);
- target->SetMaxPower(POWER_MANA,manam);
+ target->SetMaxPower(POWER_MANA, manam);
target->SetPower(POWER_MANA, mana);
return true;
@@ -188,10 +188,10 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy/10, energym/10);
- target->SetMaxPower(POWER_ENERGY,energym);
+ target->SetMaxPower(POWER_ENERGY, energym);
target->SetPower(POWER_ENERGY, energy);
- sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY),target->GetMaxPower(POWER_ENERGY));
+ sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY));
return true;
}
@@ -239,7 +239,7 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage/10, ragem/10);
- target->SetMaxPower(POWER_RAGE,ragem);
+ target->SetMaxPower(POWER_RAGE, ragem);
target->SetPower(POWER_RAGE, rage);
return true;
@@ -273,7 +273,7 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune/10, runem/10);
- target->SetMaxPower(POWER_RUNIC_POWER,runem);
+ target->SetMaxPower(POWER_RUNIC_POWER, runem);
target->SetPower(POWER_RUNIC_POWER, rune);
return true;
@@ -285,7 +285,7 @@ public:
if (!*args)
return false;
- char* pfactionid = handler->extractKeyFromLink((char*)args,"Hfaction");
+ char* pfactionid = handler->extractKeyFromLink((char*)args, "Hfaction");
Creature* target = handler->getSelectedCreature();
if (!target)
@@ -303,7 +303,7 @@ public:
uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
- handler->PSendSysMessage(LANG_CURRENT_FACTION,target->GetGUIDLow(),factionid,flag,npcflag,dyflag);
+ handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUIDLow(), factionid, flag, npcflag, dyflag);
}
return true;
}
@@ -347,12 +347,12 @@ public:
return false;
}
- handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUIDLow(),factionid,flag,npcflag,dyflag);
+ handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUIDLow(), factionid, flag, npcflag, dyflag);
target->setFaction(factionid);
- target->SetUInt32Value(UNIT_FIELD_FLAGS,flag);
- target->SetUInt32Value(UNIT_NPC_FLAGS,npcflag);
- target->SetUInt32Value(UNIT_DYNAMIC_FLAGS,dyflag);
+ target->SetUInt32Value(UNIT_FIELD_FLAGS, flag);
+ target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
+ target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, dyflag);
return true;
}
@@ -488,7 +488,7 @@ public:
if (target->isInFlight())
{
- handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT,targetNameLink.c_str());
+ handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -497,11 +497,11 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, handler->GetNameLink().c_str(), ASpeed);
- target->SetSpeed(MOVE_WALK, ASpeed,true);
- target->SetSpeed(MOVE_RUN, ASpeed,true);
- target->SetSpeed(MOVE_SWIM, ASpeed,true);
- //target->SetSpeed(MOVE_TURN, ASpeed,true);
- target->SetSpeed(MOVE_FLIGHT, ASpeed,true);
+ target->SetSpeed(MOVE_WALK, ASpeed, true);
+ target->SetSpeed(MOVE_RUN, ASpeed, true);
+ target->SetSpeed(MOVE_SWIM, ASpeed, true);
+ //target->SetSpeed(MOVE_TURN, ASpeed, true);
+ target->SetSpeed(MOVE_FLIGHT, ASpeed, true);
return true;
}
@@ -536,7 +536,7 @@ public:
if (target->isInFlight())
{
- handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT,targetNameLink.c_str());
+ handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -545,7 +545,7 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, handler->GetNameLink().c_str(), Speed);
- target->SetSpeed(MOVE_RUN,Speed,true);
+ target->SetSpeed(MOVE_RUN, Speed, true);
return true;
}
@@ -581,7 +581,7 @@ public:
if (target->isInFlight())
{
- handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT,targetNameLink.c_str());
+ handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -590,7 +590,7 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, handler->GetNameLink().c_str(), Swim);
- target->SetSpeed(MOVE_SWIM,Swim,true);
+ target->SetSpeed(MOVE_SWIM, Swim, true);
return true;
}
@@ -626,7 +626,7 @@ public:
if (target->isInFlight())
{
- handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT,targetNameLink.c_str());
+ handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -635,7 +635,7 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, handler->GetNameLink().c_str(), BSpeed);
- target->SetSpeed(MOVE_RUN_BACK,BSpeed,true);
+ target->SetSpeed(MOVE_RUN_BACK, BSpeed, true);
return true;
}
@@ -671,7 +671,7 @@ public:
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, handler->GetNameLink().c_str(), FSpeed);
- target->SetSpeed(MOVE_FLIGHT,FSpeed,true);
+ target->SetSpeed(MOVE_FLIGHT, FSpeed, true);
return true;
}
@@ -1148,7 +1148,7 @@ public:
if (handler->HasLowerSecurity(target, 0))
return false;
- char* factionTxt = handler->extractKeyFromLink((char*)args,"Hfaction");
+ char* factionTxt = handler->extractKeyFromLink((char*)args, "Hfaction");
if (!factionTxt)
return false;
@@ -1164,7 +1164,7 @@ public:
{
std::string rankStr = rankTxt;
std::wstring wrankStr;
- if (!Utf8toWStr(rankStr,wrankStr))
+ if (!Utf8toWStr(rankStr, wrankStr))
return false;
wstrToLower(wrankStr);
@@ -1177,12 +1177,12 @@ public:
continue;
std::wstring wrank;
- if (!Utf8toWStr(rank,wrank))
+ if (!Utf8toWStr(rank, wrank))
continue;
wstrToLower(wrank);
- if (wrank.substr(0,wrankStr.size()) == wrankStr)
+ if (wrank.substr(0, wrankStr.size()) == wrankStr)
{
char *deltaTxt = strtok(NULL, " ");
if (deltaTxt)
@@ -1224,7 +1224,7 @@ public:
return false;
}
- target->GetReputationMgr().SetReputation(factionEntry,amount);
+ target->GetReputationMgr().SetReputation(factionEntry, amount);
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId,
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
return true;
@@ -1267,7 +1267,7 @@ public:
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
return false;
- target->SetPhaseMask(phasemask,true);
+ target->SetPhaseMask(phasemask, true);
return true;
}
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 1309bc959f5..6e1ea1a6be8 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -109,7 +109,7 @@ public:
{
if (!*args)
return false;
- char* charID = handler->extractKeyFromLink((char*)args,"Hcreature_entry");
+ char* charID = handler->extractKeyFromLink((char*)args, "Hcreature_entry");
if (!charID)
return false;
@@ -161,7 +161,7 @@ public:
if (!*args)
return false;
- char* pitem = handler->extractKeyFromLink((char*)args,"Hitem");
+ char* pitem = handler->extractKeyFromLink((char*)args, "Hitem");
if (!pitem)
{
handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND);
@@ -193,17 +193,17 @@ public:
uint32 vendor_entry = vendor ? vendor->GetEntry() : 0;
- if (!sObjectMgr->IsVendorItemValid(vendor_entry,itemId,maxcount,incrtime,extendedcost,handler->GetSession()->GetPlayer()))
+ if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, handler->GetSession()->GetPlayer()))
{
handler->SetSentErrorMessage(true);
return false;
}
- sObjectMgr->AddVendorItem(vendor_entry,itemId,maxcount,incrtime,extendedcost);
+ sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, extendedcost);
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
- handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST,itemId,itemTemplate->Name1.c_str(), maxcount,incrtime,extendedcost);
+ handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST, itemId, itemTemplate->Name1.c_str(), maxcount, incrtime, extendedcost);
return true;
}
@@ -222,7 +222,7 @@ public:
/* FIXME: impossible without entry
if (lowguid)
- pCreature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(),MAKE_GUID(lowguid,HIGHGUID_UNIT));
+ pCreature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(), MAKE_GUID(lowguid, HIGHGUID_UNIT));
*/
// attempt check creature existence by DB data
@@ -252,7 +252,7 @@ public:
//WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0);
// update movement type
- WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid);
+ WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, lowguid);
if (pCreature && pCreature->GetWaypointPath())
{
pCreature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
@@ -358,7 +358,7 @@ public:
if (*args)
{
// number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hcreature");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hcreature");
if (!cId)
return false;
@@ -403,7 +403,7 @@ public:
return false;
}
- char* pitem = handler->extractKeyFromLink((char*)args,"Hitem");
+ char* pitem = handler->extractKeyFromLink((char*)args, "Hitem");
if (!pitem)
{
handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND);
@@ -412,16 +412,16 @@ public:
}
uint32 itemId = atol(pitem);
- if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(),itemId))
+ if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId))
{
- handler->PSendSysMessage(LANG_ITEM_NOT_IN_LIST,itemId);
+ handler->PSendSysMessage(LANG_ITEM_NOT_IN_LIST, itemId);
handler->SetSentErrorMessage(true);
return false;
}
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
- handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST,itemId,itemTemplate->Name1.c_str());
+ handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST, itemId, itemTemplate->Name1.c_str());
return true;
}
@@ -533,19 +533,19 @@ public:
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
if (curRespawnDelay < 0)
curRespawnDelay = 0;
- std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay),true);
- std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(),true);
+ std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
+ std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true);
handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetDBTableGUIDLow(), target->GetGUIDLow(), faction, npcflags, Entry, displayid, nativeid);
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel());
- handler->PSendSysMessage(LANG_NPCINFO_HEALTH,target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth());
+ handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth());
handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->getFaction());
- handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(),curRespawnDelayStr.c_str());
- handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid,cInfo->pickpocketLootId,cInfo->SkinLootId);
+ handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str());
+ handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId);
handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId());
handler->PSendSysMessage(LANG_NPCINFO_PHASEMASK, target->GetPhaseMask());
handler->PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor());
- handler->PSendSysMessage(LANG_NPCINFO_POSITION,float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ()));
+ handler->PSendSysMessage(LANG_NPCINFO_POSITION, float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ()));
if ((npcflags & UNIT_NPC_FLAG_VENDOR))
{
@@ -569,7 +569,7 @@ public:
if (!pCreature)
{
// number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hcreature");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hcreature");
if (!cId)
return false;
@@ -577,7 +577,7 @@ public:
/* FIXME: impossible without entry
if (lowguid)
- pCreature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(),MAKE_GUID(lowguid,HIGHGUID_UNIT));
+ pCreature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(), MAKE_GUID(lowguid, HIGHGUID_UNIT));
*/
// Attempting creature load from DB data
@@ -624,7 +624,7 @@ public:
const_cast<CreatureData*>(data)->posZ = z;
const_cast<CreatureData*>(data)->orientation = o;
}
- pCreature->GetMap()->CreatureRelocation(pCreature,x, y, z,o);
+ pCreature->GetMap()->CreatureRelocation(pCreature, x, y, z, o);
pCreature->GetMotionMaster()->Initialize();
if (pCreature->isAlive()) // dead creature will reset movement generator at respawn
{
@@ -655,7 +655,7 @@ public:
if (target->GetGUIDTransport())
WorldDatabase.PQuery("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport());
- target->SetUInt32Value(UNIT_NPC_EMOTESTATE,emote);
+ target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote);
return true;
}
@@ -764,7 +764,7 @@ public:
/* impossible without entry
if (lowguid)
- pCreature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(),MAKE_GUID(lowguid,HIGHGUID_UNIT));
+ pCreature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(), MAKE_GUID(lowguid, HIGHGUID_UNIT));
*/
// attempt check creature existence by DB data
@@ -821,11 +821,11 @@ public:
}
if (doNotDelete == false)
{
- handler->PSendSysMessage(LANG_MOVE_TYPE_SET,type_str);
+ handler->PSendSysMessage(LANG_MOVE_TYPE_SET, type_str);
}
else
{
- handler->PSendSysMessage(LANG_MOVE_TYPE_SET_NODEL,type_str);
+ handler->PSendSysMessage(LANG_MOVE_TYPE_SET_NODEL, type_str);
}
return true;
@@ -854,7 +854,7 @@ public:
return false;
}
- pCreature->SetPhaseMask(phasemask,true);
+ pCreature->SetPhaseMask(phasemask, true);
if (!pCreature->isPet())
pCreature->SaveToDB();
@@ -896,8 +896,8 @@ public:
pCreature->Respawn();
}
- WorldDatabase.PExecute("UPDATE creature SET spawndist=%f, MovementType=%i WHERE guid=%u",option,mtype,u_guidlow);
- handler->PSendSysMessage(LANG_COMMAND_SPAWNDIST,option);
+ WorldDatabase.PExecute("UPDATE creature SET spawndist=%f, MovementType=%i WHERE guid=%u", option, mtype, u_guidlow);
+ handler->PSendSysMessage(LANG_COMMAND_SPAWNDIST, option);
return true;
}
@@ -929,9 +929,9 @@ public:
else
return false;
- WorldDatabase.PExecute("UPDATE creature SET spawntimesecs=%i WHERE guid=%u",i_stime,u_guidlow);
+ WorldDatabase.PExecute("UPDATE creature SET spawntimesecs=%i WHERE guid=%u", i_stime, u_guidlow);
pCreature->SetRespawnDelay((uint32)i_stime);
- handler->PSendSysMessage(LANG_COMMAND_SPAWNTIME,i_stime);
+ handler->PSendSysMessage(LANG_COMMAND_SPAWNTIME, i_stime);
return true;
}
@@ -1044,7 +1044,7 @@ public:
if (handler->HasLowerSecurity(sObjectMgr->GetPlayer(receiver_guid), 0))
return false;
- pCreature->MonsterWhisper(text,receiver_guid);
+ pCreature->MonsterWhisper(text, receiver_guid);
return true;
}
@@ -1114,7 +1114,7 @@ public:
if (!cInfo->isTameable (player->CanTameExoticPets()))
{
- handler->PSendSysMessage (LANG_CREATURE_NON_TAMEABLE,cInfo->Entry);
+ handler->PSendSysMessage (LANG_CREATURE_NON_TAMEABLE, cInfo->Entry);
handler->SetSentErrorMessage (true);
return false;
}
@@ -1123,15 +1123,15 @@ public:
Pet* pet = player->CreateTamedPetFrom (creatureTarget);
if (!pet)
{
- handler->PSendSysMessage (LANG_CREATURE_NON_TAMEABLE,cInfo->Entry);
+ handler->PSendSysMessage (LANG_CREATURE_NON_TAMEABLE, cInfo->Entry);
handler->SetSentErrorMessage (true);
return false;
}
// place pet before player
- float x,y,z;
- player->GetClosePoint (x,y,z,creatureTarget->GetObjectSize (),CONTACT_DISTANCE);
- pet->Relocate (x,y,z,M_PI-player->GetOrientation ());
+ float x, y, z;
+ player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize (), CONTACT_DISTANCE);
+ pet->Relocate (x, y, z, M_PI-player->GetOrientation ());
// set pet to defensive mode by default (some classes can't control controlled pets in fact).
pet->SetReactState(REACT_DEFENSIVE);
@@ -1218,14 +1218,14 @@ public:
group_member = new FormationInfo;
group_member->follow_angle = (pCreature->GetAngle(chr) - chr->GetOrientation()) * 180 / M_PI;
- group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - pCreature->GetPositionX(),int(2))+pow(chr->GetPositionY()-pCreature->GetPositionY(),int(2)));
+ group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - pCreature->GetPositionX(), int(2))+pow(chr->GetPositionY()-pCreature->GetPositionY(), int(2)));
group_member->leaderGUID = leaderGUID;
group_member->groupAI = 0;
CreatureGroupMap[lowguid] = group_member;
pCreature->SearchFormation();
- WorldDatabase.PExecute("INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES ('%u','%u','%f', '%f', '%u')",
+ WorldDatabase.PExecute("INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES ('%u', '%u', '%f', '%f', '%u')",
leaderGUID, lowguid, group_member->follow_dist, group_member->follow_angle, group_member->groupAI);
handler->PSendSysMessage("Creature %u added to formation with leader %u", lowguid, leaderGUID);
@@ -1319,17 +1319,17 @@ public:
added = true;
break;
default:
- handler->PSendSysMessage(LANG_ITEM_SLOT_NOT_EXIST,SlotID);
+ handler->PSendSysMessage(LANG_ITEM_SLOT_NOT_EXIST, SlotID);
added = false;
break;
}
if (added)
- handler->PSendSysMessage(LANG_ITEM_ADDED_TO_SLOT,ItemID,tmpItem->Name1,SlotID);
+ handler->PSendSysMessage(LANG_ITEM_ADDED_TO_SLOT, ItemID, tmpItem->Name1, SlotID);
}
else
{
- handler->PSendSysMessage(LANG_ITEM_NOT_FOUND,ItemID);
+ handler->PSendSysMessage(LANG_ITEM_NOT_FOUND, ItemID);
return true;
}
*/
@@ -1420,7 +1420,7 @@ public:
return true;
}
- uint32 idname = sObjectMgr->AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID));
+ uint32 idname = sObjectMgr->AddCreatureSubName(pCreature->GetName(), args, pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID));
pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
pCreature->SaveToDB();
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 9538221c3ba..381860e5f53 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -60,7 +60,7 @@ public:
// .addquest #entry'
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hquest");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
if (!cId)
return false;
@@ -70,7 +70,7 @@ public:
if (!pQuest)
{
- handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND,entry);
+ handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
handler->SetSentErrorMessage(true);
return false;
}
@@ -110,7 +110,7 @@ public:
// .removequest #entry'
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hquest");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
if (!cId)
return false;
@@ -131,7 +131,7 @@ public:
uint32 quest = player->GetQuestSlotQuestId(slot);
if (quest == entry)
{
- player->SetQuestSlot(slot,0);
+ player->SetQuestSlot(slot, 0);
// we ignore unequippable quest items in this case, its' still be equipped
player->TakeQuestSourceItem(quest, false);
@@ -157,7 +157,7 @@ public:
// .quest complete #entry
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
- char* cId = handler->extractKeyFromLink((char*)args,"Hquest");
+ char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
if (!cId)
return false;
@@ -181,14 +181,14 @@ public:
if (!id || !count)
continue;
- uint32 curItemCount = player->GetItemCount(id,true);
+ uint32 curItemCount = player->GetItemCount(id, true);
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, id, count-curItemCount);
if (msg == EQUIP_ERR_OK)
{
Item* item = player->StoreNewItem(dest, id, true);
- player->SendNewItem(item,count-curItemCount,true,false);
+ player->SendNewItem(item, count-curItemCount, true, false);
}
}
@@ -201,18 +201,18 @@ public:
if (uint32 spell_id = pQuest->ReqSpell[i])
{
for (uint16 z = 0; z < creaturecount; ++z)
- player->CastedCreatureOrGO(creature,0,spell_id);
+ player->CastedCreatureOrGO(creature, 0, spell_id);
}
else if (creature > 0)
{
if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature))
for (uint16 z = 0; z < creaturecount; ++z)
- player->KilledMonster(cInfo,0);
+ player->KilledMonster(cInfo, 0);
}
else if (creature < 0)
{
for (uint16 z = 0; z < creaturecount; ++z)
- player->CastedCreatureOrGO(creature,0,0);
+ player->CastedCreatureOrGO(creature, 0, 0);
}
}
@@ -223,7 +223,7 @@ public:
uint32 curRep = player->GetReputationMgr().GetReputation(repFaction);
if (curRep < repValue)
if (FactionEntry const *factionEntry = sFactionStore.LookupEntry(repFaction))
- player->GetReputationMgr().SetReputation(factionEntry,repValue);
+ player->GetReputationMgr().SetReputation(factionEntry, repValue);
}
// If the quest requires a SECOND reputation to complete
@@ -233,7 +233,7 @@ public:
uint32 curRep = player->GetReputationMgr().GetReputation(repFaction);
if (curRep < repValue2)
if (FactionEntry const *factionEntry = sFactionStore.LookupEntry(repFaction))
- player->GetReputationMgr().SetReputation(factionEntry,repValue2);
+ player->GetReputationMgr().SetReputation(factionEntry, repValue2);
}
// If the quest requires money
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 9fed2a2167a..44baf909a16 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -46,7 +46,7 @@ public:
{
static ChatCommand reloadAllCommandTable[] =
{
- { "achievement",SEC_ADMINISTRATOR, true, &HandleReloadAllAchievementCommand,"", NULL },
+ { "achievement", SEC_ADMINISTRATOR, true, &HandleReloadAllAchievementCommand, "", NULL },
{ "area", SEC_ADMINISTRATOR, true, &HandleReloadAllAreaCommand, "", NULL },
{ "eventai", SEC_ADMINISTRATOR, true, &HandleReloadAllEventAICommand, "", NULL },
{ "gossips", SEC_ADMINISTRATOR, true, &HandleReloadAllGossipsCommand, "", NULL },
@@ -78,7 +78,7 @@ public:
{ "creature_ai_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventAIScriptsCommand, "", NULL },
{ "creature_ai_summons", SEC_ADMINISTRATOR, true, &HandleReloadEventAISummonsCommand, "", NULL },
{ "creature_ai_texts", SEC_ADMINISTRATOR, true, &HandleReloadEventAITextsCommand, "", NULL },
- { "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "",NULL },
+ { "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "", NULL },
{ "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL },
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL },
{ "creature_onkill_reputation", SEC_ADMINISTRATOR, true, &HandleReloadOnKillReputationCommand, "", NULL },
@@ -116,11 +116,11 @@ public:
{ "mail_level_reward", SEC_ADMINISTRATOR, true, &HandleReloadMailLevelRewardCommand, "", NULL },
{ "mail_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMailCommand, "", NULL },
{ "milling_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMillingCommand, "", NULL },
- { "npc_spellclick_spells", SEC_ADMINISTRATOR, true, &HandleReloadSpellClickSpellsCommand, "",NULL},
+ { "npc_spellclick_spells", SEC_ADMINISTRATOR, true, &HandleReloadSpellClickSpellsCommand, "", NULL},
{ "npc_trainer", SEC_ADMINISTRATOR, true, &HandleReloadNpcTrainerCommand, "", NULL },
{ "npc_vendor", SEC_ADMINISTRATOR, true, &HandleReloadNpcVendorCommand, "", NULL },
{ "page_text", SEC_ADMINISTRATOR, true, &HandleReloadPageTextsCommand, "", NULL },
- { "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "",NULL},
+ { "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
{ "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL },
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL },
{ "quest_end_scripts", SEC_ADMINISTRATOR, true, &HandleReloadQuestEndScriptsCommand, "", NULL },
@@ -130,7 +130,7 @@ public:
{ "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL },
{ "reserved_name", SEC_ADMINISTRATOR, true, &HandleReloadReservedNameCommand, "", NULL },
{ "reputation_reward_rate", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "", NULL },
- { "reputation_spillover_template",SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "", NULL },
+ { "reputation_spillover_template", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "", NULL },
{ "skill_discovery_template", SEC_ADMINISTRATOR, true, &HandleReloadSkillDiscoveryTemplateCommand, "", NULL },
{ "skill_extra_item_template", SEC_ADMINISTRATOR, true, &HandleReloadSkillExtraItemTemplateCommand, "", NULL },
{ "skill_fishing_base_level", SEC_ADMINISTRATOR, true, &HandleReloadSkillFishingBaseLevelCommand, "", NULL },
@@ -172,46 +172,46 @@ public:
static bool HandleReloadAllCommand(ChatHandler* handler, const char* /*args*/)
{
- HandleReloadSkillFishingBaseLevelCommand(handler,"");
-
- HandleReloadAllAchievementCommand(handler,"");
- HandleReloadAllAreaCommand(handler,"");
- HandleReloadAllEventAICommand(handler,"");
- HandleReloadAllLootCommand(handler,"");
- HandleReloadAllNpcCommand(handler,"");
- HandleReloadAllQuestCommand(handler,"");
- HandleReloadAllSpellCommand(handler,"");
- HandleReloadAllItemCommand(handler,"");
- HandleReloadAllGossipsCommand(handler,"");
- HandleReloadAllLocalesCommand(handler,"");
-
- HandleReloadAccessRequirementCommand(handler,"");
- HandleReloadMailLevelRewardCommand(handler,"");
- HandleReloadCommandCommand(handler,"");
- HandleReloadReservedNameCommand(handler,"");
- HandleReloadTrinityStringCommand(handler,"");
- HandleReloadGameTeleCommand(handler,"");
+ HandleReloadSkillFishingBaseLevelCommand(handler, "");
+
+ HandleReloadAllAchievementCommand(handler, "");
+ HandleReloadAllAreaCommand(handler, "");
+ HandleReloadAllEventAICommand(handler, "");
+ HandleReloadAllLootCommand(handler, "");
+ HandleReloadAllNpcCommand(handler, "");
+ HandleReloadAllQuestCommand(handler, "");
+ HandleReloadAllSpellCommand(handler, "");
+ HandleReloadAllItemCommand(handler, "");
+ HandleReloadAllGossipsCommand(handler, "");
+ HandleReloadAllLocalesCommand(handler, "");
+
+ HandleReloadAccessRequirementCommand(handler, "");
+ HandleReloadMailLevelRewardCommand(handler, "");
+ HandleReloadCommandCommand(handler, "");
+ HandleReloadReservedNameCommand(handler, "");
+ HandleReloadTrinityStringCommand(handler, "");
+ HandleReloadGameTeleCommand(handler, "");
HandleReloadVehicleAccessoryCommand(handler, "");
HandleReloadVehicleTemplateAccessoryCommand(handler, "");
- HandleReloadAutobroadcastCommand(handler,"");
+ HandleReloadAutobroadcastCommand(handler, "");
return true;
}
static bool HandleReloadAllAchievementCommand(ChatHandler* handler, const char* /*args*/)
{
- HandleReloadAchievementCriteriaDataCommand(handler,"");
- HandleReloadAchievementRewardCommand(handler,"");
+ HandleReloadAchievementCriteriaDataCommand(handler, "");
+ HandleReloadAchievementRewardCommand(handler, "");
return true;
}
static bool HandleReloadAllAreaCommand(ChatHandler* handler, const char* /*args*/)
{
- //HandleReloadQuestAreaTriggersCommand(handler,""); -- reloaded in HandleReloadAllQuestCommand
- HandleReloadAreaTriggerTeleportCommand(handler,"");
- HandleReloadAreaTriggerTavernCommand(handler,"");
- HandleReloadGameGraveyardZoneCommand(handler,"");
+ //HandleReloadQuestAreaTriggersCommand(handler, ""); -- reloaded in HandleReloadAllQuestCommand
+ HandleReloadAreaTriggerTeleportCommand(handler, "");
+ HandleReloadAreaTriggerTavernCommand(handler, "");
+ HandleReloadGameGraveyardZoneCommand(handler, "");
return true;
}
@@ -227,18 +227,18 @@ public:
static bool HandleReloadAllNpcCommand(ChatHandler* handler, const char* args)
{
if(*args != 'a') // will be reloaded from all_gossips
- HandleReloadNpcTrainerCommand(handler,"a");
- HandleReloadNpcVendorCommand(handler,"a");
- HandleReloadPointsOfInterestCommand(handler,"a");
- HandleReloadSpellClickSpellsCommand(handler,"a");
+ HandleReloadNpcTrainerCommand(handler, "a");
+ HandleReloadNpcVendorCommand(handler, "a");
+ HandleReloadPointsOfInterestCommand(handler, "a");
+ HandleReloadSpellClickSpellsCommand(handler, "a");
return true;
}
static bool HandleReloadAllQuestCommand(ChatHandler* handler, const char* /*args*/)
{
- HandleReloadQuestAreaTriggersCommand(handler,"a");
- HandleReloadQuestPOICommand(handler,"a");
- HandleReloadQuestTemplateCommand(handler,"a");
+ HandleReloadQuestAreaTriggersCommand(handler, "a");
+ HandleReloadQuestPOICommand(handler, "a");
+ HandleReloadQuestTemplateCommand(handler, "a");
sLog->outString("Re-Loading Quests Relations...");
sObjectMgr->LoadQuestRelations();
@@ -256,72 +256,72 @@ public:
}
sLog->outString("Re-Loading Scripts...");
- HandleReloadGameObjectScriptsCommand(handler,"a");
- HandleReloadGossipScriptsCommand(handler,"a");
- HandleReloadEventScriptsCommand(handler,"a");
- HandleReloadQuestEndScriptsCommand(handler,"a");
- HandleReloadQuestStartScriptsCommand(handler,"a");
- HandleReloadSpellScriptsCommand(handler,"a");
+ HandleReloadGameObjectScriptsCommand(handler, "a");
+ HandleReloadGossipScriptsCommand(handler, "a");
+ HandleReloadEventScriptsCommand(handler, "a");
+ HandleReloadQuestEndScriptsCommand(handler, "a");
+ HandleReloadQuestStartScriptsCommand(handler, "a");
+ HandleReloadSpellScriptsCommand(handler, "a");
handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded.");
- HandleReloadDbScriptStringCommand(handler,"a");
- HandleReloadWpScriptsCommand(handler,"a");
+ HandleReloadDbScriptStringCommand(handler, "a");
+ HandleReloadWpScriptsCommand(handler, "a");
return true;
}
static bool HandleReloadAllEventAICommand(ChatHandler* handler, const char* /*args*/)
{
- HandleReloadEventAITextsCommand(handler,"a");
- HandleReloadEventAISummonsCommand(handler,"a");
- HandleReloadEventAIScriptsCommand(handler,"a");
+ HandleReloadEventAITextsCommand(handler, "a");
+ HandleReloadEventAISummonsCommand(handler, "a");
+ HandleReloadEventAIScriptsCommand(handler, "a");
return true;
}
static bool HandleReloadAllSpellCommand(ChatHandler* handler, const char* /*args*/)
{
- HandleReloadSkillDiscoveryTemplateCommand(handler,"a");
- HandleReloadSkillExtraItemTemplateCommand(handler,"a");
- HandleReloadSpellRequiredCommand(handler,"a");
- HandleReloadSpellAreaCommand(handler,"a");
- HandleReloadSpellGroupsCommand(handler,"a");
- HandleReloadSpellLearnSpellCommand(handler,"a");
- HandleReloadSpellLinkedSpellCommand(handler,"a");
- HandleReloadSpellProcEventCommand(handler,"a");
- HandleReloadSpellBonusesCommand(handler,"a");
- HandleReloadSpellTargetPositionCommand(handler,"a");
- HandleReloadSpellThreatsCommand(handler,"a");
- HandleReloadSpellGroupStackRulesCommand(handler,"a");
- HandleReloadSpellPetAurasCommand(handler,"a");
+ HandleReloadSkillDiscoveryTemplateCommand(handler, "a");
+ HandleReloadSkillExtraItemTemplateCommand(handler, "a");
+ HandleReloadSpellRequiredCommand(handler, "a");
+ HandleReloadSpellAreaCommand(handler, "a");
+ HandleReloadSpellGroupsCommand(handler, "a");
+ HandleReloadSpellLearnSpellCommand(handler, "a");
+ HandleReloadSpellLinkedSpellCommand(handler, "a");
+ HandleReloadSpellProcEventCommand(handler, "a");
+ HandleReloadSpellBonusesCommand(handler, "a");
+ HandleReloadSpellTargetPositionCommand(handler, "a");
+ HandleReloadSpellThreatsCommand(handler, "a");
+ HandleReloadSpellGroupStackRulesCommand(handler, "a");
+ HandleReloadSpellPetAurasCommand(handler, "a");
return true;
}
static bool HandleReloadAllGossipsCommand(ChatHandler* handler, const char* args)
{
- HandleReloadGossipMenuCommand(handler,"a");
- HandleReloadGossipMenuOptionCommand(handler,"a");
+ HandleReloadGossipMenuCommand(handler, "a");
+ HandleReloadGossipMenuOptionCommand(handler, "a");
if(*args != 'a') // already reload from all_scripts
- HandleReloadGossipScriptsCommand(handler,"a");
- HandleReloadPointsOfInterestCommand(handler,"a");
+ HandleReloadGossipScriptsCommand(handler, "a");
+ HandleReloadPointsOfInterestCommand(handler, "a");
return true;
}
static bool HandleReloadAllItemCommand(ChatHandler* handler, const char* /*args*/)
{
- HandleReloadPageTextsCommand(handler,"a");
- HandleReloadItemEnchantementsCommand(handler,"a");
+ HandleReloadPageTextsCommand(handler, "a");
+ HandleReloadItemEnchantementsCommand(handler, "a");
return true;
}
static bool HandleReloadAllLocalesCommand(ChatHandler* handler, const char* /*args*/)
{
- HandleReloadLocalesAchievementRewardCommand(handler,"a");
- HandleReloadLocalesCreatureCommand(handler,"a");
- HandleReloadLocalesGameobjectCommand(handler,"a");
- HandleReloadLocalesGossipMenuOptionCommand(handler,"a");
- HandleReloadLocalesItemCommand(handler,"a");
- HandleReloadLocalesNpcTextCommand(handler,"a");
- HandleReloadLocalesPageTextCommand(handler,"a");
- HandleReloadLocalesPointsOfInterestCommand(handler,"a");
- HandleReloadLocalesQuestCommand(handler,"a");
+ HandleReloadLocalesAchievementRewardCommand(handler, "a");
+ HandleReloadLocalesCreatureCommand(handler, "a");
+ HandleReloadLocalesGameobjectCommand(handler, "a");
+ HandleReloadLocalesGossipMenuOptionCommand(handler, "a");
+ HandleReloadLocalesItemCommand(handler, "a");
+ HandleReloadLocalesNpcTextCommand(handler, "a");
+ HandleReloadLocalesPageTextCommand(handler, "a");
+ HandleReloadLocalesPointsOfInterestCommand(handler, "a");
+ HandleReloadLocalesQuestCommand(handler, "a");
return true;
}
@@ -403,7 +403,7 @@ public:
return false;
uint32 entry = (uint32) atoi((char*)args);
- QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1,difficulty_entry_2,difficulty_entry_3,KillCredit1,KillCredit2,modelid1,modelid2,modelid3,modelid4,name,subname,IconName,gossip_menu_id,minlevel,maxlevel,exp,faction_A,faction_H,npcflag,speed_walk,speed_run,scale,rank,mindmg,maxdmg,dmgschool,attackpower,dmg_multiplier,baseattacktime,rangeattacktime,unit_class,unit_flags,dynamicflags,family,trainer_type,trainer_spell,trainer_class,trainer_race,minrangedmg,maxrangedmg,rangedattackpower,type,type_flags,lootid,pickpocketloot,skinloot,resistance1,resistance2,resistance3,resistance4,resistance5,resistance6,spell1,spell2,spell3,spell4,spell5,spell6,spell7,spell8,PetSpellDataId,VehicleId,mingold,maxgold,AIName,MovementType,InhabitType,Health_mod,Mana_mod,Armor_mod,RacialLeader,questItem1,questItem2,questItem3,questItem4,questItem5,questItem6,movementId,RegenHealth,equipment_id,mechanic_immune_mask,flags_extra,ScriptName FROM creature_template WHERE entry = %u", entry);
+ QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry);
if (!result)
{
handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry);
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index 8925ba0d250..eac6d29651b 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -115,14 +115,14 @@ public:
{
char* nameStr;
char* teleStr;
- handler->extractOptFirstArg((char*)args,&nameStr,&teleStr);
+ handler->extractOptFirstArg((char*)args, &nameStr, &teleStr);
if (!teleStr)
return false;
Player* target;
uint64 target_guid;
std::string target_name;
- if (!handler->extractPlayerTarget(nameStr,&target,&target_guid,&target_name))
+ if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
return false;
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
@@ -149,7 +149,7 @@ public:
return false;
}
- handler->PSendSysMessage(LANG_TELEPORTING_TO, chrNameLink.c_str(),"", tele->name.c_str());
+ handler->PSendSysMessage(LANG_TELEPORTING_TO, chrNameLink.c_str(), "", tele->name.c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_TELEPORTED_TO_BY, handler->GetNameLink().c_str());
@@ -163,7 +163,7 @@ public:
else
target->SaveRecallPosition();
- target->TeleportTo(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation);
+ target->TeleportTo(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation);
}
else
{
@@ -174,8 +174,8 @@ public:
std::string nameLink = handler->playerLink(target_name);
handler->PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), handler->GetTrinityString(LANG_OFFLINE), tele->name.c_str());
- Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,
- sMapMgr->GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid);
+ Player::SavePositionInDB(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation,
+ sMapMgr->GetZoneId(tele->mapId, tele->position_x, tele->position_y, tele->position_z), target_guid);
}
return true;
@@ -221,7 +221,7 @@ public:
Group *grp = player->GetGroup();
if (!grp)
{
- handler->PSendSysMessage(LANG_NOT_IN_GROUP,nameLink.c_str());
+ handler->PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
@@ -245,7 +245,7 @@ public:
continue;
}
- handler->PSendSysMessage(LANG_TELEPORTING_TO, plNameLink.c_str(),"", tele->name.c_str());
+ handler->PSendSysMessage(LANG_TELEPORTING_TO, plNameLink.c_str(), "", tele->name.c_str());
if (handler->needReportToTarget(pl))
(ChatHandler(pl)).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink.c_str());
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index 644023f9ac1..b96b656e7d8 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -57,7 +57,7 @@ public:
static bool HandleTitlesCurrentCommand(ChatHandler* handler, const char* args)
{
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
- char* id_p = handler->extractKeyFromLink((char*)args,"Htitle");
+ char* id_p = handler->extractKeyFromLink((char*)args, "Htitle");
if (!id_p)
return false;
@@ -92,7 +92,7 @@ public:
std::string tNameLink = handler->GetNameLink(target);
target->SetTitle(titleInfo); // to be sure that title now known
- target->SetUInt32Value(PLAYER_CHOSEN_TITLE,titleInfo->bit_index);
+ target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index);
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name[handler->GetSessionDbcLocale()], tNameLink.c_str());
@@ -102,7 +102,7 @@ public:
static bool HandleTitlesAddCommand(ChatHandler* handler, const char* args)
{
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
- char* id_p = handler->extractKeyFromLink((char*)args,"Htitle");
+ char* id_p = handler->extractKeyFromLink((char*)args, "Htitle");
if (!id_p)
return false;
@@ -138,7 +138,7 @@ public:
char const* targetName = target->GetName();
char titleNameStr[80];
- snprintf(titleNameStr,80,titleInfo->name[handler->GetSessionDbcLocale()],targetName);
+ snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName);
target->SetTitle(titleInfo);
handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str());
@@ -149,7 +149,7 @@ public:
static bool HandleTitlesRemoveCommand(ChatHandler* handler, const char* args)
{
// number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r
- char* id_p = handler->extractKeyFromLink((char*)args,"Htitle");
+ char* id_p = handler->extractKeyFromLink((char*)args, "Htitle");
if (!id_p)
return false;
@@ -181,19 +181,19 @@ public:
return false;
}
- target->SetTitle(titleInfo,true);
+ target->SetTitle(titleInfo, true);
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()], targetName);
handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str());
if (!target->HasTitle(target->GetInt32Value(PLAYER_CHOSEN_TITLE)))
{
- target->SetUInt32Value(PLAYER_CHOSEN_TITLE,0);
+ target->SetUInt32Value(PLAYER_CHOSEN_TITLE, 0);
handler->PSendSysMessage(LANG_CURRENT_TITLE_RESET, tNameLink.c_str());
}
@@ -235,8 +235,8 @@ public:
if (!target->HasTitle(target->GetInt32Value(PLAYER_CHOSEN_TITLE)))
{
- target->SetUInt32Value(PLAYER_CHOSEN_TITLE,0);
- handler->PSendSysMessage(LANG_CURRENT_TITLE_RESET,handler->GetNameLink(target).c_str());
+ target->SetUInt32Value(PLAYER_CHOSEN_TITLE, 0);
+ handler->PSendSysMessage(LANG_CURRENT_TITLE_RESET, handler->GetNameLink(target).c_str());
}
return true;
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index fcb15b4b6f3..12475f8d218 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -109,7 +109,7 @@ public:
return true;
}
- QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid);
+ QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'", pathid);
if (result)
point = (*result)[0].GetUInt32();
@@ -117,10 +117,10 @@ public:
Player* player = handler->GetSession()->GetPlayer();
//Map *map = player->GetMap();
- WorldDatabase.PExecute("INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES ('%u','%u','%f', '%f', '%f')",
+ WorldDatabase.PExecute("INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES ('%u', '%u', '%f', '%f', '%f')",
pathid, point+1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
- handler->PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point+1,"|r|cff00ff00 created. ");
+ handler->PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point+1, "|r|cff00ff00 created. ");
return true;
} // HandleWpAddCommand
@@ -166,19 +166,19 @@ public:
}
guidlow = target->GetDBTableGUIDLow();
- QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature_addon WHERE guid = '%u'",guidlow);
+ QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature_addon WHERE guid = '%u'", guidlow);
if (result)
WorldDatabase.PExecute("UPDATE creature_addon SET path_id = '%u' WHERE guid = '%u'", pathid, guidlow);
else
- WorldDatabase.PExecute("INSERT INTO creature_addon(guid,path_id) VALUES ('%u','%u')", guidlow, pathid);
+ WorldDatabase.PExecute("INSERT INTO creature_addon(guid, path_id) VALUES ('%u', '%u')", guidlow, pathid);
WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, guidlow);
target->LoadPath(pathid);
target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
target->GetMotionMaster()->Initialize();
- target->MonsterSay("Path loaded.",0,0);
+ target->MonsterSay("Path loaded.", 0, 0);
return true;
}
@@ -219,7 +219,7 @@ public:
target->SetDefaultMovementType(IDLE_MOTION_TYPE);
target->GetMotionMaster()->MoveTargetedHome();
target->GetMotionMaster()->Initialize();
- target->MonsterSay("Path unloaded.",0,0);
+ target->MonsterSay("Path unloaded.", 0, 0);
return true;
}
handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path.");
@@ -263,7 +263,7 @@ public:
QueryResult result = WorldDatabase.Query("SELECT MAX(guid) FROM waypoint_scripts");
id = result->Fetch()->GetUInt32();
WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id+1);
- handler->PSendSysMessage("%s%s%u|r", "|cff00ff00","Wp Event: New waypoint event added: |r|cff00ffff", id+1);
+ handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: |r|cff00ffff", id+1);
}
return true;
@@ -273,7 +273,7 @@ public:
{
if (!arg_id)
{
- handler->PSendSysMessage("%s%s|r", "|cff33ffff","Wp Event: You must provide waypoint script id.");
+ handler->PSendSysMessage("%s%s|r", "|cff33ffff", "Wp Event: You must provide waypoint script id.");
return true;
}
@@ -321,7 +321,7 @@ public:
if (result)
{
WorldDatabase.PExecute("DELETE FROM waypoint_scripts WHERE guid = %u", id);
- handler->PSendSysMessage("%s%s%u|r","|cff00ff00","Wp Event: Waypoint script removed: ", id);
+ handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: Waypoint script removed: ", id);
}
else
handler->PSendSysMessage("|cffff33ffWp Event: ERROR: you have selected a non existing script: %u|r", id);
@@ -345,7 +345,7 @@ public:
return true;
}
- char* arg_2 = strtok(NULL," ");
+ char* arg_2 = strtok(NULL, " ");
if (!arg_2)
{
@@ -365,7 +365,7 @@ public:
char* arg_3;
std::string arg_str_2 = arg_2;
- arg_3 = strtok(NULL," ");
+ arg_3 = strtok(NULL, " ");
if (!arg_3)
{
@@ -378,13 +378,13 @@ public:
if (arg_str_2 == "setid")
{
uint32 newid = atoi(arg_3);
- handler->PSendSysMessage("%s%s|r|cff00ffff%u|r|cff00ff00%s|r|cff00ffff%u|r","|cff00ff00","Wp Event: Wypoint scipt guid: ", newid," id changed: ", id);
+ handler->PSendSysMessage("%s%s|r|cff00ffff%u|r|cff00ff00%s|r|cff00ffff%u|r", "|cff00ff00", "Wp Event: Wypoint scipt guid: ", newid, " id changed: ", id);
WorldDatabase.PExecute("UPDATE waypoint_scripts SET id='%u' WHERE guid='%u'",
newid, id); return true;
}
else
{
- QueryResult result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'",id);
+ QueryResult result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'", id);
if (!result)
{
@@ -439,7 +439,7 @@ public:
arg_2, arg_str_3.c_str(), id);
}
}
- handler->PSendSysMessage("%s%s|r|cff00ffff%u:|r|cff00ff00 %s %s|r","|cff00ff00","Waypoint script:", id, arg_2,"updated.");
+ handler->PSendSysMessage("%s%s|r|cff00ffff%u:|r|cff00ff00 %s %s|r", "|cff00ff00", "Waypoint script:", id, arg_2, "updated.");
}
return true;
}
@@ -599,7 +599,7 @@ public:
//sMapMgr->GetMap(npcCreature->GetMapId())->Add(wpCreature2);
}
- WorldDatabase.PExecute("UPDATE waypoint_data SET position_x = '%f',position_y = '%f',position_z = '%f' where id = '%u' AND point='%u'",
+ WorldDatabase.PExecute("UPDATE waypoint_data SET position_x = '%f', position_y = '%f', position_z = '%f' where id = '%u' AND point='%u'",
chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), pathid, point);
handler->PSendSysMessage(LANG_WAYPOINT_CHANGED);
@@ -719,7 +719,7 @@ public:
if (show == "on")
{
- QueryResult result = WorldDatabase.PQuery("SELECT point, position_x,position_y,position_z FROM waypoint_data WHERE id = '%u'", pathid);
+ QueryResult result = WorldDatabase.PQuery("SELECT point, position_x, position_y, position_z FROM waypoint_data WHERE id = '%u'", pathid);
if (!result)
{
@@ -740,7 +740,7 @@ public:
{
Field *fields = result2->Fetch();
uint32 wpguid = fields[0].GetUInt32();
- Creature* pCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpguid,VISUAL_WAYPOINT,HIGHGUID_UNIT));
+ Creature* pCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpguid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
if (!pCreature)
{
@@ -793,7 +793,7 @@ public:
wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
- wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(),map);
+ wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(), map);
map->Add(wpCreature);
if (target)
@@ -813,7 +813,7 @@ public:
{
handler->PSendSysMessage("|cff00ff00DEBUG: wp first, GUID: %u|r", pathid);
- QueryResult result = WorldDatabase.PQuery("SELECT position_x,position_y,position_z FROM waypoint_data WHERE point='1' AND id = '%u'",pathid);
+ QueryResult result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z FROM waypoint_data WHERE point='1' AND id = '%u'", pathid);
if (!result)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUND, pathid);
@@ -832,7 +832,7 @@ public:
Map *map = chr->GetMap();
Creature* pCreature = new Creature;
- if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
+ if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete pCreature;
@@ -856,13 +856,13 @@ public:
{
handler->PSendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff%u|r", pathid);
- QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid);
+ QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'", pathid);
if (result)
Maxpoint = (*result)[0].GetUInt32();
else
Maxpoint = 0;
- result = WorldDatabase.PQuery("SELECT position_x,position_y,position_z FROM waypoint_data WHERE point ='%u' AND id = '%u'",Maxpoint, pathid);
+ result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z FROM waypoint_data WHERE point ='%u' AND id = '%u'", Maxpoint, pathid);
if (!result)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDLAST, pathid);
@@ -914,7 +914,7 @@ public:
{
Field *fields = result->Fetch();
uint32 guid = fields[0].GetUInt32();
- Creature* pCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(guid,VISUAL_WAYPOINT,HIGHGUID_UNIT));
+ Creature* pCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(guid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
if (!pCreature)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid);