mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 06:36:24 +00:00
refactor(Core/Scripts): restyle scripts lib with astyle (#3467)
This commit is contained in:
@@ -100,35 +100,35 @@ public:
|
||||
AccountOpResult result = AccountMgr::CreateAccount(std::string(accountName), std::string(password));
|
||||
switch (result)
|
||||
{
|
||||
case AOR_OK:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
|
||||
if (handler->GetSession())
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.",
|
||||
handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(),
|
||||
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow());
|
||||
}
|
||||
break;
|
||||
case AOR_NAME_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_PASS_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_NAME_ALREDY_EXIST:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_ALREADY_EXIST);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_DB_INTERNAL_ERROR:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED_SQL_ERROR, accountName);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED, accountName);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_OK:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
|
||||
if (handler->GetSession())
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.",
|
||||
handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(),
|
||||
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow());
|
||||
}
|
||||
break;
|
||||
case AOR_NAME_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_PASS_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_NAME_ALREDY_EXIST:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_ALREADY_EXIST);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_DB_INTERNAL_ERROR:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED_SQL_ERROR, accountName);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED, accountName);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -171,21 +171,21 @@ public:
|
||||
AccountOpResult result = AccountMgr::DeleteAccount(accountId);
|
||||
switch (result)
|
||||
{
|
||||
case AOR_OK:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName.c_str());
|
||||
break;
|
||||
case AOR_NAME_NOT_EXIST:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_DB_INTERNAL_ERROR:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_OK:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName.c_str());
|
||||
break;
|
||||
case AOR_NAME_NOT_EXIST:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_DB_INTERNAL_ERROR:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -227,9 +227,9 @@ 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].GetUInt8(),
|
||||
fieldsLogin[2].GetUInt8());
|
||||
fieldsLogin[0].GetCString(), name.c_str(), fieldsLogin[1].GetCString(),
|
||||
fieldsDB[2].GetUInt16(), fieldsDB[3].GetUInt16(), fieldsLogin[3].GetUInt8(),
|
||||
fieldsLogin[2].GetUInt8());
|
||||
}
|
||||
else
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str());
|
||||
@@ -367,19 +367,19 @@ public:
|
||||
AccountOpResult result = AccountMgr::ChangePassword(handler->GetSession()->GetAccountId(), std::string(newPassword));
|
||||
switch (result)
|
||||
{
|
||||
case AOR_OK:
|
||||
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
sScriptMgr->OnPasswordChange(handler->GetSession()->GetAccountId());
|
||||
break;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
sScriptMgr->OnFailedPasswordChange(handler->GetSession()->GetAccountId());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_OK:
|
||||
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
sScriptMgr->OnPasswordChange(handler->GetSession()->GetAccountId());
|
||||
break;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
sScriptMgr->OnFailedPasswordChange(handler->GetSession()->GetAccountId());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
// Let set addon state only for lesser (strong) security level
|
||||
// or to self account
|
||||
if (handler->GetSession() && handler->GetSession()->GetAccountId() != accountId &&
|
||||
handler->HasLowerSecurityAccount(nullptr, accountId, true))
|
||||
handler->HasLowerSecurityAccount(nullptr, accountId, true))
|
||||
return false;
|
||||
|
||||
int expansion = atoi(exp); //get int anyway (0 if error)
|
||||
@@ -628,21 +628,21 @@ public:
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case AOR_OK:
|
||||
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
break;
|
||||
case AOR_NAME_NOT_EXIST:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_OK:
|
||||
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
break;
|
||||
case AOR_NAME_NOT_EXIST:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
if (!*_args)
|
||||
return false;
|
||||
|
||||
char* args = (char *)_args;
|
||||
char* args = (char*)_args;
|
||||
|
||||
char const* oldArenaStr = handler->extractQuotedArg(args);
|
||||
if (!oldArenaStr)
|
||||
@@ -311,7 +311,7 @@ public:
|
||||
found = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
|
||||
@@ -109,26 +109,26 @@ public:
|
||||
|
||||
switch (sBan->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : ""))
|
||||
{
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(durationStr) > 0)
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr);
|
||||
}
|
||||
break;
|
||||
case BAN_NOTFOUND:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_BAN_NOTFOUND, "character", name.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(durationStr) > 0)
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr);
|
||||
}
|
||||
break;
|
||||
case BAN_NOTFOUND:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_BAN_NOTFOUND, "character", name.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -191,16 +191,16 @@ public:
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case BAN_ACCOUNT:
|
||||
banReturn = sBan->BanAccount(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
banReturn = sBan->BanAccountByPlayerName(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_IP:
|
||||
default:
|
||||
banReturn = sBan->BanIP(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_ACCOUNT:
|
||||
banReturn = sBan->BanAccount(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
banReturn = sBan->BanAccountByPlayerName(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_IP:
|
||||
default:
|
||||
banReturn = sBan->BanIP(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (banReturn)
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(durationStr) > 0)
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
|
||||
}
|
||||
else
|
||||
@@ -292,9 +292,8 @@ public:
|
||||
bool permanent = (fields[1].GetUInt64() == uint64(0));
|
||||
std::string banTime = permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
|
||||
fields[0].GetCString(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
}
|
||||
while (result->NextRow());
|
||||
fields[0].GetCString(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
} while (result->NextRow());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -340,9 +339,8 @@ public:
|
||||
bool permanent = (fields[1].GetUInt32() == uint32(0));
|
||||
std::string banTime = permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
|
||||
fields[0].GetCString(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
}
|
||||
while (result->NextRow());
|
||||
fields[0].GetCString(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
} while (result->NextRow());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -372,8 +370,8 @@ public:
|
||||
Field* fields = result->Fetch();
|
||||
bool permanent = !fields[6].GetUInt64();
|
||||
handler->PSendSysMessage(LANG_BANINFO_IPENTRY,
|
||||
fields[0].GetCString(), fields[1].GetCString(), permanent ? handler->GetAcoreString(LANG_BANINFO_NEVER) : fields[2].GetCString(),
|
||||
permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetCString(), fields[5].GetCString());
|
||||
fields[0].GetCString(), fields[1].GetCString(), permanent ? handler->GetAcoreString(LANG_BANINFO_NEVER) : fields[2].GetCString(),
|
||||
permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetCString(), fields[5].GetCString());
|
||||
|
||||
|
||||
return true;
|
||||
@@ -428,8 +426,7 @@ public:
|
||||
Field* fields2 = banResult->Fetch();
|
||||
handler->PSendSysMessage("%s", fields2[0].GetCString());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
// Console wide output
|
||||
else
|
||||
@@ -466,8 +463,8 @@ public:
|
||||
if (fields2[0].GetUInt32() == fields2[1].GetUInt32())
|
||||
{
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
|
||||
accountName.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
fields2[2].GetCString(), fields2[3].GetCString());
|
||||
accountName.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
fields2[2].GetCString(), fields2[3].GetCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -475,15 +472,13 @@ public:
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
accountName.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year%100, tmUnban.tm_mon+1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
fields2[2].GetCString(), fields2[3].GetCString());
|
||||
accountName.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
fields2[2].GetCString(), fields2[3].GetCString());
|
||||
}
|
||||
}
|
||||
while (banInfo->NextRow());
|
||||
} while (banInfo->NextRow());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
handler->SendSysMessage(" ===============================================================================");
|
||||
}
|
||||
@@ -523,8 +518,7 @@ public:
|
||||
PreparedQueryResult banResult = CharacterDatabase.Query(stmt2);
|
||||
if (banResult)
|
||||
handler->PSendSysMessage("%s", (*banResult)[0].GetCString());
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
// Console wide output
|
||||
else
|
||||
@@ -555,8 +549,8 @@ public:
|
||||
if (banFields[0].GetUInt32() == banFields[1].GetUInt32())
|
||||
{
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
|
||||
char_name.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
banFields[2].GetCString(), banFields[3].GetCString());
|
||||
char_name.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
banFields[2].GetCString(), banFields[3].GetCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -564,15 +558,13 @@ public:
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
char_name.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year%100, tmUnban.tm_mon+1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
banFields[2].GetCString(), banFields[3].GetCString());
|
||||
char_name.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
banFields[2].GetCString(), banFields[3].GetCString());
|
||||
}
|
||||
}
|
||||
while (banInfo->NextRow());
|
||||
} while (banInfo->NextRow());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
handler->SendSysMessage(" =============================================================================== ");
|
||||
}
|
||||
|
||||
@@ -616,8 +608,7 @@ public:
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
handler->PSendSysMessage("%s", fields[0].GetCString());
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
// Console wide output
|
||||
else
|
||||
@@ -635,8 +626,8 @@ public:
|
||||
if (fields[1].GetUInt32() == fields[2].GetUInt32())
|
||||
{
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
|
||||
fields[0].GetCString(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
fields[3].GetCString(), fields[4].GetCString());
|
||||
fields[0].GetCString(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
fields[3].GetCString(), fields[4].GetCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -644,12 +635,11 @@ public:
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
fields[0].GetCString(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year%100, tmUnban.tm_mon+1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
fields[3].GetCString(), fields[4].GetCString());
|
||||
fields[0].GetCString(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
fields[3].GetCString(), fields[4].GetCString());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
handler->SendSysMessage(" ===============================================================================");
|
||||
}
|
||||
@@ -737,26 +727,26 @@ public:
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case BAN_ACCOUNT:
|
||||
if (sBan->RemoveBanAccount(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
if (sBan->RemoveBanAccountByPlayerName(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_IP:
|
||||
if (sBan->RemoveBanIP(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case BAN_ACCOUNT:
|
||||
if (sBan->RemoveBanAccount(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
if (sBan->RemoveBanAccountByPlayerName(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_IP:
|
||||
if (sBan->RemoveBanIP(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
std::vector<ChatCommand> GetCommands() const override
|
||||
{
|
||||
static std::vector<ChatCommand> castCommandTable =
|
||||
{
|
||||
{
|
||||
{ "back", SEC_GAMEMASTER, false, &HandleCastBackCommand, "" },
|
||||
{ "dist", SEC_GAMEMASTER, false, &HandleCastDistCommand, "" },
|
||||
{ "self", SEC_GAMEMASTER, false, &HandleCastSelfCommand, "" },
|
||||
|
||||
@@ -136,8 +136,7 @@ public:
|
||||
AccountMgr::GetName(info.accountId, info.accountName);
|
||||
info.deleteDate = time_t(fields[3].GetUInt32());
|
||||
foundList.push_back(info);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -168,12 +167,12 @@ public:
|
||||
|
||||
if (!handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE,
|
||||
itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
|
||||
itr->accountId, dateStr.c_str());
|
||||
itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
|
||||
itr->accountId, dateStr.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT,
|
||||
itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
|
||||
itr->accountId, dateStr.c_str());
|
||||
itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
|
||||
itr->accountId, dateStr.c_str());
|
||||
}
|
||||
|
||||
if (!handler->GetSession())
|
||||
@@ -284,8 +283,8 @@ public:
|
||||
continue;
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
|
||||
? handler->GetAcoreString(LANG_ACTIVE)
|
||||
: "";
|
||||
? handler->GetAcoreString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr, 80, name.c_str(), targetName);
|
||||
@@ -885,10 +884,11 @@ public:
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT guid FROM characters");
|
||||
if (!result)
|
||||
return true;
|
||||
do{
|
||||
do
|
||||
{
|
||||
uint64 _guid = result->Fetch()[0].GetUInt64();
|
||||
char buff[20];
|
||||
sprintf(buff,"%u", (uint32)_guid);
|
||||
sprintf(buff, "%u", (uint32)_guid);
|
||||
switch(PlayerDumpWriter().WriteDump(buff, uint32(_guid)))
|
||||
{
|
||||
case DUMP_SUCCESS:
|
||||
@@ -907,7 +907,7 @@ public:
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}while(result->NextRow());
|
||||
} while(result->NextRow());
|
||||
}
|
||||
|
||||
if (!fileStr || !playerStr)
|
||||
@@ -985,11 +985,21 @@ public:
|
||||
|
||||
switch (BagSlot)
|
||||
{
|
||||
case 2: BagSlot = 19; break;
|
||||
case 3: BagSlot = 20; break;
|
||||
case 4: BagSlot = 21; break;
|
||||
case 5: BagSlot = 22; break;
|
||||
default: BagSlot = 1; break;
|
||||
case 2:
|
||||
BagSlot = 19;
|
||||
break;
|
||||
case 3:
|
||||
BagSlot = 20;
|
||||
break;
|
||||
case 4:
|
||||
BagSlot = 21;
|
||||
break;
|
||||
case 5:
|
||||
BagSlot = 22;
|
||||
break;
|
||||
default:
|
||||
BagSlot = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage("--------------------------------------");
|
||||
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
char const* name = "test";
|
||||
uint8 code = atoi(args);
|
||||
|
||||
WorldPacket data(SMSG_CHANNEL_NOTIFY, (1+10));
|
||||
WorldPacket data(SMSG_CHANNEL_NOTIFY, (1 + 10));
|
||||
data << code; // notify type
|
||||
data << name; // channel name
|
||||
data << uint32(0);
|
||||
@@ -787,7 +787,7 @@ public:
|
||||
if (!target || target->IsTotem() || target->IsPet())
|
||||
return false;
|
||||
|
||||
ThreatContainer::StorageType const &threatList = target->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatList = target->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator itr;
|
||||
uint32 count = 0;
|
||||
handler->PSendSysMessage("Threat list of %s (guid %u)", target->GetName().c_str(), target->GetGUIDLow());
|
||||
@@ -801,7 +801,7 @@ public:
|
||||
}
|
||||
handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", ++count, unit->GetName().c_str(), unit->GetGUIDLow(), (*itr)->getThreat());
|
||||
}
|
||||
ThreatContainer::StorageType const &threatList2 = target->getThreatManager().getOfflineThreatList();
|
||||
ThreatContainer::StorageType const& threatList2 = target->getThreatManager().getOfflineThreatList();
|
||||
for (itr = threatList2.begin(); itr != threatList2.end(); ++itr)
|
||||
{
|
||||
Unit* unit = (*itr)->getTarget();
|
||||
@@ -1128,13 +1128,13 @@ public:
|
||||
if (isInt32)
|
||||
{
|
||||
uint32 value = (uint32)atoi(y);
|
||||
target->SetUInt32Value(opcode , value);
|
||||
target->SetUInt32Value(opcode, value);
|
||||
handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), opcode, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
float value = (float)atof(y);
|
||||
target->SetFloatValue(opcode , value);
|
||||
target->SetFloatValue(opcode, value);
|
||||
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), opcode, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
enum Spells
|
||||
enum Spells
|
||||
{
|
||||
LFG_SPELL_DUNGEON_DESERTER = 71041,
|
||||
BG_SPELL_DESERTER = 26013
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* targetPlayer = handler->getSelectedPlayer();
|
||||
Player* targetPlayer = handler->getSelectedPlayer();
|
||||
if (!targetPlayer)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -71,24 +71,24 @@ public:
|
||||
}
|
||||
uint32 time = atoi(timeStr);
|
||||
|
||||
if (!time)
|
||||
{
|
||||
if (!time)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Aura* aura = targetPlayer->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, targetPlayer);
|
||||
Aura* aura = targetPlayer->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, targetPlayer);
|
||||
|
||||
if (!aura)
|
||||
{
|
||||
if (!aura)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
aura->SetDuration(time * IN_MILLISECONDS);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDeserterRemove(ChatHandler* handler, char const* /*args*/, bool isInstance)
|
||||
@@ -101,9 +101,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
targetPlayer->RemoveAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER);
|
||||
targetPlayer->RemoveAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDeserterInstanceAdd(ChatHandler* handler, char const* args)
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_deserter_commandscript()
|
||||
void AddSC_deserter_commandscript()
|
||||
{
|
||||
new deserter_commandscript();
|
||||
}
|
||||
|
||||
@@ -79,71 +79,71 @@ public:
|
||||
switch (disableType)
|
||||
{
|
||||
case DISABLE_TYPE_SPELL:
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "spell";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "spell";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_QUEST:
|
||||
{
|
||||
if (!sObjectMgr->GetQuestTemplate(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sObjectMgr->GetQuestTemplate(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "quest";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "quest";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_MAP:
|
||||
{
|
||||
if (!sMapStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sMapStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "map";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "map";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_BATTLEGROUND:
|
||||
{
|
||||
if (!sBattlemasterListStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NO_BATTLEGROUND_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sBattlemasterListStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NO_BATTLEGROUND_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "battleground";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "battleground";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_OUTDOORPVP:
|
||||
{
|
||||
if (entry > MAX_OUTDOORPVP_TYPES)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NO_OUTDOOR_PVP_FORUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (entry > MAX_OUTDOORPVP_TYPES)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NO_OUTDOOR_PVP_FORUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "outdoorpvp";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "outdoorpvp";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_VMAP:
|
||||
{
|
||||
if (!sMapStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sMapStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "vmap";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "vmap";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -111,8 +111,8 @@ public:
|
||||
std::string lengthStr = secsToTimeString(eventData.length * MINUTE, true);
|
||||
|
||||
handler->PSendSysMessage(LANG_EVENT_INFO, eventId, eventData.description.c_str(), activeStr,
|
||||
startTimeStr.c_str(), endTimeStr.c_str(), occurenceStr.c_str(), lengthStr.c_str(),
|
||||
nextStr.c_str());
|
||||
startTimeStr.c_str(), endTimeStr.c_str(), occurenceStr.c_str(), lengthStr.c_str(),
|
||||
nextStr.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
{
|
||||
AccountTypes itrSec = itr->second->GetSession()->GetSecurity();
|
||||
if ((itr->second->IsGameMaster() || (!AccountMgr::IsPlayerAccount(itrSec) && itrSec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
|
||||
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
|
||||
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
}
|
||||
|
||||
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->SetSentErrorMessage(true);
|
||||
|
||||
@@ -195,8 +195,8 @@ public:
|
||||
float z = player->GetPositionZ();
|
||||
float ang = player->GetOrientation();
|
||||
|
||||
float rot2 = sin(ang/2);
|
||||
float rot3 = cos(ang/2);
|
||||
float rot2 = sin(ang / 2);
|
||||
float rot3 = cos(ang / 2);
|
||||
|
||||
uint32 objectId = atoi(id);
|
||||
|
||||
@@ -222,15 +222,15 @@ public:
|
||||
|
||||
if (objectId)
|
||||
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",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), objectId);
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), objectId);
|
||||
else
|
||||
{
|
||||
std::string name = id;
|
||||
WorldDatabase.EscapeString(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",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str());
|
||||
"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",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -256,10 +256,10 @@ public:
|
||||
eventFilter << ')';
|
||||
|
||||
result = WorldDatabase.PQuery("SELECT gameobject.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 "
|
||||
"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());
|
||||
"(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());
|
||||
}
|
||||
|
||||
if (!result)
|
||||
@@ -685,7 +685,7 @@ public:
|
||||
object->SetByteValue(GAMEOBJECT_BYTES_1, objectType, objectState);
|
||||
else if (objectType == 4)
|
||||
{
|
||||
WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4);
|
||||
WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8 + 4);
|
||||
data << object->GetGUID();
|
||||
data << (uint32)(objectState);
|
||||
object->SendMessageToSet(&data, true);
|
||||
|
||||
@@ -136,7 +136,10 @@ public:
|
||||
uint32 dungeon = 0, battleground = 0, arena = 0, spectators = 0;
|
||||
sMapMgr->GetNumInstances(dungeon, battleground, arena);
|
||||
handler->PSendSysMessage("instances loaded: dungeons (%d), battlegrounds (%d), arenas (%d)", dungeon, battleground, arena);
|
||||
dungeon = 0; battleground = 0; arena = 0; spectators = 0;
|
||||
dungeon = 0;
|
||||
battleground = 0;
|
||||
arena = 0;
|
||||
spectators = 0;
|
||||
sMapMgr->GetNumPlayersInInstances(dungeon, battleground, arena, spectators);
|
||||
handler->PSendSysMessage("players in instances: dungeons (%d), battlegrounds (%d), arenas (%d + %d spect)", dungeon, battleground, arena, spectators);
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
// search highest talent rank
|
||||
uint32 spellId = 0;
|
||||
|
||||
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
|
||||
for (int8 rank = MAX_TALENT_RANK - 1; rank >= 0; --rank)
|
||||
{
|
||||
if (talentInfo->RankID[rank] != 0)
|
||||
{
|
||||
@@ -306,7 +306,7 @@ public:
|
||||
continue;
|
||||
|
||||
if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) &&
|
||||
skillInfo->canLink) // only prof. with recipes have
|
||||
skillInfo->canLink) // only prof. with recipes have
|
||||
{
|
||||
HandleLearnSkillRecipesHelper(handler->GetSession()->GetPlayer(), skillInfo->id);
|
||||
}
|
||||
@@ -349,8 +349,8 @@ public:
|
||||
continue;
|
||||
|
||||
if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION &&
|
||||
skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) ||
|
||||
!skillInfo->canLink) // only prof with recipes have set
|
||||
skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) ||
|
||||
!skillInfo->canLink) // only prof with recipes have set
|
||||
continue;
|
||||
|
||||
int locale = handler->GetSessionDbcLocale();
|
||||
|
||||
@@ -21,8 +21,8 @@ void GetPlayerInfo(ChatHandler* handler, Player* player)
|
||||
|
||||
std::string const& state = lfg::GetStateString(sLFGMgr->GetState(guid));
|
||||
handler->PSendSysMessage(LANG_LFG_PLAYER_INFO, player->GetName().c_str(),
|
||||
state.c_str(), uint8(dungeons.size()), lfg::ConcatenateDungeons(dungeons).c_str(),
|
||||
lfg::GetRolesString(sLFGMgr->GetRoles(guid)).c_str(), sLFGMgr->GetComment(guid).c_str());
|
||||
state.c_str(), uint8(dungeons.size()), lfg::ConcatenateDungeons(dungeons).c_str(),
|
||||
lfg::GetRolesString(sLFGMgr->GetRoles(guid)).c_str(), sLFGMgr->GetComment(guid).c_str());
|
||||
}
|
||||
|
||||
class lfg_commandscript : public CommandScript
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
uint64 guid = grp->GetGUID();
|
||||
std::string const& state = lfg::GetStateString(sLFGMgr->GetState(guid));
|
||||
handler->PSendSysMessage(LANG_LFG_GROUP_INFO, grp->isLFGGroup(),
|
||||
state.c_str(), sLFGMgr->GetDungeon(guid));
|
||||
state.c_str(), sLFGMgr->GetDungeon(guid));
|
||||
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
GetPlayerInfo(handler, itr->GetSource());
|
||||
|
||||
@@ -84,11 +84,11 @@ public:
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), creatureId, count);
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), creatureId, count);
|
||||
}
|
||||
else
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u",
|
||||
creatureId, count);
|
||||
creatureId, count);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -105,8 +105,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapId);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, creatureId, creatureCount);
|
||||
@@ -185,8 +184,7 @@ public:
|
||||
itemPos = "";
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid, ownerName.c_str(), ownerGuid, ownerAccountId, itemPos);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
uint32 resultCount = uint32(result->GetRowCount());
|
||||
|
||||
@@ -232,8 +230,7 @@ public:
|
||||
char const* itemPos = "[in mail]";
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEMLIST_MAIL, itemGuid, itemSenderName.c_str(), itemSender, itemSenderAccountId, itemReceiverName.c_str(), itemReceiver, itemReceiverAccount, itemPos);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
uint32 resultCount = uint32(result->GetRowCount());
|
||||
|
||||
@@ -276,8 +273,7 @@ public:
|
||||
char const* itemPos = "[in auction]";
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid, ownerName.c_str(), owner, ownerAccountId, itemPos);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
// guild bank case
|
||||
@@ -307,8 +303,7 @@ public:
|
||||
char const* itemPos = "[in guild bank]";
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEMLIST_GUILD, itemGuid, guildName.c_str(), guildGuid, itemPos);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
uint32 resultCount = uint32(result->GetRowCount());
|
||||
|
||||
@@ -373,11 +368,11 @@ public:
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), gameObjectId, count);
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), gameObjectId, count);
|
||||
}
|
||||
else
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u",
|
||||
gameObjectId, count);
|
||||
gameObjectId, count);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -395,8 +390,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapId);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapId);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, gameObjectId, objectCount);
|
||||
@@ -431,10 +425,10 @@ public:
|
||||
ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r";
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str().c_str() : name),
|
||||
aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(),
|
||||
aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""),
|
||||
(talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",
|
||||
GUID_LOPART(aura->GetCasterGUID()));
|
||||
aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(),
|
||||
aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""),
|
||||
(talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",
|
||||
GUID_LOPART(aura->GetCasterGUID()));
|
||||
}
|
||||
|
||||
if (!args || std::string(args) != "all")
|
||||
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
// send area in "id - [name]" format
|
||||
std::ostringstream ss;
|
||||
if (handler->GetSession())
|
||||
ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[locale]<< "]|h|r";
|
||||
ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[locale] << "]|h|r";
|
||||
else
|
||||
ss << areaEntry->ID << " - " << name << ' ' << localeNames[locale];
|
||||
|
||||
@@ -1025,7 +1025,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleLookupTaxiNodeCommand(ChatHandler* handler, const char * args)
|
||||
static bool HandleLookupTaxiNodeCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -1082,10 +1082,10 @@ public:
|
||||
// send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[locale],
|
||||
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
|
||||
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[locale],
|
||||
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
|
||||
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
@@ -1126,7 +1126,7 @@ public:
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
bool limitReached = false;
|
||||
|
||||
GameTeleContainer const & teleMap = sObjectMgr->GetGameTeleMap();
|
||||
GameTeleContainer const& teleMap = sObjectMgr->GetGameTeleMap();
|
||||
for (GameTeleContainer::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
|
||||
{
|
||||
GameTele const* tele = &itr->second;
|
||||
@@ -1219,8 +1219,8 @@ public:
|
||||
char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetAcoreString(LANG_KNOWN) : "";
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
|
||||
? handler->GetAcoreString(LANG_ACTIVE)
|
||||
: "";
|
||||
? handler->GetAcoreString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr, 80, name.c_str(), targetName);
|
||||
@@ -1350,7 +1350,7 @@ public:
|
||||
int32 limit = limitStr ? atoi(limitStr) : -1;
|
||||
|
||||
if (!Utf8ToUpperOnlyLatin
|
||||
(account))
|
||||
(account))
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
|
||||
@@ -1428,15 +1428,13 @@ public:
|
||||
}
|
||||
|
||||
if (plevel > 0 && prace > 0 && prace <= RACE_DRAENEI && pclass > 0 && pclass <= CLASS_DRUID)
|
||||
handler->PSendSysMessage(" %s (GUID %u) - %s - %s - %u%s", name.c_str(), guid, name_races[prace-1], name_classes[pclass-1], plevel, (online ? " - [ONLINE]" : ""));
|
||||
handler->PSendSysMessage(" %s (GUID %u) - %s - %s - %u%s", name.c_str(), guid, name_races[prace - 1], name_classes[pclass - 1], plevel, (online ? " - [ONLINE]" : ""));
|
||||
else
|
||||
handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid);
|
||||
++counter;
|
||||
}
|
||||
while (result2->NextRow() && (limit == -1 || counter < limit));
|
||||
} while (result2->NextRow() && (limit == -1 || counter < limit));
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
if (counter == 0) // empty accounts only
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
std::string str = handler->GetAcoreString(LANG_GLOBAL_NOTIFY);
|
||||
str += args;
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
|
||||
data << str;
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
std::string str = handler->GetAcoreString(LANG_GM_NOTIFY);
|
||||
str += args;
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
|
||||
data << str;
|
||||
sWorld->SendGlobalGMMessage(&data);
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tokens.size() != uint16(count+2))
|
||||
if (tokens.size() != uint16(count + 2))
|
||||
{
|
||||
handler->PSendSysMessage("Invalid number of nicknames for this bracket.");
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -231,8 +231,8 @@ public:
|
||||
players[cnt++] = plr;
|
||||
}
|
||||
|
||||
for (uint8 i=0; i<cnt && !error; ++i)
|
||||
for (uint8 j=i+1; j<cnt; ++j)
|
||||
for (uint8 i = 0; i < cnt && !error; ++i)
|
||||
for (uint8 j = i + 1; j < cnt; ++j)
|
||||
if (players[i]->GetGUID() == players[j]->GetGUID())
|
||||
{
|
||||
last_name = players[i]->GetName();
|
||||
@@ -311,7 +311,7 @@ public:
|
||||
|
||||
TeamId teamId1 = Player::TeamIdForRace(players[0]->getRace());
|
||||
TeamId teamId2 = (teamId1 == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE);
|
||||
for (uint8 i=0; i<cnt; ++i)
|
||||
for (uint8 i = 0; i < cnt; ++i)
|
||||
{
|
||||
Player* player = players[i];
|
||||
|
||||
@@ -430,13 +430,13 @@ public:
|
||||
handler->PSendSysMessage("no VMAP available for area info");
|
||||
|
||||
handler->PSendSysMessage(LANG_MAP_POSITION,
|
||||
object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
object->GetPhaseMask(),
|
||||
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
|
||||
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
|
||||
zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap);
|
||||
object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
object->GetPhaseMask(),
|
||||
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
|
||||
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
|
||||
zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap);
|
||||
|
||||
LiquidData liquidStatus;
|
||||
ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus);
|
||||
@@ -601,7 +601,7 @@ public:
|
||||
else
|
||||
_player->SaveRecallPosition();
|
||||
|
||||
if (_player->TeleportTo(target->GetMapId(), target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+0.25f, _player->GetOrientation(), TELE_TO_GM_MODE, target))
|
||||
if (_player->TeleportTo(target->GetMapId(), target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 0.25f, _player->GetOrientation(), TELE_TO_GM_MODE, target))
|
||||
_player->SetPhaseMask(target->GetPhaseMask() | 1, false);
|
||||
}
|
||||
else
|
||||
@@ -696,8 +696,8 @@ public:
|
||||
|
||||
// we are in an instance, and can only summon players in our group with us as leader
|
||||
if (!handler->GetSession()->GetPlayer()->GetGroup() || !target->GetGroup() ||
|
||||
(target->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
|
||||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))
|
||||
(target->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
|
||||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))
|
||||
// the last check is a bit excessive, but let it be, just in case
|
||||
{
|
||||
handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
|
||||
@@ -738,12 +738,12 @@ public:
|
||||
|
||||
// in point where GM stay
|
||||
Player::SavePositionInDB(handler->GetSession()->GetPlayer()->GetMapId(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionX(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionY(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionZ(),
|
||||
handler->GetSession()->GetPlayer()->GetOrientation(),
|
||||
handler->GetSession()->GetPlayer()->GetZoneId(),
|
||||
targetGuid);
|
||||
handler->GetSession()->GetPlayer()->GetPositionX(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionY(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionZ(),
|
||||
handler->GetSession()->GetPlayer()->GetOrientation(),
|
||||
handler->GetSession()->GetPlayer()->GetZoneId(),
|
||||
targetGuid);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -775,8 +775,8 @@ public:
|
||||
|
||||
// we are in instance, and can summon only player in our group with us as lead
|
||||
if (toInstance && (
|
||||
!handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
|
||||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())))
|
||||
!handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
|
||||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())))
|
||||
// the last check is a bit excessive, but let it be, just in case
|
||||
{
|
||||
handler->SendSysMessage(LANG_CANNOT_SUMMON_TO_INST);
|
||||
@@ -1032,7 +1032,7 @@ public:
|
||||
{
|
||||
uint64 guid = handler->extractGuidFromLink((char*)args);
|
||||
if (guid)
|
||||
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
|
||||
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
|
||||
|
||||
if (!obj)
|
||||
{
|
||||
@@ -1258,7 +1258,7 @@ public:
|
||||
uint32 zoneId = player->GetZoneId();
|
||||
|
||||
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(zoneId);
|
||||
if (!areaEntry || areaEntry->zone !=0)
|
||||
if (!areaEntry || areaEntry->zone != 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -1423,7 +1423,7 @@ public:
|
||||
|
||||
if (itemNameStr && itemNameStr[0])
|
||||
{
|
||||
std::string itemName = itemNameStr+1;
|
||||
std::string itemName = itemNameStr + 1;
|
||||
WorldDatabase.EscapeString(itemName);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME);
|
||||
@@ -1432,7 +1432,7 @@ public:
|
||||
|
||||
if (!result)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_COULDNOTFIND, itemNameStr+1);
|
||||
handler->PSendSysMessage(LANG_COMMAND_COULDNOTFIND, itemNameStr + 1);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1500,12 +1500,12 @@ public:
|
||||
}
|
||||
|
||||
/* [AC] Sunwell hack
|
||||
if (handler->GetSession()->GetSecurity() < SEC_ADMINISTRATOR)
|
||||
{
|
||||
handler->PSendSysMessage("You may only remove items. Adding items is available for higher GMLevel.");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
if (handler->GetSession()->GetSecurity() < SEC_ADMINISTRATOR)
|
||||
{
|
||||
handler->PSendSysMessage("You may only remove items. Adding items is available for higher GMLevel.");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
// Adding items
|
||||
uint32 noSpaceForCount = 0;
|
||||
@@ -1976,7 +1976,7 @@ public:
|
||||
// Output I. LANG_PINFO_PLAYER
|
||||
handler->PSendSysMessage(LANG_PINFO_PLAYER, target ? "" : handler->GetAcoreString(LANG_OFFLINE), nameLink.c_str(), GUID_LOPART(targetGuid));
|
||||
|
||||
// Output II. LANG_PINFO_GM_ACTIVE if character is gamemaster
|
||||
// Output II. LANG_PINFO_GM_ACTIVE if character is gamemaster
|
||||
if (target && target->IsGameMaster())
|
||||
handler->PSendSysMessage(LANG_PINFO_GM_ACTIVE);
|
||||
|
||||
@@ -2010,7 +2010,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_LEVEL_HIGH, level);
|
||||
|
||||
// Output XI. LANG_PINFO_CHR_RACE
|
||||
switch (raceid)
|
||||
switch (raceid)
|
||||
{
|
||||
case RACE_HUMAN:
|
||||
raceStr = "Human";
|
||||
@@ -2087,7 +2087,7 @@ public:
|
||||
// Output XIII. LANG_PINFO_CHR_PHASE if player is not in GM mode (GM is in every phase)
|
||||
if (target && !target->IsGameMaster()) // IsInWorld() returns false on loadingscreen, so it's more
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_PHASE, phase); // precise than just target (safer ?).
|
||||
// However, as we usually just require a target here, we use target instead.
|
||||
// However, as we usually just require a target here, we use target instead.
|
||||
// Output XIV. LANG_PINFO_CHR_MONEY
|
||||
uint32 gold = money / GOLD;
|
||||
uint32 silv = (money % GOLD) / SILVER;
|
||||
@@ -2144,7 +2144,7 @@ public:
|
||||
|
||||
// Output XXI. LANG_INFO_CHR_MAILS if at least one mail is given
|
||||
if (totalmail >= 1)
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAILS, readmail, totalmail);
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAILS, readmail, totalmail);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2324,7 +2324,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char *nameStr = strtok((char*)args, "");
|
||||
char* nameStr = strtok((char*)args, "");
|
||||
if (!nameStr)
|
||||
return false;
|
||||
|
||||
@@ -2349,7 +2349,7 @@ public:
|
||||
// helper for mutehistory
|
||||
static bool HandleMuteInfoHelper(uint32 accountId, char const* accountName, ChatHandler* handler)
|
||||
{
|
||||
PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO);
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO);
|
||||
stmt->setUInt16(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -2421,53 +2421,53 @@ public:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CONFUSED);
|
||||
break;
|
||||
case CHASE_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<ChaseMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<ChaseMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<ChaseMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<ChaseMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
|
||||
break;
|
||||
}
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
|
||||
break;
|
||||
}
|
||||
case FOLLOW_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<FollowMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<FollowMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<FollowMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<FollowMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
|
||||
break;
|
||||
}
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
|
||||
break;
|
||||
}
|
||||
case HOME_MOTION_TYPE:
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_UNIT)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
|
||||
else
|
||||
handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_UNIT)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
|
||||
else
|
||||
handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
|
||||
break;
|
||||
}
|
||||
case FLIGHT_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FLIGHT);
|
||||
break;
|
||||
case POINT_MOTION_TYPE:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
|
||||
break;
|
||||
}
|
||||
{
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
|
||||
break;
|
||||
}
|
||||
case FLEEING_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FEAR);
|
||||
break;
|
||||
@@ -2638,7 +2638,7 @@ public:
|
||||
//- TODO: Fix poor design
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
MailDraft(subject, text)
|
||||
.SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender);
|
||||
.SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
@@ -2796,8 +2796,8 @@ public:
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
MailDraft(subject, text)
|
||||
.AddMoney(money)
|
||||
.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
|
||||
.AddMoney(money)
|
||||
.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
@@ -2885,7 +2885,7 @@ public:
|
||||
}
|
||||
|
||||
// prepare visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel() - 1);
|
||||
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
|
||||
// this enables pet details window (Shift+P)
|
||||
@@ -3028,7 +3028,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleUnFreezeCommand(ChatHandler* handler, char const*args)
|
||||
static bool HandleUnFreezeCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string name;
|
||||
Player* player;
|
||||
|
||||
@@ -103,9 +103,9 @@ public:
|
||||
handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : useStraightLine ? "Raycast" : "SmoothPath");
|
||||
handler->PSendSysMessage("Result: %s - Length: " SZFMTD " - Type: %u", (result ? "true" : "false"), pointPath.size(), path.GetPathType());
|
||||
|
||||
G3D::Vector3 const &start = path.GetStartPosition();
|
||||
G3D::Vector3 const &end = path.GetEndPosition();
|
||||
G3D::Vector3 const &actualEnd = path.GetActualEndPosition();
|
||||
G3D::Vector3 const& start = path.GetStartPosition();
|
||||
G3D::Vector3 const& end = path.GetEndPosition();
|
||||
G3D::Vector3 const& actualEnd = path.GetActualEndPosition();
|
||||
|
||||
handler->PSendSysMessage("StartPosition (%.3f, %.3f, %.3f)", start.x, start.y, start.z);
|
||||
handler->PSendSysMessage("EndPosition (%.3f, %.3f, %.3f)", end.x, end.y, end.z);
|
||||
|
||||
@@ -167,8 +167,8 @@ public:
|
||||
// int32 manam = atoi(pmanaMax);
|
||||
// int32 mana = atoi(pmana);
|
||||
|
||||
int32 energy = atoi((char*)args)*10;
|
||||
int32 energym = atoi((char*)args)*10;
|
||||
int32 energy = atoi((char*)args) * 10;
|
||||
int32 energym = atoi((char*)args) * 10;
|
||||
|
||||
if (energy <= 0 || energym <= 0 || energym < energy)
|
||||
{
|
||||
@@ -189,9 +189,9 @@ public:
|
||||
if (handler->HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energy/10, energym/10);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energy / 10, energym / 10);
|
||||
if (handler->needReportToTarget(target))
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy/10, energym/10);
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy / 10, energym / 10);
|
||||
|
||||
target->SetMaxPower(POWER_ENERGY, energym);
|
||||
target->SetPower(POWER_ENERGY, energy);
|
||||
@@ -220,8 +220,8 @@ public:
|
||||
// int32 manam = atoi(pmanaMax);
|
||||
// int32 mana = atoi(pmana);
|
||||
|
||||
int32 rage = atoi((char*)args)*10;
|
||||
int32 ragem = atoi((char*)args)*10;
|
||||
int32 rage = atoi((char*)args) * 10;
|
||||
int32 ragem = atoi((char*)args) * 10;
|
||||
|
||||
if (rage <= 0 || ragem <= 0 || ragem < rage)
|
||||
{
|
||||
@@ -242,9 +242,9 @@ public:
|
||||
if (handler->HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), rage/10, ragem/10);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), rage / 10, ragem / 10);
|
||||
if (handler->needReportToTarget(target))
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage/10, ragem/10);
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage / 10, ragem / 10);
|
||||
|
||||
target->SetMaxPower(POWER_RAGE, ragem);
|
||||
target->SetPower(POWER_RAGE, rage);
|
||||
@@ -258,8 +258,8 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
int32 rune = atoi((char*)args)*10;
|
||||
int32 runem = atoi((char*)args)*10;
|
||||
int32 rune = atoi((char*)args) * 10;
|
||||
int32 runem = atoi((char*)args) * 10;
|
||||
|
||||
if (rune <= 0 || runem <= 0 || runem < rune)
|
||||
{
|
||||
@@ -276,9 +276,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target).c_str(), rune/10, runem/10);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target).c_str(), rune / 10, runem / 10);
|
||||
if (handler->needReportToTarget(target))
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune/10, runem/10);
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune / 10, runem / 10);
|
||||
|
||||
target->SetMaxPower(POWER_RUNIC_POWER, runem);
|
||||
target->SetPower(POWER_RUNIC_POWER, rune);
|
||||
@@ -315,7 +315,7 @@ public:
|
||||
uint32 factionid = atoi(pfactionid);
|
||||
uint32 flag;
|
||||
|
||||
char *pflag = strtok(nullptr, " ");
|
||||
char* pflag = strtok(nullptr, " ");
|
||||
if (!pflag)
|
||||
flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
|
||||
else
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
if (handler->needReportToTarget(target))
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink().c_str(), spellflatid, val, mark);
|
||||
|
||||
WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1+1+2+2));
|
||||
WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1 + 1 + 2 + 2));
|
||||
data << uint8(spellflatid);
|
||||
data << uint8(op);
|
||||
data << uint16(val);
|
||||
@@ -736,217 +736,217 @@ public:
|
||||
num = atoi((char*)args);
|
||||
switch (num)
|
||||
{
|
||||
case 1:
|
||||
mId=14340;
|
||||
break;
|
||||
case 2:
|
||||
mId=4806;
|
||||
break;
|
||||
case 3:
|
||||
mId=6471;
|
||||
break;
|
||||
case 4:
|
||||
mId=12345;
|
||||
break;
|
||||
case 5:
|
||||
mId=6472;
|
||||
break;
|
||||
case 6:
|
||||
mId=6473;
|
||||
break;
|
||||
case 7:
|
||||
mId=10670;
|
||||
break;
|
||||
case 8:
|
||||
mId=10719;
|
||||
break;
|
||||
case 9:
|
||||
mId=10671;
|
||||
break;
|
||||
case 10:
|
||||
mId=10672;
|
||||
break;
|
||||
case 11:
|
||||
mId=10720;
|
||||
break;
|
||||
case 12:
|
||||
mId=14349;
|
||||
break;
|
||||
case 13:
|
||||
mId=11641;
|
||||
break;
|
||||
case 14:
|
||||
mId=12244;
|
||||
break;
|
||||
case 15:
|
||||
mId=12242;
|
||||
break;
|
||||
case 16:
|
||||
mId=14578;
|
||||
break;
|
||||
case 17:
|
||||
mId=14579;
|
||||
break;
|
||||
case 18:
|
||||
mId=14349;
|
||||
break;
|
||||
case 19:
|
||||
mId=12245;
|
||||
break;
|
||||
case 20:
|
||||
mId=14335;
|
||||
break;
|
||||
case 21:
|
||||
mId=207;
|
||||
break;
|
||||
case 22:
|
||||
mId=2328;
|
||||
break;
|
||||
case 23:
|
||||
mId=2327;
|
||||
break;
|
||||
case 24:
|
||||
mId=2326;
|
||||
break;
|
||||
case 25:
|
||||
mId=14573;
|
||||
break;
|
||||
case 26:
|
||||
mId=14574;
|
||||
break;
|
||||
case 27:
|
||||
mId=14575;
|
||||
break;
|
||||
case 28:
|
||||
mId=604;
|
||||
break;
|
||||
case 29:
|
||||
mId=1166;
|
||||
break;
|
||||
case 30:
|
||||
mId=2402;
|
||||
break;
|
||||
case 31:
|
||||
mId=2410;
|
||||
break;
|
||||
case 32:
|
||||
mId=2409;
|
||||
break;
|
||||
case 33:
|
||||
mId=2408;
|
||||
break;
|
||||
case 34:
|
||||
mId=2405;
|
||||
break;
|
||||
case 35:
|
||||
mId=14337;
|
||||
break;
|
||||
case 36:
|
||||
mId=6569;
|
||||
break;
|
||||
case 37:
|
||||
mId=10661;
|
||||
break;
|
||||
case 38:
|
||||
mId=10666;
|
||||
break;
|
||||
case 39:
|
||||
mId=9473;
|
||||
break;
|
||||
case 40:
|
||||
mId=9476;
|
||||
break;
|
||||
case 41:
|
||||
mId=9474;
|
||||
break;
|
||||
case 42:
|
||||
mId=14374;
|
||||
break;
|
||||
case 43:
|
||||
mId=14376;
|
||||
break;
|
||||
case 44:
|
||||
mId=14377;
|
||||
break;
|
||||
case 45:
|
||||
mId=2404;
|
||||
break;
|
||||
case 46:
|
||||
mId=2784;
|
||||
break;
|
||||
case 47:
|
||||
mId=2787;
|
||||
break;
|
||||
case 48:
|
||||
mId=2785;
|
||||
break;
|
||||
case 49:
|
||||
mId=2736;
|
||||
break;
|
||||
case 50:
|
||||
mId=2786;
|
||||
break;
|
||||
case 51:
|
||||
mId=14347;
|
||||
break;
|
||||
case 52:
|
||||
mId=14346;
|
||||
break;
|
||||
case 53:
|
||||
mId=14576;
|
||||
break;
|
||||
case 54:
|
||||
mId=9695;
|
||||
break;
|
||||
case 55:
|
||||
mId=9991;
|
||||
break;
|
||||
case 56:
|
||||
mId=6448;
|
||||
break;
|
||||
case 57:
|
||||
mId=6444;
|
||||
break;
|
||||
case 58:
|
||||
mId=6080;
|
||||
break;
|
||||
case 59:
|
||||
mId=6447;
|
||||
break;
|
||||
case 60:
|
||||
mId=4805;
|
||||
break;
|
||||
case 61:
|
||||
mId=9714;
|
||||
break;
|
||||
case 62:
|
||||
mId=6448;
|
||||
break;
|
||||
case 63:
|
||||
mId=6442;
|
||||
break;
|
||||
case 64:
|
||||
mId=14632;
|
||||
break;
|
||||
case 65:
|
||||
mId=14332;
|
||||
break;
|
||||
case 66:
|
||||
mId=14331;
|
||||
break;
|
||||
case 67:
|
||||
mId=8469;
|
||||
break;
|
||||
case 68:
|
||||
mId=2830;
|
||||
break;
|
||||
case 69:
|
||||
mId=2346;
|
||||
break;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_NO_MOUNT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case 1:
|
||||
mId = 14340;
|
||||
break;
|
||||
case 2:
|
||||
mId = 4806;
|
||||
break;
|
||||
case 3:
|
||||
mId = 6471;
|
||||
break;
|
||||
case 4:
|
||||
mId = 12345;
|
||||
break;
|
||||
case 5:
|
||||
mId = 6472;
|
||||
break;
|
||||
case 6:
|
||||
mId = 6473;
|
||||
break;
|
||||
case 7:
|
||||
mId = 10670;
|
||||
break;
|
||||
case 8:
|
||||
mId = 10719;
|
||||
break;
|
||||
case 9:
|
||||
mId = 10671;
|
||||
break;
|
||||
case 10:
|
||||
mId = 10672;
|
||||
break;
|
||||
case 11:
|
||||
mId = 10720;
|
||||
break;
|
||||
case 12:
|
||||
mId = 14349;
|
||||
break;
|
||||
case 13:
|
||||
mId = 11641;
|
||||
break;
|
||||
case 14:
|
||||
mId = 12244;
|
||||
break;
|
||||
case 15:
|
||||
mId = 12242;
|
||||
break;
|
||||
case 16:
|
||||
mId = 14578;
|
||||
break;
|
||||
case 17:
|
||||
mId = 14579;
|
||||
break;
|
||||
case 18:
|
||||
mId = 14349;
|
||||
break;
|
||||
case 19:
|
||||
mId = 12245;
|
||||
break;
|
||||
case 20:
|
||||
mId = 14335;
|
||||
break;
|
||||
case 21:
|
||||
mId = 207;
|
||||
break;
|
||||
case 22:
|
||||
mId = 2328;
|
||||
break;
|
||||
case 23:
|
||||
mId = 2327;
|
||||
break;
|
||||
case 24:
|
||||
mId = 2326;
|
||||
break;
|
||||
case 25:
|
||||
mId = 14573;
|
||||
break;
|
||||
case 26:
|
||||
mId = 14574;
|
||||
break;
|
||||
case 27:
|
||||
mId = 14575;
|
||||
break;
|
||||
case 28:
|
||||
mId = 604;
|
||||
break;
|
||||
case 29:
|
||||
mId = 1166;
|
||||
break;
|
||||
case 30:
|
||||
mId = 2402;
|
||||
break;
|
||||
case 31:
|
||||
mId = 2410;
|
||||
break;
|
||||
case 32:
|
||||
mId = 2409;
|
||||
break;
|
||||
case 33:
|
||||
mId = 2408;
|
||||
break;
|
||||
case 34:
|
||||
mId = 2405;
|
||||
break;
|
||||
case 35:
|
||||
mId = 14337;
|
||||
break;
|
||||
case 36:
|
||||
mId = 6569;
|
||||
break;
|
||||
case 37:
|
||||
mId = 10661;
|
||||
break;
|
||||
case 38:
|
||||
mId = 10666;
|
||||
break;
|
||||
case 39:
|
||||
mId = 9473;
|
||||
break;
|
||||
case 40:
|
||||
mId = 9476;
|
||||
break;
|
||||
case 41:
|
||||
mId = 9474;
|
||||
break;
|
||||
case 42:
|
||||
mId = 14374;
|
||||
break;
|
||||
case 43:
|
||||
mId = 14376;
|
||||
break;
|
||||
case 44:
|
||||
mId = 14377;
|
||||
break;
|
||||
case 45:
|
||||
mId = 2404;
|
||||
break;
|
||||
case 46:
|
||||
mId = 2784;
|
||||
break;
|
||||
case 47:
|
||||
mId = 2787;
|
||||
break;
|
||||
case 48:
|
||||
mId = 2785;
|
||||
break;
|
||||
case 49:
|
||||
mId = 2736;
|
||||
break;
|
||||
case 50:
|
||||
mId = 2786;
|
||||
break;
|
||||
case 51:
|
||||
mId = 14347;
|
||||
break;
|
||||
case 52:
|
||||
mId = 14346;
|
||||
break;
|
||||
case 53:
|
||||
mId = 14576;
|
||||
break;
|
||||
case 54:
|
||||
mId = 9695;
|
||||
break;
|
||||
case 55:
|
||||
mId = 9991;
|
||||
break;
|
||||
case 56:
|
||||
mId = 6448;
|
||||
break;
|
||||
case 57:
|
||||
mId = 6444;
|
||||
break;
|
||||
case 58:
|
||||
mId = 6080;
|
||||
break;
|
||||
case 59:
|
||||
mId = 6447;
|
||||
break;
|
||||
case 60:
|
||||
mId = 4805;
|
||||
break;
|
||||
case 61:
|
||||
mId = 9714;
|
||||
break;
|
||||
case 62:
|
||||
mId = 6448;
|
||||
break;
|
||||
case 63:
|
||||
mId = 6442;
|
||||
break;
|
||||
case 64:
|
||||
mId = 14632;
|
||||
break;
|
||||
case 65:
|
||||
mId = 14332;
|
||||
break;
|
||||
case 66:
|
||||
mId = 14331;
|
||||
break;
|
||||
case 67:
|
||||
mId = 8469;
|
||||
break;
|
||||
case 68:
|
||||
mId = 2830;
|
||||
break;
|
||||
case 69:
|
||||
mId = 2346;
|
||||
break;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_NO_MOUNT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
@@ -968,14 +968,14 @@ public:
|
||||
target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
|
||||
target->Mount(mId);
|
||||
|
||||
WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8+4+1+4));
|
||||
WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8 + 4 + 1 + 4));
|
||||
data.append(target->GetPackGUID());
|
||||
data << (uint32)0;
|
||||
data << (uint8)0; //new 2.1.0
|
||||
data << float(speed);
|
||||
target->SendMessageToSet(&data, true);
|
||||
|
||||
data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8+4+4));
|
||||
data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8 + 4 + 4));
|
||||
data.append(target->GetPackGUID());
|
||||
data << (uint32)0;
|
||||
data << float(speed);
|
||||
@@ -1100,14 +1100,14 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target->HasFlag(field, (1<<(bit-1))))
|
||||
if (target->HasFlag(field, (1 << (bit - 1))))
|
||||
{
|
||||
target->RemoveFlag(field, (1<<(bit-1)));
|
||||
target->RemoveFlag(field, (1 << (bit - 1)));
|
||||
handler->PSendSysMessage(LANG_REMOVE_BIT, bit, field);
|
||||
}
|
||||
else
|
||||
{
|
||||
target->SetFlag(field, (1<<(bit-1)));
|
||||
target->SetFlag(field, (1 << (bit - 1)));
|
||||
handler->PSendSysMessage(LANG_SET_BIT, bit, field);
|
||||
}
|
||||
return true;
|
||||
@@ -1178,7 +1178,7 @@ public:
|
||||
uint32 factionId = atoi(factionTxt);
|
||||
|
||||
int32 amount = 0;
|
||||
char *rankTxt = strtok(nullptr, " ");
|
||||
char* rankTxt = strtok(nullptr, " ");
|
||||
if (!factionTxt || !rankTxt)
|
||||
return false;
|
||||
|
||||
@@ -1207,13 +1207,13 @@ public:
|
||||
|
||||
if (wrank.substr(0, wrankStr.size()) == wrankStr)
|
||||
{
|
||||
char *deltaTxt = strtok(nullptr, " ");
|
||||
char* deltaTxt = strtok(nullptr, " ");
|
||||
if (deltaTxt)
|
||||
{
|
||||
int32 delta = atoi(deltaTxt);
|
||||
if ((delta < 0) || (delta > ReputationMgr::PointsInRank[r] -1))
|
||||
if ((delta < 0) || (delta > ReputationMgr::PointsInRank[r] - 1))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_DELTA, (ReputationMgr::PointsInRank[r]-1));
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_DELTA, (ReputationMgr::PointsInRank[r] - 1));
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1250,7 +1250,7 @@ public:
|
||||
target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
|
||||
target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
|
||||
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId,
|
||||
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
|
||||
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
|
||||
return true;
|
||||
}
|
||||
static bool HandleMorphTargetCommand(ChatHandler* handler, const char* args)
|
||||
|
||||
@@ -68,38 +68,38 @@ struct MechanicImmune
|
||||
|
||||
MechanicImmune const mechanicImmunes[MAX_MECHANIC] =
|
||||
{
|
||||
{ MECHANIC_NONE , "MECHANIC_NONE" },
|
||||
{ MECHANIC_CHARM , "MECHANIC_CHARM" },
|
||||
{ MECHANIC_DISORIENTED , "MECHANIC_DISORIENTED" },
|
||||
{ MECHANIC_DISARM , "MECHANIC_DISARM" },
|
||||
{ MECHANIC_DISTRACT , "MECHANIC_DISTRACT" },
|
||||
{ MECHANIC_FEAR , "MECHANIC_FEAR" },
|
||||
{ MECHANIC_GRIP , "MECHANIC_GRIP" },
|
||||
{ MECHANIC_ROOT , "MECHANIC_ROOT" },
|
||||
{ MECHANIC_SLOW_ATTACK , "MECHANIC_SLOW_ATTACK" },
|
||||
{ MECHANIC_SILENCE , "MECHANIC_SILENCE" },
|
||||
{ MECHANIC_SLEEP , "MECHANIC_SLEEP" },
|
||||
{ MECHANIC_SNARE , "MECHANIC_SNARE" },
|
||||
{ MECHANIC_STUN , "MECHANIC_STUN" },
|
||||
{ MECHANIC_FREEZE , "MECHANIC_FREEZE" },
|
||||
{ MECHANIC_KNOCKOUT , "MECHANIC_KNOCKOUT" },
|
||||
{ MECHANIC_BLEED , "MECHANIC_BLEED" },
|
||||
{ MECHANIC_BANDAGE , "MECHANIC_BANDAGE" },
|
||||
{ MECHANIC_POLYMORPH , "MECHANIC_POLYMORPH" },
|
||||
{ MECHANIC_BANISH , "MECHANIC_BANISH" },
|
||||
{ MECHANIC_SHIELD , "MECHANIC_SHIELD" },
|
||||
{ MECHANIC_SHACKLE , "MECHANIC_SHACKLE" },
|
||||
{ MECHANIC_MOUNT , "MECHANIC_MOUNT" },
|
||||
{ MECHANIC_INFECTED , "MECHANIC_INFECTED" },
|
||||
{ MECHANIC_TURN , "MECHANIC_TURN" },
|
||||
{ MECHANIC_HORROR , "MECHANIC_HORROR" },
|
||||
{ MECHANIC_INVULNERABILITY , "MECHANIC_INVULNERABILITY" },
|
||||
{ MECHANIC_INTERRUPT , "MECHANIC_INTERRUPT" },
|
||||
{ MECHANIC_DAZE , "MECHANIC_DAZE" },
|
||||
{ MECHANIC_DISCOVERY , "MECHANIC_DISCOVERY" },
|
||||
{ MECHANIC_IMMUNE_SHIELD , "MECHANIC_IMMUNE_SHIELD" },
|
||||
{ MECHANIC_SAPPED , "MECHANIC_SAPPED" },
|
||||
{ MECHANIC_ENRAGED , "MECHANIC_ENRAGED" },
|
||||
{ MECHANIC_NONE, "MECHANIC_NONE" },
|
||||
{ MECHANIC_CHARM, "MECHANIC_CHARM" },
|
||||
{ MECHANIC_DISORIENTED, "MECHANIC_DISORIENTED" },
|
||||
{ MECHANIC_DISARM, "MECHANIC_DISARM" },
|
||||
{ MECHANIC_DISTRACT, "MECHANIC_DISTRACT" },
|
||||
{ MECHANIC_FEAR, "MECHANIC_FEAR" },
|
||||
{ MECHANIC_GRIP, "MECHANIC_GRIP" },
|
||||
{ MECHANIC_ROOT, "MECHANIC_ROOT" },
|
||||
{ MECHANIC_SLOW_ATTACK, "MECHANIC_SLOW_ATTACK" },
|
||||
{ MECHANIC_SILENCE, "MECHANIC_SILENCE" },
|
||||
{ MECHANIC_SLEEP, "MECHANIC_SLEEP" },
|
||||
{ MECHANIC_SNARE, "MECHANIC_SNARE" },
|
||||
{ MECHANIC_STUN, "MECHANIC_STUN" },
|
||||
{ MECHANIC_FREEZE, "MECHANIC_FREEZE" },
|
||||
{ MECHANIC_KNOCKOUT, "MECHANIC_KNOCKOUT" },
|
||||
{ MECHANIC_BLEED, "MECHANIC_BLEED" },
|
||||
{ MECHANIC_BANDAGE, "MECHANIC_BANDAGE" },
|
||||
{ MECHANIC_POLYMORPH, "MECHANIC_POLYMORPH" },
|
||||
{ MECHANIC_BANISH, "MECHANIC_BANISH" },
|
||||
{ MECHANIC_SHIELD, "MECHANIC_SHIELD" },
|
||||
{ MECHANIC_SHACKLE, "MECHANIC_SHACKLE" },
|
||||
{ MECHANIC_MOUNT, "MECHANIC_MOUNT" },
|
||||
{ MECHANIC_INFECTED, "MECHANIC_INFECTED" },
|
||||
{ MECHANIC_TURN, "MECHANIC_TURN" },
|
||||
{ MECHANIC_HORROR, "MECHANIC_HORROR" },
|
||||
{ MECHANIC_INVULNERABILITY, "MECHANIC_INVULNERABILITY" },
|
||||
{ MECHANIC_INTERRUPT, "MECHANIC_INTERRUPT" },
|
||||
{ MECHANIC_DAZE, "MECHANIC_DAZE" },
|
||||
{ MECHANIC_DISCOVERY, "MECHANIC_DISCOVERY" },
|
||||
{ MECHANIC_IMMUNE_SHIELD, "MECHANIC_IMMUNE_SHIELD" },
|
||||
{ MECHANIC_SAPPED, "MECHANIC_SAPPED" },
|
||||
{ MECHANIC_ENRAGED, "MECHANIC_ENRAGED" },
|
||||
};
|
||||
|
||||
class npc_commandscript : public CommandScript
|
||||
@@ -442,15 +442,15 @@ public:
|
||||
{
|
||||
if (((Pet*)creature)->getPetType() == HUNTER_PET)
|
||||
{
|
||||
creature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr->GetXPForLevel(lvl)/4);
|
||||
creature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr->GetXPForLevel(lvl) / 4);
|
||||
creature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
}
|
||||
((Pet*)creature)->GivePetLevel(lvl);
|
||||
}
|
||||
else
|
||||
{
|
||||
creature->SetMaxHealth(100 + 30*lvl);
|
||||
creature->SetHealth(100 + 30*lvl);
|
||||
creature->SetMaxHealth(100 + 30 * lvl);
|
||||
creature->SetHealth(100 + 30 * lvl);
|
||||
creature->SetLevel(lvl);
|
||||
creature->SaveToDB();
|
||||
}
|
||||
@@ -722,7 +722,7 @@ public:
|
||||
uint32 nativeid = target->GetNativeDisplayId();
|
||||
uint32 Entry = target->GetEntry();
|
||||
|
||||
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(nullptr);
|
||||
int64 curRespawnDelay = target->GetRespawnTimeEx() - time(nullptr);
|
||||
if (curRespawnDelay < 0)
|
||||
curRespawnDelay = 0;
|
||||
std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
|
||||
@@ -791,8 +791,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, creatureTemplate->Name.c_str(), x, y, z, mapId);
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_NEAR_NPC_MESSAGE, distance, count);
|
||||
@@ -1122,7 +1121,7 @@ public:
|
||||
}
|
||||
|
||||
MovementGeneratorType mtype = IDLE_MOTION_TYPE;
|
||||
if (option >0.0f)
|
||||
if (option > 0.0f)
|
||||
mtype = RANDOM_MOTION_TYPE;
|
||||
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
@@ -1214,9 +1213,15 @@ public:
|
||||
char lastchar = args[strlen(args) - 1];
|
||||
switch (lastchar)
|
||||
{
|
||||
case '?': creature->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); break;
|
||||
case '!': creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); break;
|
||||
default: creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break;
|
||||
case '?':
|
||||
creature->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION);
|
||||
break;
|
||||
case '!':
|
||||
creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
|
||||
break;
|
||||
default:
|
||||
creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1386,7 +1391,7 @@ public:
|
||||
// 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());
|
||||
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);
|
||||
@@ -1442,7 +1447,7 @@ public:
|
||||
|
||||
group_member = new FormationInfo;
|
||||
group_member->follow_angle = (creature->GetAngle(chr) - chr->GetOrientation()) * 180 / M_PI;
|
||||
group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - creature->GetPositionX(), int(2))+pow(chr->GetPositionY() - creature->GetPositionY(), int(2)));
|
||||
group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - creature->GetPositionX(), int(2)) + pow(chr->GetPositionY() - creature->GetPositionY(), int(2)));
|
||||
group_member->leaderGUID = leaderGUID;
|
||||
group_member->groupAI = 0;
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ public:
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player->IsActiveQuest(entry))
|
||||
|
||||
if (player->IsActiveQuest(entry))
|
||||
{
|
||||
handler->PSendSysMessage("This quest is already active!");
|
||||
return false;
|
||||
@@ -181,11 +181,11 @@ public:
|
||||
uint32 curItemCount = player->GetItemCount(id, true);
|
||||
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, id, count-curItemCount);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
static bool HandleReloadAllNpcCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
if (*args != 'a') // will be reloaded from all_gossips
|
||||
HandleReloadNpcTrainerCommand(handler, "a");
|
||||
HandleReloadNpcTrainerCommand(handler, "a");
|
||||
HandleReloadNpcVendorCommand(handler, "a");
|
||||
HandleReloadPointsOfInterestCommand(handler, "a");
|
||||
HandleReloadSpellClickSpellsCommand(handler, "a");
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
HandleReloadGossipMenuCommand(handler, "a");
|
||||
HandleReloadGossipMenuOptionCommand(handler, "a");
|
||||
if (*args != 'a') // already reload from all_scripts
|
||||
HandleReloadPointsOfInterestCommand(handler, "a");
|
||||
HandleReloadPointsOfInterestCommand(handler, "a");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ public:
|
||||
cInfo->SkinLootId = fields[45].GetUInt32();
|
||||
|
||||
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
cInfo->resistance[i] = fields[46 + i -1].GetUInt16();
|
||||
cInfo->resistance[i] = fields[46 + i - 1].GetUInt16();
|
||||
|
||||
cInfo->spells[0] = fields[52].GetUInt32();
|
||||
cInfo->spells[1] = fields[53].GetUInt32();
|
||||
|
||||
@@ -119,8 +119,8 @@ public:
|
||||
|
||||
// set starting level
|
||||
uint32 startLevel = target->getClass() != CLASS_DEATH_KNIGHT
|
||||
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
|
||||
target->_ApplyAllLevelScaleItemMods(false);
|
||||
target->SetLevel(startLevel);
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS);
|
||||
sWorld->SendWorldText(LANG_RESETALL_TALENTS);
|
||||
if (!handler->GetSession())
|
||||
handler->SendSysMessage(LANG_RESETALL_TALENTS);
|
||||
handler->SendSysMessage(LANG_RESETALL_TALENTS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -31,25 +31,25 @@ public:
|
||||
static std::vector<ChatCommand> serverIdleRestartCommandTable =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "" }
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> serverIdleShutdownCommandTable =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "" }
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> serverRestartCommandTable =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "" }
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> serverShutdownCommandTable =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "" }
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> serverSetCommandTable =
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
{ "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "server", SEC_PLAYER, true, nullptr, "", serverCommandTable }
|
||||
};
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
else
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, char const* args)
|
||||
@@ -273,7 +273,7 @@ public:
|
||||
}
|
||||
else
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE);
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Exit the realm
|
||||
|
||||
@@ -152,7 +152,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
|
||||
const Unit::VisibleAuraMap* va = player->GetVisibleAuras();
|
||||
for (Unit::VisibleAuraMap::const_iterator itr = va->begin(); itr != va->end(); ++itr)
|
||||
if (Aura* aura = itr->second->GetBase())
|
||||
if (!itr->second->IsPositive() && !aura->IsPermanent() && aura->GetDuration() < HOUR*IN_MILLISECONDS)
|
||||
if (!itr->second->IsPositive() && !aura->IsPermanent() && aura->GetDuration() < HOUR * IN_MILLISECONDS)
|
||||
{
|
||||
switch (aura->GetSpellInfo()->Id)
|
||||
{
|
||||
@@ -180,7 +180,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
|
||||
|
||||
bool bgPreparation = false;
|
||||
if ((!handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS) ||
|
||||
(handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS))
|
||||
(handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS))
|
||||
{
|
||||
bgPreparation = true;
|
||||
handler->SendSysMessage("Arena is not in progress yet. You will be invited as soon as it starts.");
|
||||
@@ -192,7 +192,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
|
||||
{
|
||||
handler->PSendSysMessage("To spectate, please fix the following:");
|
||||
for (std::list<std::string>::const_iterator itr = errors.begin(); itr != errors.end(); ++itr)
|
||||
handler->PSendSysMessage("- %s",(*itr).c_str());
|
||||
handler->PSendSysMessage("- %s", (*itr).c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -203,7 +203,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
|
||||
player->SetPendingSpectatorForBG(spectate->GetBattlegroundId());
|
||||
player->SetBattlegroundId(spectate->GetBattlegroundId(), spectate->GetBattlegroundTypeId(), PLAYER_MAX_BATTLEGROUND_QUEUES, false, false, TEAM_NEUTRAL);
|
||||
player->SetEntryPoint();
|
||||
float z = spectate->GetMapId() == 618 ? std::max(28.27f, spectate->GetPositionZ()+0.25f) : spectate->GetPositionZ()+0.25f;
|
||||
float z = spectate->GetMapId() == 618 ? std::max(28.27f, spectate->GetPositionZ() + 0.25f) : spectate->GetPositionZ() + 0.25f;
|
||||
player->TeleportTo(spectate->GetMapId(), spectate->GetPositionX(), spectate->GetPositionY(), z, spectate->GetOrientation(), TELE_TO_GM_MODE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
GameTele const* tele = handler->extractGameTeleFromLink((char*)args);
|
||||
if (!tele)
|
||||
{
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
|
||||
handler->PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), handler->GetAcoreString(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);
|
||||
sMapMgr->GetZoneId(tele->mapId, tele->position_x, tele->position_y, tele->position_z), target_guid);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
|
||||
std::string const assignedName = ticket->GetAssignedToName();
|
||||
std::string msg = ticket->FormatMessageString(*handler, assignedName.empty() ? nullptr : assignedName.c_str(), nullptr, nullptr, nullptr);
|
||||
|
||||
|
||||
msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName().c_str() : "Console", comment);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
@@ -401,7 +401,7 @@ public:
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
std::string msg = ticket->FormatMessageString(*handler, nullptr, assignedTo.c_str(),
|
||||
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", nullptr);
|
||||
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", nullptr);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
return true;
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
uint32 maxpathid = result->Fetch()->GetInt32();
|
||||
pathid = maxpathid+1;
|
||||
pathid = maxpathid + 1;
|
||||
handler->PSendSysMessage("%s%s|r", "|cff00ff00", "New path started.");
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
|
||||
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
|
||||
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
|
||||
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;
|
||||
@@ -365,8 +365,7 @@ public:
|
||||
a11 = fields[9].GetFloat();
|
||||
|
||||
handler->PSendSysMessage("|cffff33ffid:|r|cff00ffff %u|r|cff00ff00, guid: |r|cff00ffff%u|r|cff00ff00, delay: |r|cff00ffff%u|r|cff00ff00, command: |r|cff00ffff%u|r|cff00ff00, datalong: |r|cff00ffff%u|r|cff00ff00, datalong2: |r|cff00ffff%u|r|cff00ff00, datatext: |r|cff00ffff%s|r|cff00ff00, posx: |r|cff00ffff%f|r|cff00ff00, posy: |r|cff00ffff%f|r|cff00ff00, posz: |r|cff00ffff%f|r|cff00ff00, orientation: |r|cff00ffff%f|r", id, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
if (show == "del")
|
||||
@@ -428,8 +427,8 @@ public:
|
||||
std::string arg_string = arg_2;
|
||||
|
||||
if ((arg_string != "setid") && (arg_string != "delay") && (arg_string != "command")
|
||||
&& (arg_string != "datalong") && (arg_string != "datalong2") && (arg_string != "dataint") && (arg_string != "posx")
|
||||
&& (arg_string != "posy") && (arg_string != "posz") && (arg_string != "orientation"))
|
||||
&& (arg_string != "datalong") && (arg_string != "datalong2") && (arg_string != "dataint") && (arg_string != "posx")
|
||||
&& (arg_string != "posy") && (arg_string != "posz") && (arg_string != "orientation"))
|
||||
{
|
||||
handler->SendSysMessage("|cffff33ffERROR: No valid argument present.|r");
|
||||
return true;
|
||||
@@ -554,8 +553,8 @@ public:
|
||||
// Check
|
||||
// Remember: "show" must also be the name of a column!
|
||||
if ((show != "delay") && (show != "action") && (show != "action_chance")
|
||||
&& (show != "move_type") && (show != "del") && (show != "move") && (show != "wpadd")
|
||||
)
|
||||
&& (show != "move_type") && (show != "del") && (show != "move") && (show != "wpadd")
|
||||
)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -619,8 +618,7 @@ public:
|
||||
Field* fields = result->Fetch();
|
||||
pathid = fields[0].GetUInt32();
|
||||
point = fields[1].GetUInt32();
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
// We have the waypoint number and the GUID of the "master npc"
|
||||
// Text is enclosed in "<>", all other arguments not
|
||||
@@ -719,7 +717,7 @@ public:
|
||||
return true;
|
||||
} // move
|
||||
|
||||
const char *text = arg_str;
|
||||
const char* text = arg_str;
|
||||
|
||||
if (text == 0)
|
||||
{
|
||||
@@ -824,8 +822,7 @@ public:
|
||||
handler->PSendSysMessage("|cff00ff00Show info: Move flag: |r|cff00ffff%u|r", flag);
|
||||
handler->PSendSysMessage("|cff00ff00Show info: Waypoint event: |r|cff00ffff%u|r", ev_id);
|
||||
handler->PSendSysMessage("|cff00ff00Show info: Event chance: |r|cff00ffff%u|r", ev_chance);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -881,8 +878,7 @@ public:
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
|
||||
}
|
||||
while (result2->NextRow());
|
||||
} while (result2->NextRow());
|
||||
|
||||
if (hasError)
|
||||
{
|
||||
@@ -938,8 +934,7 @@ public:
|
||||
wpCreature->SetObjectScale(0.5f);
|
||||
wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point);
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
handler->SendSysMessage("|cff00ff00Showing the current creature's path.|r");
|
||||
return true;
|
||||
@@ -1079,8 +1074,7 @@ public:
|
||||
creature->DeleteFromDB();
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
// set "wpguid" column to "empty" - no visual waypoint spawned
|
||||
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user