Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources
This commit is contained in:
1 parent
7fff6c424f
commit
5ff847159c
1243 files changed
+29780
-36517
No files matched your search
@@ -91,10 +91,6 @@ endforeach()
|
||||
# Base sources which are used by every script project
|
||||
if (USE_SCRIPTPCH)
|
||||
set(PRIVATE_PCH_HEADER ScriptPCH.h)
|
||||
set(PRIVATE_PCH_SOURCE ScriptPCH.cpp)
|
||||
if (MSVC)
|
||||
list(INSERT PRIVATE_SOURCES 0 ScriptPCH.cpp)
|
||||
endif (MSVC)
|
||||
endif ()
|
||||
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
@@ -161,14 +157,13 @@ foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
|
||||
GetProjectNameOfScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PROJECT_NAME)
|
||||
# Add the module name to DYNAMIC_SCRIPT_MODULES
|
||||
list(APPEND DYNAMIC_SCRIPT_MODULE_PROJECTS ${SCRIPT_MODULE_PROJECT_NAME})
|
||||
if (USE_SCRIPTPCH AND MSVC)
|
||||
list(INSERT SCRIPT_MODULE_PRIVATE_SOURCES 0 ScriptPCH.cpp)
|
||||
endif (USE_SCRIPTPCH AND MSVC)
|
||||
# Create the script module project
|
||||
add_library(${SCRIPT_MODULE_PROJECT_NAME} SHARED
|
||||
${SCRIPT_MODULE_PRIVATE_SOURCES}
|
||||
${SCRIPT_MODULE_PRIVATE_SCRIPTLOADER})
|
||||
target_link_libraries(${SCRIPT_MODULE_PROJECT_NAME}
|
||||
PRIVATE
|
||||
trinity-core-interface
|
||||
PUBLIC
|
||||
game)
|
||||
set_target_properties(${SCRIPT_MODULE_PROJECT_NAME}
|
||||
@@ -209,6 +204,8 @@ add_library(scripts STATIC
|
||||
${PRIVATE_SOURCES})
|
||||
|
||||
target_link_libraries(scripts
|
||||
PRIVATE
|
||||
trinity-core-interface
|
||||
PUBLIC
|
||||
game)
|
||||
|
||||
|
||||
@@ -24,9 +24,14 @@ EndScriptData */
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "IpAddress.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class account_commandscript : public CommandScript
|
||||
{
|
||||
@@ -43,7 +48,7 @@ public:
|
||||
static std::vector<ChatCommand> accountSetCommandTable =
|
||||
{
|
||||
{ "addon", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_ADDON, true, &HandleAccountSetAddonCommand, "" },
|
||||
{ "sec", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SEC, true, NULL, "", accountSetSecTable },
|
||||
{ "sec", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SEC, true, nullptr, "", accountSetSecTable },
|
||||
{ "gmlevel", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_GMLEVEL, true, &HandleAccountSetGmLevelCommand, "" },
|
||||
{ "password", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_PASSWORD, true, &HandleAccountSetPasswordCommand, "" },
|
||||
};
|
||||
@@ -59,14 +64,14 @@ public:
|
||||
{ "delete", rbac::RBAC_PERM_COMMAND_ACCOUNT_DELETE, true, &HandleAccountDeleteCommand, "" },
|
||||
{ "email", rbac::RBAC_PERM_COMMAND_ACCOUNT_EMAIL, false, &HandleAccountEmailCommand, "" },
|
||||
{ "onlinelist", rbac::RBAC_PERM_COMMAND_ACCOUNT_ONLINE_LIST, true, &HandleAccountOnlineListCommand, "" },
|
||||
{ "lock", rbac::RBAC_PERM_COMMAND_ACCOUNT_LOCK, false, NULL, "", accountLockCommandTable },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET, true, NULL, "", accountSetCommandTable },
|
||||
{ "lock", rbac::RBAC_PERM_COMMAND_ACCOUNT_LOCK, false, nullptr, "", accountLockCommandTable },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET, true, nullptr, "", accountSetCommandTable },
|
||||
{ "password", rbac::RBAC_PERM_COMMAND_ACCOUNT_PASSWORD, false, &HandleAccountPasswordCommand, "" },
|
||||
{ "", rbac::RBAC_PERM_COMMAND_ACCOUNT, false, &HandleAccountCommand, "" },
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "account", rbac::RBAC_PERM_COMMAND_ACCOUNT, true, NULL, "", accountCommandTable },
|
||||
{ "account", rbac::RBAC_PERM_COMMAND_ACCOUNT, true, nullptr, "", accountCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -113,8 +118,8 @@ public:
|
||||
|
||||
///- %Parse the command line arguments
|
||||
char* accountName = strtok((char*)args, " ");
|
||||
char* password = strtok(NULL, " ");
|
||||
char* possibleEmail = strtok(NULL, " ' ");
|
||||
char* password = strtok(nullptr, " ");
|
||||
char* possibleEmail = strtok(nullptr, " ' ");
|
||||
if (possibleEmail)
|
||||
email = possibleEmail;
|
||||
|
||||
@@ -196,7 +201,7 @@ public:
|
||||
/// Commands not recommended call from chat, but support anyway
|
||||
/// can delete only for account with less security
|
||||
/// This is also reject self apply in fact
|
||||
if (handler->HasLowerSecurityAccount(NULL, accountId, true))
|
||||
if (handler->HasLowerSecurityAccount(nullptr, accountId, true))
|
||||
return false;
|
||||
|
||||
AccountOpResult result = AccountMgr::DeleteAccount(accountId);
|
||||
@@ -286,7 +291,7 @@ public:
|
||||
if (param == "on")
|
||||
{
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGON_COUNTRY);
|
||||
uint32 ip = inet_addr(handler->GetSession()->GetRemoteAddress().c_str());
|
||||
uint32 ip = Trinity::Net::address_to_uint(Trinity::Net::make_address_v4(handler->GetSession()->GetRemoteAddress()));
|
||||
EndianConvertReverse(ip);
|
||||
stmt->setUInt32(0, ip);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
@@ -368,9 +373,9 @@ public:
|
||||
}
|
||||
|
||||
char* oldEmail = strtok((char*)args, " ");
|
||||
char* password = strtok(NULL, " ");
|
||||
char* email = strtok(NULL, " ");
|
||||
char* emailConfirmation = strtok(NULL, " ");
|
||||
char* password = strtok(nullptr, " ");
|
||||
char* email = strtok(nullptr, " ");
|
||||
char* emailConfirmation = strtok(nullptr, " ");
|
||||
|
||||
if (!oldEmail || !password || !email || !emailConfirmation)
|
||||
{
|
||||
@@ -462,9 +467,9 @@ public:
|
||||
|
||||
// Command is supposed to be: .account password [$oldpassword] [$newpassword] [$newpasswordconfirmation] [$emailconfirmation]
|
||||
char* oldPassword = strtok((char*)args, " "); // This extracts [$oldpassword]
|
||||
char* newPassword = strtok(NULL, " "); // This extracts [$newpassword]
|
||||
char* passwordConfirmation = strtok(NULL, " "); // This extracts [$newpasswordconfirmation]
|
||||
char const* emailConfirmation = strtok(NULL, " "); // This defines the emailConfirmation variable, which is optional depending on sec type.
|
||||
char* newPassword = strtok(nullptr, " "); // This extracts [$newpassword]
|
||||
char* passwordConfirmation = strtok(nullptr, " "); // This extracts [$newpasswordconfirmation]
|
||||
char const* emailConfirmation = strtok(nullptr, " "); // This defines the emailConfirmation variable, which is optional depending on sec type.
|
||||
if (!emailConfirmation) // This extracts [$emailconfirmation]. If it doesn't exist, however...
|
||||
emailConfirmation = ""; // ... it's simply "" for emailConfirmation.
|
||||
|
||||
@@ -580,7 +585,7 @@ public:
|
||||
{
|
||||
///- Get the command line arguments
|
||||
char* account = strtok((char*)args, " ");
|
||||
char* exp = strtok(NULL, " ");
|
||||
char* exp = strtok(nullptr, " ");
|
||||
|
||||
if (!account)
|
||||
return false;
|
||||
@@ -621,7 +626,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(NULL, accountId, true))
|
||||
handler->HasLowerSecurityAccount(nullptr, accountId, true))
|
||||
return false;
|
||||
|
||||
int expansion = atoi(exp); //get int anyway (0 if error)
|
||||
@@ -653,8 +658,8 @@ public:
|
||||
uint32 targetSecurity = 0;
|
||||
uint32 gm = 0;
|
||||
char* arg1 = strtok((char*)args, " ");
|
||||
char* arg2 = strtok(NULL, " ");
|
||||
char* arg3 = strtok(NULL, " ");
|
||||
char* arg2 = strtok(nullptr, " ");
|
||||
char* arg3 = strtok(nullptr, " ");
|
||||
bool isAccountNameGiven = true;
|
||||
|
||||
if (!arg3)
|
||||
@@ -689,7 +694,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
// handler->getSession() == NULL only for console
|
||||
// handler->getSession() == nullptr only for console
|
||||
targetAccountId = (isAccountNameGiven) ? AccountMgr::GetId(targetAccountName) : handler->getSelectedPlayer()->GetSession()->GetAccountId();
|
||||
int32 gmRealmID = (isAccountNameGiven) ? atoi(arg3) : atoi(arg2);
|
||||
uint32 playerSecurity;
|
||||
@@ -734,7 +739,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
rbac::RBACData* rbac = isAccountNameGiven ? NULL : handler->getSelectedPlayer()->GetSession()->GetRBACData();
|
||||
rbac::RBACData* rbac = isAccountNameGiven ? nullptr : handler->getSelectedPlayer()->GetSession()->GetRBACData();
|
||||
sAccountMgr->UpdateAccountAccess(rbac, targetAccountId, uint8(gm), gmRealmID);
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm);
|
||||
@@ -753,8 +758,8 @@ public:
|
||||
|
||||
///- Get the command line arguments
|
||||
char* account = strtok((char*)args, " ");
|
||||
char* password = strtok(NULL, " ");
|
||||
char* passwordConfirmation = strtok(NULL, " ");
|
||||
char* password = strtok(nullptr, " ");
|
||||
char* passwordConfirmation = strtok(nullptr, " ");
|
||||
|
||||
if (!account || !password || !passwordConfirmation)
|
||||
return false;
|
||||
@@ -777,7 +782,7 @@ public:
|
||||
|
||||
/// can set password only for target with less security
|
||||
/// This also restricts setting handler's own password
|
||||
if (handler->HasLowerSecurityAccount(NULL, targetAccountId, true))
|
||||
if (handler->HasLowerSecurityAccount(nullptr, targetAccountId, true))
|
||||
return false;
|
||||
|
||||
if (strcmp(password, passwordConfirmation) != 0)
|
||||
@@ -818,8 +823,8 @@ public:
|
||||
|
||||
///- Get the command line arguments
|
||||
char* account = strtok((char*)args, " ");
|
||||
char* email = strtok(NULL, " ");
|
||||
char* emailConfirmation = strtok(NULL, " ");
|
||||
char* email = strtok(nullptr, " ");
|
||||
char* emailConfirmation = strtok(nullptr, " ");
|
||||
|
||||
if (!account || !email || !emailConfirmation)
|
||||
{
|
||||
@@ -846,7 +851,7 @@ public:
|
||||
|
||||
/// can set email only for target with less security
|
||||
/// This also restricts setting handler's own email.
|
||||
if (handler->HasLowerSecurityAccount(NULL, targetAccountId, true))
|
||||
if (handler->HasLowerSecurityAccount(nullptr, targetAccountId, true))
|
||||
return false;
|
||||
|
||||
if (strcmp(email, emailConfirmation) != 0)
|
||||
@@ -894,8 +899,8 @@ public:
|
||||
|
||||
///- Get the command line arguments
|
||||
char* account = strtok((char*)args, " ");
|
||||
char* email = strtok(NULL, " ");
|
||||
char* emailConfirmation = strtok(NULL, " ");
|
||||
char* email = strtok(nullptr, " ");
|
||||
char* emailConfirmation = strtok(nullptr, " ");
|
||||
|
||||
if (!account || !email || !emailConfirmation)
|
||||
{
|
||||
@@ -922,7 +927,7 @@ public:
|
||||
|
||||
/// can set email only for target with less security
|
||||
/// This also restricts setting handler's own email.
|
||||
if (handler->HasLowerSecurityAccount(NULL, targetAccountId, true))
|
||||
if (handler->HasLowerSecurityAccount(nullptr, targetAccountId, true))
|
||||
return false;
|
||||
|
||||
if (strcmp(email, emailConfirmation) != 0)
|
||||
|
||||
@@ -22,11 +22,12 @@ Comment: All achievement related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
|
||||
class achievement_commandscript : public CommandScript
|
||||
{
|
||||
@@ -41,7 +42,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "achievement", rbac::RBAC_PERM_COMMAND_ACHIEVEMENT, false, NULL, "", achievementCommandTable },
|
||||
{ "achievement", rbac::RBAC_PERM_COMMAND_ACHIEVEMENT, false, nullptr, "", achievementCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AuctionHouseBot.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "AuctionHouseBot.h"
|
||||
#include "RBAC.h"
|
||||
|
||||
static const uint32 ahbotQualityIds[MAX_AUCTION_QUALITY] =
|
||||
uint32 const ahbotQualityIds[MAX_AUCTION_QUALITY] =
|
||||
{
|
||||
LANG_AHBOT_QUALITY_GRAY, LANG_AHBOT_QUALITY_WHITE,
|
||||
LANG_AHBOT_QUALITY_GREEN, LANG_AHBOT_QUALITY_BLUE,
|
||||
@@ -57,8 +58,8 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> ahbotCommandTable =
|
||||
{
|
||||
{ "items", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS, true, NULL, "", ahbotItemsAmountCommandTable },
|
||||
{ "ratio", rbac::RBAC_PERM_COMMAND_AHBOT_RATIO, true, NULL, "", ahbotItemsRatioCommandTable },
|
||||
{ "items", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS, true, nullptr, "", ahbotItemsAmountCommandTable },
|
||||
{ "ratio", rbac::RBAC_PERM_COMMAND_AHBOT_RATIO, true, nullptr, "", ahbotItemsRatioCommandTable },
|
||||
{ "rebuild", rbac::RBAC_PERM_COMMAND_AHBOT_REBUILD, true, &HandleAHBotRebuildCommand, "" },
|
||||
{ "reload", rbac::RBAC_PERM_COMMAND_AHBOT_RELOAD, true, &HandleAHBotReloadCommand, "" },
|
||||
{ "status", rbac::RBAC_PERM_COMMAND_AHBOT_STATUS, true, &HandleAHBotStatusCommand, "" },
|
||||
@@ -66,13 +67,13 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "ahbot", rbac::RBAC_PERM_COMMAND_AHBOT, false, NULL, "", ahbotCommandTable },
|
||||
{ "ahbot", rbac::RBAC_PERM_COMMAND_AHBOT, false, nullptr, "", ahbotCommandTable },
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static bool HandleAHBotItemsAmountCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleAHBotItemsAmountCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
uint32 qVals[MAX_AUCTION_QUALITY];
|
||||
char* arg = strtok((char*)args, " ");
|
||||
@@ -81,7 +82,7 @@ public:
|
||||
if (!arg)
|
||||
return false;
|
||||
qVals[i] = atoi(arg);
|
||||
arg = strtok(NULL, " ");
|
||||
arg = strtok(nullptr, " ");
|
||||
}
|
||||
|
||||
sAuctionBot->SetItemsAmount(qVals);
|
||||
@@ -93,7 +94,7 @@ public:
|
||||
}
|
||||
|
||||
template <AuctionQuality Q>
|
||||
static bool HandleAHBotItemsAmountQualityCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleAHBotItemsAmountQualityCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
char* arg = strtok((char*)args, " ");
|
||||
if (!arg)
|
||||
@@ -107,7 +108,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleAHBotItemsRatioCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleAHBotItemsRatioCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
uint32 rVal[MAX_AUCTION_QUALITY];
|
||||
char* arg = strtok((char*)args, " ");
|
||||
@@ -116,7 +117,7 @@ public:
|
||||
if (!arg)
|
||||
return false;
|
||||
rVal[i] = atoi(arg);
|
||||
arg = strtok(NULL, " ");
|
||||
arg = strtok(nullptr, " ");
|
||||
}
|
||||
|
||||
sAuctionBot->SetItemsRatio(rVal[0], rVal[1], rVal[2]);
|
||||
@@ -127,7 +128,7 @@ public:
|
||||
}
|
||||
|
||||
template<AuctionHouseType H>
|
||||
static bool HandleAHBotItemsRatioHouseCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleAHBotItemsRatioHouseCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
char* arg = strtok((char*)args, " ");
|
||||
if (!arg)
|
||||
@@ -139,7 +140,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleAHBotRebuildCommand(ChatHandler* /*handler*/, const char* args)
|
||||
static bool HandleAHBotRebuildCommand(ChatHandler* /*handler*/, char const* args)
|
||||
{
|
||||
char* arg = strtok((char*)args, " ");
|
||||
|
||||
@@ -151,14 +152,14 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleAHBotReloadCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleAHBotReloadCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
sAuctionBot->ReloadAllConfig();
|
||||
handler->SendSysMessage(LANG_AHBOT_RELOAD_OK);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleAHBotStatusCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleAHBotStatusCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
char* arg = strtok((char*)args, " ");
|
||||
if (!arg)
|
||||
@@ -227,17 +228,17 @@ public:
|
||||
|
||||
};
|
||||
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GRAY>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_WHITE>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GREEN>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_BLUE>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_PURPLE>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_ORANGE>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_YELLOW>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GRAY>(ChatHandler* handler, char const*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_WHITE>(ChatHandler* handler, char const*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GREEN>(ChatHandler* handler, char const*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_BLUE>(ChatHandler* handler, char const*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_PURPLE>(ChatHandler* handler, char const*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_ORANGE>(ChatHandler* handler, char const*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_YELLOW>(ChatHandler* handler, char const*);
|
||||
|
||||
template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_ALLIANCE>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_HORDE>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_NEUTRAL>(ChatHandler* handler, const char*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_ALLIANCE>(ChatHandler* handler, char const*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_HORDE>(ChatHandler* handler, char const*);
|
||||
template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_NEUTRAL>(ChatHandler* handler, char const*);
|
||||
|
||||
void AddSC_ahbot_commandscript()
|
||||
{
|
||||
|
||||
@@ -22,13 +22,16 @@ Comment: All arena team related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class arena_commandscript : public CommandScript
|
||||
{
|
||||
@@ -48,7 +51,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "arena", rbac::RBAC_PERM_COMMAND_ARENA, false, NULL, "", arenaCommandTable },
|
||||
{ "arena", rbac::RBAC_PERM_COMMAND_ARENA, false, nullptr, "", arenaCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -59,10 +62,10 @@ public:
|
||||
return false;
|
||||
|
||||
Player* target;
|
||||
if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : NULL, &target))
|
||||
if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : nullptr, &target))
|
||||
return false;
|
||||
|
||||
char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
|
||||
char* tailStr = *args != '"' ? strtok(nullptr, "") : (char*)args;
|
||||
if (!tailStr)
|
||||
return false;
|
||||
|
||||
@@ -70,7 +73,7 @@ public:
|
||||
if (!name)
|
||||
return false;
|
||||
|
||||
char* typeStr = strtok(NULL, "");
|
||||
char* typeStr = strtok(nullptr, "");
|
||||
if (!typeStr)
|
||||
return false;
|
||||
|
||||
@@ -168,7 +171,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char const* newArenaStr = handler->extractQuotedArg(strtok(NULL, ""));
|
||||
char const* newArenaStr = handler->extractQuotedArg(strtok(nullptr, ""));
|
||||
if (!newArenaStr)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
|
||||
@@ -22,14 +22,18 @@ Comment: All ban related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class ban_commandscript : public CommandScript
|
||||
{
|
||||
@@ -66,10 +70,10 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "ban", rbac::RBAC_PERM_COMMAND_BAN, true, NULL, "", banCommandTable },
|
||||
{ "baninfo", rbac::RBAC_PERM_COMMAND_BANINFO, true, NULL, "", baninfoCommandTable },
|
||||
{ "banlist", rbac::RBAC_PERM_COMMAND_BANLIST, true, NULL, "", banlistCommandTable },
|
||||
{ "unban", rbac::RBAC_PERM_COMMAND_UNBAN, true, NULL, "", unbanCommandTable },
|
||||
{ "ban", rbac::RBAC_PERM_COMMAND_BAN, true, nullptr, "", banCommandTable },
|
||||
{ "baninfo", rbac::RBAC_PERM_COMMAND_BANINFO, true, nullptr, "", baninfoCommandTable },
|
||||
{ "banlist", rbac::RBAC_PERM_COMMAND_BANLIST, true, nullptr, "", banlistCommandTable },
|
||||
{ "unban", rbac::RBAC_PERM_COMMAND_UNBAN, true, nullptr, "", unbanCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -90,11 +94,11 @@ public:
|
||||
|
||||
std::string name = nameStr;
|
||||
|
||||
char* durationStr = strtok(NULL, " ");
|
||||
char* durationStr = strtok(nullptr, " ");
|
||||
if (!durationStr || !atoi(durationStr))
|
||||
return false;
|
||||
|
||||
char* reasonStr = strtok(NULL, "");
|
||||
char* reasonStr = strtok(nullptr, "");
|
||||
if (!reasonStr)
|
||||
return false;
|
||||
|
||||
@@ -161,11 +165,11 @@ public:
|
||||
|
||||
std::string nameOrIP = cnameOrIP;
|
||||
|
||||
char* durationStr = strtok(NULL, " ");
|
||||
char* durationStr = strtok(nullptr, " ");
|
||||
if (!durationStr || !atoi(durationStr))
|
||||
return false;
|
||||
|
||||
char* reasonStr = strtok(NULL, "");
|
||||
char* reasonStr = strtok(nullptr, "");
|
||||
if (!reasonStr)
|
||||
return false;
|
||||
|
||||
@@ -281,7 +285,7 @@ public:
|
||||
|
||||
time_t unbanDate = time_t(fields[3].GetUInt32());
|
||||
bool active = false;
|
||||
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(NULL)))
|
||||
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(nullptr)))
|
||||
active = true;
|
||||
bool permanent = (fields[1].GetUInt64() == uint64(0));
|
||||
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
@@ -339,7 +343,7 @@ public:
|
||||
Field* fields = result->Fetch();
|
||||
time_t unbanDate = time_t(fields[3].GetUInt32());
|
||||
bool active = false;
|
||||
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(NULL)))
|
||||
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(nullptr)))
|
||||
active = true;
|
||||
bool permanent = (fields[1].GetUInt32() == uint32(0));
|
||||
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt32(), true);
|
||||
@@ -385,7 +389,7 @@ public:
|
||||
|
||||
static bool HandleBanListAccountCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
@@ -15,12 +15,16 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "BattlenetAccountMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "BattlenetAccountMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class battlenet_account_commandscript : public CommandScript
|
||||
{
|
||||
@@ -43,14 +47,14 @@ public:
|
||||
static std::vector<ChatCommand> accountCommandTable =
|
||||
{
|
||||
{ "create", rbac::RBAC_PERM_COMMAND_BNET_ACCOUNT_CREATE, true, &HandleAccountCreateCommand, "" },
|
||||
{ "lock", rbac::RBAC_PERM_COMMAND_BNET_ACCOUNT, false, NULL, "", accountLockCommandTable },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_BNET_ACCOUNT_SET, true, NULL, "", accountSetCommandTable },
|
||||
{ "lock", rbac::RBAC_PERM_COMMAND_BNET_ACCOUNT, false, nullptr, "", accountLockCommandTable },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_BNET_ACCOUNT_SET, true, nullptr, "", accountSetCommandTable },
|
||||
{ "password", rbac::RBAC_PERM_COMMAND_BNET_ACCOUNT_PASSWORD, false, &HandleAccountPasswordCommand, "" },
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "battlenetaccount", rbac::RBAC_PERM_COMMAND_BNET_ACCOUNT, true, NULL, "", accountCommandTable },
|
||||
{ "battlenetaccount", rbac::RBAC_PERM_COMMAND_BNET_ACCOUNT, true, nullptr, "", accountCommandTable },
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
@@ -66,7 +70,7 @@ public:
|
||||
|
||||
///- %Parse the command line arguments
|
||||
char* accountName = strtok((char*)args, " ");
|
||||
char* password = strtok(NULL, " ");
|
||||
char* password = strtok(nullptr, " ");
|
||||
if (!accountName || !password)
|
||||
return false;
|
||||
|
||||
@@ -210,8 +214,8 @@ public:
|
||||
|
||||
// Command is supposed to be: .account password [$oldpassword] [$newpassword] [$newpasswordconfirmation] [$emailconfirmation]
|
||||
char* oldPassword = strtok((char*)args, " "); // This extracts [$oldpassword]
|
||||
char* newPassword = strtok(NULL, " "); // This extracts [$newpassword]
|
||||
char* passwordConfirmation = strtok(NULL, " "); // This extracts [$newpasswordconfirmation]
|
||||
char* newPassword = strtok(nullptr, " "); // This extracts [$newpassword]
|
||||
char* passwordConfirmation = strtok(nullptr, " "); // This extracts [$newpasswordconfirmation]
|
||||
|
||||
//Is any of those variables missing for any reason ? We return false.
|
||||
if (!oldPassword || !newPassword || !passwordConfirmation)
|
||||
@@ -275,8 +279,8 @@ public:
|
||||
|
||||
///- Get the command line arguments
|
||||
char* account = strtok((char*)args, " ");
|
||||
char* password = strtok(NULL, " ");
|
||||
char* passwordConfirmation = strtok(NULL, " ");
|
||||
char* password = strtok(nullptr, " ");
|
||||
char* passwordConfirmation = strtok(nullptr, " ");
|
||||
|
||||
if (!account || !password || !passwordConfirmation)
|
||||
return false;
|
||||
|
||||
@@ -23,8 +23,9 @@ Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "RBAC.h"
|
||||
|
||||
class bf_commandscript : public CommandScript
|
||||
{
|
||||
@@ -43,12 +44,12 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "bf", rbac::RBAC_PERM_COMMAND_BF, false, NULL, "", battlefieldcommandTable },
|
||||
{ "bf", rbac::RBAC_PERM_COMMAND_BF, false, nullptr, "", battlefieldcommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static bool HandleBattlefieldStart(ChatHandler* handler, const char* args)
|
||||
static bool HandleBattlefieldStart(ChatHandler* handler, char const* args)
|
||||
{
|
||||
uint32 battleid = 0;
|
||||
char* battleid_str = strtok((char*)args, " ");
|
||||
@@ -70,7 +71,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleBattlefieldEnd(ChatHandler* handler, const char* args)
|
||||
static bool HandleBattlefieldEnd(ChatHandler* handler, char const* args)
|
||||
{
|
||||
uint32 battleid = 0;
|
||||
char* battleid_str = strtok((char*)args, " ");
|
||||
@@ -92,7 +93,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleBattlefieldEnable(ChatHandler* handler, const char* args)
|
||||
static bool HandleBattlefieldEnable(ChatHandler* handler, char const* args)
|
||||
{
|
||||
uint32 battleid = 0;
|
||||
char* battleid_str = strtok((char*)args, " ");
|
||||
@@ -122,7 +123,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleBattlefieldSwitch(ChatHandler* handler, const char* args)
|
||||
static bool HandleBattlefieldSwitch(ChatHandler* handler, char const* args)
|
||||
{
|
||||
uint32 battleid = 0;
|
||||
char* battleid_str = strtok((char*)args, " ");
|
||||
@@ -143,14 +144,14 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleBattlefieldTimer(ChatHandler* handler, const char* args)
|
||||
static bool HandleBattlefieldTimer(ChatHandler* handler, char const* args)
|
||||
{
|
||||
uint32 battleid = 0;
|
||||
uint32 time = 0;
|
||||
char* battleid_str = strtok((char*)args, " ");
|
||||
if (!battleid_str)
|
||||
return false;
|
||||
char* time_str = strtok(NULL, " ");
|
||||
char* time_str = strtok(nullptr, " ");
|
||||
if (!time_str)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ EndScriptData */
|
||||
#include "Creature.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class cast_commandscript : public CommandScript
|
||||
{
|
||||
@@ -46,7 +49,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "cast", rbac::RBAC_PERM_COMMAND_CAST, false, NULL, "", castCommandTable },
|
||||
{ "cast", rbac::RBAC_PERM_COMMAND_CAST, false, nullptr, "", castCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -91,7 +94,7 @@ public:
|
||||
if (!CheckSpellExistsAndIsValid(handler, spellId))
|
||||
return false;
|
||||
|
||||
char* triggeredStr = strtok(NULL, " ");
|
||||
char* triggeredStr = strtok(nullptr, " ");
|
||||
if (triggeredStr)
|
||||
{
|
||||
int l = strlen(triggeredStr);
|
||||
@@ -99,7 +102,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
handler->GetSession()->GetPlayer()->CastSpell(target, spellId, triggered);
|
||||
|
||||
return true;
|
||||
@@ -123,7 +126,7 @@ public:
|
||||
if (!CheckSpellExistsAndIsValid(handler, spellId))
|
||||
return false;
|
||||
|
||||
char* triggeredStr = strtok(NULL, " ");
|
||||
char* triggeredStr = strtok(nullptr, " ");
|
||||
if (triggeredStr)
|
||||
{
|
||||
int l = strlen(triggeredStr);
|
||||
@@ -131,7 +134,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
caster->CastSpell(handler->GetSession()->GetPlayer(), spellId, triggered);
|
||||
|
||||
return true;
|
||||
@@ -150,14 +153,14 @@ public:
|
||||
if (!CheckSpellExistsAndIsValid(handler, spellId))
|
||||
return false;
|
||||
|
||||
char* distStr = strtok(NULL, " ");
|
||||
char* distStr = strtok(nullptr, " ");
|
||||
|
||||
float dist = 0;
|
||||
|
||||
if (distStr)
|
||||
sscanf(distStr, "%f", &dist);
|
||||
|
||||
char* triggeredStr = strtok(NULL, " ");
|
||||
char* triggeredStr = strtok(nullptr, " ");
|
||||
if (triggeredStr)
|
||||
{
|
||||
int l = strlen(triggeredStr);
|
||||
@@ -165,7 +168,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
float x, y, z;
|
||||
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist);
|
||||
|
||||
@@ -219,7 +222,7 @@ public:
|
||||
if (!CheckSpellExistsAndIsValid(handler, spellId))
|
||||
return false;
|
||||
|
||||
char* triggeredStr = strtok(NULL, " ");
|
||||
char* triggeredStr = strtok(nullptr, " ");
|
||||
if (triggeredStr)
|
||||
{
|
||||
int l = strlen(triggeredStr);
|
||||
@@ -227,7 +230,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
caster->CastSpell(caster->GetVictim(), spellId, triggered);
|
||||
|
||||
return true;
|
||||
@@ -251,9 +254,9 @@ public:
|
||||
if (!CheckSpellExistsAndIsValid(handler, spellId))
|
||||
return false;
|
||||
|
||||
char* posX = strtok(NULL, " ");
|
||||
char* posY = strtok(NULL, " ");
|
||||
char* posZ = strtok(NULL, " ");
|
||||
char* posX = strtok(nullptr, " ");
|
||||
char* posY = strtok(nullptr, " ");
|
||||
char* posZ = strtok(nullptr, " ");
|
||||
|
||||
if (!posX || !posY || !posZ)
|
||||
return false;
|
||||
@@ -262,7 +265,7 @@ public:
|
||||
float y = float(atof(posY));
|
||||
float z = float(atof(posZ));
|
||||
|
||||
char* triggeredStr = strtok(NULL, " ");
|
||||
char* triggeredStr = strtok(nullptr, " ");
|
||||
if (triggeredStr)
|
||||
{
|
||||
int l = strlen(triggeredStr);
|
||||
@@ -270,7 +273,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
|
||||
caster->CastSpell(x, y, z, spellId, triggered);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -22,14 +22,21 @@ Comment: All character related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PlayerDump.h"
|
||||
#include "Player.h"
|
||||
#include "PlayerDump.h"
|
||||
#include "RBAC.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class character_commandscript : public CommandScript
|
||||
{
|
||||
@@ -57,7 +64,7 @@ public:
|
||||
{ "changefaction", rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGEFACTION, true, &HandleCharacterChangeFactionCommand, "", },
|
||||
{ "changerace", rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGERACE, true, &HandleCharacterChangeRaceCommand, "", },
|
||||
{ "changeaccount", rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGEACCOUNT, true, &HandleCharacterChangeAccountCommand, "", },
|
||||
{ "deleted", rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED, true, NULL, "", characterDeletedCommandTable },
|
||||
{ "deleted", rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED, true, nullptr, "", characterDeletedCommandTable },
|
||||
{ "erase", rbac::RBAC_PERM_COMMAND_CHARACTER_ERASE, true, &HandleCharacterEraseCommand, "", },
|
||||
{ "level", rbac::RBAC_PERM_COMMAND_CHARACTER_LEVEL, true, &HandleCharacterLevelCommand, "", },
|
||||
{ "rename", rbac::RBAC_PERM_COMMAND_CHARACTER_RENAME, true, &HandleCharacterRenameCommand, "", },
|
||||
@@ -67,9 +74,9 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "character", rbac::RBAC_PERM_COMMAND_CHARACTER, true, NULL, "", characterCommandTable },
|
||||
{ "character", rbac::RBAC_PERM_COMMAND_CHARACTER, true, nullptr, "", characterCommandTable },
|
||||
{ "levelup", rbac::RBAC_PERM_COMMAND_LEVELUP, false, &HandleLevelUpCommand, "" },
|
||||
{ "pdump", rbac::RBAC_PERM_COMMAND_PDUMP, true, NULL, "", pdumpCommandTable },
|
||||
{ "pdump", rbac::RBAC_PERM_COMMAND_PDUMP, true, nullptr, "", pdumpCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -269,11 +276,9 @@ public:
|
||||
char const* knownStr = handler->GetTrinityString(LANG_KNOWN);
|
||||
|
||||
// Search in CharTitles.dbc
|
||||
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
|
||||
for (CharTitlesEntry const* titleInfo : sCharTitlesStore)
|
||||
{
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
|
||||
if (titleInfo && target->HasTitle(titleInfo))
|
||||
if (target->HasTitle(titleInfo))
|
||||
{
|
||||
std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale;
|
||||
if (name.empty())
|
||||
@@ -288,9 +293,9 @@ public:
|
||||
|
||||
// send title in "id (idx:idx) - [namedlink locale]" format
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
|
||||
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, titleInfo->ID, titleInfo->bit_index, titleInfo->ID, titleNameStr, localeNames[loc], knownStr, activeStr);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
|
||||
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, titleInfo->ID, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +311,7 @@ public:
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
|
||||
return false;
|
||||
|
||||
char const* newNameStr = strtok(NULL, " ");
|
||||
char const* newNameStr = strtok(nullptr, " ");
|
||||
|
||||
if (newNameStr)
|
||||
{
|
||||
@@ -324,7 +329,7 @@ public:
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (handler->HasLowerSecurity(NULL, targetGuid))
|
||||
if (handler->HasLowerSecurity(nullptr, targetGuid))
|
||||
return false;
|
||||
|
||||
sCharacterCache->GetCharacterNameByGuid(targetGuid, playerOldName);
|
||||
@@ -410,7 +415,7 @@ public:
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (handler->HasLowerSecurity(NULL, targetGuid))
|
||||
if (handler->HasLowerSecurity(nullptr, targetGuid))
|
||||
return false;
|
||||
|
||||
std::string oldNameLink = handler->playerLink(targetName);
|
||||
@@ -457,7 +462,7 @@ public:
|
||||
newlevel = STRONG_MAX_LEVEL;
|
||||
|
||||
HandleCharacterLevel(target, targetGuid, oldlevel, newlevel, handler);
|
||||
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including player == NULL
|
||||
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including player == nullptr
|
||||
{
|
||||
std::string nameLink = handler->playerLink(targetName);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
|
||||
@@ -892,7 +897,7 @@ public:
|
||||
if (levelStr && isalpha(levelStr[0]))
|
||||
{
|
||||
nameStr = levelStr;
|
||||
levelStr = NULL; // current level will be used
|
||||
levelStr = nullptr; // current level will be used
|
||||
}
|
||||
|
||||
Player* target;
|
||||
@@ -913,7 +918,7 @@ public:
|
||||
|
||||
HandleCharacterLevel(target, targetGuid, oldlevel, newlevel, handler);
|
||||
|
||||
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including chr == NULL
|
||||
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including chr == nullptr
|
||||
{
|
||||
std::string nameLink = handler->playerLink(targetName);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
|
||||
@@ -931,7 +936,7 @@ public:
|
||||
if (!fileStr)
|
||||
return false;
|
||||
|
||||
char* accountStr = strtok(NULL, " ");
|
||||
char* accountStr = strtok(nullptr, " ");
|
||||
if (!accountStr)
|
||||
return false;
|
||||
|
||||
@@ -962,8 +967,8 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* guidStr = NULL;
|
||||
char* nameStr = strtok(NULL, " ");
|
||||
char* guidStr = nullptr;
|
||||
char* nameStr = strtok(nullptr, " ");
|
||||
|
||||
std::string name;
|
||||
if (nameStr)
|
||||
@@ -984,7 +989,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
guidStr = strtok(NULL, " ");
|
||||
guidStr = strtok(nullptr, " ");
|
||||
}
|
||||
|
||||
ObjectGuid::LowType guid = 0;
|
||||
@@ -1039,7 +1044,7 @@ public:
|
||||
return false;
|
||||
|
||||
char* fileStr = strtok((char*)args, " ");
|
||||
char* playerStr = strtok(NULL, " ");
|
||||
char* playerStr = strtok(nullptr, " ");
|
||||
|
||||
if (!fileStr || !playerStr)
|
||||
return false;
|
||||
|
||||
@@ -22,10 +22,12 @@ Comment: All cheat related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class cheat_commandscript : public CommandScript
|
||||
{
|
||||
@@ -49,12 +51,12 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "cheat", rbac::RBAC_PERM_COMMAND_CHEAT, false, NULL, "", cheatCommandTable },
|
||||
{ "cheat", rbac::RBAC_PERM_COMMAND_CHEAT, false, nullptr, "", cheatCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static bool HandleGodModeCheatCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleGodModeCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string argstr = (char*)args;
|
||||
|
||||
@@ -77,7 +79,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleCasttimeCheatCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleCasttimeCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string argstr = (char*)args;
|
||||
|
||||
@@ -100,7 +102,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleCoolDownCheatCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleCoolDownCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string argstr = (char*)args;
|
||||
|
||||
@@ -123,7 +125,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandlePowerCheatCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandlePowerCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string argstr = (char*)args;
|
||||
|
||||
@@ -146,12 +148,12 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleCheatStatusCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleCheatStatusCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
const char* enabled = "ON";
|
||||
const char* disabled = "OFF";
|
||||
char const* enabled = "ON";
|
||||
char const* disabled = "OFF";
|
||||
|
||||
handler->SendSysMessage(LANG_COMMAND_CHEAT_STATUS);
|
||||
handler->PSendSysMessage(LANG_COMMAND_CHEAT_GOD, player->GetCommandStatus(CHEAT_GOD) ? enabled : disabled);
|
||||
@@ -164,7 +166,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWaterWalkCheatCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWaterWalkCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string argstr = (char*)args;
|
||||
|
||||
@@ -190,7 +192,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleTaxiCheatCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleTaxiCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string argstr = (char*)args;
|
||||
Player* chr = handler->getSelectedPlayer();
|
||||
|
||||
@@ -23,20 +23,22 @@ Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Bag.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Transport.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
|
||||
#include "M2Stores.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "RBAC.h"
|
||||
#include "Transport.h"
|
||||
#include "WorldSession.h"
|
||||
#include <fstream>
|
||||
#include <limits>
|
||||
|
||||
@@ -122,7 +124,9 @@ public:
|
||||
}
|
||||
|
||||
uint32 cinematicId = atoul(args);
|
||||
if (!sCinematicSequencesStore.LookupEntry(cinematicId))
|
||||
|
||||
CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId);
|
||||
if (!cineSeq)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, cinematicId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -130,20 +134,16 @@ public:
|
||||
}
|
||||
|
||||
// Dump camera locations
|
||||
if (CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId))
|
||||
if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->cinematicCamera))
|
||||
{
|
||||
std::unordered_map<uint32, FlyByCameraCollection>::const_iterator itr = sFlyByCameraStore.find(cineSeq->cinematicCamera);
|
||||
if (itr != sFlyByCameraStore.end())
|
||||
handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera);
|
||||
uint32 count = 1;
|
||||
for (FlyByCamera const& cam : *flyByCameras)
|
||||
{
|
||||
handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera);
|
||||
uint32 count = 1;
|
||||
for (FlyByCamera cam : itr->second)
|
||||
{
|
||||
handler->PSendSysMessage("%02u - %7ums [%f, %f, %f] Facing %f (%f degrees)", count, cam.timeStamp, cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w, cam.locations.w * (180 / M_PI));
|
||||
count++;
|
||||
}
|
||||
handler->PSendSysMessage("%u waypoints dumped", itr->second.size());
|
||||
handler->PSendSysMessage("%02u - %7ums [%s (%f degrees)]", count, cam.timeStamp, cam.locations.ToString().c_str(), cam.locations.GetOrientation() * (180 / M_PI));
|
||||
++count;
|
||||
}
|
||||
handler->PSendSysMessage("%u waypoints dumped", flyByCameras->size());
|
||||
}
|
||||
|
||||
handler->GetSession()->GetPlayer()->SendCinematicStart(cinematicId);
|
||||
@@ -251,10 +251,10 @@ public:
|
||||
if (failNum == 0 && *result != '0')
|
||||
return false;
|
||||
|
||||
char* fail1 = strtok(NULL, " ");
|
||||
char* fail1 = strtok(nullptr, " ");
|
||||
uint8 failArg1 = fail1 ? (uint8)atoi(fail1) : 0;
|
||||
|
||||
char* fail2 = strtok(NULL, " ");
|
||||
char* fail2 = strtok(nullptr, " ");
|
||||
uint8 failArg2 = fail2 ? (uint8)atoi(fail2) : 0;
|
||||
|
||||
WorldPacket data(SMSG_CAST_FAILED, 5);
|
||||
@@ -267,7 +267,6 @@ public:
|
||||
data << uint32(failArg2);
|
||||
|
||||
handler->GetSession()->SendPacket(&data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -277,7 +276,7 @@ public:
|
||||
return false;
|
||||
|
||||
InventoryResult msg = InventoryResult(atoi(args));
|
||||
handler->GetSession()->GetPlayer()->SendEquipError(msg, NULL, NULL);
|
||||
handler->GetSession()->GetPlayer()->SendEquipError(msg, nullptr, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -304,7 +303,7 @@ public:
|
||||
static bool HandleDebugSendOpcodeCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
Unit* unit = handler->getSelectedUnit();
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
|
||||
player = handler->GetSession()->GetPlayer();
|
||||
else
|
||||
@@ -475,7 +474,7 @@ public:
|
||||
static bool HandleDebugUpdateWorldStateCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
char* w = strtok((char*)args, " ");
|
||||
char* s = strtok(NULL, " ");
|
||||
char* s = strtok(nullptr, " ");
|
||||
|
||||
if (!w || !s)
|
||||
return false;
|
||||
@@ -693,9 +692,9 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (updateQueue[qp] == NULL)
|
||||
if (updateQueue[qp] == nullptr)
|
||||
{
|
||||
handler->PSendSysMessage("The item with slot %d and guid %d has its queuepos (%d) pointing to NULL in the queue!", item->GetSlot(), item->GetGUID().GetCounter(), qp);
|
||||
handler->PSendSysMessage("The item with slot %d and guid %d has its queuepos (%d) pointing to nullptr in the queue!", item->GetSlot(), item->GetGUID().GetCounter(), qp);
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
@@ -761,9 +760,9 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (updateQueue[qp] == NULL)
|
||||
if (updateQueue[qp] == nullptr)
|
||||
{
|
||||
handler->PSendSysMessage("The item in bag %d at slot %d having guid %d has a queuepos (%d) that points to NULL in the queue!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), qp);
|
||||
handler->PSendSysMessage("The item in bag %d at slot %d having guid %d has a queuepos (%d) that points to nullptr in the queue!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), qp);
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
@@ -810,7 +809,7 @@ public:
|
||||
|
||||
Item* test = player->GetItemByPos(item->GetBagSlot(), item->GetSlot());
|
||||
|
||||
if (test == NULL)
|
||||
if (test == nullptr)
|
||||
{
|
||||
handler->PSendSysMessage("queue(%zu): The bag(%d) and slot(%d) values for %s are incorrect, the player doesn't have any item at that position!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString().c_str());
|
||||
error = true;
|
||||
@@ -849,7 +848,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->GetGUID().GetCounter());
|
||||
@@ -918,7 +917,7 @@ public:
|
||||
if (!i)
|
||||
return false;
|
||||
|
||||
char* j = strtok(NULL, " ");
|
||||
char* j = strtok(nullptr, " ");
|
||||
|
||||
uint32 entry = (uint32)atoi(i);
|
||||
int8 seatId = j ? (int8)atoi(j) : -1;
|
||||
@@ -927,7 +926,7 @@ public:
|
||||
handler->GetSession()->GetPlayer()->EnterVehicle(target, seatId);
|
||||
else
|
||||
{
|
||||
Creature* passenger = NULL;
|
||||
Creature* passenger = nullptr;
|
||||
Trinity::AllCreaturesOfEntryInRange check(handler->GetSession()->GetPlayer(), entry, 20.0f);
|
||||
Trinity::CreatureSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(handler->GetSession()->GetPlayer(), passenger, check);
|
||||
Cell::VisitAllObjects(handler->GetSession()->GetPlayer(), searcher, 30.0f);
|
||||
@@ -946,7 +945,7 @@ public:
|
||||
return false;
|
||||
|
||||
char* e = strtok((char*)args, " ");
|
||||
char* i = strtok(NULL, " ");
|
||||
char* i = strtok(nullptr, " ");
|
||||
|
||||
if (!e)
|
||||
return false;
|
||||
@@ -989,7 +988,7 @@ public:
|
||||
|
||||
static bool HandleDebugSendLargePacketCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
const char* stuffingString = "This is a dummy string to push the packet's size beyond 128000 bytes. ";
|
||||
char const* stuffingString = "This is a dummy string to push the packet's size beyond 128000 bytes. ";
|
||||
std::ostringstream ss;
|
||||
while (ss.str().size() < 128000)
|
||||
ss << stuffingString;
|
||||
@@ -1003,8 +1002,8 @@ public:
|
||||
return false;
|
||||
|
||||
char* t = strtok((char*)args, " ");
|
||||
char* p = strtok(NULL, " ");
|
||||
char* m = strtok(NULL, " ");
|
||||
char* p = strtok(nullptr, " ");
|
||||
char* m = strtok(nullptr, " ");
|
||||
|
||||
if (!t)
|
||||
return false;
|
||||
@@ -1032,7 +1031,7 @@ public:
|
||||
return false;
|
||||
|
||||
char* e = strtok((char*)args, " ");
|
||||
char* f = strtok(NULL, " ");
|
||||
char* f = strtok(nullptr, " ");
|
||||
|
||||
if (!e || !f)
|
||||
return false;
|
||||
@@ -1061,8 +1060,8 @@ public:
|
||||
return false;
|
||||
|
||||
char* e = strtok((char*)args, " ");
|
||||
char* f = strtok(NULL, " ");
|
||||
char* g = strtok(NULL, " ");
|
||||
char* f = strtok(nullptr, " ");
|
||||
char* g = strtok(nullptr, " ");
|
||||
|
||||
if (!e || !f || !g)
|
||||
return false;
|
||||
@@ -1168,8 +1167,8 @@ public:
|
||||
return false;
|
||||
|
||||
char* x = strtok((char*)args, " ");
|
||||
char* y = strtok(NULL, " ");
|
||||
char* z = strtok(NULL, " ");
|
||||
char* y = strtok(nullptr, " ");
|
||||
char* z = strtok(nullptr, " ");
|
||||
|
||||
if (!x || !y)
|
||||
return false;
|
||||
@@ -1217,7 +1216,7 @@ public:
|
||||
return false;
|
||||
|
||||
char* x = strtok((char*)args, " ");
|
||||
char* z = strtok(NULL, " ");
|
||||
char* z = strtok(nullptr, " ");
|
||||
|
||||
if (!x)
|
||||
return false;
|
||||
@@ -1263,7 +1262,7 @@ public:
|
||||
return false;
|
||||
|
||||
char* x = strtok((char*)args, " ");
|
||||
char* y = strtok(NULL, " ");
|
||||
char* y = strtok(nullptr, " ");
|
||||
|
||||
if (!x || !y)
|
||||
return false;
|
||||
@@ -1318,7 +1317,7 @@ public:
|
||||
else if (updateIndex >= UNIT_END)
|
||||
return true;
|
||||
|
||||
char* val = strtok(NULL, " ");
|
||||
char* val = strtok(nullptr, " ");
|
||||
if (!val)
|
||||
{
|
||||
value = unit->GetUInt32Value(updateIndex);
|
||||
@@ -1350,7 +1349,7 @@ public:
|
||||
}
|
||||
|
||||
char* x = strtok((char*)args, " ");
|
||||
char* y = strtok(NULL, " ");
|
||||
char* y = strtok(nullptr, " ");
|
||||
|
||||
if (!x || !y)
|
||||
return false;
|
||||
@@ -1384,7 +1383,7 @@ public:
|
||||
if (!mask1)
|
||||
return false;
|
||||
|
||||
char* mask2 = strtok(NULL, " \n");
|
||||
char* mask2 = strtok(nullptr, " \n");
|
||||
|
||||
uint32 moveFlags = (uint32)atoi(mask1);
|
||||
target->SetUnitMovementFlags(moveFlags);
|
||||
@@ -1576,13 +1575,13 @@ public:
|
||||
if (stricmp(args, "linked"))
|
||||
{
|
||||
if (Battleground* bg = player->GetBattleground())
|
||||
nearestLoc = bg->GetClosestGraveYard(player);
|
||||
nearestLoc = bg->GetClosestGraveyard(player);
|
||||
else
|
||||
{
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()))
|
||||
nearestLoc = bf->GetClosestGraveYard(player);
|
||||
nearestLoc = bf->GetClosestGraveyard(player);
|
||||
else
|
||||
nearestLoc = sObjectMgr->GetClosestGraveYard(*player, player->GetTeam(), player);
|
||||
nearestLoc = sObjectMgr->GetClosestGraveyard(*player, player->GetTeam(), player);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
* This file contains the CommandScripts for all deserter sub-commands
|
||||
*/
|
||||
|
||||
#include "Chat.h"
|
||||
#include "Player.h"
|
||||
#include "Language.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "SpellAuras.h"
|
||||
|
||||
enum Spells
|
||||
@@ -58,12 +59,12 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> deserterCommandTable =
|
||||
{
|
||||
{ "instance", rbac::RBAC_PERM_COMMAND_DESERTER_INSTANCE, false, NULL, "", deserterInstanceCommandTable },
|
||||
{ "bg", rbac::RBAC_PERM_COMMAND_DESERTER_BG, false, NULL, "", deserterBGCommandTable },
|
||||
{ "instance", rbac::RBAC_PERM_COMMAND_DESERTER_INSTANCE, false, nullptr, "", deserterInstanceCommandTable },
|
||||
{ "bg", rbac::RBAC_PERM_COMMAND_DESERTER_BG, false, nullptr, "", deserterBGCommandTable },
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "deserter", rbac::RBAC_PERM_COMMAND_DESERTER, false, NULL, "", deserterCommandTable },
|
||||
{ "deserter", rbac::RBAC_PERM_COMMAND_DESERTER, false, nullptr, "", deserterCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
@@ -22,14 +22,16 @@ Comment: All disable related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "DisableMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvP.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
class disable_commandscript : public CommandScript
|
||||
@@ -63,12 +65,12 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> disableCommandTable =
|
||||
{
|
||||
{ "add", rbac::RBAC_PERM_COMMAND_DISABLE_ADD, true, NULL, "", addDisableCommandTable },
|
||||
{ "remove", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE, true, NULL, "", removeDisableCommandTable },
|
||||
{ "add", rbac::RBAC_PERM_COMMAND_DISABLE_ADD, true, nullptr, "", addDisableCommandTable },
|
||||
{ "remove", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE, true, nullptr, "", removeDisableCommandTable },
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "disable", rbac::RBAC_PERM_COMMAND_DISABLE, false, NULL, "", disableCommandTable },
|
||||
{ "disable", rbac::RBAC_PERM_COMMAND_DISABLE, false, nullptr, "", disableCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -79,10 +81,10 @@ public:
|
||||
if (!entryStr || !atoi(entryStr))
|
||||
return false;
|
||||
|
||||
char* flagsStr = strtok(NULL, " ");
|
||||
char* flagsStr = strtok(nullptr, " ");
|
||||
uint8 flags = flagsStr ? uint8(atoi(flagsStr)) : 0;
|
||||
|
||||
char* commentStr = strtok(NULL, "");
|
||||
char* commentStr = strtok(nullptr, "");
|
||||
if (!commentStr)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -22,11 +22,12 @@ Comment: All event related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
|
||||
class event_commandscript : public CommandScript
|
||||
{
|
||||
@@ -44,7 +45,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "event", rbac::RBAC_PERM_COMMAND_EVENT, false, NULL, "", eventCommandTable },
|
||||
{ "event", rbac::RBAC_PERM_COMMAND_EVENT, false, nullptr, "", eventCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -115,8 +116,8 @@ public:
|
||||
std::string endTimeStr = TimeToTimestampStr(eventData.end);
|
||||
|
||||
uint32 delay = sGameEventMgr->NextCheck(eventId);
|
||||
time_t nextTime = time(NULL) + delay;
|
||||
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(NULL) + delay) : "-";
|
||||
time_t nextTime = time(nullptr) + delay;
|
||||
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(nullptr) + delay) : "-";
|
||||
|
||||
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE);
|
||||
std::string lengthStr = secsToTimeString(eventData.length * MINUTE);
|
||||
|
||||
@@ -23,13 +23,19 @@ Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "World.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "Realm.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
#include <boost/thread/locks.hpp>
|
||||
#include <boost/thread/shared_mutex.hpp>
|
||||
|
||||
class gm_commandscript : public CommandScript
|
||||
{
|
||||
@@ -49,7 +55,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "gm", rbac::RBAC_PERM_COMMAND_GM, false, NULL, "", gmCommandTable },
|
||||
{ "gm", rbac::RBAC_PERM_COMMAND_GM, false, nullptr, "", gmCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
@@ -23,14 +23,18 @@ Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "MapManager.h"
|
||||
#include "TicketMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "TicketMgr.h"
|
||||
#include "Transport.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class go_commandscript : public CommandScript
|
||||
{
|
||||
@@ -55,7 +59,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "go", rbac::RBAC_PERM_COMMAND_GO, false, NULL, "", goCommandTable },
|
||||
{ "go", rbac::RBAC_PERM_COMMAND_GO, false, nullptr, "", goCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -90,7 +94,7 @@ public:
|
||||
{
|
||||
// Get the "creature_template.entry"
|
||||
// number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
|
||||
char* tail = strtok(NULL, "");
|
||||
char* tail = strtok(nullptr, "");
|
||||
if (!tail)
|
||||
return false;
|
||||
char* id = handler->extractKeyFromLink(tail, "Hcreature_entry");
|
||||
@@ -112,7 +116,7 @@ public:
|
||||
{
|
||||
std::string name = param1;
|
||||
WorldDatabase.EscapeString(name);
|
||||
whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name " _LIKE_" '" << name << '\'';
|
||||
whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name LIKE '" << name << '\'';
|
||||
}
|
||||
else
|
||||
whereClause << "WHERE guid = '" << guidLow << '\'';
|
||||
@@ -135,7 +139,7 @@ public:
|
||||
float o = fields[3].GetFloat();
|
||||
uint32 mapId = fields[4].GetUInt16();
|
||||
|
||||
Transport* transport = NULL;
|
||||
Transport* transport = nullptr;
|
||||
|
||||
if (!MapManager::IsValidMapCoord(mapId, x, y, z, o) || sObjectMgr->IsTransportMap(mapId))
|
||||
{
|
||||
@@ -216,8 +220,8 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
char* gridX = strtok((char*)args, " ");
|
||||
char* gridY = strtok(NULL, " ");
|
||||
char* id = strtok(NULL, " ");
|
||||
char* gridY = strtok(nullptr, " ");
|
||||
char* id = strtok(nullptr, " ");
|
||||
|
||||
if (!gridX || !gridY)
|
||||
return false;
|
||||
@@ -408,8 +412,8 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
char* zoneX = strtok((char*)args, " ");
|
||||
char* zoneY = strtok(NULL, " ");
|
||||
char* tail = strtok(NULL, "");
|
||||
char* zoneY = strtok(nullptr, " ");
|
||||
char* tail = strtok(nullptr, "");
|
||||
|
||||
char* id = handler->extractKeyFromLink(tail, "Harea"); // string or [name] Shift-click form |color|Harea:area_id|h[name]|h|r
|
||||
|
||||
@@ -481,10 +485,10 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
char* goX = strtok((char*)args, " ");
|
||||
char* goY = strtok(NULL, " ");
|
||||
char* goZ = strtok(NULL, " ");
|
||||
char* id = strtok(NULL, " ");
|
||||
char* port = strtok(NULL, " ");
|
||||
char* goY = strtok(nullptr, " ");
|
||||
char* goZ = strtok(nullptr, " ");
|
||||
char* id = strtok(nullptr, " ");
|
||||
char* port = strtok(nullptr, " ");
|
||||
|
||||
if (!goX || !goY)
|
||||
return false;
|
||||
@@ -572,9 +576,9 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
char* goX = strtok((char*)args, " ");
|
||||
char* goY = strtok(NULL, " ");
|
||||
char* goZ = strtok(NULL, " ");
|
||||
char* port = strtok(NULL, " ");
|
||||
char* goY = strtok(nullptr, " ");
|
||||
char* goZ = strtok(nullptr, " ");
|
||||
char* port = strtok(nullptr, " ");
|
||||
|
||||
float x, y, z, o;
|
||||
player->GetPosition(x, y, z, o);
|
||||
|
||||
@@ -23,15 +23,21 @@ Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class gobject_commandscript : public CommandScript
|
||||
{
|
||||
@@ -59,12 +65,12 @@ public:
|
||||
{ "near", rbac::RBAC_PERM_COMMAND_GOBJECT_NEAR, false, &HandleGameObjectNearCommand, "" },
|
||||
{ "target", rbac::RBAC_PERM_COMMAND_GOBJECT_TARGET, false, &HandleGameObjectTargetCommand, "" },
|
||||
{ "turn", rbac::RBAC_PERM_COMMAND_GOBJECT_TURN, false, &HandleGameObjectTurnCommand, "" },
|
||||
{ "add", rbac::RBAC_PERM_COMMAND_GOBJECT_ADD, false, NULL, "", gobjectAddCommandTable },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_GOBJECT_SET, false, NULL, "", gobjectSetCommandTable },
|
||||
{ "add", rbac::RBAC_PERM_COMMAND_GOBJECT_ADD, false, nullptr, "", gobjectAddCommandTable },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_GOBJECT_SET, false, nullptr, "", gobjectSetCommandTable },
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "gobject", rbac::RBAC_PERM_COMMAND_GOBJECT, false, NULL, "", gobjectCommandTable },
|
||||
{ "gobject", rbac::RBAC_PERM_COMMAND_GOBJECT, false, nullptr, "", gobjectCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -116,9 +122,9 @@ public:
|
||||
if (!objectId)
|
||||
return false;
|
||||
|
||||
char* spawntimeSecs = strtok(NULL, " ");
|
||||
char* spawntimeSecs = strtok(nullptr, " ");
|
||||
|
||||
const GameObjectTemplate* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
|
||||
GameObjectTemplate const* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
|
||||
|
||||
if (!objectInfo)
|
||||
{
|
||||
@@ -142,7 +148,7 @@ public:
|
||||
GameObject* object = new GameObject;
|
||||
ObjectGuid::LowType guidLow = map->GenerateLowGuid<HighGuid::GameObject>();
|
||||
|
||||
if (!object->Create(guidLow, objectInfo->entry, map, 0, *player, G3D::Quat(), 255, GO_STATE_READY))
|
||||
if (!object->Create(guidLow, objectInfo->entry, map, 0, *player, QuaternionData(), 255, GO_STATE_READY))
|
||||
{
|
||||
delete object;
|
||||
return false;
|
||||
@@ -191,13 +197,13 @@ public:
|
||||
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
char* spawntime = strtok(NULL, " ");
|
||||
char* spawntime = strtok(nullptr, " ");
|
||||
uint32 spawntm = 300;
|
||||
|
||||
if (spawntime)
|
||||
spawntm = atoul(spawntime);
|
||||
|
||||
G3D::Quat rotation = G3D::Matrix3::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
|
||||
QuaternionData rotation = QuaternionData::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
|
||||
uint32 objectId = atoul(id);
|
||||
|
||||
if (!sObjectMgr->GetGameObjectTemplate(objectId))
|
||||
@@ -236,7 +242,7 @@ public:
|
||||
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",
|
||||
"FROM gameobject LEFT JOIN gameobject_template ON gameobject_template.entry = gameobject.id WHERE map = %i AND name LIKE '%%%s%%' ORDER BY order_ ASC LIMIT 1",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str());
|
||||
}
|
||||
}
|
||||
@@ -318,7 +324,7 @@ public:
|
||||
|
||||
if (target)
|
||||
{
|
||||
int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - time(NULL));
|
||||
int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - time(nullptr));
|
||||
if (curRespawnDelay < 0)
|
||||
curRespawnDelay = 0;
|
||||
|
||||
@@ -393,18 +399,18 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* orientation = strtok(NULL, " ");
|
||||
char* orientation = strtok(nullptr, " ");
|
||||
float oz = 0.f, oy = 0.f, ox = 0.f;
|
||||
|
||||
if (orientation)
|
||||
{
|
||||
oz = float(atof(orientation));
|
||||
|
||||
orientation = strtok(NULL, " ");
|
||||
orientation = strtok(nullptr, " ");
|
||||
if (orientation)
|
||||
{
|
||||
oy = float(atof(orientation));
|
||||
orientation = strtok(NULL, " ");
|
||||
orientation = strtok(nullptr, " ");
|
||||
if (orientation)
|
||||
ox = float(atof(orientation));
|
||||
}
|
||||
@@ -444,9 +450,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* toX = strtok(NULL, " ");
|
||||
char* toY = strtok(NULL, " ");
|
||||
char* toZ = strtok(NULL, " ");
|
||||
char* toX = strtok(nullptr, " ");
|
||||
char* toY = strtok(nullptr, " ");
|
||||
char* toZ = strtok(nullptr, " ");
|
||||
|
||||
float x, y, z;
|
||||
if (!toX)
|
||||
@@ -499,7 +505,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* phase = strtok (NULL, " ");
|
||||
char* phase = strtok (nullptr, " ");
|
||||
uint32 phaseMask = phase ? atoi(phase) : 0;
|
||||
if (phaseMask == 0)
|
||||
{
|
||||
@@ -581,7 +587,7 @@ public:
|
||||
if (!cValue)
|
||||
return false;
|
||||
ObjectGuid::LowType guidLow = atoul(cValue);
|
||||
const GameObjectData* data = sObjectMgr->GetGOData(guidLow);
|
||||
GameObjectData const* data = sObjectMgr->GetGOData(guidLow);
|
||||
if (!data)
|
||||
return false;
|
||||
entry = data->id;
|
||||
@@ -641,7 +647,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* type = strtok(NULL, " ");
|
||||
char* type = strtok(nullptr, " ");
|
||||
if (!type)
|
||||
return false;
|
||||
|
||||
@@ -655,7 +661,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char* state = strtok(NULL, " ");
|
||||
char* state = strtok(nullptr, " ");
|
||||
if (!state)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -15,15 +15,22 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "Language.h"
|
||||
#include "LFG.h"
|
||||
#include "Player.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class group_commandscript : public CommandScript
|
||||
{
|
||||
@@ -180,7 +187,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool GroupFlagCommand(ChatHandler* handler, char const* args, GroupMemberFlags flag, const char* what)
|
||||
static bool GroupFlagCommand(ChatHandler* handler, char const* args, GroupMemberFlags flag, char const* what)
|
||||
{
|
||||
Player* player = nullptr;
|
||||
Group* group = nullptr;
|
||||
@@ -293,7 +300,7 @@ public:
|
||||
ObjectGuid guidSource;
|
||||
ObjectGuid guidTarget;
|
||||
char* nameplgrStr = strtok((char*)args, " ");
|
||||
char* nameplStr = strtok(NULL, " ");
|
||||
char* nameplStr = strtok(nullptr, " ");
|
||||
|
||||
if (!handler->GetPlayerGroupAndGUIDByName(nameplgrStr, playerSource, groupSource, guidSource, true))
|
||||
return false;
|
||||
@@ -335,7 +342,7 @@ public:
|
||||
ObjectGuid guidTarget;
|
||||
std::string nameTarget;
|
||||
std::string zoneName;
|
||||
const char* onlineState = "";
|
||||
char const* onlineState = "";
|
||||
|
||||
// Parse the guid to uint32...
|
||||
ObjectGuid parseGUID(HighGuid::Player, uint32(atoul(args)));
|
||||
@@ -351,7 +358,7 @@ public:
|
||||
return false;
|
||||
|
||||
// Next, we need a group. So we define a group variable.
|
||||
Group* groupTarget = NULL;
|
||||
Group* groupTarget = nullptr;
|
||||
|
||||
// We try to extract a group from an online player.
|
||||
if (playerTarget)
|
||||
|
||||
@@ -22,14 +22,16 @@ Comment: All guild related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include <iomanip>
|
||||
|
||||
class guild_commandscript : public CommandScript
|
||||
@@ -51,7 +53,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "guild", rbac::RBAC_PERM_COMMAND_GUILD, true, NULL, "", guildCommandTable },
|
||||
{ "guild", rbac::RBAC_PERM_COMMAND_GUILD, true, nullptr, "", guildCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -71,10 +73,10 @@ public:
|
||||
|
||||
// if not guild name only (in "") then player name
|
||||
Player* target;
|
||||
if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : NULL, &target))
|
||||
if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : nullptr, &target))
|
||||
return false;
|
||||
|
||||
char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
|
||||
char* tailStr = *args != '"' ? strtok(nullptr, "") : (char*)args;
|
||||
if (!tailStr)
|
||||
return false;
|
||||
|
||||
@@ -100,7 +102,6 @@ public:
|
||||
}
|
||||
|
||||
sGuildMgr->AddGuild(guild);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -132,10 +133,10 @@ public:
|
||||
|
||||
// if not guild name only (in "") then player name
|
||||
ObjectGuid targetGuid;
|
||||
if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : NULL, NULL, &targetGuid))
|
||||
if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : nullptr, nullptr, &targetGuid))
|
||||
return false;
|
||||
|
||||
char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
|
||||
char* tailStr = *args != '"' ? strtok(nullptr, "") : (char*)args;
|
||||
if (!tailStr)
|
||||
return false;
|
||||
|
||||
@@ -215,7 +216,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char const* newGuildStr = handler->extractQuotedArg(strtok(NULL, ""));
|
||||
char const* newGuildStr = handler->extractQuotedArg(strtok(nullptr, ""));
|
||||
if (!newGuildStr)
|
||||
{
|
||||
handler->SendSysMessage(LANG_INSERT_GUILD_NAME);
|
||||
|
||||
@@ -22,11 +22,13 @@ Comment: All honor related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class honor_commandscript : public CommandScript
|
||||
{
|
||||
@@ -43,13 +45,13 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> honorCommandTable =
|
||||
{
|
||||
{ "add", rbac::RBAC_PERM_COMMAND_HONOR_ADD, false, NULL, "", honorAddCommandTable },
|
||||
{ "add", rbac::RBAC_PERM_COMMAND_HONOR_ADD, false, nullptr, "", honorAddCommandTable },
|
||||
{ "update", rbac::RBAC_PERM_COMMAND_HONOR_UPDATE, false, &HandleHonorUpdateCommand, "" },
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "honor", rbac::RBAC_PERM_COMMAND_HONOR, false, NULL, "", honorCommandTable },
|
||||
{ "honor", rbac::RBAC_PERM_COMMAND_HONOR, false, nullptr, "", honorCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -72,7 +74,7 @@ public:
|
||||
return false;
|
||||
|
||||
uint32 amount = (uint32)atoi(args);
|
||||
target->RewardHonor(NULL, 1, amount);
|
||||
target->RewardHonor(nullptr, 1, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,13 @@ EndScriptData */
|
||||
#include "Group.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MapManager.h"
|
||||
#include "Player.h"
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class instance_commandscript : public CommandScript
|
||||
{
|
||||
@@ -50,7 +54,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "instance", rbac::RBAC_PERM_COMMAND_INSTANCE, true, NULL, "", instanceCommandTable },
|
||||
{ "instance", rbac::RBAC_PERM_COMMAND_INSTANCE, true, nullptr, "", instanceCommandTable },
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
@@ -81,7 +85,7 @@ public:
|
||||
for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
||||
{
|
||||
InstanceSave* save = itr->second.save;
|
||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(nullptr));
|
||||
handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", itr->second.extendState == EXTEND_STATE_EXPIRED ? "expired" : itr->second.extendState == EXTEND_STATE_EXTENDED ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
|
||||
counter++;
|
||||
}
|
||||
@@ -97,7 +101,7 @@ public:
|
||||
for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
||||
{
|
||||
InstanceSave* save = itr->second.save;
|
||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(nullptr));
|
||||
handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", "-", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
|
||||
counter++;
|
||||
}
|
||||
@@ -118,7 +122,7 @@ public:
|
||||
player = handler->GetSession()->GetPlayer();
|
||||
|
||||
char* map = strtok((char*)args, " ");
|
||||
char* pDiff = strtok(NULL, " ");
|
||||
char* pDiff = strtok(nullptr, " ");
|
||||
int8 diff = -1;
|
||||
if (pDiff)
|
||||
diff = atoi(pDiff);
|
||||
@@ -140,7 +144,7 @@ public:
|
||||
InstanceSave* save = itr->second.save;
|
||||
if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
|
||||
{
|
||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(nullptr));
|
||||
handler->PSendSysMessage(LANG_COMMAND_INST_UNBIND_UNBINDING, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
|
||||
player->UnbindInstance(itr, Difficulty(i));
|
||||
counter++;
|
||||
|
||||
@@ -22,14 +22,17 @@ Comment: All learn related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "Chat.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Language.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class learn_commandscript : public CommandScript
|
||||
{
|
||||
@@ -48,7 +51,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> learnAllCommandTable =
|
||||
{
|
||||
{ "my", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY, false, NULL, "", learnAllMyCommandTable },
|
||||
{ "my", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY, false, nullptr, "", learnAllMyCommandTable },
|
||||
{ "gm", rbac::RBAC_PERM_COMMAND_LEARN_ALL_GM, false, &HandleLearnAllGMCommand, "" },
|
||||
{ "crafts", rbac::RBAC_PERM_COMMAND_LEARN_ALL_CRAFTS, false, &HandleLearnAllCraftsCommand, "" },
|
||||
{ "default", rbac::RBAC_PERM_COMMAND_LEARN_ALL_DEFAULT, false, &HandleLearnAllDefaultCommand, "" },
|
||||
@@ -58,13 +61,13 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> learnCommandTable =
|
||||
{
|
||||
{ "all", rbac::RBAC_PERM_COMMAND_LEARN_ALL, false, NULL, "", learnAllCommandTable },
|
||||
{ "all", rbac::RBAC_PERM_COMMAND_LEARN_ALL, false, nullptr, "", learnAllCommandTable },
|
||||
{ "", rbac::RBAC_PERM_COMMAND_LEARN, false, &HandleLearnCommand, "" },
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "learn", rbac::RBAC_PERM_COMMAND_LEARN, false, NULL, "", learnCommandTable },
|
||||
{ "learn", rbac::RBAC_PERM_COMMAND_LEARN, false, nullptr, "", learnCommandTable },
|
||||
{ "unlearn", rbac::RBAC_PERM_COMMAND_UNLEARN, false, &HandleUnLearnCommand, "" },
|
||||
};
|
||||
return commandTable;
|
||||
@@ -86,7 +89,7 @@ public:
|
||||
if (!spell || !sSpellMgr->GetSpellInfo(spell))
|
||||
return false;
|
||||
|
||||
char const* all = strtok(NULL, " ");
|
||||
char const* all = strtok(nullptr, " ");
|
||||
bool allRanks = all ? (strncmp(all, "all", strlen(all)) == 0) : false;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
|
||||
@@ -150,12 +153,8 @@ public:
|
||||
return true;
|
||||
uint32 family = classEntry->spellfamily;
|
||||
|
||||
for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
|
||||
for (SkillLineAbilityEntry const* entry : sSkillLineAbilityStore)
|
||||
{
|
||||
SkillLineAbilityEntry const* entry = sSkillLineAbilityStore.LookupEntry(i);
|
||||
if (!entry)
|
||||
continue;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->spellId);
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
@@ -192,12 +191,8 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
uint32 classMask = player->getClassMask();
|
||||
|
||||
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
|
||||
for (TalentEntry const* talentInfo : sTalentStore)
|
||||
{
|
||||
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
|
||||
if (!talentInfo)
|
||||
continue;
|
||||
|
||||
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
|
||||
if (!talentTabInfo)
|
||||
continue;
|
||||
@@ -269,12 +264,8 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
|
||||
for (TalentEntry const* talentInfo : sTalentStore)
|
||||
{
|
||||
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
|
||||
if (!talentInfo)
|
||||
continue;
|
||||
|
||||
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
|
||||
if (!talentTabInfo)
|
||||
continue;
|
||||
@@ -286,7 +277,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)
|
||||
{
|
||||
@@ -314,9 +305,9 @@ public:
|
||||
|
||||
static bool HandleLearnAllLangCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
// skipping UNIVERSAL language (0)
|
||||
for (uint8 i = 1; i < LANGUAGES_COUNT; ++i)
|
||||
handler->GetSession()->GetPlayer()->LearnSpell(lang_description[i].spell_id, false);
|
||||
for (LanguageDesc const& langDesc : lang_description)
|
||||
if (uint32 langSpellId = langDesc.spell_id)
|
||||
handler->GetSession()->GetPlayer()->LearnSpell(langSpellId, false);
|
||||
|
||||
handler->SendSysMessage(LANG_COMMAND_LEARN_ALL_LANG);
|
||||
return true;
|
||||
@@ -384,7 +375,7 @@ public:
|
||||
|
||||
std::string name;
|
||||
|
||||
SkillLineEntry const* targetSkillInfo = NULL;
|
||||
SkillLineEntry const* targetSkillInfo = nullptr;
|
||||
for (uint32 i = 1; i < sSkillLineStore.GetNumRows(); ++i)
|
||||
{
|
||||
SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(i);
|
||||
@@ -421,12 +412,8 @@ public:
|
||||
{
|
||||
uint32 classmask = player->getClassMask();
|
||||
|
||||
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
|
||||
for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore)
|
||||
{
|
||||
SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j);
|
||||
if (!skillLine)
|
||||
continue;
|
||||
|
||||
// wrong skill
|
||||
if (skillLine->skillId != skillId)
|
||||
continue;
|
||||
@@ -461,7 +448,7 @@ public:
|
||||
if (!spellId)
|
||||
return false;
|
||||
|
||||
char const* allStr = strtok(NULL, " ");
|
||||
char const* allStr = strtok(nullptr, " ");
|
||||
bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
|
||||
@@ -18,12 +18,15 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "Language.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
|
||||
void GetPlayerInfo(ChatHandler* handler, Player* player)
|
||||
{
|
||||
@@ -57,16 +60,16 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "lfg", rbac::RBAC_PERM_COMMAND_LFG, true, NULL, "", lfgCommandTable },
|
||||
{ "lfg", rbac::RBAC_PERM_COMMAND_LFG, true, nullptr, "", lfgCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static bool HandleLfgPlayerInfoCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* target = NULL;
|
||||
Player* target = nullptr;
|
||||
std::string playerName;
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, nullptr, &playerName))
|
||||
return false;
|
||||
|
||||
GetPlayerInfo(handler, target);
|
||||
@@ -89,7 +92,7 @@ public:
|
||||
else if (!handler->extractPlayerTarget((char*)args, &playerTarget, &guidTarget, &nameTarget))
|
||||
return false;
|
||||
|
||||
Group* groupTarget = NULL;
|
||||
Group* groupTarget = nullptr;
|
||||
|
||||
if (playerTarget)
|
||||
groupTarget = playerTarget->GetGroup();
|
||||
|
||||
@@ -23,13 +23,17 @@ Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "RBAC.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "WorldSession.h"
|
||||
#include <iostream>
|
||||
|
||||
class list_commandscript : public CommandScript
|
||||
@@ -49,7 +53,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "list", rbac::RBAC_PERM_COMMAND_LIST,true, NULL, "", listCommandTable },
|
||||
{ "list", rbac::RBAC_PERM_COMMAND_LIST,true, nullptr, "", listCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -80,7 +84,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* countStr = strtok(NULL, " ");
|
||||
char* countStr = strtok(nullptr, " ");
|
||||
uint32 count = countStr ? atoul(countStr) : 10;
|
||||
|
||||
if (count == 0)
|
||||
@@ -152,7 +156,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* countStr = strtok(NULL, " ");
|
||||
char* countStr = strtok(nullptr, " ");
|
||||
uint32 count = countStr ? atoul(countStr) : 10;
|
||||
|
||||
if (count == 0)
|
||||
@@ -227,7 +231,7 @@ public:
|
||||
result = CharacterDatabase.Query(stmt);
|
||||
}
|
||||
else
|
||||
result = PreparedQueryResult(NULL);
|
||||
result = PreparedQueryResult(nullptr);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -274,7 +278,7 @@ public:
|
||||
result = CharacterDatabase.Query(stmt);
|
||||
}
|
||||
else
|
||||
result = PreparedQueryResult(NULL);
|
||||
result = PreparedQueryResult(nullptr);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -369,7 +373,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* countStr = strtok(NULL, " ");
|
||||
char* countStr = strtok(nullptr, " ");
|
||||
uint32 count = countStr ? atoul(countStr) : 10;
|
||||
|
||||
if (count == 0)
|
||||
@@ -470,7 +474,7 @@ public:
|
||||
Player* target;
|
||||
ObjectGuid targetGuid;
|
||||
std::string targetName;
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -22,15 +22,20 @@ Comment: All lookup related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class lookup_commandscript : public CommandScript
|
||||
{
|
||||
@@ -62,9 +67,9 @@ public:
|
||||
{ "itemset", rbac::RBAC_PERM_COMMAND_LOOKUP_ITEMSET, true, &HandleLookupItemSetCommand, "" },
|
||||
{ "object", rbac::RBAC_PERM_COMMAND_LOOKUP_OBJECT, true, &HandleLookupObjectCommand, "" },
|
||||
{ "quest", rbac::RBAC_PERM_COMMAND_LOOKUP_QUEST, true, &HandleLookupQuestCommand, "" },
|
||||
{ "player", rbac::RBAC_PERM_COMMAND_LOOKUP_PLAYER, true, NULL, "", lookupPlayerCommandTable },
|
||||
{ "player", rbac::RBAC_PERM_COMMAND_LOOKUP_PLAYER, true, nullptr, "", lookupPlayerCommandTable },
|
||||
{ "skill", rbac::RBAC_PERM_COMMAND_LOOKUP_SKILL, true, &HandleLookupSkillCommand, "" },
|
||||
{ "spell", rbac::RBAC_PERM_COMMAND_LOOKUP_SPELL, true, NULL, "", lookupSpellCommandTable },
|
||||
{ "spell", rbac::RBAC_PERM_COMMAND_LOOKUP_SPELL, true, nullptr, "", lookupSpellCommandTable },
|
||||
{ "taxinode", rbac::RBAC_PERM_COMMAND_LOOKUP_TAXINODE, true, &HandleLookupTaxiNodeCommand, "" },
|
||||
{ "tele", rbac::RBAC_PERM_COMMAND_LOOKUP_TELE, true, &HandleLookupTeleCommand, "" },
|
||||
{ "title", rbac::RBAC_PERM_COMMAND_LOOKUP_TITLE, true, &HandleLookupTitleCommand, "" },
|
||||
@@ -73,7 +78,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "lookup", rbac::RBAC_PERM_COMMAND_LOOKUP, true, NULL, "", lookupCommandTable },
|
||||
{ "lookup", rbac::RBAC_PERM_COMMAND_LOOKUP, true, nullptr, "", lookupCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -97,36 +102,32 @@ public:
|
||||
wstrToLower(wNamePart);
|
||||
|
||||
// Search in AreaTable.dbc
|
||||
for (uint32 i = 0; i < sAreaTableStore.GetNumRows(); ++i)
|
||||
for (AreaTableEntry const* areaEntry : sAreaTableStore)
|
||||
{
|
||||
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(i);
|
||||
if (areaEntry)
|
||||
std::string name = areaEntry->area_name;
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
if (!Utf8FitTo(name, wNamePart))
|
||||
continue;
|
||||
|
||||
if (maxResults && count++ == maxResults)
|
||||
{
|
||||
std::string name = areaEntry->area_name;
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
if (!Utf8FitTo(name, wNamePart))
|
||||
continue;
|
||||
|
||||
if (maxResults && count++ == maxResults)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
|
||||
return true;
|
||||
}
|
||||
|
||||
// send area in "id - [name]" format
|
||||
std::ostringstream ss;
|
||||
if (handler->GetSession())
|
||||
ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name<< "]|h|r";
|
||||
else
|
||||
ss << areaEntry->ID << " - " << name;
|
||||
|
||||
handler->SendSysMessage(ss.str().c_str());
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
|
||||
return true;
|
||||
}
|
||||
|
||||
// send area in "id - [name]" format
|
||||
std::ostringstream ss;
|
||||
if (handler->GetSession())
|
||||
ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << "]|h|r";
|
||||
else
|
||||
ss << areaEntry->ID << " - " << name;
|
||||
|
||||
handler->SendSysMessage(ss.str().c_str());
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
@@ -273,7 +274,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// Can be NULL at console call
|
||||
// Can be nullptr at console call
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
|
||||
std::string namePart = args;
|
||||
@@ -293,7 +294,7 @@ public:
|
||||
{
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(id))
|
||||
{
|
||||
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
|
||||
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : nullptr;
|
||||
|
||||
std::string name = factionEntry->name;
|
||||
if (name.empty())
|
||||
@@ -316,7 +317,7 @@ public:
|
||||
else
|
||||
ss << id << " - " << name;
|
||||
|
||||
if (factionState) // and then target != NULL also
|
||||
if (factionState) // and then target != nullptr also
|
||||
{
|
||||
uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
|
||||
std::string rankName = handler->GetTrinityString(index);
|
||||
@@ -568,7 +569,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// can be NULL at console call
|
||||
// can be nullptr at console call
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
|
||||
std::string namePart = args;
|
||||
@@ -698,7 +699,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// can be NULL in console call
|
||||
// can be nullptr in console call
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
|
||||
std::string namePart = args;
|
||||
@@ -768,7 +769,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// can be NULL at console call
|
||||
// can be nullptr at console call
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
|
||||
std::string namePart = args;
|
||||
@@ -860,7 +861,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// can be NULL at console call
|
||||
// can be nullptr at console call
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
|
||||
uint32 id = atoi((char*)args);
|
||||
@@ -1044,7 +1045,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// can be NULL in console call
|
||||
// can be nullptr in console call
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
|
||||
// title name have single string arg for player name
|
||||
@@ -1184,7 +1185,7 @@ public:
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
if (!*args)
|
||||
{
|
||||
// NULL only if used from console
|
||||
// nullptr only if used from console
|
||||
if (!target || target == handler->GetSession()->GetPlayer())
|
||||
return false;
|
||||
|
||||
@@ -1194,7 +1195,7 @@ public:
|
||||
else
|
||||
{
|
||||
ip = strtok((char*)args, " ");
|
||||
limitStr = strtok(NULL, " ");
|
||||
limitStr = strtok(nullptr, " ");
|
||||
limit = limitStr ? atoi(limitStr) : -1;
|
||||
}
|
||||
|
||||
@@ -1211,7 +1212,7 @@ public:
|
||||
return false;
|
||||
|
||||
std::string account = strtok((char*)args, " ");
|
||||
char* limitStr = strtok(NULL, " ");
|
||||
char* limitStr = strtok(nullptr, " ");
|
||||
int32 limit = limitStr ? atoi(limitStr) : -1;
|
||||
|
||||
if (!Utf8ToUpperOnlyLatin(account))
|
||||
@@ -1230,7 +1231,7 @@ public:
|
||||
return false;
|
||||
|
||||
std::string email = strtok((char*)args, " ");
|
||||
char* limitStr = strtok(NULL, " ");
|
||||
char* limitStr = strtok(nullptr, " ");
|
||||
int32 limit = limitStr ? atoi(limitStr) : -1;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
|
||||
|
||||
@@ -23,12 +23,18 @@ Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Channel.h"
|
||||
#include "ChannelMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class message_commandscript : public CommandScript
|
||||
{
|
||||
@@ -43,11 +49,11 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> channelCommandTable =
|
||||
{
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_CHANNEL_SET, true, NULL, "", channelSetCommandTable },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_CHANNEL_SET, true, nullptr, "", channelSetCommandTable },
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "channel", rbac::RBAC_PERM_COMMAND_CHANNEL, true, NULL, "", channelCommandTable },
|
||||
{ "channel", rbac::RBAC_PERM_COMMAND_CHANNEL, true, nullptr, "", channelCommandTable },
|
||||
{ "nameannounce", rbac::RBAC_PERM_COMMAND_NAMEANNOUNCE, true, &HandleNameAnnounceCommand, "" },
|
||||
{ "gmnameannounce", rbac::RBAC_PERM_COMMAND_GMNAMEANNOUNCE, true, &HandleGMNameAnnounceCommand, "" },
|
||||
{ "announce", rbac::RBAC_PERM_COMMAND_ANNOUNCE, true, &HandleAnnounceCommand, "" },
|
||||
@@ -70,26 +76,18 @@ public:
|
||||
return false;
|
||||
|
||||
uint32 channelId = 0;
|
||||
for (uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i)
|
||||
for (ChatChannelsEntry const* entry : sChatChannelsStore)
|
||||
{
|
||||
ChatChannelsEntry const* entry = sChatChannelsStore.LookupEntry(i);
|
||||
if (!entry)
|
||||
continue;
|
||||
|
||||
if (strstr(entry->pattern, channelStr))
|
||||
{
|
||||
channelId = i;
|
||||
channelId = entry->ChannelID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AreaTableEntry const* zoneEntry = nullptr;
|
||||
for (uint32 i = 0; i < sAreaTableStore.GetNumRows(); ++i)
|
||||
for (AreaTableEntry const* entry : sAreaTableStore)
|
||||
{
|
||||
AreaTableEntry const* entry = sAreaTableStore.LookupEntry(i);
|
||||
if (!entry)
|
||||
continue;
|
||||
|
||||
if (strstr(entry->area_name, channelStr))
|
||||
{
|
||||
zoneEntry = entry;
|
||||
@@ -232,7 +230,7 @@ public:
|
||||
|
||||
if (argStr == "remove")
|
||||
{
|
||||
std::string name = strtok(NULL, " ");
|
||||
std::string name = strtok(nullptr, " ");
|
||||
if (normalizePlayerName(name))
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayerByName(name))
|
||||
|
||||
@@ -15,30 +15,41 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "IpAddress.h"
|
||||
#include "Item.h"
|
||||
#include "Language.h"
|
||||
#include "LFG.h"
|
||||
#include "Log.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "MovementGenerator.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "TargetedMovementGenerator.h"
|
||||
#include "WeatherMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Pet.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "LFG.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Realm.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "TargetedMovementGenerator.h"
|
||||
#include "Transport.h"
|
||||
#include "Weather.h"
|
||||
#include "WeatherMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class misc_commandscript : public CommandScript
|
||||
{
|
||||
@@ -411,7 +422,7 @@ public:
|
||||
{
|
||||
Group* group = _player->GetGroup();
|
||||
// if no bind exists, create a solo bind
|
||||
InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
|
||||
InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : nullptr; // if no bind exists, create a solo bind
|
||||
if (!gBind)
|
||||
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId()))
|
||||
_player->BindToInstance(save, !save->CanReset());
|
||||
@@ -446,7 +457,7 @@ public:
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (handler->HasLowerSecurity(NULL, targetGuid))
|
||||
if (handler->HasLowerSecurity(nullptr, targetGuid))
|
||||
return false;
|
||||
|
||||
std::string nameLink = handler->playerLink(targetName);
|
||||
@@ -577,7 +588,7 @@ public:
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (handler->HasLowerSecurity(NULL, targetGuid))
|
||||
if (handler->HasLowerSecurity(nullptr, targetGuid))
|
||||
return false;
|
||||
|
||||
std::string nameLink = handler->playerLink(targetName);
|
||||
@@ -624,7 +635,7 @@ public:
|
||||
if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE))
|
||||
handler->GetSession()->GetPlayer()->Kill(target);
|
||||
else
|
||||
handler->GetSession()->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
handler->GetSession()->GetPlayer()->DealDamage(target, target->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -717,7 +728,7 @@ public:
|
||||
if (!param1)
|
||||
return false;
|
||||
|
||||
char const* param2 = strtok(NULL, " ");
|
||||
char const* param2 = strtok(nullptr, " ");
|
||||
if (!param2)
|
||||
return false;
|
||||
|
||||
@@ -910,9 +921,9 @@ public:
|
||||
// kick player
|
||||
static bool HandleKickPlayerCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* target = NULL;
|
||||
Player* target = nullptr;
|
||||
std::string playerName;
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, nullptr, &playerName))
|
||||
return false;
|
||||
|
||||
if (handler->GetSession() && target == handler->GetSession()->GetPlayer())
|
||||
@@ -929,8 +940,8 @@ public:
|
||||
std::string kickReasonStr = handler->GetTrinityString(LANG_NO_REASON);
|
||||
if (*args != '\0')
|
||||
{
|
||||
char const* kickReason = strtok(NULL, "\r");
|
||||
if (kickReason != NULL)
|
||||
char const* kickReason = strtok(nullptr, "\r");
|
||||
if (kickReason != nullptr)
|
||||
kickReasonStr = kickReason;
|
||||
}
|
||||
|
||||
@@ -963,10 +974,10 @@ public:
|
||||
return false;
|
||||
|
||||
std::string location_str = "inn";
|
||||
if (char const* loc = strtok(NULL, " "))
|
||||
if (char const* loc = strtok(nullptr, " "))
|
||||
location_str = loc;
|
||||
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
if (!handler->extractPlayerTarget(player_str, &player))
|
||||
return false;
|
||||
|
||||
@@ -1018,7 +1029,7 @@ public:
|
||||
|
||||
uint32 team;
|
||||
|
||||
char* px2 = strtok(NULL, " ");
|
||||
char* px2 = strtok(nullptr, " ");
|
||||
|
||||
if (!px2)
|
||||
team = 0;
|
||||
@@ -1050,7 +1061,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sObjectMgr->AddGraveYardLink(graveyardId, zoneId, team))
|
||||
if (sObjectMgr->AddGraveyardLink(graveyardId, zoneId, team))
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, graveyardId, zoneId);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, graveyardId, zoneId);
|
||||
@@ -1076,12 +1087,12 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
uint32 zone_id = player->GetZoneId();
|
||||
|
||||
WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(*player, team, nullptr);
|
||||
WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveyard(*player, team, nullptr);
|
||||
if (graveyard)
|
||||
{
|
||||
uint32 graveyardId = graveyard->ID;
|
||||
|
||||
GraveYardData const* data = sObjectMgr->FindGraveYardData(graveyardId, zone_id);
|
||||
GraveyardData const* data = sObjectMgr->FindGraveyardData(graveyardId, zone_id);
|
||||
if (!data)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, graveyardId);
|
||||
@@ -1233,12 +1244,12 @@ public:
|
||||
itemId = atoul(id);
|
||||
}
|
||||
|
||||
char const* ccount = strtok(NULL, " ");
|
||||
char const* ccount = strtok(nullptr, " ");
|
||||
|
||||
int32 count = 1;
|
||||
|
||||
if (ccount)
|
||||
count = strtol(ccount, NULL, 10);
|
||||
count = strtol(ccount, nullptr, 10);
|
||||
|
||||
if (count == 0)
|
||||
count = 1;
|
||||
@@ -1282,7 +1293,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Item* item = playerTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
Item* item = playerTarget->StoreNewItem(dest, itemId, true, GenerateItemRandomPropertyId(itemId));
|
||||
|
||||
// remove binding (let GM give it to another player later)
|
||||
if (player == playerTarget)
|
||||
@@ -1352,7 +1363,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
player->SendEquipError(msg, NULL, NULL, itr->second.ItemId);
|
||||
player->SendEquipError(msg, nullptr, nullptr, itr->second.ItemId);
|
||||
handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itr->second.ItemId, 1);
|
||||
}
|
||||
}
|
||||
@@ -1389,7 +1400,7 @@ public:
|
||||
|
||||
// *Change the weather of a cell
|
||||
char const* px = strtok((char*)args, " ");
|
||||
char const* py = strtok(NULL, " ");
|
||||
char const* py = strtok(nullptr, " ");
|
||||
|
||||
if (!px || !py)
|
||||
return false;
|
||||
@@ -1439,11 +1450,11 @@ public:
|
||||
if (!skillStr)
|
||||
return false;
|
||||
|
||||
char const* levelStr = strtok(NULL, " ");
|
||||
char const* levelStr = strtok(nullptr, " ");
|
||||
if (!levelStr)
|
||||
return false;
|
||||
|
||||
char const* maxPureSkill = strtok(NULL, " ");
|
||||
char const* maxPureSkill = strtok(nullptr, " ");
|
||||
|
||||
int32 skill = atoi(skillStr);
|
||||
if (skill <= 0)
|
||||
@@ -1512,7 +1523,7 @@ public:
|
||||
Player* target;
|
||||
ObjectGuid targetGuid;
|
||||
std::string targetName;
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
// To make sure we get a target, we convert our guid to an omniversal...
|
||||
ObjectGuid parseGUID(HighGuid::Player, uint32(atoul(args)));
|
||||
@@ -1635,7 +1646,7 @@ public:
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (handler->HasLowerSecurity(NULL, targetGuid))
|
||||
if (handler->HasLowerSecurity(nullptr, targetGuid))
|
||||
return false;
|
||||
|
||||
// Query informations from the DB
|
||||
@@ -1686,7 +1697,7 @@ public:
|
||||
lastIp = fields[4].GetString();
|
||||
lastLogin = fields[5].GetString();
|
||||
|
||||
uint32 ip = inet_addr(lastIp.c_str());
|
||||
uint32 ip = Trinity::Net::address_to_uint(Trinity::Net::make_address_v4(lastIp));
|
||||
EndianConvertReverse(ip);
|
||||
|
||||
// If ip2nation table is populated, it displays the country
|
||||
@@ -1781,7 +1792,7 @@ public:
|
||||
|
||||
// Output III. LANG_PINFO_BANNED if ban exists and is applied
|
||||
if (banTime >= 0)
|
||||
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
|
||||
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(nullptr), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
|
||||
|
||||
// Output IV. LANG_PINFO_MUTED if mute is applied
|
||||
if (muteTime > 0)
|
||||
@@ -1912,9 +1923,9 @@ public:
|
||||
if (!delayStr)
|
||||
return false;
|
||||
|
||||
char const* muteReason = strtok(NULL, "\r");
|
||||
char const* muteReason = strtok(nullptr, "\r");
|
||||
std::string muteReasonStr = handler->GetTrinityString(LANG_NO_REASON);
|
||||
if (muteReason != NULL)
|
||||
if (muteReason != nullptr)
|
||||
muteReasonStr = muteReason;
|
||||
|
||||
Player* target;
|
||||
@@ -1946,7 +1957,7 @@ public:
|
||||
if (target)
|
||||
{
|
||||
// Target is online, mute will be in effect right away.
|
||||
int64 muteTime = time(NULL) + notSpeakTime * MINUTE;
|
||||
int64 muteTime = time(nullptr) + notSpeakTime * MINUTE;
|
||||
target->GetSession()->m_muteTime = muteTime;
|
||||
stmt->setInt64(0, muteTime);
|
||||
std::string nameLink = handler->playerLink(targetName);
|
||||
@@ -2133,7 +2144,7 @@ public:
|
||||
break;
|
||||
case CHASE_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<ChaseMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
@@ -2149,7 +2160,7 @@ public:
|
||||
}
|
||||
case FOLLOW_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<FollowMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
@@ -2222,7 +2233,7 @@ public:
|
||||
|
||||
if (strcmp(str, "go") == 0)
|
||||
{
|
||||
char* guidStr = strtok(NULL, " ");
|
||||
char* guidStr = strtok(nullptr, " ");
|
||||
if (!guidStr)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
@@ -2238,7 +2249,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
char* damageStr = strtok(NULL, " ");
|
||||
char* damageStr = strtok(nullptr, " ");
|
||||
if (!damageStr)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
@@ -2303,12 +2314,12 @@ public:
|
||||
|
||||
uint32 damage = damage_int;
|
||||
|
||||
char* schoolStr = strtok((char*)NULL, " ");
|
||||
char* schoolStr = strtok((char*)nullptr, " ");
|
||||
|
||||
// flat melee damage without resistence/etc reduction
|
||||
if (!schoolStr)
|
||||
{
|
||||
handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
handler->GetSession()->GetPlayer()->DealDamage(target, damage, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
|
||||
if (target != handler->GetSession()->GetPlayer())
|
||||
handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0);
|
||||
return true;
|
||||
@@ -2321,9 +2332,9 @@ public:
|
||||
SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);
|
||||
|
||||
if (Unit::IsDamageReducedByArmor(schoolmask))
|
||||
damage = handler->GetSession()->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK);
|
||||
damage = handler->GetSession()->GetPlayer()->CalcArmorReducedDamage(target, damage, nullptr, BASE_ATTACK);
|
||||
|
||||
char* spellStr = strtok((char*)NULL, " ");
|
||||
char* spellStr = strtok((char*)nullptr, " ");
|
||||
|
||||
// melee damage by specific school
|
||||
if (!spellStr)
|
||||
@@ -2370,7 +2381,7 @@ public:
|
||||
|
||||
static bool HandleCombatStopCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* target = NULL;
|
||||
Player* target = nullptr;
|
||||
|
||||
if (args && args[0] != '\0')
|
||||
{
|
||||
@@ -2444,7 +2455,7 @@ public:
|
||||
{
|
||||
// Get the args that we might have (up to 2)
|
||||
char const* arg1 = strtok((char*)args, " ");
|
||||
char const* arg2 = strtok(NULL, " ");
|
||||
char const* arg2 = strtok(nullptr, " ");
|
||||
|
||||
// Analyze them to see if we got either a playerName or duration or both
|
||||
if (arg1)
|
||||
|
||||
@@ -24,19 +24,20 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Map.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "PointMovementGenerator.h"
|
||||
#include "PathGenerator.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
#include "PointMovementGenerator.h"
|
||||
#include "RBAC.h"
|
||||
#include "TargetedMovementGenerator.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class mmaps_commandscript : public CommandScript
|
||||
{
|
||||
@@ -56,7 +57,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "mmap", rbac::RBAC_PERM_COMMAND_MMAP, true, NULL, "", mmapCommandTable },
|
||||
{ "mmap", rbac::RBAC_PERM_COMMAND_MMAP, true, nullptr, "", mmapCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -104,9 +105,9 @@ public:
|
||||
handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : useStraightLine ? "Raycast" : "SmoothPath");
|
||||
handler->PSendSysMessage("Result: %s - Length: %zu - 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);
|
||||
@@ -159,7 +160,7 @@ public:
|
||||
// navmesh poly -> navmesh tile location
|
||||
dtQueryFilter filter = dtQueryFilter();
|
||||
dtPolyRef polyRef = INVALID_POLYREF;
|
||||
if (dtStatusFailed(navmeshquery->findNearestPoly(location, extents, &filter, &polyRef, NULL)))
|
||||
if (dtStatusFailed(navmeshquery->findNearestPoly(location, extents, &filter, &polyRef, nullptr)))
|
||||
{
|
||||
handler->PSendSysMessage("Dt [??,??] (invalid poly, probably no tile loaded)");
|
||||
return true;
|
||||
|
||||
@@ -22,16 +22,18 @@ Comment: All modify related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include <stdlib.h>
|
||||
#include "DBCStores.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Pet.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
#include "WorldSession.h"
|
||||
|
||||
class modify_commandscript : public CommandScript
|
||||
{
|
||||
@@ -67,7 +69,7 @@ public:
|
||||
{ "reputation", rbac::RBAC_PERM_COMMAND_MODIFY_REPUTATION, false, &HandleModifyRepCommand, "" },
|
||||
{ "runicpower", rbac::RBAC_PERM_COMMAND_MODIFY_RUNICPOWER, false, &HandleModifyRunicPowerCommand, "" },
|
||||
{ "scale", rbac::RBAC_PERM_COMMAND_MODIFY_SCALE, false, &HandleModifyScaleCommand, "" },
|
||||
{ "speed", rbac::RBAC_PERM_COMMAND_MODIFY_SPEED, false, NULL, "", modifyspeedCommandTable },
|
||||
{ "speed", rbac::RBAC_PERM_COMMAND_MODIFY_SPEED, false, nullptr, "", modifyspeedCommandTable },
|
||||
{ "spell", rbac::RBAC_PERM_COMMAND_MODIFY_SPELL, false, &HandleModifySpellCommand, "" },
|
||||
{ "standstate", rbac::RBAC_PERM_COMMAND_MODIFY_STANDSTATE, false, &HandleModifyStandStateCommand, "" },
|
||||
{ "talentpoints", rbac::RBAC_PERM_COMMAND_MODIFY_TALENTPOINTS, false, &HandleModifyTalentCommand, "" },
|
||||
@@ -77,7 +79,7 @@ public:
|
||||
{
|
||||
{ "morph", rbac::RBAC_PERM_COMMAND_MORPH, false, &HandleModifyMorphCommand, "" },
|
||||
{ "demorph", rbac::RBAC_PERM_COMMAND_DEMORPH, false, &HandleDeMorphCommand, "" },
|
||||
{ "modify", rbac::RBAC_PERM_COMMAND_MODIFY, false, NULL, "", modifyCommandTable },
|
||||
{ "modify", rbac::RBAC_PERM_COMMAND_MODIFY, false, nullptr, "", modifyCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -93,7 +95,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static bool CheckModifyResources(ChatHandler* handler, const char* args, Player* target, int32& res, int32& resmax, int8 const multiplier = 1)
|
||||
static bool CheckModifyResources(ChatHandler* handler, char const* args, Player* target, int32& res, int32& resmax, int8 const multiplier = 1)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -122,7 +124,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player HP
|
||||
static bool HandleModifyHPCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyHPCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
int32 hp, hpmax;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -137,7 +139,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Mana
|
||||
static bool HandleModifyManaCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyManaCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
int32 mana, manamax;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -153,7 +155,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Energy
|
||||
static bool HandleModifyEnergyCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyEnergyCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
int32 energy, energymax;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -170,7 +172,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Rage
|
||||
static bool HandleModifyRageCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyRageCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
int32 rage, ragemax;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -186,7 +188,7 @@ public:
|
||||
}
|
||||
|
||||
// Edit Player Runic Power
|
||||
static bool HandleModifyRunicPowerCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyRunicPowerCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
int32 rune, runemax;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -202,7 +204,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Faction
|
||||
static bool HandleModifyFactionCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyFactionCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -230,13 +232,13 @@ public:
|
||||
uint32 factionid = atoi(pfactionid);
|
||||
uint32 flag;
|
||||
|
||||
char *pflag = strtok(NULL, " ");
|
||||
char *pflag = strtok(nullptr, " ");
|
||||
if (!pflag)
|
||||
flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
|
||||
else
|
||||
flag = atoi(pflag);
|
||||
|
||||
char* pnpcflag = strtok(NULL, " ");
|
||||
char* pnpcflag = strtok(nullptr, " ");
|
||||
|
||||
uint32 npcflag;
|
||||
if (!pnpcflag)
|
||||
@@ -244,7 +246,7 @@ public:
|
||||
else
|
||||
npcflag = atoi(pnpcflag);
|
||||
|
||||
char* pdyflag = strtok(NULL, " ");
|
||||
char* pdyflag = strtok(nullptr, " ");
|
||||
|
||||
uint32 dyflag;
|
||||
if (!pdyflag)
|
||||
@@ -270,7 +272,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Spell
|
||||
static bool HandleModifySpellCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifySpellCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -279,17 +281,17 @@ public:
|
||||
if (!pspellflatid)
|
||||
return false;
|
||||
|
||||
char* pop = strtok(NULL, " ");
|
||||
char* pop = strtok(nullptr, " ");
|
||||
if (!pop)
|
||||
return false;
|
||||
|
||||
char* pval = strtok(NULL, " ");
|
||||
char* pval = strtok(nullptr, " ");
|
||||
if (!pval)
|
||||
return false;
|
||||
|
||||
uint16 mark;
|
||||
|
||||
char* pmark = strtok(NULL, " ");
|
||||
char* pmark = strtok(nullptr, " ");
|
||||
|
||||
uint8 spellflatid = atoi(pspellflatid);
|
||||
uint8 op = atoi(pop);
|
||||
@@ -300,7 +302,7 @@ public:
|
||||
mark = atoi(pmark);
|
||||
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (target == NULL)
|
||||
if (target == nullptr)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -320,13 +322,13 @@ public:
|
||||
data << uint8(op);
|
||||
data << uint16(val);
|
||||
data << uint16(mark);
|
||||
target->GetSession()->SendPacket(&data);
|
||||
target->SendDirectMessage(&data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Edit Player TP
|
||||
static bool HandleModifyTalentCommand (ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyTalentCommand (ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -371,7 +373,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool CheckModifySpeed(ChatHandler* handler, const char* args, Unit* target, float& speed, float minimumBound, float maximumBound, bool checkInFlight = true)
|
||||
static bool CheckModifySpeed(ChatHandler* handler, char const* args, Unit* target, float& speed, float minimumBound, float maximumBound, bool checkInFlight = true)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -409,7 +411,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Aspeed
|
||||
static bool HandleModifyASpeedCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyASpeedCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
float allSpeed;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -426,7 +428,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Speed
|
||||
static bool HandleModifySpeedCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifySpeedCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
float Speed;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -440,7 +442,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Swim Speed
|
||||
static bool HandleModifySwimCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifySwimCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
float swimSpeed;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -454,7 +456,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Backwards Walk Speed
|
||||
static bool HandleModifyBWalkCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyBWalkCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
float backSpeed;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -468,7 +470,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player Fly
|
||||
static bool HandleModifyFlyCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyFlyCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
float flySpeed;
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
@@ -482,7 +484,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player or Creature Scale
|
||||
static bool HandleModifyScaleCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyScaleCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
float Scale;
|
||||
Unit* target = handler->getSelectedUnit();
|
||||
@@ -496,7 +498,7 @@ public:
|
||||
}
|
||||
|
||||
//Enable Player mount
|
||||
static bool HandleModifyMountCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyMountCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -539,7 +541,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Player money
|
||||
static bool HandleModifyMoneyCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyMoneyCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -607,7 +609,7 @@ public:
|
||||
}
|
||||
|
||||
//Edit Unit field
|
||||
static bool HandleModifyBitCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyBitCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -628,7 +630,7 @@ public:
|
||||
if (!pField)
|
||||
return false;
|
||||
|
||||
char* pBit = strtok(NULL, " ");
|
||||
char* pBit = strtok(nullptr, " ");
|
||||
if (!pBit)
|
||||
return false;
|
||||
|
||||
@@ -661,7 +663,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleModifyHonorCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyHonorCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -687,7 +689,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleModifyDrunkCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyDrunkCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -702,7 +704,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleModifyRepCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyRepCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -726,7 +728,7 @@ public:
|
||||
uint32 factionId = atoi(factionTxt);
|
||||
|
||||
int32 amount = 0;
|
||||
char *rankTxt = strtok(NULL, " ");
|
||||
char *rankTxt = strtok(nullptr, " ");
|
||||
if (!factionId || !rankTxt)
|
||||
return false;
|
||||
|
||||
@@ -755,7 +757,7 @@ public:
|
||||
|
||||
if (wrank.substr(0, wrankStr.size()) == wrankStr)
|
||||
{
|
||||
char *deltaTxt = strtok(NULL, " ");
|
||||
char *deltaTxt = strtok(nullptr, " ");
|
||||
if (deltaTxt)
|
||||
{
|
||||
int32 delta = atoi(deltaTxt);
|
||||
@@ -780,7 +782,6 @@ public:
|
||||
}
|
||||
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
|
||||
|
||||
if (!factionEntry)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_UNKNOWN, factionId);
|
||||
@@ -803,7 +804,7 @@ public:
|
||||
}
|
||||
|
||||
//morph creature or player
|
||||
static bool HandleModifyMorphCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyMorphCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -824,7 +825,7 @@ public:
|
||||
}
|
||||
|
||||
// Toggles a phaseid on a player
|
||||
static bool HandleModifyPhaseCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyPhaseCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -876,7 +877,7 @@ public:
|
||||
}
|
||||
|
||||
//change standstate
|
||||
static bool HandleModifyStandStateCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyStandStateCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -887,7 +888,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleModifyGenderCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyGenderCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -948,7 +949,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
//demorph player or unit
|
||||
static bool HandleDeMorphCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleDeMorphCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
Unit* target = handler->getSelectedUnit();
|
||||
if (!target)
|
||||
@@ -963,7 +964,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleModifyCurrencyCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleModifyCurrencyCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -981,7 +982,7 @@ public:
|
||||
if (!currencyType)
|
||||
return false;
|
||||
|
||||
uint32 amount = atoi(strtok(NULL, " "));
|
||||
uint32 amount = atoi(strtok(nullptr, " "));
|
||||
if (!amount)
|
||||
return false;
|
||||
|
||||
@@ -991,7 +992,7 @@ public:
|
||||
}
|
||||
|
||||
// mod xp command
|
||||
static bool HandleModifyXPCommand(ChatHandler *handler, const char* args)
|
||||
static bool HandleModifyXPCommand(ChatHandler *handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -23,16 +23,23 @@ Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Transport.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "Language.h"
|
||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||
#include "CreatureAI.h"
|
||||
#include "Player.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||
#include "Transport.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
template<typename E, typename T = char const*>
|
||||
struct EnumName
|
||||
@@ -694,7 +701,7 @@ public:
|
||||
uint32 nativeid = target->GetNativeDisplayId();
|
||||
uint32 Entry = target->GetEntry();
|
||||
|
||||
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
|
||||
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(nullptr);
|
||||
if (curRespawnDelay < 0)
|
||||
curRespawnDelay = 0;
|
||||
std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
|
||||
|
||||
@@ -15,14 +15,19 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
static inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
|
||||
inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
|
||||
{
|
||||
if (Unit* target = handler->getSelectedUnit())
|
||||
{
|
||||
@@ -35,6 +40,7 @@ static inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
return player ? player->GetPet() : nullptr;
|
||||
}
|
||||
|
||||
class pet_commandscript : public CommandScript
|
||||
{
|
||||
public:
|
||||
@@ -52,7 +58,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "pet", rbac::RBAC_PERM_COMMAND_PET, false, NULL, "", petCommandTable },
|
||||
{ "pet", rbac::RBAC_PERM_COMMAND_PET, false, nullptr, "", petCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
@@ -22,11 +22,15 @@ Comment: All quest related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "World.h"
|
||||
|
||||
class quest_commandscript : public CommandScript
|
||||
{
|
||||
@@ -44,12 +48,12 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "quest", rbac::RBAC_PERM_COMMAND_QUEST, false, NULL, "", questCommandTable },
|
||||
{ "quest", rbac::RBAC_PERM_COMMAND_QUEST, false, nullptr, "", questCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static bool HandleQuestAdd(ChatHandler* handler, const char* args)
|
||||
static bool HandleQuestAdd(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* player = handler->getSelectedPlayerOrSelf();
|
||||
if (!player)
|
||||
@@ -78,7 +82,10 @@ public:
|
||||
|
||||
// check item starting quest (it can work incorrectly if added without item in inventory)
|
||||
ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore();
|
||||
ItemTemplateContainer::const_iterator result = find_if (itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
|
||||
ItemTemplateContainer::const_iterator result = std::find_if(itc->begin(), itc->end(), [quest](ItemTemplateContainer::value_type const& value)
|
||||
{
|
||||
return value.second.StartQuest == quest->GetQuestId();
|
||||
});
|
||||
|
||||
if (result != itc->end())
|
||||
{
|
||||
@@ -89,12 +96,12 @@ public:
|
||||
|
||||
// ok, normal (creature/GO starting) quest
|
||||
if (player->CanAddQuest(quest, true))
|
||||
player->AddQuestAndCheckCompletion(quest, NULL);
|
||||
player->AddQuestAndCheckCompletion(quest, nullptr);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleQuestRemove(ChatHandler* handler, const char* args)
|
||||
static bool HandleQuestRemove(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* player = handler->getSelectedPlayer();
|
||||
if (!player)
|
||||
@@ -157,7 +164,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static bool HandleQuestComplete(ChatHandler* handler, const char* args)
|
||||
static bool HandleQuestComplete(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* player = handler->getSelectedPlayerOrSelf();
|
||||
if (!player)
|
||||
|
||||
@@ -22,16 +22,20 @@ Comment: All role based access control related commands (including account relat
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Config.h"
|
||||
#include "Chat.h"
|
||||
#include "Config.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "Realm.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
struct RBACCommandData
|
||||
{
|
||||
RBACCommandData(): id(0), realmId(0), rbac(NULL), needDelete(false) { }
|
||||
RBACCommandData(): id(0), realmId(0), rbac(nullptr), needDelete(false) { }
|
||||
~RBACCommandData()
|
||||
{
|
||||
if (needDelete)
|
||||
@@ -61,13 +65,13 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> rbacCommandTable =
|
||||
{
|
||||
{ "account", rbac::RBAC_PERM_COMMAND_RBAC_ACC, true, NULL, "", rbacAccountCommandTable },
|
||||
{ "account", rbac::RBAC_PERM_COMMAND_RBAC_ACC, true, nullptr, "", rbacAccountCommandTable },
|
||||
{ "list", rbac::RBAC_PERM_COMMAND_RBAC_LIST, true, &HandleRBACListPermissionsCommand, "" },
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "rbac", rbac::RBAC_PERM_COMMAND_RBAC, true, NULL, "", rbacCommandTable },
|
||||
{ "rbac", rbac::RBAC_PERM_COMMAND_RBAC, true, nullptr, "", rbacCommandTable },
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
@@ -76,18 +80,18 @@ public:
|
||||
static RBACCommandData* ReadParams(ChatHandler* handler, char const* args, bool checkParams = true)
|
||||
{
|
||||
if (!args)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
char* param1 = strtok((char*)args, " ");
|
||||
char* param2 = strtok(NULL, " ");
|
||||
char* param3 = strtok(NULL, " ");
|
||||
char* param2 = strtok(nullptr, " ");
|
||||
char* param3 = strtok(nullptr, " ");
|
||||
|
||||
int32 realmId = -1;
|
||||
uint32 accountId = 0;
|
||||
std::string accountName;
|
||||
uint32 id = 0;
|
||||
RBACCommandData* data = NULL;
|
||||
rbac::RBACData* rdata = NULL;
|
||||
RBACCommandData* data = nullptr;
|
||||
rbac::RBACData* rdata = nullptr;
|
||||
bool useSelectedPlayer = false;
|
||||
|
||||
if (checkParams)
|
||||
@@ -112,14 +116,14 @@ public:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, id);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (realmId < -1 || !realmId)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_REALM, realmId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else if (!param1)
|
||||
@@ -129,7 +133,7 @@ public:
|
||||
{
|
||||
Player* player = handler->getSelectedPlayer();
|
||||
if (!player)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
rdata = player->GetSession()->GetRBACData();
|
||||
accountId = rdata->GetId();
|
||||
@@ -146,12 +150,12 @@ public:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (checkParams && handler->HasLowerSecurityAccount(NULL, accountId, true))
|
||||
return NULL;
|
||||
if (checkParams && handler->HasLowerSecurityAccount(nullptr, accountId, true))
|
||||
return nullptr;
|
||||
|
||||
data = new RBACCommandData();
|
||||
|
||||
|
||||
@@ -22,18 +22,22 @@ Comment: All reload related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "ItemEnchantmentMgr.h"
|
||||
#include "Language.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "LootMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "SkillExtraItems.h"
|
||||
#include "SmartAI.h"
|
||||
@@ -41,6 +45,7 @@ EndScriptData */
|
||||
#include "TicketMgr.h"
|
||||
#include "WardenCheckMgr.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "World.h"
|
||||
|
||||
class reload_commandscript : public CommandScript
|
||||
{
|
||||
@@ -164,13 +169,13 @@ public:
|
||||
}
|
||||
|
||||
//reload commands
|
||||
static bool HandleReloadGMTicketsCommand(ChatHandler* /*handler*/, const char* /*args*/)
|
||||
static bool HandleReloadGMTicketsCommand(ChatHandler* /*handler*/, char const* /*args*/)
|
||||
{
|
||||
sTicketMgr->LoadTickets();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
HandleReloadSkillFishingBaseLevelCommand(handler, "");
|
||||
|
||||
@@ -201,14 +206,14 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllAchievementCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllAchievementCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
HandleReloadAchievementCriteriaDataCommand(handler, "");
|
||||
HandleReloadAchievementRewardCommand(handler, "");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllAreaCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllAreaCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
HandleReloadQuestGreetingCommand(handler, "");
|
||||
//HandleReloadQuestAreaTriggersCommand(handler, ""); -- reloaded in HandleReloadAllQuestCommand
|
||||
@@ -218,7 +223,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllLootCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllLootCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables...");
|
||||
LoadLootTables();
|
||||
@@ -227,7 +232,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllNpcCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleReloadAllNpcCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (*args != 'a') // will be reloaded from all_gossips
|
||||
HandleReloadNpcTrainerCommand(handler, "a");
|
||||
@@ -237,7 +242,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllQuestCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllQuestCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
HandleReloadQuestAreaTriggersCommand(handler, "a");
|
||||
HandleReloadQuestPOICommand(handler, "a");
|
||||
@@ -249,7 +254,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllScriptsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllScriptsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
if (sMapMgr->IsScriptScheduled())
|
||||
{
|
||||
@@ -267,7 +272,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllSpellCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllSpellCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
HandleReloadSkillDiscoveryTemplateCommand(handler, "a");
|
||||
HandleReloadSkillExtraItemTemplateCommand(handler, "a");
|
||||
@@ -285,7 +290,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllGossipsCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleReloadAllGossipsCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
HandleReloadGossipMenuCommand(handler, "a");
|
||||
HandleReloadGossipMenuOptionCommand(handler, "a");
|
||||
@@ -294,14 +299,14 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllItemCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllItemCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
HandleReloadPageTextsCommand(handler, "a");
|
||||
HandleReloadItemEnchantementsCommand(handler, "a");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAllLocalesCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAllLocalesCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
HandleReloadLocalesAchievementRewardCommand(handler, "a");
|
||||
HandleReloadLocalesCreatureCommand(handler, "a");
|
||||
@@ -317,7 +322,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadConfigCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadConfigCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading config settings...");
|
||||
sWorld->LoadConfigSettings(true);
|
||||
@@ -326,7 +331,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAccessRequirementCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAccessRequirementCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Access Requirement definitions...");
|
||||
sObjectMgr->LoadAccessRequirements();
|
||||
@@ -334,7 +339,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAchievementCriteriaDataCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAchievementCriteriaDataCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Additional Achievement Criteria Data...");
|
||||
sAchievementMgr->LoadAchievementCriteriaData();
|
||||
@@ -342,7 +347,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAchievementRewardCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAchievementRewardCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Achievement Reward Data...");
|
||||
sAchievementMgr->LoadRewards();
|
||||
@@ -350,7 +355,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAreaTriggerTavernCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAreaTriggerTavernCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Tavern Area Triggers...");
|
||||
sObjectMgr->LoadTavernAreaTriggers();
|
||||
@@ -358,7 +363,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAreaTriggerTeleportCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAreaTriggerTeleportCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading AreaTrigger teleport definitions...");
|
||||
sObjectMgr->LoadAreaTriggerTeleports();
|
||||
@@ -366,7 +371,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAutobroadcastCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAutobroadcastCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Autobroadcasts...");
|
||||
sWorld->LoadAutobroadcasts();
|
||||
@@ -382,7 +387,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadBroadcastTextCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadBroadcastTextCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Broadcast texts...");
|
||||
sObjectMgr->LoadBroadcastTexts();
|
||||
@@ -391,14 +396,14 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadCommandCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadCommandCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
ChatHandler::invalidateCommandTable();
|
||||
handler->SendGlobalGMSysMessage("DB table `command` will be reloaded at next chat command use.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading creature award reputation definitions...");
|
||||
sObjectMgr->LoadReputationOnKill();
|
||||
@@ -406,7 +411,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadCreatureSummonGroupsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadCreatureSummonGroupsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Reloading creature summon groups...");
|
||||
sObjectMgr->LoadTempSummons();
|
||||
@@ -414,7 +419,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadCreatureTemplateCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleReloadCreatureTemplateCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -453,7 +458,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadCreatureQuestStarterCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadCreatureQuestStarterCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Loading Quests Relations... (`creature_queststarter`)");
|
||||
sObjectMgr->LoadCreatureQuestStarters();
|
||||
@@ -461,7 +466,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLinkedRespawnCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLinkedRespawnCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Loading Linked Respawns... (`creature_linked_respawn`)");
|
||||
sObjectMgr->LoadLinkedRespawn();
|
||||
@@ -469,7 +474,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadCreatureQuestEnderCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadCreatureQuestEnderCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Loading Quests Relations... (`creature_questender`)");
|
||||
sObjectMgr->LoadCreatureQuestEnders();
|
||||
@@ -477,7 +482,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGossipMenuCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadGossipMenuCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading `gossip_menu` Table!");
|
||||
sObjectMgr->LoadGossipMenu();
|
||||
@@ -486,7 +491,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadGossipMenuOptionCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading `gossip_menu_option` Table!");
|
||||
sObjectMgr->LoadGossipMenuItems();
|
||||
@@ -495,7 +500,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGOQuestStarterCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadGOQuestStarterCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Loading Quests Relations... (`gameobject_queststarter`)");
|
||||
sObjectMgr->LoadGameobjectQuestStarters();
|
||||
@@ -503,7 +508,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGOQuestEnderCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadGOQuestEnderCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Loading Quests Relations... (`gameobject_questender`)");
|
||||
sObjectMgr->LoadGameobjectQuestEnders();
|
||||
@@ -511,7 +516,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadQuestAreaTriggersCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadQuestAreaTriggersCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Quest Area Triggers...");
|
||||
sObjectMgr->LoadQuestAreaTriggers();
|
||||
@@ -535,7 +540,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadQuestTemplateCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadQuestTemplateCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Quest Templates...");
|
||||
sObjectMgr->LoadQuests();
|
||||
@@ -548,7 +553,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesCreatureCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesCreatureCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`creature_loot_template`)");
|
||||
LoadLootTemplates_Creature();
|
||||
@@ -558,7 +563,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesDisenchantCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesDisenchantCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`disenchant_loot_template`)");
|
||||
LoadLootTemplates_Disenchant();
|
||||
@@ -568,7 +573,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesFishingCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesFishingCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`fishing_loot_template`)");
|
||||
LoadLootTemplates_Fishing();
|
||||
@@ -578,7 +583,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesGameobjectCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesGameobjectCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`gameobject_loot_template`)");
|
||||
LoadLootTemplates_Gameobject();
|
||||
@@ -588,7 +593,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesItemCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesItemCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`item_loot_template`)");
|
||||
LoadLootTemplates_Item();
|
||||
@@ -598,7 +603,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesMillingCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesMillingCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`milling_loot_template`)");
|
||||
LoadLootTemplates_Milling();
|
||||
@@ -608,7 +613,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesPickpocketingCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesPickpocketingCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`pickpocketing_loot_template`)");
|
||||
LoadLootTemplates_Pickpocketing();
|
||||
@@ -618,7 +623,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesProspectingCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesProspectingCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`prospecting_loot_template`)");
|
||||
LoadLootTemplates_Prospecting();
|
||||
@@ -628,7 +633,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesMailCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesMailCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`mail_loot_template`)");
|
||||
LoadLootTemplates_Mail();
|
||||
@@ -638,7 +643,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesReferenceCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesReferenceCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`reference_loot_template`)");
|
||||
LoadLootTemplates_Reference();
|
||||
@@ -647,7 +652,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesSkinningCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesSkinningCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`skinning_loot_template`)");
|
||||
LoadLootTemplates_Skinning();
|
||||
@@ -657,7 +662,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLootTemplatesSpellCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLootTemplatesSpellCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`spell_loot_template`)");
|
||||
LoadLootTemplates_Spell();
|
||||
@@ -667,7 +672,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadTrinityStringCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadTrinityStringCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading trinity_string Table!");
|
||||
sObjectMgr->LoadTrinityStrings();
|
||||
@@ -675,7 +680,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadWardenactionCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadWardenactionCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED))
|
||||
{
|
||||
@@ -690,7 +695,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadNpcTrainerCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadNpcTrainerCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading `npc_trainer` Table!");
|
||||
sObjectMgr->LoadTrainerSpell();
|
||||
@@ -698,7 +703,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadNpcVendorCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadNpcVendorCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading `npc_vendor` Table!");
|
||||
sObjectMgr->LoadVendors();
|
||||
@@ -706,7 +711,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadPointsOfInterestCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading `points_of_interest` Table!");
|
||||
sObjectMgr->LoadPointsOfInterest();
|
||||
@@ -714,7 +719,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadQuestPOICommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadQuestPOICommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Quest POI ..." );
|
||||
sObjectMgr->LoadQuestPOI();
|
||||
@@ -722,7 +727,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellClickSpellsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellClickSpellsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading `npc_spellclick_spells` Table!");
|
||||
sObjectMgr->LoadNPCSpellClickSpells();
|
||||
@@ -730,7 +735,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadReservedNameCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadReservedNameCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Loading ReservedNames... (`reserved_name`)");
|
||||
sObjectMgr->LoadReservedPlayersNames();
|
||||
@@ -738,7 +743,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadReputationRewardRateCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadReputationRewardRateCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading `reputation_reward_rate` Table!" );
|
||||
sObjectMgr->LoadReputationRewardRate();
|
||||
@@ -746,7 +751,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadReputationSpilloverTemplateCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadReputationSpilloverTemplateCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading `reputation_spillover_template` Table!" );
|
||||
sObjectMgr->LoadReputationSpilloverTemplate();
|
||||
@@ -754,7 +759,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSkillDiscoveryTemplateCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSkillDiscoveryTemplateCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Skill Discovery Table...");
|
||||
LoadSkillDiscoveryTable();
|
||||
@@ -762,7 +767,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSkillPerfectItemTemplateCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSkillPerfectItemTemplateCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{ // latched onto HandleReloadSkillExtraItemTemplateCommand as it's part of that table group (and i don't want to chance all the command IDs)
|
||||
TC_LOG_INFO("misc", "Re-Loading Skill Perfection Data Table...");
|
||||
LoadSkillPerfectItemTable();
|
||||
@@ -770,7 +775,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSkillExtraItemTemplateCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleReloadSkillExtraItemTemplateCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Skill Extra Item Table...");
|
||||
LoadSkillExtraItemTable();
|
||||
@@ -779,7 +784,7 @@ public:
|
||||
return HandleReloadSkillPerfectItemTemplateCommand(handler, args);
|
||||
}
|
||||
|
||||
static bool HandleReloadSkillFishingBaseLevelCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSkillFishingBaseLevelCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Skill Fishing base level requirements...");
|
||||
sObjectMgr->LoadFishingBaseSkillLevel();
|
||||
@@ -787,7 +792,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellAreaCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellAreaCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading SpellArea Data...");
|
||||
sSpellMgr->LoadSpellAreas();
|
||||
@@ -795,7 +800,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellRequiredCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellRequiredCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell Required Data... ");
|
||||
sSpellMgr->LoadSpellRequired();
|
||||
@@ -803,7 +808,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellGroupsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellGroupsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell Groups...");
|
||||
sSpellMgr->LoadSpellGroups();
|
||||
@@ -811,7 +816,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellLearnSpellCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellLearnSpellCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell Learn Spells...");
|
||||
sSpellMgr->LoadSpellLearnSpells();
|
||||
@@ -819,7 +824,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellLinkedSpellCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellLinkedSpellCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell Linked Spells...");
|
||||
sSpellMgr->LoadSpellLinked();
|
||||
@@ -827,7 +832,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellProcsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellProcsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell Proc conditions and data...");
|
||||
sSpellMgr->LoadSpellProcs();
|
||||
@@ -835,7 +840,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellBonusesCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellBonusesCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell Bonus Data...");
|
||||
sSpellMgr->LoadSpellBonusess();
|
||||
@@ -843,7 +848,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellTargetPositionCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellTargetPositionCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell target coordinates...");
|
||||
sSpellMgr->LoadSpellTargetPositions();
|
||||
@@ -851,7 +856,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellThreatsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellThreatsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Aggro Spells Definitions...");
|
||||
sSpellMgr->LoadSpellThreats();
|
||||
@@ -859,7 +864,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellGroupStackRulesCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellGroupStackRulesCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell Group Stack Rules...");
|
||||
sSpellMgr->LoadSpellGroupStackRules();
|
||||
@@ -867,7 +872,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellPetAurasCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSpellPetAurasCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Spell pet auras...");
|
||||
sSpellMgr->LoadSpellPetAuras();
|
||||
@@ -875,7 +880,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadPageTextsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadPageTextsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Page Text...");
|
||||
sObjectMgr->LoadPageTexts();
|
||||
@@ -883,7 +888,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadItemEnchantementsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadItemEnchantementsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Item Random Enchantments Table...");
|
||||
LoadRandomEnchantmentsTable();
|
||||
@@ -891,7 +896,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadEventScriptsCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleReloadEventScriptsCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (sMapMgr->IsScriptScheduled())
|
||||
{
|
||||
@@ -911,7 +916,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadWpScriptsCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleReloadWpScriptsCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (sMapMgr->IsScriptScheduled())
|
||||
{
|
||||
@@ -931,7 +936,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadWpCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleReloadWpCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (*args != 'a')
|
||||
TC_LOG_INFO("misc", "Re-Loading Waypoints data from 'waypoints_data'");
|
||||
@@ -944,7 +949,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (sMapMgr->IsScriptScheduled())
|
||||
{
|
||||
@@ -964,7 +969,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Graveyard-zone links...");
|
||||
|
||||
@@ -975,7 +980,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGameTeleCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadGameTeleCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Game Tele coordinates...");
|
||||
|
||||
@@ -986,7 +991,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadDisablesCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadDisablesCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading disables table...");
|
||||
DisableMgr::LoadDisables();
|
||||
@@ -996,7 +1001,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Achievement Reward Data Locale...");
|
||||
sAchievementMgr->LoadRewardLocales();
|
||||
@@ -1004,7 +1009,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLfgRewardsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLfgRewardsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading lfg dungeon rewards...");
|
||||
sLFGMgr->LoadRewards();
|
||||
@@ -1012,7 +1017,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Creature Template Locale...");
|
||||
sObjectMgr->LoadCreatureLocales();
|
||||
@@ -1020,7 +1025,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Creature Texts Locale...");
|
||||
sCreatureTextMgr->LoadCreatureTextLocales();
|
||||
@@ -1028,7 +1033,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Gameobject Template Locale... ");
|
||||
sObjectMgr->LoadGameObjectLocales();
|
||||
@@ -1036,7 +1041,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Gossip Menu Option Locale... ");
|
||||
sObjectMgr->LoadGossipMenuItemsLocales();
|
||||
@@ -1044,7 +1049,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesItemCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesItemCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Item Template Locale... ");
|
||||
sObjectMgr->LoadItemLocales();
|
||||
@@ -1052,7 +1057,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading NPC Text Locale... ");
|
||||
sObjectMgr->LoadNpcTextLocales();
|
||||
@@ -1060,7 +1065,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Page Text Locale... ");
|
||||
sObjectMgr->LoadPageTextLocales();
|
||||
@@ -1068,7 +1073,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Points Of Interest Locale... ");
|
||||
sObjectMgr->LoadPointOfInterestLocales();
|
||||
@@ -1076,7 +1081,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesQuestCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadLocalesQuestCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Quest Template Locale... ");
|
||||
sObjectMgr->LoadQuestLocales();
|
||||
@@ -1084,7 +1089,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadMailLevelRewardCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadMailLevelRewardCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Player level dependent mail rewards...");
|
||||
sObjectMgr->LoadMailLevelRewards();
|
||||
@@ -1092,7 +1097,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAuctionsCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadAuctionsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
///- Reload dynamic data tables from the database
|
||||
TC_LOG_INFO("misc", "Re-Loading Auctions...");
|
||||
@@ -1102,7 +1107,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadConditions(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadConditions(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Conditions...");
|
||||
sConditionMgr->LoadConditions(true);
|
||||
@@ -1110,7 +1115,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadCreatureText(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadCreatureText(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Creature Texts...");
|
||||
sCreatureTextMgr->LoadCreatureTexts();
|
||||
@@ -1118,7 +1123,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadSmartScripts(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadSmartScripts(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Re-Loading Smart Scripts...");
|
||||
sSmartScriptMgr->LoadSmartAIFromDB();
|
||||
@@ -1126,7 +1131,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadVehicleAccessoryCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadVehicleAccessoryCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Reloading vehicle_accessory table...");
|
||||
sObjectMgr->LoadVehicleAccessories();
|
||||
@@ -1134,7 +1139,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadVehicleTemplateAccessoryCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadVehicleTemplateAccessoryCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Reloading vehicle_template_accessory table...");
|
||||
sObjectMgr->LoadVehicleTemplateAccessories();
|
||||
@@ -1142,7 +1147,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadRBACCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleReloadRBACCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
TC_LOG_INFO("misc", "Reloading RBAC tables...");
|
||||
sAccountMgr->LoadRBAC();
|
||||
|
||||
@@ -22,13 +22,20 @@ Comment: All reset related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "Pet.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
#include <boost/thread/locks.hpp>
|
||||
#include <boost/thread/shared_mutex.hpp>
|
||||
|
||||
class reset_commandscript : public CommandScript
|
||||
{
|
||||
@@ -49,7 +56,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "reset", rbac::RBAC_PERM_COMMAND_RESET, true, NULL, "", resetCommandTable },
|
||||
{ "reset", rbac::RBAC_PERM_COMMAND_RESET, true, nullptr, "", resetCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
@@ -15,12 +15,17 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Item.h"
|
||||
#include "Language.h"
|
||||
#include "Mail.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class send_commandscript : public CommandScript
|
||||
{
|
||||
@@ -39,7 +44,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "send", rbac::RBAC_PERM_COMMAND_SEND, false, NULL, "", sendCommandTable },
|
||||
{ "send", rbac::RBAC_PERM_COMMAND_SEND, false, nullptr, "", sendCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -54,7 +59,7 @@ public:
|
||||
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
|
||||
return false;
|
||||
|
||||
char* tail1 = strtok(NULL, "");
|
||||
char* tail1 = strtok(nullptr, "");
|
||||
if (!tail1)
|
||||
return false;
|
||||
|
||||
@@ -62,7 +67,7 @@ public:
|
||||
if (!msgSubject)
|
||||
return false;
|
||||
|
||||
char* tail2 = strtok(NULL, "");
|
||||
char* tail2 = strtok(nullptr, "");
|
||||
if (!tail2)
|
||||
return false;
|
||||
|
||||
@@ -99,7 +104,7 @@ public:
|
||||
if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName))
|
||||
return false;
|
||||
|
||||
char* tail1 = strtok(NULL, "");
|
||||
char* tail1 = strtok(nullptr, "");
|
||||
if (!tail1)
|
||||
return false;
|
||||
|
||||
@@ -107,7 +112,7 @@ public:
|
||||
if (!msgSubject)
|
||||
return false;
|
||||
|
||||
char* tail2 = strtok(NULL, "");
|
||||
char* tail2 = strtok(nullptr, "");
|
||||
if (!tail2)
|
||||
return false;
|
||||
|
||||
@@ -125,17 +130,17 @@ public:
|
||||
ItemPairs items;
|
||||
|
||||
// get all tail string
|
||||
char* tail = strtok(NULL, "");
|
||||
char* tail = strtok(nullptr, "");
|
||||
|
||||
// get from tail next item str
|
||||
while (char* itemStr = strtok(tail, " "))
|
||||
{
|
||||
// and get new tail
|
||||
tail = strtok(NULL, "");
|
||||
tail = strtok(nullptr, "");
|
||||
|
||||
// parse item str
|
||||
char const* itemIdStr = strtok(itemStr, ":");
|
||||
char const* itemCountStr = strtok(NULL, " ");
|
||||
char const* itemCountStr = strtok(nullptr, " ");
|
||||
|
||||
uint32 itemId = atoi(itemIdStr);
|
||||
if (!itemId)
|
||||
@@ -208,7 +213,7 @@ public:
|
||||
if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName))
|
||||
return false;
|
||||
|
||||
char* tail1 = strtok(NULL, "");
|
||||
char* tail1 = strtok(nullptr, "");
|
||||
if (!tail1)
|
||||
return false;
|
||||
|
||||
@@ -216,7 +221,7 @@ public:
|
||||
if (!msgSubject)
|
||||
return false;
|
||||
|
||||
char* tail2 = strtok(NULL, "");
|
||||
char* tail2 = strtok(nullptr, "");
|
||||
if (!tail2)
|
||||
return false;
|
||||
|
||||
@@ -224,7 +229,7 @@ public:
|
||||
if (!msgText)
|
||||
return false;
|
||||
|
||||
char* moneyStr = strtok(NULL, "");
|
||||
char* moneyStr = strtok(nullptr, "");
|
||||
int32 money = moneyStr ? atoi(moneyStr) : 0;
|
||||
if (money <= 0)
|
||||
return false;
|
||||
@@ -256,7 +261,7 @@ public:
|
||||
if (!handler->extractPlayerTarget((char*)args, &player))
|
||||
return false;
|
||||
|
||||
char* msgStr = strtok(NULL, "");
|
||||
char* msgStr = strtok(nullptr, "");
|
||||
if (!msgStr)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -22,14 +22,19 @@ Comment: All tele related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Group.h"
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class tele_commandscript : public CommandScript
|
||||
{
|
||||
@@ -48,12 +53,12 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "tele", rbac::RBAC_PERM_COMMAND_TELE, false, NULL, "", teleCommandTable },
|
||||
{ "tele", rbac::RBAC_PERM_COMMAND_TELE, false, nullptr, "", teleCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static bool HandleTeleAddCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleTeleAddCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -93,7 +98,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleTeleDelCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleTeleDelCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -113,7 +118,7 @@ public:
|
||||
}
|
||||
|
||||
// teleport player to given game_tele.entry
|
||||
static bool HandleTeleNameCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleTeleNameCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
char* nameStr;
|
||||
char* teleStr;
|
||||
@@ -194,7 +199,7 @@ public:
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (handler->HasLowerSecurity(NULL, target_guid))
|
||||
if (handler->HasLowerSecurity(nullptr, target_guid))
|
||||
return false;
|
||||
|
||||
std::string nameLink = handler->playerLink(target_name);
|
||||
@@ -210,7 +215,7 @@ public:
|
||||
}
|
||||
|
||||
//Teleport group to given game_tele.entry
|
||||
static bool HandleTeleGroupCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleTeleGroupCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -254,7 +259,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
|
||||
@@ -293,7 +298,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleTeleCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleTeleCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -22,15 +22,19 @@ Comment: All ticket related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "Realm.h"
|
||||
#include "TicketMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class ticket_commandscript : public CommandScript
|
||||
{
|
||||
@@ -67,7 +71,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "ticket", rbac::RBAC_PERM_COMMAND_TICKET, false, NULL, "", ticketCommandTable },
|
||||
{ "ticket", rbac::RBAC_PERM_COMMAND_TICKET, false, nullptr, "", ticketCommandTable },
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
@@ -81,7 +85,7 @@ public:
|
||||
char* ticketIdStr = strtok((char*)args, " ");
|
||||
uint32 ticketId = atoi(ticketIdStr);
|
||||
|
||||
char* targetStr = strtok(NULL, " ");
|
||||
char* targetStr = strtok(nullptr, " ");
|
||||
if (!targetStr)
|
||||
return false;
|
||||
|
||||
@@ -122,12 +126,12 @@ public:
|
||||
}
|
||||
|
||||
// Assign ticket
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(AccountMgr::GetSecurity(accountId, realm.Id.Realm)));
|
||||
ticket->SaveToDB(trans);
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
std::string msg = ticket->FormatMessageString(*handler, NULL, target.c_str(), NULL, NULL, NULL);
|
||||
std::string msg = ticket->FormatMessageString(*handler, nullptr, target.c_str(), nullptr, nullptr, nullptr);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
return true;
|
||||
}
|
||||
@@ -157,7 +161,7 @@ public:
|
||||
sTicketMgr->ResolveAndCloseTicket(ticket->GetId(), player ? player->GetGUID() : ObjectGuid(uint64(0)));
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", NULL, NULL, NULL, NULL);
|
||||
std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", nullptr, nullptr, nullptr, nullptr);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
// Inform player, who submitted this ticket, that it is closed
|
||||
@@ -165,7 +169,7 @@ public:
|
||||
{
|
||||
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
|
||||
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
|
||||
submitter->GetSession()->SendPacket(&data);
|
||||
submitter->SendDirectMessage(&data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -178,7 +182,7 @@ public:
|
||||
char* ticketIdStr = strtok((char*)args, " ");
|
||||
uint32 ticketId = atoi(ticketIdStr);
|
||||
|
||||
char* comment = strtok(NULL, "\n");
|
||||
char* comment = strtok(nullptr, "\n");
|
||||
if (!comment)
|
||||
return false;
|
||||
|
||||
@@ -198,7 +202,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SetComment(comment);
|
||||
ticket->SaveToDB(trans);
|
||||
sTicketMgr->UpdateLastChange();
|
||||
@@ -236,7 +240,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char* response = strtok(NULL, "\n");
|
||||
char* response = strtok(nullptr, "\n");
|
||||
if (response)
|
||||
{
|
||||
// Cannot add response to ticket, assigned to someone else
|
||||
@@ -256,13 +260,13 @@ public:
|
||||
|
||||
Player* gm = handler->GetSession() ? handler->GetSession()->GetPlayer() : nullptr;
|
||||
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SetResolvedBy(gm ? gm->GetGUID() : ObjectGuid(uint64(0)));
|
||||
ticket->SetCompleted();
|
||||
ticket->SaveToDB(trans);
|
||||
|
||||
std::string msg = ticket->FormatMessageString(*handler, NULL, NULL,
|
||||
NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console");
|
||||
std::string msg = ticket->FormatMessageString(*handler, nullptr, nullptr,
|
||||
nullptr, nullptr, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console");
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
sTicketMgr->UpdateLastChange();
|
||||
return true;
|
||||
@@ -287,7 +291,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL);
|
||||
std::string msg = ticket->FormatMessageString(*handler, nullptr, nullptr, nullptr, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", nullptr);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
sTicketMgr->RemoveTicket(ticket->GetId());
|
||||
@@ -298,7 +302,7 @@ public:
|
||||
// Force abandon ticket
|
||||
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
|
||||
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -409,13 +413,13 @@ public:
|
||||
}
|
||||
|
||||
std::string assignedTo = ticket->GetAssignedToName(); // copy assignedto name because we need it after the ticket has been unnassigned
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SetUnassigned();
|
||||
ticket->SaveToDB(trans);
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
std::string msg = ticket->FormatMessageString(*handler, NULL, assignedTo.c_str(),
|
||||
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL, NULL);
|
||||
std::string msg = ticket->FormatMessageString(*handler, nullptr, assignedTo.c_str(),
|
||||
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", nullptr, nullptr);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
return true;
|
||||
@@ -434,7 +438,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SetViewed();
|
||||
ticket->SaveToDB(trans);
|
||||
|
||||
@@ -473,7 +477,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SetViewed();
|
||||
ticket->SaveToDB(trans);
|
||||
|
||||
@@ -489,7 +493,7 @@ public:
|
||||
char* ticketIdStr = strtok((char*)args, " ");
|
||||
uint32 ticketId = atoi(ticketIdStr);
|
||||
|
||||
char* response = strtok(NULL, "\n");
|
||||
char* response = strtok(nullptr, "\n");
|
||||
if (!response)
|
||||
return false;
|
||||
|
||||
@@ -509,7 +513,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->AppendResponse(response);
|
||||
if (newLine)
|
||||
ticket->AppendResponse("\n");
|
||||
|
||||
@@ -22,11 +22,13 @@ Comment: All titles related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
|
||||
class titles_commandscript : public CommandScript
|
||||
{
|
||||
@@ -44,11 +46,11 @@ public:
|
||||
{ "add", rbac::RBAC_PERM_COMMAND_TITLES_ADD, false, &HandleTitlesAddCommand, "" },
|
||||
{ "current", rbac::RBAC_PERM_COMMAND_TITLES_CURRENT, false, &HandleTitlesCurrentCommand, "" },
|
||||
{ "remove", rbac::RBAC_PERM_COMMAND_TITLES_REMOVE, false, &HandleTitlesRemoveCommand, "" },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_TITLES_SET, false, NULL, "", titlesSetCommandTable },
|
||||
{ "set", rbac::RBAC_PERM_COMMAND_TITLES_SET, false, nullptr, "", titlesSetCommandTable },
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "titles", rbac::RBAC_PERM_COMMAND_TITLES, false, NULL, "", titlesCommandTable },
|
||||
{ "titles", rbac::RBAC_PERM_COMMAND_TITLES, false, nullptr, "", titlesCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -133,12 +135,10 @@ public:
|
||||
}
|
||||
|
||||
std::string tNameLink = handler->GetNameLink(target);
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, target->GetName().c_str());
|
||||
std::string titleNameStr = Trinity::StringFormat(target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, target->GetName().c_str());
|
||||
|
||||
target->SetTitle(titleInfo);
|
||||
handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str());
|
||||
handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr.c_str(), tNameLink.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -202,9 +202,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint64 titles = 0;
|
||||
|
||||
sscanf((char*)args, UI64FMTD, &titles);
|
||||
uint64 titles = atoull(args);
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
if (!target)
|
||||
@@ -218,13 +216,11 @@ public:
|
||||
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
|
||||
return false;
|
||||
|
||||
uint64 titles2 = titles;
|
||||
uint64 allValidTitleMask = 0;
|
||||
for (CharTitlesEntry const* tEntry : sCharTitlesStore)
|
||||
allValidTitleMask |= (uint64(1) << tEntry->bit_index);
|
||||
|
||||
for (uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||
if (CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i))
|
||||
titles2 &= ~(uint64(1) << tEntry->bit_index);
|
||||
|
||||
titles &= ~titles2; // remove non-existing titles
|
||||
titles &= allValidTitleMask; // remove non-existing titles
|
||||
|
||||
target->SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES, titles);
|
||||
handler->SendSysMessage(LANG_DONE);
|
||||
|
||||
@@ -22,13 +22,19 @@ Comment: All wp related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Creature.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class wp_commandscript : public CommandScript
|
||||
{
|
||||
@@ -49,7 +55,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "wp", rbac::RBAC_PERM_COMMAND_WP, false, NULL, "", wpCommandTable },
|
||||
{ "wp", rbac::RBAC_PERM_COMMAND_WP, false, nullptr, "", wpCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -70,14 +76,14 @@ public:
|
||||
* -> adds a waypoint to the currently selected creature
|
||||
*
|
||||
*
|
||||
* @param args if the user did not provide a GUID, it is NULL
|
||||
* @param args if the user did not provide a GUID, it is nullptr
|
||||
*
|
||||
* @return true - command did succeed, false - something went wrong
|
||||
*/
|
||||
static bool HandleWpAddCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpAddCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
// optional
|
||||
char* path_number = NULL;
|
||||
char* path_number = nullptr;
|
||||
uint32 pathid = 0;
|
||||
|
||||
if (*args)
|
||||
@@ -137,13 +143,13 @@ public:
|
||||
return true;
|
||||
} // HandleWpAddCommand
|
||||
|
||||
static bool HandleWpLoadCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpLoadCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// optional
|
||||
char* path_number = NULL;
|
||||
char* path_number = nullptr;
|
||||
|
||||
if (*args)
|
||||
path_number = strtok((char*)args, " ");
|
||||
@@ -218,7 +224,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpReloadCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpReloadCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -233,11 +239,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleWpUnLoadCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
if (!target)
|
||||
{
|
||||
@@ -278,20 +284,20 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpEventCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpEventCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* show_str = strtok((char*)args, " ");
|
||||
std::string show = show_str;
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
// Check
|
||||
if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid"))
|
||||
return false;
|
||||
|
||||
char* arg_id = strtok(NULL, " ");
|
||||
char* arg_id = strtok(nullptr, " ");
|
||||
uint32 id = 0;
|
||||
|
||||
if (show == "add")
|
||||
@@ -420,7 +426,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char* arg_2 = strtok(NULL, " ");
|
||||
char* arg_2 = strtok(nullptr, " ");
|
||||
|
||||
if (!arg_2)
|
||||
{
|
||||
@@ -440,7 +446,7 @@ public:
|
||||
|
||||
char* arg_3;
|
||||
std::string arg_str_2 = arg_2;
|
||||
arg_3 = strtok(NULL, " ");
|
||||
arg_3 = strtok(nullptr, " ");
|
||||
|
||||
if (!arg_3)
|
||||
{
|
||||
@@ -535,7 +541,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpModifyCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpModifyCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -558,7 +564,7 @@ public:
|
||||
}
|
||||
|
||||
// Next arg is: <PATHID> <WPNUM> <ARGUMENT>
|
||||
char* arg_str = NULL;
|
||||
char* arg_str = nullptr;
|
||||
|
||||
// Did user provide a GUID
|
||||
// or did the user select a creature?
|
||||
@@ -566,7 +572,7 @@ public:
|
||||
uint32 pathid = 0;
|
||||
uint32 point = 0;
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
// User did select a visual waypoint?
|
||||
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
|
||||
@@ -617,10 +623,10 @@ public:
|
||||
|
||||
// We have the waypoint number and the GUID of the "master npc"
|
||||
// Text is enclosed in "<>", all other arguments not
|
||||
arg_str = strtok((char*)NULL, " ");
|
||||
arg_str = strtok((char*)nullptr, " ");
|
||||
|
||||
// Check for argument
|
||||
if (show != "del" && show != "move" && arg_str == NULL)
|
||||
if (show != "del" && show != "move" && arg_str == nullptr)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_ARGUMENTREQ, show_str);
|
||||
return false;
|
||||
@@ -697,7 +703,7 @@ public:
|
||||
if (text == 0)
|
||||
{
|
||||
// show_str check for present in list of correct values, no sql injection possible
|
||||
WorldDatabase.PExecute("UPDATE waypoint_data SET %s=NULL WHERE id='%u' AND point='%u'", show_str, pathid, point); // Query can't be a prepared statement
|
||||
WorldDatabase.PExecute("UPDATE waypoint_data SET %s=nullptr WHERE id='%u' AND point='%u'", show_str, pathid, point); // Query can't be a prepared statement
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -711,7 +717,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpShowCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpShowCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -722,11 +728,11 @@ public:
|
||||
return false;
|
||||
|
||||
// second arg: GUID (optional, if a creature is selected)
|
||||
char* guid_str = strtok((char*)NULL, " ");
|
||||
char* guid_str = strtok((char*)nullptr, " ");
|
||||
|
||||
uint32 pathid = 0;
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
// Did player provide a PathID?
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Spells
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
#ifndef DEF_BARADIN_HOLD_H_
|
||||
#define DEF_BARADIN_HOLD_H_
|
||||
|
||||
#include "Map.h"
|
||||
#include "Creature.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
#define DataHeader "BH"
|
||||
#define BHScriptName "instance_baradin_hold"
|
||||
@@ -52,14 +50,10 @@ enum BHGameObjectIds
|
||||
GO_ALIZABAL_DOOR = 209849
|
||||
};
|
||||
|
||||
template<class AI>
|
||||
CreatureAI* GetBaradinHoldAI(Creature* creature)
|
||||
template <class AI, class T>
|
||||
inline AI* GetBaradinHoldAI(T* obj)
|
||||
{
|
||||
if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
|
||||
if (instance->GetInstanceScript())
|
||||
if (instance->GetScriptId() == sObjectMgr->GetScriptId(BHScriptName))
|
||||
return new AI(creature);
|
||||
return NULL;
|
||||
return GetInstanceAI<AI>(obj, BHScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -16,10 +16,12 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "baradin_hold.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
|
||||
@@ -16,11 +16,14 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Vehicle.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "baradin_hold.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -202,7 +205,7 @@ class npc_eyestalk : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
class FocusedFireTargetSelector : public std::unary_function<Unit *, bool>
|
||||
class FocusedFireTargetSelector
|
||||
{
|
||||
public:
|
||||
FocusedFireTargetSelector(Creature* me, const Unit* victim) : _me(me), _victim(victim) { }
|
||||
@@ -267,9 +270,7 @@ class spell_occuthar_eyes_of_occuthar : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue()))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ uint32(spellInfo->Effects[EFFECT_0].CalcValue()) });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -317,7 +318,7 @@ class spell_occuthar_eyes_of_occuthar_vehicle : public SpellScriptLoader
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetInstanceScript() != NULL;
|
||||
return GetCaster()->GetInstanceScript() != nullptr;
|
||||
}
|
||||
|
||||
void HandleScript()
|
||||
@@ -363,7 +364,7 @@ class spell_occuthar_occuthars_destruction : public SpellScriptLoader
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (IsExpired())
|
||||
caster->CastSpell((Unit*)NULL, SPELL_OCCUTHARS_DESTUCTION, true, NULL, aurEff);
|
||||
caster->CastSpell((Unit*)nullptr, SPELL_OCCUTHARS_DESTUCTION, true, nullptr, aurEff);
|
||||
|
||||
caster->ToCreature()->DespawnOrUnsummon(500);
|
||||
}
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "baradin_hold.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "baradin_hold.h"
|
||||
|
||||
/* TODO:
|
||||
- Fel Firestorm need completion
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "baradin_hold.h"
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
@@ -43,7 +46,7 @@ class instance_baradin_hold: public InstanceMapScript
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch(creature->GetEntry())
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case BOSS_ARGALOTH:
|
||||
ArgalothGUID = creature->GetGUID();
|
||||
|
||||
+13
-15
@@ -16,12 +16,13 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "blackrock_caverns.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellScript.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
/*#####
|
||||
# npc_fire_cyclone
|
||||
@@ -722,9 +723,7 @@ class spell_chains_of_woe_1 : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CHAINS_OF_WOE_1))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CHAINS_OF_WOE_1 });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -759,9 +758,7 @@ class spell_chains_of_woe_4 : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CHAINS_OF_WOE_4))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CHAINS_OF_WOE_4 });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -804,11 +801,12 @@ class spell_nether_dragon_essence_1 : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NETHER_DRAGON_ESSENCE_2)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_NETHER_DRAGON_ESSENCE_3)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_NETHER_DRAGON_ESSENCE_4))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_NETHER_DRAGON_ESSENCE_2,
|
||||
SPELL_NETHER_DRAGON_ESSENCE_3,
|
||||
SPELL_NETHER_DRAGON_ESSENCE_4
|
||||
});
|
||||
}
|
||||
|
||||
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
|
||||
|
||||
+5
-3
@@ -18,6 +18,8 @@
|
||||
#ifndef BLACKROCKCAVERNS_H_
|
||||
#define BLACKROCKCAVERNS_H_
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
#define BCScriptName "instance_blackrock_caverns"
|
||||
#define DataHeader "BRC"
|
||||
|
||||
@@ -43,10 +45,10 @@ enum BRCCreatureIds
|
||||
NPC_ROMOGG_BONECRUSHER = 39665
|
||||
};
|
||||
|
||||
template<class AI>
|
||||
inline AI* GetBlackrockCavernsAI(Creature* creature)
|
||||
template <class AI, class T>
|
||||
inline AI* GetBlackrockCavernsAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(creature, BCScriptName);
|
||||
return GetInstanceAI<AI>(obj, BCScriptName);
|
||||
}
|
||||
|
||||
#endif // BLACKROCKCAVERNS_H_
|
||||
+1
-1
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_caverns.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Text
|
||||
{
|
||||
|
||||
+1
-1
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_caverns.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Text
|
||||
{
|
||||
|
||||
+1
-1
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_caverns.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Text
|
||||
{
|
||||
|
||||
+2
-1
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_caverns.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Romogg
|
||||
{
|
||||
|
||||
+2
-1
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "blackrock_caverns.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
|
||||
+36
-33
@@ -16,13 +16,17 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "Player.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "WorldSession.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
//go_shadowforge_brazier
|
||||
class go_shadowforge_brazier : public GameObjectScript
|
||||
@@ -32,29 +36,28 @@ public:
|
||||
|
||||
struct go_shadowforge_brazierAI : public GameObjectAI
|
||||
{
|
||||
go_shadowforge_brazierAI(GameObject* go) : GameObjectAI(go) { }
|
||||
go_shadowforge_brazierAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
bool GossipHello(Player* /*player*/) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
if (instance->GetData(TYPE_LYCEUM) == IN_PROGRESS)
|
||||
instance->SetData(TYPE_LYCEUM, DONE);
|
||||
else
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
// If used brazier open linked doors (North or South)
|
||||
if (me->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_N))
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
else if (me->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_S))
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
}
|
||||
if (instance->GetData(TYPE_LYCEUM) == IN_PROGRESS)
|
||||
instance->SetData(TYPE_LYCEUM, DONE);
|
||||
else
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
// If used brazier open linked doors (North or South)
|
||||
if (me->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_N))
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
else if (me->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_S))
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_shadowforge_brazierAI(go);
|
||||
return GetBlackrockDepthsAI<go_shadowforge_brazierAI>(go);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -93,7 +96,7 @@ class at_ring_of_law : public AreaTriggerScript
|
||||
public:
|
||||
at_ring_of_law() : AreaTriggerScript("at_ring_of_law") { }
|
||||
|
||||
bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) override
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*at*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
{
|
||||
@@ -126,11 +129,6 @@ class npc_grimstone : public CreatureScript
|
||||
public:
|
||||
npc_grimstone() : CreatureScript("npc_grimstone") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_grimstoneAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_grimstoneAI : public npc_escortAI
|
||||
{
|
||||
npc_grimstoneAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -224,7 +222,7 @@ public:
|
||||
Event_Timer = 5000;
|
||||
break;
|
||||
case 5:
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
|
||||
instance->UpdateEncounterStateForKilledCreature(NPC_GRIMSTONE, me);
|
||||
instance->SetData(TYPE_RING_OF_LAW, DONE);
|
||||
TC_LOG_DEBUG("scripts", "npc_grimstone: event reached end and set complete.");
|
||||
break;
|
||||
@@ -348,6 +346,11 @@ public:
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetBlackrockDepthsAI<npc_grimstoneAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// npc_phalanx
|
||||
@@ -363,11 +366,6 @@ class npc_phalanx : public CreatureScript
|
||||
public:
|
||||
npc_phalanx() : CreatureScript("npc_phalanx") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_phalanxAI(creature);
|
||||
}
|
||||
|
||||
struct npc_phalanxAI : public ScriptedAI
|
||||
{
|
||||
npc_phalanxAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -424,6 +422,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetBlackrockDepthsAI<npc_phalanxAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// npc_lokhtos_darkbargainer
|
||||
@@ -489,7 +492,7 @@ class npc_lokhtos_darkbargainer : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_lokhtos_darkbargainerAI(creature);
|
||||
return GetBlackrockDepthsAI<npc_lokhtos_darkbargainerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -535,7 +538,7 @@ class npc_rocknot : public CreatureScript
|
||||
|
||||
void DoGo(uint32 id, uint32 state)
|
||||
{
|
||||
if (GameObject* go = instance->instance->GetGameObject(instance->GetGuidData(id)))
|
||||
if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(id)))
|
||||
go->SetGoState((GOState)state);
|
||||
}
|
||||
|
||||
@@ -629,7 +632,7 @@ class npc_rocknot : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_rocknotAI(creature);
|
||||
return GetBlackrockDepthsAI<npc_rocknotAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+9
@@ -19,6 +19,9 @@
|
||||
#ifndef DEF_BRD_H
|
||||
#define DEF_BRD_H
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
#define BRDScriptName "instance_blackrock_depths"
|
||||
#define DataHeader "BRD"
|
||||
|
||||
enum BRDFactionIds
|
||||
@@ -64,4 +67,10 @@ enum BRDDataTypes
|
||||
DATA_COREN = 28
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetBlackrockDepthsAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, BRDScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
+20
-25
@@ -16,16 +16,20 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "Player.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Group.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "SpellScript.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum DirebrewSays
|
||||
{
|
||||
@@ -274,7 +278,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_coren_direbrewAI>(creature);
|
||||
return GetBlackrockDepthsAI<boss_coren_direbrewAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -338,7 +342,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_coren_direbrew_sistersAI>(creature);
|
||||
return GetBlackrockDepthsAI<npc_coren_direbrew_sistersAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -370,7 +374,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_direbrew_minionAI>(creature);
|
||||
return GetBlackrockDepthsAI<npc_direbrew_minionAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -412,7 +416,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_direbrew_antagonistAI>(creature);
|
||||
return GetBlackrockDepthsAI<npc_direbrew_antagonistAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -455,7 +459,7 @@ public:
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return GetInstanceAI<go_direbrew_mole_machineAI>(go);
|
||||
return GetBlackrockDepthsAI<go_direbrew_mole_machineAI>(go);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -471,10 +475,7 @@ class spell_direbrew_disarm : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DIREBREW_DISARM)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DIREBREW_DISARM_GROW))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DIREBREW_DISARM, SPELL_DIREBREW_DISARM_GROW });
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
@@ -517,9 +518,7 @@ class spell_direbrew_summon_mole_machine_target_picker : public SpellScriptLoade
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOLE_MACHINE_MINION_SUMMONER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MOLE_MACHINE_MINION_SUMMONER });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -603,9 +602,7 @@ class spell_request_second_mug : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SEND_SECOND_MUG))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SEND_SECOND_MUG });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -637,9 +634,7 @@ class spell_send_mug_control_aura : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SEND_MUG_TARGET_PICKER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SEND_MUG_TARGET_PICKER });
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
|
||||
+4
-2
@@ -16,8 +16,10 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
@@ -112,7 +114,7 @@ class boss_emperor_dagran_thaurissan : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_draganthaurissanAI>(creature);
|
||||
return GetBlackrockDepthsAI<boss_draganthaurissanAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+3
-2
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -105,7 +106,7 @@ class boss_magmus : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_magmusAI(creature);
|
||||
return GetBlackrockDepthsAI<boss_magmusAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+4
-3
@@ -17,10 +17,11 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -267,7 +268,7 @@ class boss_doomrel : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_doomrelAI>(creature);
|
||||
return GetBlackrockDepthsAI<boss_doomrelAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+130
-125
@@ -17,9 +17,14 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "blackrock_depths.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
|
||||
#define TIMER_TOMBOFTHESEVEN 15000
|
||||
#define MAX_ENCOUNTER 6
|
||||
@@ -68,7 +73,7 @@ enum GameObjects
|
||||
class instance_blackrock_depths : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_blackrock_depths() : InstanceMapScript("instance_blackrock_depths", 230) { }
|
||||
instance_blackrock_depths() : InstanceMapScript(BRDScriptName, 230) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
{
|
||||
@@ -130,22 +135,22 @@ public:
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break;
|
||||
case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break;
|
||||
case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break;
|
||||
case NPC_COREN: CorenGUID = creature->GetGUID(); break;
|
||||
case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break;
|
||||
case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break;
|
||||
case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break;
|
||||
case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break;
|
||||
case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break;
|
||||
case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break;
|
||||
case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break;
|
||||
case NPC_MAGMUS:
|
||||
MagmusGUID = creature->GetGUID();
|
||||
if (!creature->IsAlive())
|
||||
HandleGameObject(GetGuidData(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
|
||||
break;
|
||||
case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break;
|
||||
case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break;
|
||||
case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break;
|
||||
case NPC_COREN: CorenGUID = creature->GetGUID(); break;
|
||||
case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break;
|
||||
case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break;
|
||||
case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break;
|
||||
case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break;
|
||||
case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break;
|
||||
case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break;
|
||||
case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break;
|
||||
case NPC_MAGMUS:
|
||||
MagmusGUID = creature->GetGUID();
|
||||
if (!creature->IsAlive())
|
||||
HandleGameObject(GetGuidData(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,33 +158,33 @@ public:
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_ARENA1: GoArena1GUID = go->GetGUID(); break;
|
||||
case GO_ARENA2: GoArena2GUID = go->GetGUID(); break;
|
||||
case GO_ARENA3: GoArena3GUID = go->GetGUID(); break;
|
||||
case GO_ARENA4: GoArena4GUID = go->GetGUID(); break;
|
||||
case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break;
|
||||
case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break;
|
||||
case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break;
|
||||
case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break;
|
||||
case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break;
|
||||
case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break;
|
||||
case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break;
|
||||
case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break;
|
||||
case GO_TOMB_EXIT:
|
||||
GoTombExitGUID = go->GetGUID();
|
||||
if (GhostKillCount >= 7)
|
||||
HandleGameObject(ObjectGuid::Empty, true, go);
|
||||
else
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break;
|
||||
case GO_SF_S: GoSFSGUID = go->GetGUID(); break;
|
||||
case GO_SF_N: GoSFNGUID = go->GetGUID(); break;
|
||||
case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break;
|
||||
case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break;
|
||||
case GO_THRONE_ROOM: GoThroneGUID = go->GetGUID(); break;
|
||||
case GO_CHEST_SEVEN: GoChestGUID = go->GetGUID(); break;
|
||||
case GO_SPECTRAL_CHALICE: GoSpectralChaliceGUID = go->GetGUID(); break;
|
||||
case GO_ARENA1: GoArena1GUID = go->GetGUID(); break;
|
||||
case GO_ARENA2: GoArena2GUID = go->GetGUID(); break;
|
||||
case GO_ARENA3: GoArena3GUID = go->GetGUID(); break;
|
||||
case GO_ARENA4: GoArena4GUID = go->GetGUID(); break;
|
||||
case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break;
|
||||
case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break;
|
||||
case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break;
|
||||
case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break;
|
||||
case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break;
|
||||
case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break;
|
||||
case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break;
|
||||
case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break;
|
||||
case GO_TOMB_EXIT:
|
||||
GoTombExitGUID = go->GetGUID();
|
||||
if (GhostKillCount >= 7)
|
||||
HandleGameObject(ObjectGuid::Empty, true, go);
|
||||
else
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break;
|
||||
case GO_SF_S: GoSFSGUID = go->GetGUID(); break;
|
||||
case GO_SF_N: GoSFNGUID = go->GetGUID(); break;
|
||||
case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break;
|
||||
case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break;
|
||||
case GO_THRONE_ROOM: GoThroneGUID = go->GetGUID(); break;
|
||||
case GO_CHEST_SEVEN: GoChestGUID = go->GetGUID(); break;
|
||||
case GO_SPECTRAL_CHALICE: GoSpectralChaliceGUID = go->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,30 +210,30 @@ public:
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_RING_OF_LAW:
|
||||
encounter[0] = data;
|
||||
break;
|
||||
case TYPE_VAULT:
|
||||
encounter[1] = data;
|
||||
break;
|
||||
case TYPE_BAR:
|
||||
if (data == SPECIAL)
|
||||
++BarAleCount;
|
||||
else
|
||||
encounter[2] = data;
|
||||
break;
|
||||
case TYPE_TOMB_OF_SEVEN:
|
||||
encounter[3] = data;
|
||||
break;
|
||||
case TYPE_LYCEUM:
|
||||
encounter[4] = data;
|
||||
break;
|
||||
case TYPE_IRON_HALL:
|
||||
encounter[5] = data;
|
||||
break;
|
||||
case DATA_GHOSTKILL:
|
||||
GhostKillCount += data;
|
||||
break;
|
||||
case TYPE_RING_OF_LAW:
|
||||
encounter[0] = data;
|
||||
break;
|
||||
case TYPE_VAULT:
|
||||
encounter[1] = data;
|
||||
break;
|
||||
case TYPE_BAR:
|
||||
if (data == SPECIAL)
|
||||
++BarAleCount;
|
||||
else
|
||||
encounter[2] = data;
|
||||
break;
|
||||
case TYPE_TOMB_OF_SEVEN:
|
||||
encounter[3] = data;
|
||||
break;
|
||||
case TYPE_LYCEUM:
|
||||
encounter[4] = data;
|
||||
break;
|
||||
case TYPE_IRON_HALL:
|
||||
encounter[5] = data;
|
||||
break;
|
||||
case DATA_GHOSTKILL:
|
||||
GhostKillCount += data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE || GhostKillCount >= 7)
|
||||
@@ -250,23 +255,23 @@ public:
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_RING_OF_LAW:
|
||||
return encounter[0];
|
||||
case TYPE_VAULT:
|
||||
return encounter[1];
|
||||
case TYPE_BAR:
|
||||
if (encounter[2] == IN_PROGRESS && BarAleCount == 3)
|
||||
return SPECIAL;
|
||||
else
|
||||
return encounter[2];
|
||||
case TYPE_TOMB_OF_SEVEN:
|
||||
return encounter[3];
|
||||
case TYPE_LYCEUM:
|
||||
return encounter[4];
|
||||
case TYPE_IRON_HALL:
|
||||
return encounter[5];
|
||||
case DATA_GHOSTKILL:
|
||||
return GhostKillCount;
|
||||
case TYPE_RING_OF_LAW:
|
||||
return encounter[0];
|
||||
case TYPE_VAULT:
|
||||
return encounter[1];
|
||||
case TYPE_BAR:
|
||||
if (encounter[2] == IN_PROGRESS && BarAleCount == 3)
|
||||
return SPECIAL;
|
||||
else
|
||||
return encounter[2];
|
||||
case TYPE_TOMB_OF_SEVEN:
|
||||
return encounter[3];
|
||||
case TYPE_LYCEUM:
|
||||
return encounter[4];
|
||||
case TYPE_IRON_HALL:
|
||||
return encounter[5];
|
||||
case DATA_GHOSTKILL:
|
||||
return GhostKillCount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -275,42 +280,42 @@ public:
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_EMPEROR:
|
||||
return EmperorGUID;
|
||||
case DATA_PHALANX:
|
||||
return PhalanxGUID;
|
||||
case DATA_MOIRA:
|
||||
return MoiraGUID;
|
||||
case DATA_COREN:
|
||||
return CorenGUID;
|
||||
case DATA_ARENA1:
|
||||
return GoArena1GUID;
|
||||
case DATA_ARENA2:
|
||||
return GoArena2GUID;
|
||||
case DATA_ARENA3:
|
||||
return GoArena3GUID;
|
||||
case DATA_ARENA4:
|
||||
return GoArena4GUID;
|
||||
case DATA_GO_BAR_KEG:
|
||||
return GoBarKegGUID;
|
||||
case DATA_GO_BAR_KEG_TRAP:
|
||||
return GoBarKegTrapGUID;
|
||||
case DATA_GO_BAR_DOOR:
|
||||
return GoBarDoorGUID;
|
||||
case DATA_EVENSTARTER:
|
||||
return TombEventStarterGUID;
|
||||
case DATA_SF_BRAZIER_N:
|
||||
return GoSFNGUID;
|
||||
case DATA_SF_BRAZIER_S:
|
||||
return GoSFSGUID;
|
||||
case DATA_THRONE_DOOR:
|
||||
return GoThroneGUID;
|
||||
case DATA_GOLEM_DOOR_N:
|
||||
return GoGolemNGUID;
|
||||
case DATA_GOLEM_DOOR_S:
|
||||
return GoGolemSGUID;
|
||||
case DATA_GO_CHALICE:
|
||||
return GoSpectralChaliceGUID;
|
||||
case DATA_EMPEROR:
|
||||
return EmperorGUID;
|
||||
case DATA_PHALANX:
|
||||
return PhalanxGUID;
|
||||
case DATA_MOIRA:
|
||||
return MoiraGUID;
|
||||
case DATA_COREN:
|
||||
return CorenGUID;
|
||||
case DATA_ARENA1:
|
||||
return GoArena1GUID;
|
||||
case DATA_ARENA2:
|
||||
return GoArena2GUID;
|
||||
case DATA_ARENA3:
|
||||
return GoArena3GUID;
|
||||
case DATA_ARENA4:
|
||||
return GoArena4GUID;
|
||||
case DATA_GO_BAR_KEG:
|
||||
return GoBarKegGUID;
|
||||
case DATA_GO_BAR_KEG_TRAP:
|
||||
return GoBarKegTrapGUID;
|
||||
case DATA_GO_BAR_DOOR:
|
||||
return GoBarDoorGUID;
|
||||
case DATA_EVENSTARTER:
|
||||
return TombEventStarterGUID;
|
||||
case DATA_SF_BRAZIER_N:
|
||||
return GoSFNGUID;
|
||||
case DATA_SF_BRAZIER_S:
|
||||
return GoSFSGUID;
|
||||
case DATA_THRONE_DOOR:
|
||||
return GoThroneGUID;
|
||||
case DATA_GOLEM_DOOR_N:
|
||||
return GoGolemNGUID;
|
||||
case DATA_GOLEM_DOOR_S:
|
||||
return GoGolemSGUID;
|
||||
case DATA_GO_CHALICE:
|
||||
return GoSpectralChaliceGUID;
|
||||
}
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
@@ -320,7 +325,7 @@ public:
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in) override
|
||||
void Load(char const* in) override
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
@@ -375,7 +380,7 @@ public:
|
||||
boss->CombatStop(true);
|
||||
boss->LoadCreaturesAddon();
|
||||
boss->GetMotionMaster()->MoveTargetedHome();
|
||||
boss->SetLootRecipient(NULL);
|
||||
boss->SetLootRecipient(nullptr);
|
||||
}
|
||||
boss->SetFaction(FACTION_FRIENDLY);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#ifndef DEF_BLACKROCK_SPIRE_H
|
||||
#define DEF_BLACKROCK_SPIRE_H
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
uint32 const EncounterCount = 23;
|
||||
|
||||
#define BRSScriptName "instance_blackrock_spire"
|
||||
@@ -120,4 +122,10 @@ enum BRSGameObjectsIds
|
||||
GO_PORTCULLIS_TOBOSSROOMS = 175186
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetBlackrockSpireAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, BRSScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
+3
-2
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_spire.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum Spells
|
||||
@@ -105,7 +106,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_gizrul_the_slavenerAI(creature);
|
||||
return GetBlackrockSpireAI<boss_gizrul_the_slavenerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_spire.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -176,7 +179,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_gythAI>(creature);
|
||||
return GetBlackrockSpireAI<boss_gythAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+3
-2
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_spire.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -138,7 +139,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_lord_valthalakAI>(creature);
|
||||
return GetBlackrockSpireAI<boss_lord_valthalakAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+7
-6
@@ -17,8 +17,9 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackrock_spire.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -50,11 +51,6 @@ class boss_overlord_wyrmthalak : public CreatureScript
|
||||
public:
|
||||
boss_overlord_wyrmthalak() : CreatureScript("boss_overlord_wyrmthalak") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_overlordwyrmthalakAI(creature);
|
||||
}
|
||||
|
||||
struct boss_overlordwyrmthalakAI : public BossAI
|
||||
{
|
||||
boss_overlordwyrmthalakAI(Creature* creature) : BossAI(creature, DATA_OVERLORD_WYRMTHALAK)
|
||||
@@ -139,6 +135,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetBlackrockSpireAI<boss_overlordwyrmthalakAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_overlordwyrmthalak()
|
||||
|
||||
+24
-21
@@ -15,12 +15,17 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
#include "Spell.h"
|
||||
#include "blackrock_spire.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
enum Text
|
||||
{
|
||||
@@ -104,10 +109,10 @@ public:
|
||||
break;
|
||||
case 2:
|
||||
// Close these two doors on Blackhand Incarcerators aggro
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_IN)))
|
||||
if (GameObject* door1 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_IN)))
|
||||
if (door1->GetGoState() == GO_STATE_ACTIVE)
|
||||
door1->SetGoState(GO_STATE_READY);
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_DOORS)))
|
||||
if (GameObject* door2 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_DOORS)))
|
||||
if (door2->GetGoState() == GO_STATE_ACTIVE)
|
||||
door2->SetGoState(GO_STATE_READY);
|
||||
break;
|
||||
@@ -166,33 +171,33 @@ public:
|
||||
void OpenDoors(bool Boss_Killed)
|
||||
{
|
||||
// These two doors reopen on reset or boss kill
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_IN)))
|
||||
if (GameObject* door1 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_IN)))
|
||||
door1->SetGoState(GO_STATE_ACTIVE);
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_DOORS)))
|
||||
if (GameObject* door2 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_DOORS)))
|
||||
door2->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
// This door opens on boss kill
|
||||
if (Boss_Killed)
|
||||
if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_OUT)))
|
||||
if (GameObject* door3 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_OUT)))
|
||||
door3->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void UpdateRunes(GOState state)
|
||||
{
|
||||
// update all runes
|
||||
if (GameObject* rune1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_1)))
|
||||
if (GameObject* rune1 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_1)))
|
||||
rune1->SetGoState(state);
|
||||
if (GameObject* rune2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_2)))
|
||||
if (GameObject* rune2 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_2)))
|
||||
rune2->SetGoState(state);
|
||||
if (GameObject* rune3 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_3)))
|
||||
if (GameObject* rune3 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_3)))
|
||||
rune3->SetGoState(state);
|
||||
if (GameObject* rune4 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_4)))
|
||||
if (GameObject* rune4 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_4)))
|
||||
rune4->SetGoState(state);
|
||||
if (GameObject* rune5 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_5)))
|
||||
if (GameObject* rune5 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_5)))
|
||||
rune5->SetGoState(state);
|
||||
if (GameObject* rune6 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_6)))
|
||||
if (GameObject* rune6 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_6)))
|
||||
rune6->SetGoState(state);
|
||||
if (GameObject* rune7 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_7)))
|
||||
if (GameObject* rune7 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_7)))
|
||||
rune7->SetGoState(state);
|
||||
}
|
||||
|
||||
@@ -250,7 +255,7 @@ public:
|
||||
{
|
||||
// Check to see if all players in instance have aura SPELL_EMBERSEER_START before starting event
|
||||
bool _hasAura = true;
|
||||
Map::PlayerList const &players = me->GetMap()->GetPlayers();
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource()->ToPlayer())
|
||||
if (!player->HasAura(SPELL_EMBERSEER_OBJECT_VISUAL))
|
||||
@@ -312,7 +317,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_pyroguard_emberseerAI>(creature);
|
||||
return GetBlackrockSpireAI<boss_pyroguard_emberseerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -384,8 +389,6 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
|
||||
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
_events.Update(diff);
|
||||
@@ -436,7 +439,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_blackhand_incarceratorAI(creature);
|
||||
return GetBlackrockSpireAI<npc_blackhand_incarceratorAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+12
-9
@@ -17,9 +17,12 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
#include "blackrock_spire.h"
|
||||
#include "GameObject.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -372,37 +375,37 @@ public:
|
||||
me->SummonCreature(NPC_GYTH, 211.762f, -397.5885f, 111.1817f, 4.747295f);
|
||||
break;
|
||||
case EVENT_WAVE_1:
|
||||
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
|
||||
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
|
||||
portcullis->UseDoorOrButton();
|
||||
// move wave
|
||||
break;
|
||||
case EVENT_WAVE_2:
|
||||
// spawn wave
|
||||
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
|
||||
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
|
||||
portcullis->UseDoorOrButton();
|
||||
// move wave
|
||||
break;
|
||||
case EVENT_WAVE_3:
|
||||
// spawn wave
|
||||
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
|
||||
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
|
||||
portcullis->UseDoorOrButton();
|
||||
// move wave
|
||||
break;
|
||||
case EVENT_WAVE_4:
|
||||
// spawn wave
|
||||
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
|
||||
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
|
||||
portcullis->UseDoorOrButton();
|
||||
// move wave
|
||||
break;
|
||||
case EVENT_WAVE_5:
|
||||
// spawn wave
|
||||
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
|
||||
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
|
||||
portcullis->UseDoorOrButton();
|
||||
// move wave
|
||||
break;
|
||||
case EVENT_WAVE_6:
|
||||
// spawn wave
|
||||
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
|
||||
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
|
||||
portcullis->UseDoorOrButton();
|
||||
// move wave
|
||||
break;
|
||||
@@ -452,7 +455,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_rend_blackhandAI>(creature);
|
||||
return GetBlackrockSpireAI<boss_rend_blackhandAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+9
-10
@@ -15,15 +15,14 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "blackrock_spire.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
//uint32 const DragonspireRunes[7] = { GO_HALL_RUNE_1, GO_HALL_RUNE_2, GO_HALL_RUNE_3, GO_HALL_RUNE_4, GO_HALL_RUNE_5, GO_HALL_RUNE_6, GO_HALL_RUNE_7 };
|
||||
|
||||
@@ -120,7 +119,7 @@ public:
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_WHELP_SPAWNER:
|
||||
go->CastSpell(NULL, SPELL_SUMMON_ROOKERY_WHELP);
|
||||
go->CastSpell(nullptr, SPELL_SUMMON_ROOKERY_WHELP);
|
||||
break;
|
||||
case GO_EMBERSEER_IN:
|
||||
go_emberseerin = go->GetGUID();
|
||||
@@ -419,8 +418,8 @@ public:
|
||||
|
||||
void Dragonspireroomcheck()
|
||||
{
|
||||
Creature* mob = NULL;
|
||||
GameObject* rune = NULL;
|
||||
Creature* mob = nullptr;
|
||||
GameObject* rune = nullptr;
|
||||
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#ifndef DEF_BLACKWING_LAIR_H
|
||||
#define DEF_BLACKWING_LAIR_H
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
uint32 const EncounterCount = 8;
|
||||
|
||||
#define BRLScriptName "instance_blackwing_lair"
|
||||
@@ -80,4 +82,10 @@ enum BWLMisc
|
||||
DATA_EGG_EVENT
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetBlackwingLairAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, BRLScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_broodlordAI>(creature);
|
||||
return GetBlackwingLairAI<boss_broodlordAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+5
-4
@@ -17,9 +17,10 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Emotes
|
||||
{
|
||||
@@ -240,7 +241,7 @@ public:
|
||||
break;
|
||||
case EVENT_AFFLICTION:
|
||||
{
|
||||
Map::PlayerList const &players = me->GetMap()->GetPlayers();
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if (Player* player = itr->GetSource()->ToPlayer())
|
||||
@@ -290,7 +291,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_chromaggusAI>(creature);
|
||||
return GetBlackwingLairAI<boss_chromaggusAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_ebonrocAI>(creature);
|
||||
return GetBlackwingLairAI<boss_ebonrocAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_firemawAI>(creature);
|
||||
return GetBlackwingLairAI<boss_firemawAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Emotes
|
||||
{
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_flamegorAI>(creature);
|
||||
return GetBlackwingLairAI<boss_flamegorAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+9
-5
@@ -17,10 +17,14 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum Events
|
||||
{
|
||||
@@ -351,7 +355,7 @@ public:
|
||||
nefarian->SetFarVisible(true);
|
||||
nefarian->SetCanFly(true);
|
||||
nefarian->SetDisableGravity(true);
|
||||
nefarian->CastSpell((Unit*)NULL, SPELL_SHADOWFLAME_INITIAL);
|
||||
nefarian->CastSpell((Unit*)nullptr, SPELL_SHADOWFLAME_INITIAL);
|
||||
nefarian->GetMotionMaster()->MovePoint(1, NefarianLoc[1]);
|
||||
}
|
||||
events.CancelEvent(EVENT_MIND_CONTROL);
|
||||
@@ -388,7 +392,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_victor_nefariusAI>(creature);
|
||||
return GetBlackwingLairAI<boss_victor_nefariusAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -594,7 +598,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_nefarianAI>(creature);
|
||||
return GetBlackwingLairAI<boss_nefarianAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+18
-13
@@ -17,11 +17,13 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
@@ -169,7 +171,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_razorgoreAI>(creature);
|
||||
return GetBlackwingLairAI<boss_razorgoreAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -180,24 +182,27 @@ class go_orb_of_domination : public GameObjectScript
|
||||
|
||||
struct go_orb_of_dominationAI : public GameObjectAI
|
||||
{
|
||||
go_orb_of_dominationAI(GameObject* go) : GameObjectAI(go) { }
|
||||
go_orb_of_dominationAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (instance->GetData(DATA_EGG_EVENT) != DONE)
|
||||
if (Creature* razorgore = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
|
||||
{
|
||||
razorgore->Attack(player, true);
|
||||
player->CastSpell(razorgore, SPELL_MINDCONTROL);
|
||||
}
|
||||
if (instance->GetData(DATA_EGG_EVENT) != DONE)
|
||||
{
|
||||
if (Creature* razorgore = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
|
||||
{
|
||||
razorgore->Attack(player, true);
|
||||
player->CastSpell(razorgore, SPELL_MINDCONTROL);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_orb_of_dominationAI(go);
|
||||
return GetBlackwingLairAI<go_orb_of_dominationAI>(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+6
-5
@@ -17,12 +17,13 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
@@ -239,7 +240,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_vaelAI(creature);
|
||||
return GetBlackwingLairAI<boss_vaelAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+8
-3
@@ -15,10 +15,15 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
@@ -238,7 +243,7 @@ public:
|
||||
{
|
||||
case EVENT_RAZOR_SPAWN:
|
||||
for (uint8 i = urand(2, 5); i > 0 ; --i)
|
||||
if (Creature* summon = instance->SummonCreature(Entry[urand(0, 4)], SummonPosition[urand(0, 7)]))
|
||||
if (Creature* summon = instance->SummonCreature(Entry[urand(0, 4)], SummonPosition[urand(0, 7)]))
|
||||
summon->SetInCombatWithZone();
|
||||
_events.ScheduleEvent(EVENT_RAZOR_SPAWN, urand(12, 17) * IN_MILLISECONDS);
|
||||
break;
|
||||
|
||||
@@ -23,10 +23,12 @@ SDComment: Timers need to be confirmed, Golemagg's Trust need to be checked
|
||||
SDCategory: Molten Core
|
||||
EndScriptData */
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "molten_core.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
@@ -59,9 +61,7 @@ class boss_golemagg : public CreatureScript
|
||||
|
||||
struct boss_golemaggAI : public BossAI
|
||||
{
|
||||
boss_golemaggAI(Creature* creature) : BossAI(creature, BOSS_GOLEMAGG_THE_INCINERATOR)
|
||||
{
|
||||
}
|
||||
boss_golemaggAI(Creature* creature) : BossAI(creature, BOSS_GOLEMAGG_THE_INCINERATOR) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -121,7 +121,7 @@ class boss_golemagg : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_golemaggAI(creature);
|
||||
return GetMoltenCoreAI<boss_golemaggAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -188,7 +188,7 @@ class npc_core_rager : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_core_ragerAI>(creature);
|
||||
return GetMoltenCoreAI<npc_core_ragerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+7
-5
@@ -23,12 +23,14 @@ SDComment: Correct spawning and Event NYI
|
||||
SDCategory: Molten Core
|
||||
EndScriptData */
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "molten_core.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "molten_core.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
@@ -108,7 +110,7 @@ class boss_majordomo : public CreatureScript
|
||||
|
||||
if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f))
|
||||
{
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me);
|
||||
instance->UpdateEncounterStateForKilledCreature(me->GetEntry(), me);
|
||||
me->SetFaction(FACTION_FRIENDLY);
|
||||
EnterEvadeMode();
|
||||
Talk(SAY_DEFEAT);
|
||||
@@ -209,7 +211,7 @@ class boss_majordomo : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_majordomoAI>(creature);
|
||||
return GetMoltenCoreAI<boss_majordomoAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,8 +24,11 @@ SDCategory: Molten Core
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "molten_core.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
@@ -309,7 +312,7 @@ class boss_ragnaros : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_ragnarosAI>(creature);
|
||||
return GetMoltenCoreAI<boss_ragnarosAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -344,7 +347,7 @@ class npc_son_of_flame : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_son_of_flameAI>(creature);
|
||||
return GetMoltenCoreAI<npc_son_of_flameAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "molten_core.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "molten_core.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -115,7 +115,7 @@ class boss_shazzrah : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_shazzrahAI(creature);
|
||||
return GetMoltenCoreAI<boss_shazzrahAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -131,9 +131,7 @@ class spell_shazzrah_gate_dummy : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAZZRAH_GATE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAZZRAH_GATE });
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
|
||||
+20
-13
@@ -15,29 +15,36 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "molten_core.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
Position const SummonPositions[10] =
|
||||
{
|
||||
{737.850f, -1145.35f, -120.288f, 4.71368f},
|
||||
{744.162f, -1151.63f, -119.726f, 4.58204f},
|
||||
{751.247f, -1152.82f, -119.744f, 4.49673f},
|
||||
{759.206f, -1155.09f, -120.051f, 4.30104f},
|
||||
{755.973f, -1152.33f, -120.029f, 4.25588f},
|
||||
{731.712f, -1147.56f, -120.195f, 4.95955f},
|
||||
{726.499f, -1149.80f, -120.156f, 5.24055f},
|
||||
{722.408f, -1152.41f, -120.029f, 5.33087f},
|
||||
{718.994f, -1156.36f, -119.805f, 5.75738f},
|
||||
{838.510f, -829.840f, -232.000f, 2.00000f},
|
||||
{ 737.850f, -1145.35f, -120.288f, 4.71368f },
|
||||
{ 744.162f, -1151.63f, -119.726f, 4.58204f },
|
||||
{ 751.247f, -1152.82f, -119.744f, 4.49673f },
|
||||
{ 759.206f, -1155.09f, -120.051f, 4.30104f },
|
||||
{ 755.973f, -1152.33f, -120.029f, 4.25588f },
|
||||
{ 731.712f, -1147.56f, -120.195f, 4.95955f },
|
||||
{ 726.499f, -1149.80f, -120.156f, 5.24055f },
|
||||
{ 722.408f, -1152.41f, -120.029f, 5.33087f },
|
||||
{ 718.994f, -1156.36f, -119.805f, 5.75738f },
|
||||
{ 838.510f, -829.840f, -232.000f, 2.00000f },
|
||||
};
|
||||
|
||||
Position const RagnarosTelePos = { 829.159f, -815.773f, -228.972f, 5.30500f };
|
||||
Position const RagnarosSummonPos = { 838.510f, -829.840f, -232.000f, 2.00000f };
|
||||
|
||||
class instance_molten_core : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_molten_core() : InstanceMapScript("instance_molten_core", 409) { }
|
||||
instance_molten_core() : InstanceMapScript(MCScriptName, 409) { }
|
||||
|
||||
struct instance_molten_core_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
|
||||
@@ -19,6 +19,11 @@
|
||||
#ifndef DEF_MOLTEN_CORE_H
|
||||
#define DEF_MOLTEN_CORE_H
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
struct Position;
|
||||
|
||||
#define MCScriptName "instance_molten_core"
|
||||
#define DataHeader "MC"
|
||||
|
||||
enum MCEncounters
|
||||
@@ -42,8 +47,8 @@ enum MCActions
|
||||
ACTION_START_RAGNAROS_ALT = 1,
|
||||
};
|
||||
|
||||
Position const RagnarosTelePos = {829.159f, -815.773f, -228.972f, 5.30500f};
|
||||
Position const RagnarosSummonPos = {838.510f, -829.840f, -232.000f, 2.00000f};
|
||||
extern Position const RagnarosTelePos;
|
||||
extern Position const RagnarosSummonPos;
|
||||
|
||||
enum MCCreatures
|
||||
{
|
||||
@@ -71,4 +76,10 @@ enum MCData
|
||||
DATA_RAGNAROS_ADDS = 0,
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetMoltenCoreAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, MCScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -22,8 +22,12 @@ SDComment: Timers and say taken from acid script
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "deadmines.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -51,11 +55,6 @@ class boss_mr_smite : public CreatureScript
|
||||
public:
|
||||
boss_mr_smite() : CreatureScript("boss_mr_smite") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_mr_smiteAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_mr_smiteAI : public ScriptedAI
|
||||
{
|
||||
boss_mr_smiteAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -225,6 +224,11 @@ public:
|
||||
uiPhase = 2;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetDeadminesAI<boss_mr_smiteAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_mr_smite()
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#ifndef DEF_DEADMINES_H
|
||||
#define DEF_DEADMINES_H
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
#define DMScriptName "instance_deadmines"
|
||||
#define DataHeader "DM"
|
||||
|
||||
enum DMCannonState
|
||||
@@ -61,4 +64,10 @@ enum DMInstanceTexts
|
||||
SAY_ALARM2 = 1
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetDeadminesAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, DMScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -24,8 +24,12 @@ SDCategory: Deadmines
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "deadmines.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
@@ -45,10 +49,7 @@ enum Misc
|
||||
class instance_deadmines : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_deadmines()
|
||||
: InstanceMapScript("instance_deadmines", 36)
|
||||
{
|
||||
}
|
||||
instance_deadmines() : InstanceMapScript(DMScriptName, 36) { }
|
||||
|
||||
struct instance_deadmines_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
|
||||
@@ -16,18 +16,11 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "Vehicle.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "CombatAI.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "Player.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
/*######
|
||||
##Quest 14098 - Evacuate the Merchant Place
|
||||
|
||||
@@ -23,12 +23,16 @@ SDComment: Some visual effects are not implemented.
|
||||
Script Data End */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "GameObject.h"
|
||||
#include "gnomeregan.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Player.h"
|
||||
#include "gnomeregan.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum BlastmasterEmi
|
||||
{
|
||||
@@ -85,11 +89,6 @@ class npc_blastmaster_emi_shortfuse : public CreatureScript
|
||||
public:
|
||||
npc_blastmaster_emi_shortfuse() : CreatureScript("npc_blastmaster_emi_shortfuse") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_blastmaster_emi_shortfuseAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
|
||||
{
|
||||
npc_blastmaster_emi_shortfuseAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -204,7 +203,7 @@ public:
|
||||
|
||||
void AggroAllPlayers(Creature* temp)
|
||||
{
|
||||
Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
|
||||
Map::PlayerList const& PlList = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
{
|
||||
if (Player* player = i->GetSource())
|
||||
@@ -307,7 +306,7 @@ public:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 2:
|
||||
if (GameObject* go = me->SummonGameObject(183410, -533.140f, -105.322f, -156.016f, 0.f, G3D::Quat(), 1))
|
||||
if (GameObject* go = me->SummonGameObject(183410, -533.140f, -105.322f, -156.016f, 0.f, QuaternionData(), 1))
|
||||
{
|
||||
GoSummonList.push_back(go->GetGUID());
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
@@ -322,7 +321,7 @@ public:
|
||||
Talk(SAY_BLASTMASTER_7);
|
||||
break;
|
||||
case 4:
|
||||
if (GameObject* go = me->SummonGameObject(183410, -542.199f, -96.854f, -155.790f, 0.f, G3D::Quat(), 1))
|
||||
if (GameObject* go = me->SummonGameObject(183410, -542.199f, -96.854f, -155.790f, 0.f, QuaternionData(), 1))
|
||||
{
|
||||
GoSummonList.push_back(go->GetGUID());
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
@@ -336,7 +335,7 @@ public:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 6:
|
||||
if (GameObject* go = me->SummonGameObject(183410, -507.820f, -103.333f, -151.353f, 0.f, G3D::Quat(), 1))
|
||||
if (GameObject* go = me->SummonGameObject(183410, -507.820f, -103.333f, -151.353f, 0.f, QuaternionData(), 1))
|
||||
{
|
||||
GoSummonList.push_back(go->GetGUID());
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
@@ -344,7 +343,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (GameObject* go = me->SummonGameObject(183410, -511.829f, -86.249f, -151.431f, 0.f, G3D::Quat(), 1))
|
||||
if (GameObject* go = me->SummonGameObject(183410, -511.829f, -86.249f, -151.431f, 0.f, QuaternionData(), 1))
|
||||
{
|
||||
GoSummonList.push_back(go->GetGUID());
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
@@ -356,9 +355,9 @@ public:
|
||||
me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 9:
|
||||
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[17], G3D::Quat(), 7200);
|
||||
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[18], G3D::Quat(), 7200);
|
||||
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[19], G3D::Quat(), 7200);
|
||||
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[17], QuaternionData(), 7200);
|
||||
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[18], QuaternionData(), 7200);
|
||||
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[19], QuaternionData(), 7200);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -497,6 +496,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetGnomereganAI<npc_blastmaster_emi_shortfuseAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_grubbis : public CreatureScript
|
||||
@@ -504,11 +507,6 @@ class boss_grubbis : public CreatureScript
|
||||
public:
|
||||
boss_grubbis() : CreatureScript("boss_grubbis") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_grubbisAI(creature);
|
||||
}
|
||||
|
||||
struct boss_grubbisAI : public ScriptedAI
|
||||
{
|
||||
boss_grubbisAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -545,6 +543,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetGnomereganAI<boss_grubbisAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// 12709 - Collecting Fallout
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#ifndef DEF_GNOMEREGAN_H
|
||||
#define DEF_GNOMEREGAN_H
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
#define GNOScriptName "instance_gnomeregan"
|
||||
#define DataHeader "GNO"
|
||||
|
||||
enum GNOGameObjectIds
|
||||
@@ -47,4 +50,10 @@ enum GNOData64
|
||||
DATA_NPC_BASTMASTER_EMI_SHORTFUSE
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetGnomereganAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, GNOScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -16,8 +16,12 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "gnomeregan.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
|
||||
#define MAX_ENCOUNTER 1
|
||||
@@ -25,12 +29,7 @@
|
||||
class instance_gnomeregan : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_gnomeregan() : InstanceMapScript("instance_gnomeregan", 90) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
{
|
||||
return new instance_gnomeregan_InstanceMapScript(map);
|
||||
}
|
||||
instance_gnomeregan() : InstanceMapScript(GNOScriptName, 90) { }
|
||||
|
||||
struct instance_gnomeregan_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
@@ -47,7 +46,7 @@ public:
|
||||
|
||||
ObjectGuid uiBastmasterEmiShortfuseGUID;
|
||||
|
||||
void Load(const char* in) override
|
||||
void Load(char const* in) override
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
@@ -128,6 +127,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
{
|
||||
return new instance_gnomeregan_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_gnomeregan()
|
||||
|
||||
@@ -24,9 +24,11 @@ SDCategory: Karazhan
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "karazhan.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "karazhan.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
@@ -222,7 +224,7 @@ public:
|
||||
std::bind(&BossAI::DoMeleeAttackIfReady, this));
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*source*/, const SpellInfo* spell) override
|
||||
void SpellHit(Unit* /*source*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Mechanic == MECHANIC_DISARM)
|
||||
Talk(SAY_DISARMED);
|
||||
@@ -276,7 +278,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_attumenAI(creature);
|
||||
return GetKarazhanAI<boss_attumenAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -378,7 +380,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_midnightAI(creature);
|
||||
return GetKarazhanAI<boss_midnightAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,8 +24,11 @@ SDCategory: Karazhan
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "karazhan.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
@@ -96,11 +99,6 @@ class boss_moroes : public CreatureScript
|
||||
public:
|
||||
boss_moroes() : CreatureScript("boss_moroes") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_moroesAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_moroesAI : public ScriptedAI
|
||||
{
|
||||
boss_moroesAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -326,6 +324,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_moroesAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
struct boss_moroes_guestAI : public ScriptedAI
|
||||
@@ -334,10 +337,7 @@ struct boss_moroes_guestAI : public ScriptedAI
|
||||
|
||||
ObjectGuid GuestGUID[4];
|
||||
|
||||
boss_moroes_guestAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
boss_moroes_guestAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -379,11 +379,6 @@ class boss_baroness_dorothea_millstipe : public CreatureScript
|
||||
public:
|
||||
boss_baroness_dorothea_millstipe() : CreatureScript("boss_baroness_dorothea_millstipe") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_baroness_dorothea_millstipeAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
|
||||
{
|
||||
//Shadow Priest
|
||||
@@ -443,6 +438,11 @@ public:
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_baroness_dorothea_millstipeAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_baron_rafe_dreuger : public CreatureScript
|
||||
@@ -450,11 +450,6 @@ class boss_baron_rafe_dreuger : public CreatureScript
|
||||
public:
|
||||
boss_baron_rafe_dreuger() : CreatureScript("boss_baron_rafe_dreuger") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_baron_rafe_dreugerAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
|
||||
{
|
||||
//Retr Pally
|
||||
@@ -508,6 +503,11 @@ public:
|
||||
} else HammerOfJustice_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_baron_rafe_dreugerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_lady_catriona_von_indi : public CreatureScript
|
||||
@@ -515,11 +515,6 @@ class boss_lady_catriona_von_indi : public CreatureScript
|
||||
public:
|
||||
boss_lady_catriona_von_indi() : CreatureScript("boss_lady_catriona_von_indi") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_lady_catriona_von_indiAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
|
||||
{
|
||||
//Holy Priest
|
||||
@@ -586,6 +581,12 @@ public:
|
||||
} else DispelMagic_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_lady_catriona_von_indiAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_lady_keira_berrybuck : public CreatureScript
|
||||
@@ -593,11 +594,6 @@ class boss_lady_keira_berrybuck : public CreatureScript
|
||||
public:
|
||||
boss_lady_keira_berrybuck() : CreatureScript("boss_lady_keira_berrybuck") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_lady_keira_berrybuckAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
|
||||
{
|
||||
//Holy Pally
|
||||
@@ -668,6 +664,11 @@ public:
|
||||
} else Cleanse_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_lady_keira_berrybuckAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_lord_robin_daris : public CreatureScript
|
||||
@@ -675,11 +676,6 @@ class boss_lord_robin_daris : public CreatureScript
|
||||
public:
|
||||
boss_lord_robin_daris() : CreatureScript("boss_lord_robin_daris") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_lord_robin_darisAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lord_robin_darisAI : public boss_moroes_guestAI
|
||||
{
|
||||
//Arms Warr
|
||||
@@ -732,6 +728,11 @@ public:
|
||||
} else WhirlWind_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_lord_robin_darisAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_lord_crispin_ference : public CreatureScript
|
||||
@@ -739,11 +740,6 @@ class boss_lord_crispin_ference : public CreatureScript
|
||||
public:
|
||||
boss_lord_crispin_ference() : CreatureScript("boss_lord_crispin_ference") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_lord_crispin_ferenceAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
|
||||
{
|
||||
//Arms Warr
|
||||
@@ -804,6 +800,11 @@ public:
|
||||
} else ShieldWall_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_lord_crispin_ferenceAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_moroes()
|
||||
|
||||
@@ -24,9 +24,14 @@ SDCategory: Karazhan
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "karazhan.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum Netherspite
|
||||
{
|
||||
@@ -69,11 +74,6 @@ class boss_netherspite : public CreatureScript
|
||||
public:
|
||||
boss_netherspite() : CreatureScript("boss_netherspite") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_netherspiteAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_netherspiteAI : public ScriptedAI
|
||||
{
|
||||
boss_netherspiteAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -340,6 +340,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_netherspiteAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_netherspite()
|
||||
|
||||
@@ -16,11 +16,15 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "karazhan.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "karazhan.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum NightbaneSpells
|
||||
{
|
||||
@@ -376,7 +380,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_nightbaneAI>(creature);
|
||||
return GetKarazhanAI<boss_nightbaneAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -392,9 +396,7 @@ class spell_rain_of_bones : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SKELETON))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_SKELETON });
|
||||
}
|
||||
|
||||
void OnTrigger(AuraEffect const* aurEff)
|
||||
@@ -422,15 +424,16 @@ class go_blackened_urn : public GameObjectScript
|
||||
|
||||
struct go_blackened_urnAI : public GameObjectAI
|
||||
{
|
||||
go_blackened_urnAI(GameObject* go) : GameObjectAI(go) { }
|
||||
go_blackened_urnAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
bool GossipHello(Player* /*player*/) override
|
||||
{
|
||||
if (me->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE))
|
||||
return false;
|
||||
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (!instance || instance->GetBossState(DATA_NIGHTBANE) == DONE || instance->GetBossState(DATA_NIGHTBANE) == IN_PROGRESS)
|
||||
if (instance->GetBossState(DATA_NIGHTBANE) == DONE || instance->GetBossState(DATA_NIGHTBANE) == IN_PROGRESS)
|
||||
return false;
|
||||
|
||||
if (Creature* nightbane = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_NIGHTBANE)))
|
||||
@@ -444,7 +447,7 @@ class go_blackened_urn : public GameObjectScript
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_blackened_urnAI(go);
|
||||
return GetKarazhanAI<go_blackened_urnAI>(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,9 +24,13 @@ SDCategory: Karazhan
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "karazhan.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
// 18 Coordinates for Infernal spawns
|
||||
struct InfernalPoint
|
||||
@@ -102,15 +106,10 @@ class netherspite_infernal : public CreatureScript
|
||||
public:
|
||||
netherspite_infernal() : CreatureScript("netherspite_infernal") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new netherspite_infernalAI(creature);
|
||||
}
|
||||
|
||||
struct netherspite_infernalAI : public ScriptedAI
|
||||
{
|
||||
netherspite_infernalAI(Creature* creature) : ScriptedAI(creature),
|
||||
HellfireTimer(0), CleanupTimer(0), point(NULL) { }
|
||||
HellfireTimer(0), CleanupTimer(0), point(nullptr) { }
|
||||
|
||||
uint32 HellfireTimer;
|
||||
uint32 CleanupTimer;
|
||||
@@ -151,7 +150,7 @@ public:
|
||||
creature->AI()->KilledUnit(who);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*who*/, const SpellInfo* spell) override
|
||||
void SpellHit(Unit* /*who*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_INFERNAL_RELAY)
|
||||
{
|
||||
@@ -170,6 +169,11 @@ public:
|
||||
|
||||
void Cleanup();
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<netherspite_infernalAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_malchezaar : public CreatureScript
|
||||
@@ -177,11 +181,6 @@ class boss_malchezaar : public CreatureScript
|
||||
public:
|
||||
boss_malchezaar() : CreatureScript("boss_malchezaar") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_malchezaarAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_malchezaarAI : public ScriptedAI
|
||||
{
|
||||
boss_malchezaarAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -308,16 +307,15 @@ public:
|
||||
|
||||
void EnfeebleHealthEffect()
|
||||
{
|
||||
const SpellInfo* info = sSpellMgr->GetSpellInfo(SPELL_ENFEEBLE_EFFECT);
|
||||
SpellInfo const* info = sSpellMgr->GetSpellInfo(SPELL_ENFEEBLE_EFFECT);
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit*> targets;
|
||||
|
||||
ThreatContainer::StorageType const& t_list = me->getThreatManager().getThreatList();
|
||||
if (t_list.empty())
|
||||
return;
|
||||
|
||||
std::vector<Unit*> targets;
|
||||
//begin + 1, so we don't target the one with the highest threat
|
||||
ThreatContainer::StorageType::const_iterator itr = t_list.begin();
|
||||
std::advance(itr, 1);
|
||||
@@ -356,7 +354,7 @@ public:
|
||||
|
||||
void SummonInfernal(const uint32 /*diff*/)
|
||||
{
|
||||
InfernalPoint *point = NULL;
|
||||
InfernalPoint* point = nullptr;
|
||||
Position pos;
|
||||
if ((me->GetMapId() != 532) || positions.empty())
|
||||
pos = me->GetRandomNearPosition(60);
|
||||
@@ -367,7 +365,6 @@ public:
|
||||
}
|
||||
|
||||
Creature* infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
|
||||
if (infernal)
|
||||
{
|
||||
infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
|
||||
@@ -524,7 +521,7 @@ public:
|
||||
{
|
||||
if (SWPainTimer <= diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
if (phase == 1)
|
||||
target = me->GetVictim(); // the tank
|
||||
else // anyone but the tank
|
||||
@@ -573,7 +570,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void Cleanup(Creature* infernal, InfernalPoint *point)
|
||||
void Cleanup(Creature* infernal, InfernalPoint* point)
|
||||
{
|
||||
for (GuidVector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
|
||||
{
|
||||
@@ -587,6 +584,11 @@ public:
|
||||
positions.push_back(point);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_malchezaarAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void netherspite_infernal::netherspite_infernalAI::Cleanup()
|
||||
|
||||
@@ -24,10 +24,13 @@ SDCategory: Karazhan
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "karazhan.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "karazhan.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
enum ShadeOfAran
|
||||
{
|
||||
@@ -84,11 +87,6 @@ class boss_shade_of_aran : public CreatureScript
|
||||
public:
|
||||
boss_shade_of_aran() : CreatureScript("boss_shade_of_aran") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_aranAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_aranAI : public ScriptedAI
|
||||
{
|
||||
boss_aranAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -181,12 +179,11 @@ public:
|
||||
|
||||
void FlameWreathEffect()
|
||||
{
|
||||
std::vector<Unit*> targets;
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
|
||||
ThreatContainer::StorageType const& t_list = me->getThreatManager().getThreatList();
|
||||
if (t_list.empty())
|
||||
return;
|
||||
|
||||
std::vector<Unit*> targets;
|
||||
//store the threat list in a different container
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
@@ -482,7 +479,7 @@ public:
|
||||
DrinkInturrupted = true;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*pAttacker*/, const SpellInfo* Spell) override
|
||||
void SpellHit(Unit* /*pAttacker*/, SpellInfo const* Spell) override
|
||||
{
|
||||
//We only care about interrupt effects and only if they are durring a spell currently being cast
|
||||
if ((Spell->Effects[0].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
@@ -504,6 +501,11 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_aranAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_aran_elemental : public CreatureScript
|
||||
@@ -511,11 +513,6 @@ class npc_aran_elemental : public CreatureScript
|
||||
public:
|
||||
npc_aran_elemental() : CreatureScript("npc_aran_elemental") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new water_elementalAI(creature);
|
||||
}
|
||||
|
||||
struct water_elementalAI : public ScriptedAI
|
||||
{
|
||||
water_elementalAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -549,6 +546,11 @@ public:
|
||||
} else CastTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<water_elementalAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_shade_of_aran()
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "karazhan.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
enum TerestianSays
|
||||
|
||||
@@ -24,11 +24,16 @@ SDCategory: Karazhan
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "karazhan.h"
|
||||
#include "Log.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "karazhan.h"
|
||||
#include "Player.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
/***********************************/
|
||||
/*** OPERA WIZARD OF OZ EVENT *****/
|
||||
@@ -116,11 +121,6 @@ class boss_dorothee : public CreatureScript
|
||||
public:
|
||||
boss_dorothee() : CreatureScript("boss_dorothee") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_dorotheeAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_dorotheeAI : public ScriptedAI
|
||||
{
|
||||
boss_dorotheeAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -229,6 +229,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_dorotheeAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_tito : public CreatureScript
|
||||
@@ -236,11 +241,6 @@ class npc_tito : public CreatureScript
|
||||
public:
|
||||
npc_tito() : CreatureScript("npc_tito") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_titoAI(creature);
|
||||
}
|
||||
|
||||
struct npc_titoAI : public ScriptedAI
|
||||
{
|
||||
npc_titoAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
{
|
||||
if (DorotheeGUID)
|
||||
{
|
||||
Creature* Dorothee = (ObjectAccessor::GetCreature((*me), DorotheeGUID));
|
||||
Creature* Dorothee = ObjectAccessor::GetCreature((*me), DorotheeGUID);
|
||||
if (Dorothee && Dorothee->IsAlive())
|
||||
{
|
||||
ENSURE_AI(boss_dorothee::boss_dorotheeAI, Dorothee->AI())->TitoDied = true;
|
||||
@@ -291,6 +291,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<npc_titoAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void boss_dorothee::boss_dorotheeAI::SummonTito()
|
||||
@@ -310,11 +315,6 @@ class boss_strawman : public CreatureScript
|
||||
public:
|
||||
boss_strawman() : CreatureScript("boss_strawman") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_strawmanAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_strawmanAI : public ScriptedAI
|
||||
{
|
||||
boss_strawmanAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -368,7 +368,7 @@ public:
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* Spell) override
|
||||
{
|
||||
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand32() % 10)))
|
||||
{
|
||||
@@ -423,6 +423,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_strawmanAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_tinhead : public CreatureScript
|
||||
@@ -430,11 +435,6 @@ class boss_tinhead : public CreatureScript
|
||||
public:
|
||||
boss_tinhead() : CreatureScript("boss_tinhead") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_tinheadAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_tinheadAI : public ScriptedAI
|
||||
{
|
||||
boss_tinheadAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -538,6 +538,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_tinheadAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_roar : public CreatureScript
|
||||
@@ -545,11 +550,6 @@ class boss_roar : public CreatureScript
|
||||
public:
|
||||
boss_roar() : CreatureScript("boss_roar") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_roarAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_roarAI : public ScriptedAI
|
||||
{
|
||||
boss_roarAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -652,6 +652,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_roarAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_crone : public CreatureScript
|
||||
@@ -659,11 +664,6 @@ class boss_crone : public CreatureScript
|
||||
public:
|
||||
boss_crone() : CreatureScript("boss_crone") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_croneAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_croneAI : public ScriptedAI
|
||||
{
|
||||
boss_croneAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -736,6 +736,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_croneAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_cyclone : public CreatureScript
|
||||
@@ -743,11 +748,6 @@ class npc_cyclone : public CreatureScript
|
||||
public:
|
||||
npc_cyclone() : CreatureScript("npc_cyclone") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_cycloneAI(creature);
|
||||
}
|
||||
|
||||
struct npc_cycloneAI : public ScriptedAI
|
||||
{
|
||||
npc_cycloneAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -787,6 +787,11 @@ public:
|
||||
} else MoveTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<npc_cycloneAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/**************************************/
|
||||
@@ -834,7 +839,7 @@ class npc_grandmother : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_grandmotherAI(creature);
|
||||
return GetKarazhanAI<npc_grandmotherAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -843,11 +848,6 @@ class boss_bigbadwolf : public CreatureScript
|
||||
public:
|
||||
boss_bigbadwolf() : CreatureScript("boss_bigbadwolf") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_bigbadwolfAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_bigbadwolfAI : public ScriptedAI
|
||||
{
|
||||
boss_bigbadwolfAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -962,6 +962,11 @@ public:
|
||||
} else SwipeTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_bigbadwolfAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/**********************************************/
|
||||
@@ -1042,11 +1047,6 @@ class boss_julianne : public CreatureScript
|
||||
public:
|
||||
boss_julianne() : CreatureScript("boss_julianne") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_julianneAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_julianneAI : public ScriptedAI
|
||||
{
|
||||
boss_julianneAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -1132,7 +1132,7 @@ public:
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* Spell) override
|
||||
{
|
||||
if (Spell->Id == SPELL_DRINK_POISON)
|
||||
{
|
||||
@@ -1156,6 +1156,11 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_julianneAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_romulo : public CreatureScript
|
||||
@@ -1163,11 +1168,6 @@ class boss_romulo : public CreatureScript
|
||||
public:
|
||||
boss_romulo() : CreatureScript("boss_romulo") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_romuloAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_romuloAI : public ScriptedAI
|
||||
{
|
||||
boss_romuloAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -1360,6 +1360,11 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetKarazhanAI<boss_romuloAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
|
||||
Loaded 100 of 1243 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user