mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 00:23:48 +00:00
refactor(Core/Scripts): restyle scripts lib with astyle (#3467)
This commit is contained in:
@@ -100,35 +100,35 @@ public:
|
||||
AccountOpResult result = AccountMgr::CreateAccount(std::string(accountName), std::string(password));
|
||||
switch (result)
|
||||
{
|
||||
case AOR_OK:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
|
||||
if (handler->GetSession())
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.",
|
||||
handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(),
|
||||
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow());
|
||||
}
|
||||
break;
|
||||
case AOR_NAME_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_PASS_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_NAME_ALREDY_EXIST:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_ALREADY_EXIST);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_DB_INTERNAL_ERROR:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED_SQL_ERROR, accountName);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED, accountName);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_OK:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
|
||||
if (handler->GetSession())
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.",
|
||||
handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(),
|
||||
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow());
|
||||
}
|
||||
break;
|
||||
case AOR_NAME_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_PASS_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_NAME_ALREDY_EXIST:
|
||||
handler->SendSysMessage(LANG_ACCOUNT_ALREADY_EXIST);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_DB_INTERNAL_ERROR:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED_SQL_ERROR, accountName);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED, accountName);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -171,21 +171,21 @@ public:
|
||||
AccountOpResult result = AccountMgr::DeleteAccount(accountId);
|
||||
switch (result)
|
||||
{
|
||||
case AOR_OK:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName.c_str());
|
||||
break;
|
||||
case AOR_NAME_NOT_EXIST:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_DB_INTERNAL_ERROR:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_OK:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName.c_str());
|
||||
break;
|
||||
case AOR_NAME_NOT_EXIST:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_DB_INTERNAL_ERROR:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -227,9 +227,9 @@ public:
|
||||
{
|
||||
Field* fieldsLogin = resultLogin->Fetch();
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_LIST_LINE,
|
||||
fieldsLogin[0].GetCString(), name.c_str(), fieldsLogin[1].GetCString(),
|
||||
fieldsDB[2].GetUInt16(), fieldsDB[3].GetUInt16(), fieldsLogin[3].GetUInt8(),
|
||||
fieldsLogin[2].GetUInt8());
|
||||
fieldsLogin[0].GetCString(), name.c_str(), fieldsLogin[1].GetCString(),
|
||||
fieldsDB[2].GetUInt16(), fieldsDB[3].GetUInt16(), fieldsLogin[3].GetUInt8(),
|
||||
fieldsLogin[2].GetUInt8());
|
||||
}
|
||||
else
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str());
|
||||
@@ -367,19 +367,19 @@ public:
|
||||
AccountOpResult result = AccountMgr::ChangePassword(handler->GetSession()->GetAccountId(), std::string(newPassword));
|
||||
switch (result)
|
||||
{
|
||||
case AOR_OK:
|
||||
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
sScriptMgr->OnPasswordChange(handler->GetSession()->GetAccountId());
|
||||
break;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
sScriptMgr->OnFailedPasswordChange(handler->GetSession()->GetAccountId());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_OK:
|
||||
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
sScriptMgr->OnPasswordChange(handler->GetSession()->GetAccountId());
|
||||
break;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
sScriptMgr->OnFailedPasswordChange(handler->GetSession()->GetAccountId());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
// Let set addon state only for lesser (strong) security level
|
||||
// or to self account
|
||||
if (handler->GetSession() && handler->GetSession()->GetAccountId() != accountId &&
|
||||
handler->HasLowerSecurityAccount(nullptr, accountId, true))
|
||||
handler->HasLowerSecurityAccount(nullptr, accountId, true))
|
||||
return false;
|
||||
|
||||
int expansion = atoi(exp); //get int anyway (0 if error)
|
||||
@@ -628,21 +628,21 @@ public:
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case AOR_OK:
|
||||
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
break;
|
||||
case AOR_NAME_NOT_EXIST:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_OK:
|
||||
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
break;
|
||||
case AOR_NAME_NOT_EXIST:
|
||||
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
if (!*_args)
|
||||
return false;
|
||||
|
||||
char* args = (char *)_args;
|
||||
char* args = (char*)_args;
|
||||
|
||||
char const* oldArenaStr = handler->extractQuotedArg(args);
|
||||
if (!oldArenaStr)
|
||||
@@ -311,7 +311,7 @@ public:
|
||||
found = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
|
||||
@@ -109,26 +109,26 @@ public:
|
||||
|
||||
switch (sBan->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : ""))
|
||||
{
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(durationStr) > 0)
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr);
|
||||
}
|
||||
break;
|
||||
case BAN_NOTFOUND:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_BAN_NOTFOUND, "character", name.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(durationStr) > 0)
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr);
|
||||
}
|
||||
break;
|
||||
case BAN_NOTFOUND:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_BAN_NOTFOUND, "character", name.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -191,16 +191,16 @@ public:
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case BAN_ACCOUNT:
|
||||
banReturn = sBan->BanAccount(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
banReturn = sBan->BanAccountByPlayerName(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_IP:
|
||||
default:
|
||||
banReturn = sBan->BanIP(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_ACCOUNT:
|
||||
banReturn = sBan->BanAccount(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
banReturn = sBan->BanAccountByPlayerName(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
case BAN_IP:
|
||||
default:
|
||||
banReturn = sBan->BanIP(nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (banReturn)
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(durationStr) > 0)
|
||||
{
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
|
||||
handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
|
||||
}
|
||||
else
|
||||
@@ -292,9 +292,8 @@ public:
|
||||
bool permanent = (fields[1].GetUInt64() == uint64(0));
|
||||
std::string banTime = permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
|
||||
fields[0].GetCString(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
}
|
||||
while (result->NextRow());
|
||||
fields[0].GetCString(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
} while (result->NextRow());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -340,9 +339,8 @@ public:
|
||||
bool permanent = (fields[1].GetUInt32() == uint32(0));
|
||||
std::string banTime = permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
|
||||
fields[0].GetCString(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
}
|
||||
while (result->NextRow());
|
||||
fields[0].GetCString(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
} while (result->NextRow());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -372,8 +370,8 @@ public:
|
||||
Field* fields = result->Fetch();
|
||||
bool permanent = !fields[6].GetUInt64();
|
||||
handler->PSendSysMessage(LANG_BANINFO_IPENTRY,
|
||||
fields[0].GetCString(), fields[1].GetCString(), permanent ? handler->GetAcoreString(LANG_BANINFO_NEVER) : fields[2].GetCString(),
|
||||
permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetCString(), fields[5].GetCString());
|
||||
fields[0].GetCString(), fields[1].GetCString(), permanent ? handler->GetAcoreString(LANG_BANINFO_NEVER) : fields[2].GetCString(),
|
||||
permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetCString(), fields[5].GetCString());
|
||||
|
||||
|
||||
return true;
|
||||
@@ -428,8 +426,7 @@ public:
|
||||
Field* fields2 = banResult->Fetch();
|
||||
handler->PSendSysMessage("%s", fields2[0].GetCString());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
// Console wide output
|
||||
else
|
||||
@@ -466,8 +463,8 @@ public:
|
||||
if (fields2[0].GetUInt32() == fields2[1].GetUInt32())
|
||||
{
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
|
||||
accountName.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
fields2[2].GetCString(), fields2[3].GetCString());
|
||||
accountName.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
fields2[2].GetCString(), fields2[3].GetCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -475,15 +472,13 @@ public:
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
accountName.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year%100, tmUnban.tm_mon+1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
fields2[2].GetCString(), fields2[3].GetCString());
|
||||
accountName.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
fields2[2].GetCString(), fields2[3].GetCString());
|
||||
}
|
||||
}
|
||||
while (banInfo->NextRow());
|
||||
} while (banInfo->NextRow());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
handler->SendSysMessage(" ===============================================================================");
|
||||
}
|
||||
@@ -523,8 +518,7 @@ public:
|
||||
PreparedQueryResult banResult = CharacterDatabase.Query(stmt2);
|
||||
if (banResult)
|
||||
handler->PSendSysMessage("%s", (*banResult)[0].GetCString());
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
// Console wide output
|
||||
else
|
||||
@@ -555,8 +549,8 @@ public:
|
||||
if (banFields[0].GetUInt32() == banFields[1].GetUInt32())
|
||||
{
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
|
||||
char_name.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
banFields[2].GetCString(), banFields[3].GetCString());
|
||||
char_name.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
banFields[2].GetCString(), banFields[3].GetCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -564,15 +558,13 @@ public:
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
char_name.c_str(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year%100, tmUnban.tm_mon+1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
banFields[2].GetCString(), banFields[3].GetCString());
|
||||
char_name.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
banFields[2].GetCString(), banFields[3].GetCString());
|
||||
}
|
||||
}
|
||||
while (banInfo->NextRow());
|
||||
} while (banInfo->NextRow());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
handler->SendSysMessage(" =============================================================================== ");
|
||||
}
|
||||
|
||||
@@ -616,8 +608,7 @@ public:
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
handler->PSendSysMessage("%s", fields[0].GetCString());
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
// Console wide output
|
||||
else
|
||||
@@ -635,8 +626,8 @@ public:
|
||||
if (fields[1].GetUInt32() == fields[2].GetUInt32())
|
||||
{
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
|
||||
fields[0].GetCString(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
fields[3].GetCString(), fields[4].GetCString());
|
||||
fields[0].GetCString(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
fields[3].GetCString(), fields[4].GetCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -644,12 +635,11 @@ public:
|
||||
tm tmUnban;
|
||||
localtime_r(&timeUnban, &tmUnban);
|
||||
handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
fields[0].GetCString(), tmBan.tm_year%100, tmBan.tm_mon+1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year%100, tmUnban.tm_mon+1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
fields[3].GetCString(), fields[4].GetCString());
|
||||
fields[0].GetCString(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min,
|
||||
tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min,
|
||||
fields[3].GetCString(), fields[4].GetCString());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
handler->SendSysMessage(" ===============================================================================");
|
||||
}
|
||||
@@ -737,26 +727,26 @@ public:
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case BAN_ACCOUNT:
|
||||
if (sBan->RemoveBanAccount(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
if (sBan->RemoveBanAccountByPlayerName(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_IP:
|
||||
if (sBan->RemoveBanIP(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case BAN_ACCOUNT:
|
||||
if (sBan->RemoveBanAccount(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
if (sBan->RemoveBanAccountByPlayerName(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_IP:
|
||||
if (sBan->RemoveBanIP(nameOrIP))
|
||||
handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
std::vector<ChatCommand> GetCommands() const override
|
||||
{
|
||||
static std::vector<ChatCommand> castCommandTable =
|
||||
{
|
||||
{
|
||||
{ "back", SEC_GAMEMASTER, false, &HandleCastBackCommand, "" },
|
||||
{ "dist", SEC_GAMEMASTER, false, &HandleCastDistCommand, "" },
|
||||
{ "self", SEC_GAMEMASTER, false, &HandleCastSelfCommand, "" },
|
||||
|
||||
@@ -136,8 +136,7 @@ public:
|
||||
AccountMgr::GetName(info.accountId, info.accountName);
|
||||
info.deleteDate = time_t(fields[3].GetUInt32());
|
||||
foundList.push_back(info);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -168,12 +167,12 @@ public:
|
||||
|
||||
if (!handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE,
|
||||
itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
|
||||
itr->accountId, dateStr.c_str());
|
||||
itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
|
||||
itr->accountId, dateStr.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT,
|
||||
itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
|
||||
itr->accountId, dateStr.c_str());
|
||||
itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
|
||||
itr->accountId, dateStr.c_str());
|
||||
}
|
||||
|
||||
if (!handler->GetSession())
|
||||
@@ -284,8 +283,8 @@ public:
|
||||
continue;
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
|
||||
? handler->GetAcoreString(LANG_ACTIVE)
|
||||
: "";
|
||||
? handler->GetAcoreString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr, 80, name.c_str(), targetName);
|
||||
@@ -885,10 +884,11 @@ public:
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT guid FROM characters");
|
||||
if (!result)
|
||||
return true;
|
||||
do{
|
||||
do
|
||||
{
|
||||
uint64 _guid = result->Fetch()[0].GetUInt64();
|
||||
char buff[20];
|
||||
sprintf(buff,"%u", (uint32)_guid);
|
||||
sprintf(buff, "%u", (uint32)_guid);
|
||||
switch(PlayerDumpWriter().WriteDump(buff, uint32(_guid)))
|
||||
{
|
||||
case DUMP_SUCCESS:
|
||||
@@ -907,7 +907,7 @@ public:
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}while(result->NextRow());
|
||||
} while(result->NextRow());
|
||||
}
|
||||
|
||||
if (!fileStr || !playerStr)
|
||||
@@ -985,11 +985,21 @@ public:
|
||||
|
||||
switch (BagSlot)
|
||||
{
|
||||
case 2: BagSlot = 19; break;
|
||||
case 3: BagSlot = 20; break;
|
||||
case 4: BagSlot = 21; break;
|
||||
case 5: BagSlot = 22; break;
|
||||
default: BagSlot = 1; break;
|
||||
case 2:
|
||||
BagSlot = 19;
|
||||
break;
|
||||
case 3:
|
||||
BagSlot = 20;
|
||||
break;
|
||||
case 4:
|
||||
BagSlot = 21;
|
||||
break;
|
||||
case 5:
|
||||
BagSlot = 22;
|
||||
break;
|
||||
default:
|
||||
BagSlot = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage("--------------------------------------");
|
||||
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
char const* name = "test";
|
||||
uint8 code = atoi(args);
|
||||
|
||||
WorldPacket data(SMSG_CHANNEL_NOTIFY, (1+10));
|
||||
WorldPacket data(SMSG_CHANNEL_NOTIFY, (1 + 10));
|
||||
data << code; // notify type
|
||||
data << name; // channel name
|
||||
data << uint32(0);
|
||||
@@ -787,7 +787,7 @@ public:
|
||||
if (!target || target->IsTotem() || target->IsPet())
|
||||
return false;
|
||||
|
||||
ThreatContainer::StorageType const &threatList = target->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatList = target->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator itr;
|
||||
uint32 count = 0;
|
||||
handler->PSendSysMessage("Threat list of %s (guid %u)", target->GetName().c_str(), target->GetGUIDLow());
|
||||
@@ -801,7 +801,7 @@ public:
|
||||
}
|
||||
handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", ++count, unit->GetName().c_str(), unit->GetGUIDLow(), (*itr)->getThreat());
|
||||
}
|
||||
ThreatContainer::StorageType const &threatList2 = target->getThreatManager().getOfflineThreatList();
|
||||
ThreatContainer::StorageType const& threatList2 = target->getThreatManager().getOfflineThreatList();
|
||||
for (itr = threatList2.begin(); itr != threatList2.end(); ++itr)
|
||||
{
|
||||
Unit* unit = (*itr)->getTarget();
|
||||
@@ -1128,13 +1128,13 @@ public:
|
||||
if (isInt32)
|
||||
{
|
||||
uint32 value = (uint32)atoi(y);
|
||||
target->SetUInt32Value(opcode , value);
|
||||
target->SetUInt32Value(opcode, value);
|
||||
handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), opcode, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
float value = (float)atof(y);
|
||||
target->SetFloatValue(opcode , value);
|
||||
target->SetFloatValue(opcode, value);
|
||||
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), opcode, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
enum Spells
|
||||
enum Spells
|
||||
{
|
||||
LFG_SPELL_DUNGEON_DESERTER = 71041,
|
||||
BG_SPELL_DESERTER = 26013
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* targetPlayer = handler->getSelectedPlayer();
|
||||
Player* targetPlayer = handler->getSelectedPlayer();
|
||||
if (!targetPlayer)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -71,24 +71,24 @@ public:
|
||||
}
|
||||
uint32 time = atoi(timeStr);
|
||||
|
||||
if (!time)
|
||||
{
|
||||
if (!time)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Aura* aura = targetPlayer->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, targetPlayer);
|
||||
Aura* aura = targetPlayer->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, targetPlayer);
|
||||
|
||||
if (!aura)
|
||||
{
|
||||
if (!aura)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
aura->SetDuration(time * IN_MILLISECONDS);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDeserterRemove(ChatHandler* handler, char const* /*args*/, bool isInstance)
|
||||
@@ -101,9 +101,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
targetPlayer->RemoveAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER);
|
||||
targetPlayer->RemoveAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDeserterInstanceAdd(ChatHandler* handler, char const* args)
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_deserter_commandscript()
|
||||
void AddSC_deserter_commandscript()
|
||||
{
|
||||
new deserter_commandscript();
|
||||
}
|
||||
|
||||
@@ -79,71 +79,71 @@ public:
|
||||
switch (disableType)
|
||||
{
|
||||
case DISABLE_TYPE_SPELL:
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "spell";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "spell";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_QUEST:
|
||||
{
|
||||
if (!sObjectMgr->GetQuestTemplate(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sObjectMgr->GetQuestTemplate(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "quest";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "quest";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_MAP:
|
||||
{
|
||||
if (!sMapStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sMapStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "map";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "map";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_BATTLEGROUND:
|
||||
{
|
||||
if (!sBattlemasterListStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NO_BATTLEGROUND_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sBattlemasterListStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NO_BATTLEGROUND_FOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "battleground";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "battleground";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_OUTDOORPVP:
|
||||
{
|
||||
if (entry > MAX_OUTDOORPVP_TYPES)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NO_OUTDOOR_PVP_FORUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (entry > MAX_OUTDOORPVP_TYPES)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NO_OUTDOOR_PVP_FORUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "outdoorpvp";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "outdoorpvp";
|
||||
break;
|
||||
}
|
||||
case DISABLE_TYPE_VMAP:
|
||||
{
|
||||
if (!sMapStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
if (!sMapStore.LookupEntry(entry))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
disableTypeStr = "vmap";
|
||||
break;
|
||||
}
|
||||
disableTypeStr = "vmap";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -111,8 +111,8 @@ public:
|
||||
std::string lengthStr = secsToTimeString(eventData.length * MINUTE, true);
|
||||
|
||||
handler->PSendSysMessage(LANG_EVENT_INFO, eventId, eventData.description.c_str(), activeStr,
|
||||
startTimeStr.c_str(), endTimeStr.c_str(), occurenceStr.c_str(), lengthStr.c_str(),
|
||||
nextStr.c_str());
|
||||
startTimeStr.c_str(), endTimeStr.c_str(), occurenceStr.c_str(), lengthStr.c_str(),
|
||||
nextStr.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
{
|
||||
AccountTypes itrSec = itr->second->GetSession()->GetSecurity();
|
||||
if ((itr->second->IsGameMaster() || (!AccountMgr::IsPlayerAccount(itrSec) && itrSec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
|
||||
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
|
||||
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
}
|
||||
|
||||
if ((node->x == 0.0f && node->y == 0.0f && node->z == 0.0f) ||
|
||||
!MapManager::IsValidMapCoord(node->map_id, node->x, node->y, node->z))
|
||||
!MapManager::IsValidMapCoord(node->map_id, node->x, node->y, node->z))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, node->x, node->y, node->map_id);
|
||||
handler->SetSentErrorMessage(true);
|
||||
|
||||
@@ -195,8 +195,8 @@ public:
|
||||
float z = player->GetPositionZ();
|
||||
float ang = player->GetOrientation();
|
||||
|
||||
float rot2 = sin(ang/2);
|
||||
float rot3 = cos(ang/2);
|
||||
float rot2 = sin(ang / 2);
|
||||
float rot3 = cos(ang / 2);
|
||||
|
||||
uint32 objectId = atoi(id);
|
||||
|
||||
@@ -222,15 +222,15 @@ public:
|
||||
|
||||
if (objectId)
|
||||
result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), objectId);
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), objectId);
|
||||
else
|
||||
{
|
||||
std::string name = id;
|
||||
WorldDatabase.EscapeString(name);
|
||||
result = WorldDatabase.PQuery(
|
||||
"SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
|
||||
"FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name " _LIKE_ " " _CONCAT3_("'%%'", "'%s'", "'%%'") " ORDER BY order_ ASC LIMIT 1",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str());
|
||||
"SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
|
||||
"FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name " _LIKE_ " " _CONCAT3_("'%%'", "'%s'", "'%%'") " ORDER BY order_ ASC LIMIT 1",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -256,10 +256,10 @@ public:
|
||||
eventFilter << ')';
|
||||
|
||||
result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, phaseMask, "
|
||||
"(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject "
|
||||
"LEFT OUTER JOIN game_event_gameobject on gameobject.guid = game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10",
|
||||
handler->GetSession()->GetPlayer()->GetPositionX(), handler->GetSession()->GetPlayer()->GetPositionY(), handler->GetSession()->GetPlayer()->GetPositionZ(),
|
||||
handler->GetSession()->GetPlayer()->GetMapId(), eventFilter.str().c_str());
|
||||
"(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject "
|
||||
"LEFT OUTER JOIN game_event_gameobject on gameobject.guid = game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10",
|
||||
handler->GetSession()->GetPlayer()->GetPositionX(), handler->GetSession()->GetPlayer()->GetPositionY(), handler->GetSession()->GetPlayer()->GetPositionZ(),
|
||||
handler->GetSession()->GetPlayer()->GetMapId(), eventFilter.str().c_str());
|
||||
}
|
||||
|
||||
if (!result)
|
||||
@@ -685,7 +685,7 @@ public:
|
||||
object->SetByteValue(GAMEOBJECT_BYTES_1, objectType, objectState);
|
||||
else if (objectType == 4)
|
||||
{
|
||||
WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4);
|
||||
WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8 + 4);
|
||||
data << object->GetGUID();
|
||||
data << (uint32)(objectState);
|
||||
object->SendMessageToSet(&data, true);
|
||||
|
||||
@@ -136,7 +136,10 @@ public:
|
||||
uint32 dungeon = 0, battleground = 0, arena = 0, spectators = 0;
|
||||
sMapMgr->GetNumInstances(dungeon, battleground, arena);
|
||||
handler->PSendSysMessage("instances loaded: dungeons (%d), battlegrounds (%d), arenas (%d)", dungeon, battleground, arena);
|
||||
dungeon = 0; battleground = 0; arena = 0; spectators = 0;
|
||||
dungeon = 0;
|
||||
battleground = 0;
|
||||
arena = 0;
|
||||
spectators = 0;
|
||||
sMapMgr->GetNumPlayersInInstances(dungeon, battleground, arena, spectators);
|
||||
handler->PSendSysMessage("players in instances: dungeons (%d), battlegrounds (%d), arenas (%d + %d spect)", dungeon, battleground, arena, spectators);
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
// search highest talent rank
|
||||
uint32 spellId = 0;
|
||||
|
||||
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
|
||||
for (int8 rank = MAX_TALENT_RANK - 1; rank >= 0; --rank)
|
||||
{
|
||||
if (talentInfo->RankID[rank] != 0)
|
||||
{
|
||||
@@ -306,7 +306,7 @@ public:
|
||||
continue;
|
||||
|
||||
if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) &&
|
||||
skillInfo->canLink) // only prof. with recipes have
|
||||
skillInfo->canLink) // only prof. with recipes have
|
||||
{
|
||||
HandleLearnSkillRecipesHelper(handler->GetSession()->GetPlayer(), skillInfo->id);
|
||||
}
|
||||
@@ -349,8 +349,8 @@ public:
|
||||
continue;
|
||||
|
||||
if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION &&
|
||||
skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) ||
|
||||
!skillInfo->canLink) // only prof with recipes have set
|
||||
skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) ||
|
||||
!skillInfo->canLink) // only prof with recipes have set
|
||||
continue;
|
||||
|
||||
int locale = handler->GetSessionDbcLocale();
|
||||
|
||||
@@ -21,8 +21,8 @@ void GetPlayerInfo(ChatHandler* handler, Player* player)
|
||||
|
||||
std::string const& state = lfg::GetStateString(sLFGMgr->GetState(guid));
|
||||
handler->PSendSysMessage(LANG_LFG_PLAYER_INFO, player->GetName().c_str(),
|
||||
state.c_str(), uint8(dungeons.size()), lfg::ConcatenateDungeons(dungeons).c_str(),
|
||||
lfg::GetRolesString(sLFGMgr->GetRoles(guid)).c_str(), sLFGMgr->GetComment(guid).c_str());
|
||||
state.c_str(), uint8(dungeons.size()), lfg::ConcatenateDungeons(dungeons).c_str(),
|
||||
lfg::GetRolesString(sLFGMgr->GetRoles(guid)).c_str(), sLFGMgr->GetComment(guid).c_str());
|
||||
}
|
||||
|
||||
class lfg_commandscript : public CommandScript
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
uint64 guid = grp->GetGUID();
|
||||
std::string const& state = lfg::GetStateString(sLFGMgr->GetState(guid));
|
||||
handler->PSendSysMessage(LANG_LFG_GROUP_INFO, grp->isLFGGroup(),
|
||||
state.c_str(), sLFGMgr->GetDungeon(guid));
|
||||
state.c_str(), sLFGMgr->GetDungeon(guid));
|
||||
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
GetPlayerInfo(handler, itr->GetSource());
|
||||
|
||||
@@ -84,11 +84,11 @@ public:
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), creatureId, count);
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), creatureId, count);
|
||||
}
|
||||
else
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u",
|
||||
creatureId, count);
|
||||
creatureId, count);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -105,8 +105,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapId);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, creatureId, creatureCount);
|
||||
@@ -185,8 +184,7 @@ public:
|
||||
itemPos = "";
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid, ownerName.c_str(), ownerGuid, ownerAccountId, itemPos);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
uint32 resultCount = uint32(result->GetRowCount());
|
||||
|
||||
@@ -232,8 +230,7 @@ public:
|
||||
char const* itemPos = "[in mail]";
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEMLIST_MAIL, itemGuid, itemSenderName.c_str(), itemSender, itemSenderAccountId, itemReceiverName.c_str(), itemReceiver, itemReceiverAccount, itemPos);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
uint32 resultCount = uint32(result->GetRowCount());
|
||||
|
||||
@@ -276,8 +273,7 @@ public:
|
||||
char const* itemPos = "[in auction]";
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid, ownerName.c_str(), owner, ownerAccountId, itemPos);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
// guild bank case
|
||||
@@ -307,8 +303,7 @@ public:
|
||||
char const* itemPos = "[in guild bank]";
|
||||
|
||||
handler->PSendSysMessage(LANG_ITEMLIST_GUILD, itemGuid, guildName.c_str(), guildGuid, itemPos);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
uint32 resultCount = uint32(result->GetRowCount());
|
||||
|
||||
@@ -373,11 +368,11 @@ public:
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), gameObjectId, count);
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), gameObjectId, count);
|
||||
}
|
||||
else
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u",
|
||||
gameObjectId, count);
|
||||
gameObjectId, count);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -395,8 +390,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapId);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapId);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, gameObjectId, objectCount);
|
||||
@@ -431,10 +425,10 @@ public:
|
||||
ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r";
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str().c_str() : name),
|
||||
aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(),
|
||||
aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""),
|
||||
(talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",
|
||||
GUID_LOPART(aura->GetCasterGUID()));
|
||||
aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(),
|
||||
aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""),
|
||||
(talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",
|
||||
GUID_LOPART(aura->GetCasterGUID()));
|
||||
}
|
||||
|
||||
if (!args || std::string(args) != "all")
|
||||
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
// send area in "id - [name]" format
|
||||
std::ostringstream ss;
|
||||
if (handler->GetSession())
|
||||
ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[locale]<< "]|h|r";
|
||||
ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[locale] << "]|h|r";
|
||||
else
|
||||
ss << areaEntry->ID << " - " << name << ' ' << localeNames[locale];
|
||||
|
||||
@@ -1025,7 +1025,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleLookupTaxiNodeCommand(ChatHandler* handler, const char * args)
|
||||
static bool HandleLookupTaxiNodeCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -1082,10 +1082,10 @@ public:
|
||||
// send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[locale],
|
||||
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
|
||||
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[locale],
|
||||
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
|
||||
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
@@ -1126,7 +1126,7 @@ public:
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
bool limitReached = false;
|
||||
|
||||
GameTeleContainer const & teleMap = sObjectMgr->GetGameTeleMap();
|
||||
GameTeleContainer const& teleMap = sObjectMgr->GetGameTeleMap();
|
||||
for (GameTeleContainer::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
|
||||
{
|
||||
GameTele const* tele = &itr->second;
|
||||
@@ -1219,8 +1219,8 @@ public:
|
||||
char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetAcoreString(LANG_KNOWN) : "";
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
|
||||
? handler->GetAcoreString(LANG_ACTIVE)
|
||||
: "";
|
||||
? handler->GetAcoreString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr, 80, name.c_str(), targetName);
|
||||
@@ -1350,7 +1350,7 @@ public:
|
||||
int32 limit = limitStr ? atoi(limitStr) : -1;
|
||||
|
||||
if (!Utf8ToUpperOnlyLatin
|
||||
(account))
|
||||
(account))
|
||||
return false;
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
|
||||
@@ -1428,15 +1428,13 @@ public:
|
||||
}
|
||||
|
||||
if (plevel > 0 && prace > 0 && prace <= RACE_DRAENEI && pclass > 0 && pclass <= CLASS_DRUID)
|
||||
handler->PSendSysMessage(" %s (GUID %u) - %s - %s - %u%s", name.c_str(), guid, name_races[prace-1], name_classes[pclass-1], plevel, (online ? " - [ONLINE]" : ""));
|
||||
handler->PSendSysMessage(" %s (GUID %u) - %s - %s - %u%s", name.c_str(), guid, name_races[prace - 1], name_classes[pclass - 1], plevel, (online ? " - [ONLINE]" : ""));
|
||||
else
|
||||
handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid);
|
||||
++counter;
|
||||
}
|
||||
while (result2->NextRow() && (limit == -1 || counter < limit));
|
||||
} while (result2->NextRow() && (limit == -1 || counter < limit));
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
if (counter == 0) // empty accounts only
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
std::string str = handler->GetAcoreString(LANG_GLOBAL_NOTIFY);
|
||||
str += args;
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
|
||||
data << str;
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
std::string str = handler->GetAcoreString(LANG_GM_NOTIFY);
|
||||
str += args;
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
|
||||
data << str;
|
||||
sWorld->SendGlobalGMMessage(&data);
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tokens.size() != uint16(count+2))
|
||||
if (tokens.size() != uint16(count + 2))
|
||||
{
|
||||
handler->PSendSysMessage("Invalid number of nicknames for this bracket.");
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -231,8 +231,8 @@ public:
|
||||
players[cnt++] = plr;
|
||||
}
|
||||
|
||||
for (uint8 i=0; i<cnt && !error; ++i)
|
||||
for (uint8 j=i+1; j<cnt; ++j)
|
||||
for (uint8 i = 0; i < cnt && !error; ++i)
|
||||
for (uint8 j = i + 1; j < cnt; ++j)
|
||||
if (players[i]->GetGUID() == players[j]->GetGUID())
|
||||
{
|
||||
last_name = players[i]->GetName();
|
||||
@@ -311,7 +311,7 @@ public:
|
||||
|
||||
TeamId teamId1 = Player::TeamIdForRace(players[0]->getRace());
|
||||
TeamId teamId2 = (teamId1 == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE);
|
||||
for (uint8 i=0; i<cnt; ++i)
|
||||
for (uint8 i = 0; i < cnt; ++i)
|
||||
{
|
||||
Player* player = players[i];
|
||||
|
||||
@@ -430,13 +430,13 @@ public:
|
||||
handler->PSendSysMessage("no VMAP available for area info");
|
||||
|
||||
handler->PSendSysMessage(LANG_MAP_POSITION,
|
||||
object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
object->GetPhaseMask(),
|
||||
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
|
||||
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
|
||||
zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap);
|
||||
object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
|
||||
object->GetPhaseMask(),
|
||||
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
|
||||
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
|
||||
zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap);
|
||||
|
||||
LiquidData liquidStatus;
|
||||
ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus);
|
||||
@@ -601,7 +601,7 @@ public:
|
||||
else
|
||||
_player->SaveRecallPosition();
|
||||
|
||||
if (_player->TeleportTo(target->GetMapId(), target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+0.25f, _player->GetOrientation(), TELE_TO_GM_MODE, target))
|
||||
if (_player->TeleportTo(target->GetMapId(), target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 0.25f, _player->GetOrientation(), TELE_TO_GM_MODE, target))
|
||||
_player->SetPhaseMask(target->GetPhaseMask() | 1, false);
|
||||
}
|
||||
else
|
||||
@@ -696,8 +696,8 @@ public:
|
||||
|
||||
// we are in an instance, and can only summon players in our group with us as leader
|
||||
if (!handler->GetSession()->GetPlayer()->GetGroup() || !target->GetGroup() ||
|
||||
(target->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
|
||||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))
|
||||
(target->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
|
||||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))
|
||||
// the last check is a bit excessive, but let it be, just in case
|
||||
{
|
||||
handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
|
||||
@@ -738,12 +738,12 @@ public:
|
||||
|
||||
// in point where GM stay
|
||||
Player::SavePositionInDB(handler->GetSession()->GetPlayer()->GetMapId(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionX(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionY(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionZ(),
|
||||
handler->GetSession()->GetPlayer()->GetOrientation(),
|
||||
handler->GetSession()->GetPlayer()->GetZoneId(),
|
||||
targetGuid);
|
||||
handler->GetSession()->GetPlayer()->GetPositionX(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionY(),
|
||||
handler->GetSession()->GetPlayer()->GetPositionZ(),
|
||||
handler->GetSession()->GetPlayer()->GetOrientation(),
|
||||
handler->GetSession()->GetPlayer()->GetZoneId(),
|
||||
targetGuid);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -775,8 +775,8 @@ public:
|
||||
|
||||
// we are in instance, and can summon only player in our group with us as lead
|
||||
if (toInstance && (
|
||||
!handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
|
||||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())))
|
||||
!handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) ||
|
||||
(handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())))
|
||||
// the last check is a bit excessive, but let it be, just in case
|
||||
{
|
||||
handler->SendSysMessage(LANG_CANNOT_SUMMON_TO_INST);
|
||||
@@ -1032,7 +1032,7 @@ public:
|
||||
{
|
||||
uint64 guid = handler->extractGuidFromLink((char*)args);
|
||||
if (guid)
|
||||
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
|
||||
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
|
||||
|
||||
if (!obj)
|
||||
{
|
||||
@@ -1258,7 +1258,7 @@ public:
|
||||
uint32 zoneId = player->GetZoneId();
|
||||
|
||||
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(zoneId);
|
||||
if (!areaEntry || areaEntry->zone !=0)
|
||||
if (!areaEntry || areaEntry->zone != 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -1423,7 +1423,7 @@ public:
|
||||
|
||||
if (itemNameStr && itemNameStr[0])
|
||||
{
|
||||
std::string itemName = itemNameStr+1;
|
||||
std::string itemName = itemNameStr + 1;
|
||||
WorldDatabase.EscapeString(itemName);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME);
|
||||
@@ -1432,7 +1432,7 @@ public:
|
||||
|
||||
if (!result)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_COULDNOTFIND, itemNameStr+1);
|
||||
handler->PSendSysMessage(LANG_COMMAND_COULDNOTFIND, itemNameStr + 1);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1500,12 +1500,12 @@ public:
|
||||
}
|
||||
|
||||
/* [AC] Sunwell hack
|
||||
if (handler->GetSession()->GetSecurity() < SEC_ADMINISTRATOR)
|
||||
{
|
||||
handler->PSendSysMessage("You may only remove items. Adding items is available for higher GMLevel.");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
if (handler->GetSession()->GetSecurity() < SEC_ADMINISTRATOR)
|
||||
{
|
||||
handler->PSendSysMessage("You may only remove items. Adding items is available for higher GMLevel.");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
// Adding items
|
||||
uint32 noSpaceForCount = 0;
|
||||
@@ -1976,7 +1976,7 @@ public:
|
||||
// Output I. LANG_PINFO_PLAYER
|
||||
handler->PSendSysMessage(LANG_PINFO_PLAYER, target ? "" : handler->GetAcoreString(LANG_OFFLINE), nameLink.c_str(), GUID_LOPART(targetGuid));
|
||||
|
||||
// Output II. LANG_PINFO_GM_ACTIVE if character is gamemaster
|
||||
// Output II. LANG_PINFO_GM_ACTIVE if character is gamemaster
|
||||
if (target && target->IsGameMaster())
|
||||
handler->PSendSysMessage(LANG_PINFO_GM_ACTIVE);
|
||||
|
||||
@@ -2010,7 +2010,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_LEVEL_HIGH, level);
|
||||
|
||||
// Output XI. LANG_PINFO_CHR_RACE
|
||||
switch (raceid)
|
||||
switch (raceid)
|
||||
{
|
||||
case RACE_HUMAN:
|
||||
raceStr = "Human";
|
||||
@@ -2087,7 +2087,7 @@ public:
|
||||
// Output XIII. LANG_PINFO_CHR_PHASE if player is not in GM mode (GM is in every phase)
|
||||
if (target && !target->IsGameMaster()) // IsInWorld() returns false on loadingscreen, so it's more
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_PHASE, phase); // precise than just target (safer ?).
|
||||
// However, as we usually just require a target here, we use target instead.
|
||||
// However, as we usually just require a target here, we use target instead.
|
||||
// Output XIV. LANG_PINFO_CHR_MONEY
|
||||
uint32 gold = money / GOLD;
|
||||
uint32 silv = (money % GOLD) / SILVER;
|
||||
@@ -2144,7 +2144,7 @@ public:
|
||||
|
||||
// Output XXI. LANG_INFO_CHR_MAILS if at least one mail is given
|
||||
if (totalmail >= 1)
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAILS, readmail, totalmail);
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAILS, readmail, totalmail);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2324,7 +2324,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char *nameStr = strtok((char*)args, "");
|
||||
char* nameStr = strtok((char*)args, "");
|
||||
if (!nameStr)
|
||||
return false;
|
||||
|
||||
@@ -2349,7 +2349,7 @@ public:
|
||||
// helper for mutehistory
|
||||
static bool HandleMuteInfoHelper(uint32 accountId, char const* accountName, ChatHandler* handler)
|
||||
{
|
||||
PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO);
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO);
|
||||
stmt->setUInt16(0, accountId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
@@ -2421,53 +2421,53 @@ public:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CONFUSED);
|
||||
break;
|
||||
case CHASE_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<ChaseMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<ChaseMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<ChaseMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<ChaseMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
|
||||
break;
|
||||
}
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
|
||||
break;
|
||||
}
|
||||
case FOLLOW_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<FollowMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<FollowMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<FollowMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<FollowMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
|
||||
break;
|
||||
}
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName().c_str(), target->GetGUIDLow());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName().c_str(), target->GetGUIDLow());
|
||||
break;
|
||||
}
|
||||
case HOME_MOTION_TYPE:
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_UNIT)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
|
||||
else
|
||||
handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_UNIT)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
|
||||
else
|
||||
handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
|
||||
break;
|
||||
}
|
||||
case FLIGHT_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FLIGHT);
|
||||
break;
|
||||
case POINT_MOTION_TYPE:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
|
||||
break;
|
||||
}
|
||||
{
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
|
||||
break;
|
||||
}
|
||||
case FLEEING_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FEAR);
|
||||
break;
|
||||
@@ -2638,7 +2638,7 @@ public:
|
||||
//- TODO: Fix poor design
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
MailDraft(subject, text)
|
||||
.SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender);
|
||||
.SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
@@ -2796,8 +2796,8 @@ public:
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
MailDraft(subject, text)
|
||||
.AddMoney(money)
|
||||
.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
|
||||
.AddMoney(money)
|
||||
.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
@@ -2885,7 +2885,7 @@ public:
|
||||
}
|
||||
|
||||
// prepare visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel() - 1);
|
||||
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
|
||||
// this enables pet details window (Shift+P)
|
||||
@@ -3028,7 +3028,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleUnFreezeCommand(ChatHandler* handler, char const*args)
|
||||
static bool HandleUnFreezeCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string name;
|
||||
Player* player;
|
||||
|
||||
@@ -103,9 +103,9 @@ public:
|
||||
handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : useStraightLine ? "Raycast" : "SmoothPath");
|
||||
handler->PSendSysMessage("Result: %s - Length: " SZFMTD " - Type: %u", (result ? "true" : "false"), pointPath.size(), path.GetPathType());
|
||||
|
||||
G3D::Vector3 const &start = path.GetStartPosition();
|
||||
G3D::Vector3 const &end = path.GetEndPosition();
|
||||
G3D::Vector3 const &actualEnd = path.GetActualEndPosition();
|
||||
G3D::Vector3 const& start = path.GetStartPosition();
|
||||
G3D::Vector3 const& end = path.GetEndPosition();
|
||||
G3D::Vector3 const& actualEnd = path.GetActualEndPosition();
|
||||
|
||||
handler->PSendSysMessage("StartPosition (%.3f, %.3f, %.3f)", start.x, start.y, start.z);
|
||||
handler->PSendSysMessage("EndPosition (%.3f, %.3f, %.3f)", end.x, end.y, end.z);
|
||||
|
||||
@@ -167,8 +167,8 @@ public:
|
||||
// int32 manam = atoi(pmanaMax);
|
||||
// int32 mana = atoi(pmana);
|
||||
|
||||
int32 energy = atoi((char*)args)*10;
|
||||
int32 energym = atoi((char*)args)*10;
|
||||
int32 energy = atoi((char*)args) * 10;
|
||||
int32 energym = atoi((char*)args) * 10;
|
||||
|
||||
if (energy <= 0 || energym <= 0 || energym < energy)
|
||||
{
|
||||
@@ -189,9 +189,9 @@ public:
|
||||
if (handler->HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energy/10, energym/10);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energy / 10, energym / 10);
|
||||
if (handler->needReportToTarget(target))
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy/10, energym/10);
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy / 10, energym / 10);
|
||||
|
||||
target->SetMaxPower(POWER_ENERGY, energym);
|
||||
target->SetPower(POWER_ENERGY, energy);
|
||||
@@ -220,8 +220,8 @@ public:
|
||||
// int32 manam = atoi(pmanaMax);
|
||||
// int32 mana = atoi(pmana);
|
||||
|
||||
int32 rage = atoi((char*)args)*10;
|
||||
int32 ragem = atoi((char*)args)*10;
|
||||
int32 rage = atoi((char*)args) * 10;
|
||||
int32 ragem = atoi((char*)args) * 10;
|
||||
|
||||
if (rage <= 0 || ragem <= 0 || ragem < rage)
|
||||
{
|
||||
@@ -242,9 +242,9 @@ public:
|
||||
if (handler->HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), rage/10, ragem/10);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), rage / 10, ragem / 10);
|
||||
if (handler->needReportToTarget(target))
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage/10, ragem/10);
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage / 10, ragem / 10);
|
||||
|
||||
target->SetMaxPower(POWER_RAGE, ragem);
|
||||
target->SetPower(POWER_RAGE, rage);
|
||||
@@ -258,8 +258,8 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
int32 rune = atoi((char*)args)*10;
|
||||
int32 runem = atoi((char*)args)*10;
|
||||
int32 rune = atoi((char*)args) * 10;
|
||||
int32 runem = atoi((char*)args) * 10;
|
||||
|
||||
if (rune <= 0 || runem <= 0 || runem < rune)
|
||||
{
|
||||
@@ -276,9 +276,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target).c_str(), rune/10, runem/10);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target).c_str(), rune / 10, runem / 10);
|
||||
if (handler->needReportToTarget(target))
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune/10, runem/10);
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune / 10, runem / 10);
|
||||
|
||||
target->SetMaxPower(POWER_RUNIC_POWER, runem);
|
||||
target->SetPower(POWER_RUNIC_POWER, rune);
|
||||
@@ -315,7 +315,7 @@ public:
|
||||
uint32 factionid = atoi(pfactionid);
|
||||
uint32 flag;
|
||||
|
||||
char *pflag = strtok(nullptr, " ");
|
||||
char* pflag = strtok(nullptr, " ");
|
||||
if (!pflag)
|
||||
flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
|
||||
else
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
if (handler->needReportToTarget(target))
|
||||
(ChatHandler(target->GetSession())).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink().c_str(), spellflatid, val, mark);
|
||||
|
||||
WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1+1+2+2));
|
||||
WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1 + 1 + 2 + 2));
|
||||
data << uint8(spellflatid);
|
||||
data << uint8(op);
|
||||
data << uint16(val);
|
||||
@@ -736,217 +736,217 @@ public:
|
||||
num = atoi((char*)args);
|
||||
switch (num)
|
||||
{
|
||||
case 1:
|
||||
mId=14340;
|
||||
break;
|
||||
case 2:
|
||||
mId=4806;
|
||||
break;
|
||||
case 3:
|
||||
mId=6471;
|
||||
break;
|
||||
case 4:
|
||||
mId=12345;
|
||||
break;
|
||||
case 5:
|
||||
mId=6472;
|
||||
break;
|
||||
case 6:
|
||||
mId=6473;
|
||||
break;
|
||||
case 7:
|
||||
mId=10670;
|
||||
break;
|
||||
case 8:
|
||||
mId=10719;
|
||||
break;
|
||||
case 9:
|
||||
mId=10671;
|
||||
break;
|
||||
case 10:
|
||||
mId=10672;
|
||||
break;
|
||||
case 11:
|
||||
mId=10720;
|
||||
break;
|
||||
case 12:
|
||||
mId=14349;
|
||||
break;
|
||||
case 13:
|
||||
mId=11641;
|
||||
break;
|
||||
case 14:
|
||||
mId=12244;
|
||||
break;
|
||||
case 15:
|
||||
mId=12242;
|
||||
break;
|
||||
case 16:
|
||||
mId=14578;
|
||||
break;
|
||||
case 17:
|
||||
mId=14579;
|
||||
break;
|
||||
case 18:
|
||||
mId=14349;
|
||||
break;
|
||||
case 19:
|
||||
mId=12245;
|
||||
break;
|
||||
case 20:
|
||||
mId=14335;
|
||||
break;
|
||||
case 21:
|
||||
mId=207;
|
||||
break;
|
||||
case 22:
|
||||
mId=2328;
|
||||
break;
|
||||
case 23:
|
||||
mId=2327;
|
||||
break;
|
||||
case 24:
|
||||
mId=2326;
|
||||
break;
|
||||
case 25:
|
||||
mId=14573;
|
||||
break;
|
||||
case 26:
|
||||
mId=14574;
|
||||
break;
|
||||
case 27:
|
||||
mId=14575;
|
||||
break;
|
||||
case 28:
|
||||
mId=604;
|
||||
break;
|
||||
case 29:
|
||||
mId=1166;
|
||||
break;
|
||||
case 30:
|
||||
mId=2402;
|
||||
break;
|
||||
case 31:
|
||||
mId=2410;
|
||||
break;
|
||||
case 32:
|
||||
mId=2409;
|
||||
break;
|
||||
case 33:
|
||||
mId=2408;
|
||||
break;
|
||||
case 34:
|
||||
mId=2405;
|
||||
break;
|
||||
case 35:
|
||||
mId=14337;
|
||||
break;
|
||||
case 36:
|
||||
mId=6569;
|
||||
break;
|
||||
case 37:
|
||||
mId=10661;
|
||||
break;
|
||||
case 38:
|
||||
mId=10666;
|
||||
break;
|
||||
case 39:
|
||||
mId=9473;
|
||||
break;
|
||||
case 40:
|
||||
mId=9476;
|
||||
break;
|
||||
case 41:
|
||||
mId=9474;
|
||||
break;
|
||||
case 42:
|
||||
mId=14374;
|
||||
break;
|
||||
case 43:
|
||||
mId=14376;
|
||||
break;
|
||||
case 44:
|
||||
mId=14377;
|
||||
break;
|
||||
case 45:
|
||||
mId=2404;
|
||||
break;
|
||||
case 46:
|
||||
mId=2784;
|
||||
break;
|
||||
case 47:
|
||||
mId=2787;
|
||||
break;
|
||||
case 48:
|
||||
mId=2785;
|
||||
break;
|
||||
case 49:
|
||||
mId=2736;
|
||||
break;
|
||||
case 50:
|
||||
mId=2786;
|
||||
break;
|
||||
case 51:
|
||||
mId=14347;
|
||||
break;
|
||||
case 52:
|
||||
mId=14346;
|
||||
break;
|
||||
case 53:
|
||||
mId=14576;
|
||||
break;
|
||||
case 54:
|
||||
mId=9695;
|
||||
break;
|
||||
case 55:
|
||||
mId=9991;
|
||||
break;
|
||||
case 56:
|
||||
mId=6448;
|
||||
break;
|
||||
case 57:
|
||||
mId=6444;
|
||||
break;
|
||||
case 58:
|
||||
mId=6080;
|
||||
break;
|
||||
case 59:
|
||||
mId=6447;
|
||||
break;
|
||||
case 60:
|
||||
mId=4805;
|
||||
break;
|
||||
case 61:
|
||||
mId=9714;
|
||||
break;
|
||||
case 62:
|
||||
mId=6448;
|
||||
break;
|
||||
case 63:
|
||||
mId=6442;
|
||||
break;
|
||||
case 64:
|
||||
mId=14632;
|
||||
break;
|
||||
case 65:
|
||||
mId=14332;
|
||||
break;
|
||||
case 66:
|
||||
mId=14331;
|
||||
break;
|
||||
case 67:
|
||||
mId=8469;
|
||||
break;
|
||||
case 68:
|
||||
mId=2830;
|
||||
break;
|
||||
case 69:
|
||||
mId=2346;
|
||||
break;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_NO_MOUNT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
case 1:
|
||||
mId = 14340;
|
||||
break;
|
||||
case 2:
|
||||
mId = 4806;
|
||||
break;
|
||||
case 3:
|
||||
mId = 6471;
|
||||
break;
|
||||
case 4:
|
||||
mId = 12345;
|
||||
break;
|
||||
case 5:
|
||||
mId = 6472;
|
||||
break;
|
||||
case 6:
|
||||
mId = 6473;
|
||||
break;
|
||||
case 7:
|
||||
mId = 10670;
|
||||
break;
|
||||
case 8:
|
||||
mId = 10719;
|
||||
break;
|
||||
case 9:
|
||||
mId = 10671;
|
||||
break;
|
||||
case 10:
|
||||
mId = 10672;
|
||||
break;
|
||||
case 11:
|
||||
mId = 10720;
|
||||
break;
|
||||
case 12:
|
||||
mId = 14349;
|
||||
break;
|
||||
case 13:
|
||||
mId = 11641;
|
||||
break;
|
||||
case 14:
|
||||
mId = 12244;
|
||||
break;
|
||||
case 15:
|
||||
mId = 12242;
|
||||
break;
|
||||
case 16:
|
||||
mId = 14578;
|
||||
break;
|
||||
case 17:
|
||||
mId = 14579;
|
||||
break;
|
||||
case 18:
|
||||
mId = 14349;
|
||||
break;
|
||||
case 19:
|
||||
mId = 12245;
|
||||
break;
|
||||
case 20:
|
||||
mId = 14335;
|
||||
break;
|
||||
case 21:
|
||||
mId = 207;
|
||||
break;
|
||||
case 22:
|
||||
mId = 2328;
|
||||
break;
|
||||
case 23:
|
||||
mId = 2327;
|
||||
break;
|
||||
case 24:
|
||||
mId = 2326;
|
||||
break;
|
||||
case 25:
|
||||
mId = 14573;
|
||||
break;
|
||||
case 26:
|
||||
mId = 14574;
|
||||
break;
|
||||
case 27:
|
||||
mId = 14575;
|
||||
break;
|
||||
case 28:
|
||||
mId = 604;
|
||||
break;
|
||||
case 29:
|
||||
mId = 1166;
|
||||
break;
|
||||
case 30:
|
||||
mId = 2402;
|
||||
break;
|
||||
case 31:
|
||||
mId = 2410;
|
||||
break;
|
||||
case 32:
|
||||
mId = 2409;
|
||||
break;
|
||||
case 33:
|
||||
mId = 2408;
|
||||
break;
|
||||
case 34:
|
||||
mId = 2405;
|
||||
break;
|
||||
case 35:
|
||||
mId = 14337;
|
||||
break;
|
||||
case 36:
|
||||
mId = 6569;
|
||||
break;
|
||||
case 37:
|
||||
mId = 10661;
|
||||
break;
|
||||
case 38:
|
||||
mId = 10666;
|
||||
break;
|
||||
case 39:
|
||||
mId = 9473;
|
||||
break;
|
||||
case 40:
|
||||
mId = 9476;
|
||||
break;
|
||||
case 41:
|
||||
mId = 9474;
|
||||
break;
|
||||
case 42:
|
||||
mId = 14374;
|
||||
break;
|
||||
case 43:
|
||||
mId = 14376;
|
||||
break;
|
||||
case 44:
|
||||
mId = 14377;
|
||||
break;
|
||||
case 45:
|
||||
mId = 2404;
|
||||
break;
|
||||
case 46:
|
||||
mId = 2784;
|
||||
break;
|
||||
case 47:
|
||||
mId = 2787;
|
||||
break;
|
||||
case 48:
|
||||
mId = 2785;
|
||||
break;
|
||||
case 49:
|
||||
mId = 2736;
|
||||
break;
|
||||
case 50:
|
||||
mId = 2786;
|
||||
break;
|
||||
case 51:
|
||||
mId = 14347;
|
||||
break;
|
||||
case 52:
|
||||
mId = 14346;
|
||||
break;
|
||||
case 53:
|
||||
mId = 14576;
|
||||
break;
|
||||
case 54:
|
||||
mId = 9695;
|
||||
break;
|
||||
case 55:
|
||||
mId = 9991;
|
||||
break;
|
||||
case 56:
|
||||
mId = 6448;
|
||||
break;
|
||||
case 57:
|
||||
mId = 6444;
|
||||
break;
|
||||
case 58:
|
||||
mId = 6080;
|
||||
break;
|
||||
case 59:
|
||||
mId = 6447;
|
||||
break;
|
||||
case 60:
|
||||
mId = 4805;
|
||||
break;
|
||||
case 61:
|
||||
mId = 9714;
|
||||
break;
|
||||
case 62:
|
||||
mId = 6448;
|
||||
break;
|
||||
case 63:
|
||||
mId = 6442;
|
||||
break;
|
||||
case 64:
|
||||
mId = 14632;
|
||||
break;
|
||||
case 65:
|
||||
mId = 14332;
|
||||
break;
|
||||
case 66:
|
||||
mId = 14331;
|
||||
break;
|
||||
case 67:
|
||||
mId = 8469;
|
||||
break;
|
||||
case 68:
|
||||
mId = 2830;
|
||||
break;
|
||||
case 69:
|
||||
mId = 2346;
|
||||
break;
|
||||
default:
|
||||
handler->SendSysMessage(LANG_NO_MOUNT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
@@ -968,14 +968,14 @@ public:
|
||||
target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
|
||||
target->Mount(mId);
|
||||
|
||||
WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8+4+1+4));
|
||||
WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8 + 4 + 1 + 4));
|
||||
data.append(target->GetPackGUID());
|
||||
data << (uint32)0;
|
||||
data << (uint8)0; //new 2.1.0
|
||||
data << float(speed);
|
||||
target->SendMessageToSet(&data, true);
|
||||
|
||||
data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8+4+4));
|
||||
data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8 + 4 + 4));
|
||||
data.append(target->GetPackGUID());
|
||||
data << (uint32)0;
|
||||
data << float(speed);
|
||||
@@ -1100,14 +1100,14 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target->HasFlag(field, (1<<(bit-1))))
|
||||
if (target->HasFlag(field, (1 << (bit - 1))))
|
||||
{
|
||||
target->RemoveFlag(field, (1<<(bit-1)));
|
||||
target->RemoveFlag(field, (1 << (bit - 1)));
|
||||
handler->PSendSysMessage(LANG_REMOVE_BIT, bit, field);
|
||||
}
|
||||
else
|
||||
{
|
||||
target->SetFlag(field, (1<<(bit-1)));
|
||||
target->SetFlag(field, (1 << (bit - 1)));
|
||||
handler->PSendSysMessage(LANG_SET_BIT, bit, field);
|
||||
}
|
||||
return true;
|
||||
@@ -1178,7 +1178,7 @@ public:
|
||||
uint32 factionId = atoi(factionTxt);
|
||||
|
||||
int32 amount = 0;
|
||||
char *rankTxt = strtok(nullptr, " ");
|
||||
char* rankTxt = strtok(nullptr, " ");
|
||||
if (!factionTxt || !rankTxt)
|
||||
return false;
|
||||
|
||||
@@ -1207,13 +1207,13 @@ public:
|
||||
|
||||
if (wrank.substr(0, wrankStr.size()) == wrankStr)
|
||||
{
|
||||
char *deltaTxt = strtok(nullptr, " ");
|
||||
char* deltaTxt = strtok(nullptr, " ");
|
||||
if (deltaTxt)
|
||||
{
|
||||
int32 delta = atoi(deltaTxt);
|
||||
if ((delta < 0) || (delta > ReputationMgr::PointsInRank[r] -1))
|
||||
if ((delta < 0) || (delta > ReputationMgr::PointsInRank[r] - 1))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_DELTA, (ReputationMgr::PointsInRank[r]-1));
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_DELTA, (ReputationMgr::PointsInRank[r] - 1));
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1250,7 +1250,7 @@ public:
|
||||
target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
|
||||
target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
|
||||
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId,
|
||||
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
|
||||
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
|
||||
return true;
|
||||
}
|
||||
static bool HandleMorphTargetCommand(ChatHandler* handler, const char* args)
|
||||
|
||||
@@ -68,38 +68,38 @@ struct MechanicImmune
|
||||
|
||||
MechanicImmune const mechanicImmunes[MAX_MECHANIC] =
|
||||
{
|
||||
{ MECHANIC_NONE , "MECHANIC_NONE" },
|
||||
{ MECHANIC_CHARM , "MECHANIC_CHARM" },
|
||||
{ MECHANIC_DISORIENTED , "MECHANIC_DISORIENTED" },
|
||||
{ MECHANIC_DISARM , "MECHANIC_DISARM" },
|
||||
{ MECHANIC_DISTRACT , "MECHANIC_DISTRACT" },
|
||||
{ MECHANIC_FEAR , "MECHANIC_FEAR" },
|
||||
{ MECHANIC_GRIP , "MECHANIC_GRIP" },
|
||||
{ MECHANIC_ROOT , "MECHANIC_ROOT" },
|
||||
{ MECHANIC_SLOW_ATTACK , "MECHANIC_SLOW_ATTACK" },
|
||||
{ MECHANIC_SILENCE , "MECHANIC_SILENCE" },
|
||||
{ MECHANIC_SLEEP , "MECHANIC_SLEEP" },
|
||||
{ MECHANIC_SNARE , "MECHANIC_SNARE" },
|
||||
{ MECHANIC_STUN , "MECHANIC_STUN" },
|
||||
{ MECHANIC_FREEZE , "MECHANIC_FREEZE" },
|
||||
{ MECHANIC_KNOCKOUT , "MECHANIC_KNOCKOUT" },
|
||||
{ MECHANIC_BLEED , "MECHANIC_BLEED" },
|
||||
{ MECHANIC_BANDAGE , "MECHANIC_BANDAGE" },
|
||||
{ MECHANIC_POLYMORPH , "MECHANIC_POLYMORPH" },
|
||||
{ MECHANIC_BANISH , "MECHANIC_BANISH" },
|
||||
{ MECHANIC_SHIELD , "MECHANIC_SHIELD" },
|
||||
{ MECHANIC_SHACKLE , "MECHANIC_SHACKLE" },
|
||||
{ MECHANIC_MOUNT , "MECHANIC_MOUNT" },
|
||||
{ MECHANIC_INFECTED , "MECHANIC_INFECTED" },
|
||||
{ MECHANIC_TURN , "MECHANIC_TURN" },
|
||||
{ MECHANIC_HORROR , "MECHANIC_HORROR" },
|
||||
{ MECHANIC_INVULNERABILITY , "MECHANIC_INVULNERABILITY" },
|
||||
{ MECHANIC_INTERRUPT , "MECHANIC_INTERRUPT" },
|
||||
{ MECHANIC_DAZE , "MECHANIC_DAZE" },
|
||||
{ MECHANIC_DISCOVERY , "MECHANIC_DISCOVERY" },
|
||||
{ MECHANIC_IMMUNE_SHIELD , "MECHANIC_IMMUNE_SHIELD" },
|
||||
{ MECHANIC_SAPPED , "MECHANIC_SAPPED" },
|
||||
{ MECHANIC_ENRAGED , "MECHANIC_ENRAGED" },
|
||||
{ MECHANIC_NONE, "MECHANIC_NONE" },
|
||||
{ MECHANIC_CHARM, "MECHANIC_CHARM" },
|
||||
{ MECHANIC_DISORIENTED, "MECHANIC_DISORIENTED" },
|
||||
{ MECHANIC_DISARM, "MECHANIC_DISARM" },
|
||||
{ MECHANIC_DISTRACT, "MECHANIC_DISTRACT" },
|
||||
{ MECHANIC_FEAR, "MECHANIC_FEAR" },
|
||||
{ MECHANIC_GRIP, "MECHANIC_GRIP" },
|
||||
{ MECHANIC_ROOT, "MECHANIC_ROOT" },
|
||||
{ MECHANIC_SLOW_ATTACK, "MECHANIC_SLOW_ATTACK" },
|
||||
{ MECHANIC_SILENCE, "MECHANIC_SILENCE" },
|
||||
{ MECHANIC_SLEEP, "MECHANIC_SLEEP" },
|
||||
{ MECHANIC_SNARE, "MECHANIC_SNARE" },
|
||||
{ MECHANIC_STUN, "MECHANIC_STUN" },
|
||||
{ MECHANIC_FREEZE, "MECHANIC_FREEZE" },
|
||||
{ MECHANIC_KNOCKOUT, "MECHANIC_KNOCKOUT" },
|
||||
{ MECHANIC_BLEED, "MECHANIC_BLEED" },
|
||||
{ MECHANIC_BANDAGE, "MECHANIC_BANDAGE" },
|
||||
{ MECHANIC_POLYMORPH, "MECHANIC_POLYMORPH" },
|
||||
{ MECHANIC_BANISH, "MECHANIC_BANISH" },
|
||||
{ MECHANIC_SHIELD, "MECHANIC_SHIELD" },
|
||||
{ MECHANIC_SHACKLE, "MECHANIC_SHACKLE" },
|
||||
{ MECHANIC_MOUNT, "MECHANIC_MOUNT" },
|
||||
{ MECHANIC_INFECTED, "MECHANIC_INFECTED" },
|
||||
{ MECHANIC_TURN, "MECHANIC_TURN" },
|
||||
{ MECHANIC_HORROR, "MECHANIC_HORROR" },
|
||||
{ MECHANIC_INVULNERABILITY, "MECHANIC_INVULNERABILITY" },
|
||||
{ MECHANIC_INTERRUPT, "MECHANIC_INTERRUPT" },
|
||||
{ MECHANIC_DAZE, "MECHANIC_DAZE" },
|
||||
{ MECHANIC_DISCOVERY, "MECHANIC_DISCOVERY" },
|
||||
{ MECHANIC_IMMUNE_SHIELD, "MECHANIC_IMMUNE_SHIELD" },
|
||||
{ MECHANIC_SAPPED, "MECHANIC_SAPPED" },
|
||||
{ MECHANIC_ENRAGED, "MECHANIC_ENRAGED" },
|
||||
};
|
||||
|
||||
class npc_commandscript : public CommandScript
|
||||
@@ -442,15 +442,15 @@ public:
|
||||
{
|
||||
if (((Pet*)creature)->getPetType() == HUNTER_PET)
|
||||
{
|
||||
creature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr->GetXPForLevel(lvl)/4);
|
||||
creature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr->GetXPForLevel(lvl) / 4);
|
||||
creature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
}
|
||||
((Pet*)creature)->GivePetLevel(lvl);
|
||||
}
|
||||
else
|
||||
{
|
||||
creature->SetMaxHealth(100 + 30*lvl);
|
||||
creature->SetHealth(100 + 30*lvl);
|
||||
creature->SetMaxHealth(100 + 30 * lvl);
|
||||
creature->SetHealth(100 + 30 * lvl);
|
||||
creature->SetLevel(lvl);
|
||||
creature->SaveToDB();
|
||||
}
|
||||
@@ -722,7 +722,7 @@ public:
|
||||
uint32 nativeid = target->GetNativeDisplayId();
|
||||
uint32 Entry = target->GetEntry();
|
||||
|
||||
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(nullptr);
|
||||
int64 curRespawnDelay = target->GetRespawnTimeEx() - time(nullptr);
|
||||
if (curRespawnDelay < 0)
|
||||
curRespawnDelay = 0;
|
||||
std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
|
||||
@@ -791,8 +791,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, creatureTemplate->Name.c_str(), x, y, z, mapId);
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_NEAR_NPC_MESSAGE, distance, count);
|
||||
@@ -1122,7 +1121,7 @@ public:
|
||||
}
|
||||
|
||||
MovementGeneratorType mtype = IDLE_MOTION_TYPE;
|
||||
if (option >0.0f)
|
||||
if (option > 0.0f)
|
||||
mtype = RANDOM_MOTION_TYPE;
|
||||
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
@@ -1214,9 +1213,15 @@ public:
|
||||
char lastchar = args[strlen(args) - 1];
|
||||
switch (lastchar)
|
||||
{
|
||||
case '?': creature->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); break;
|
||||
case '!': creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); break;
|
||||
default: creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break;
|
||||
case '?':
|
||||
creature->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION);
|
||||
break;
|
||||
case '!':
|
||||
creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
|
||||
break;
|
||||
default:
|
||||
creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1386,7 +1391,7 @@ public:
|
||||
// place pet before player
|
||||
float x, y, z;
|
||||
player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize(), CONTACT_DISTANCE);
|
||||
pet->Relocate(x, y, z, M_PI-player->GetOrientation());
|
||||
pet->Relocate(x, y, z, M_PI - player->GetOrientation());
|
||||
|
||||
// set pet to defensive mode by default (some classes can't control controlled pets in fact).
|
||||
pet->SetReactState(REACT_DEFENSIVE);
|
||||
@@ -1442,7 +1447,7 @@ public:
|
||||
|
||||
group_member = new FormationInfo;
|
||||
group_member->follow_angle = (creature->GetAngle(chr) - chr->GetOrientation()) * 180 / M_PI;
|
||||
group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - creature->GetPositionX(), int(2))+pow(chr->GetPositionY() - creature->GetPositionY(), int(2)));
|
||||
group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - creature->GetPositionX(), int(2)) + pow(chr->GetPositionY() - creature->GetPositionY(), int(2)));
|
||||
group_member->leaderGUID = leaderGUID;
|
||||
group_member->groupAI = 0;
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ public:
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player->IsActiveQuest(entry))
|
||||
|
||||
if (player->IsActiveQuest(entry))
|
||||
{
|
||||
handler->PSendSysMessage("This quest is already active!");
|
||||
return false;
|
||||
@@ -181,11 +181,11 @@ public:
|
||||
uint32 curItemCount = player->GetItemCount(id, true);
|
||||
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, id, count-curItemCount);
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, id, count - curItemCount);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
Item* item = player->StoreNewItem(dest, id, true);
|
||||
player->SendNewItem(item, count-curItemCount, true, false);
|
||||
player->SendNewItem(item, count - curItemCount, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
static bool HandleReloadAllNpcCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
if (*args != 'a') // will be reloaded from all_gossips
|
||||
HandleReloadNpcTrainerCommand(handler, "a");
|
||||
HandleReloadNpcTrainerCommand(handler, "a");
|
||||
HandleReloadNpcVendorCommand(handler, "a");
|
||||
HandleReloadPointsOfInterestCommand(handler, "a");
|
||||
HandleReloadSpellClickSpellsCommand(handler, "a");
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
HandleReloadGossipMenuCommand(handler, "a");
|
||||
HandleReloadGossipMenuOptionCommand(handler, "a");
|
||||
if (*args != 'a') // already reload from all_scripts
|
||||
HandleReloadPointsOfInterestCommand(handler, "a");
|
||||
HandleReloadPointsOfInterestCommand(handler, "a");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ public:
|
||||
cInfo->SkinLootId = fields[45].GetUInt32();
|
||||
|
||||
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
cInfo->resistance[i] = fields[46 + i -1].GetUInt16();
|
||||
cInfo->resistance[i] = fields[46 + i - 1].GetUInt16();
|
||||
|
||||
cInfo->spells[0] = fields[52].GetUInt32();
|
||||
cInfo->spells[1] = fields[53].GetUInt32();
|
||||
|
||||
@@ -119,8 +119,8 @@ public:
|
||||
|
||||
// set starting level
|
||||
uint32 startLevel = target->getClass() != CLASS_DEATH_KNIGHT
|
||||
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
|
||||
target->_ApplyAllLevelScaleItemMods(false);
|
||||
target->SetLevel(startLevel);
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS);
|
||||
sWorld->SendWorldText(LANG_RESETALL_TALENTS);
|
||||
if (!handler->GetSession())
|
||||
handler->SendSysMessage(LANG_RESETALL_TALENTS);
|
||||
handler->SendSysMessage(LANG_RESETALL_TALENTS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -31,25 +31,25 @@ public:
|
||||
static std::vector<ChatCommand> serverIdleRestartCommandTable =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "" }
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> serverIdleShutdownCommandTable =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "" }
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> serverRestartCommandTable =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "" }
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> serverShutdownCommandTable =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "" }
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> serverSetCommandTable =
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
{ "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "server", SEC_PLAYER, true, nullptr, "", serverCommandTable }
|
||||
};
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
else
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, char const* args)
|
||||
@@ -273,7 +273,7 @@ public:
|
||||
}
|
||||
else
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE);
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Exit the realm
|
||||
|
||||
@@ -152,7 +152,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
|
||||
const Unit::VisibleAuraMap* va = player->GetVisibleAuras();
|
||||
for (Unit::VisibleAuraMap::const_iterator itr = va->begin(); itr != va->end(); ++itr)
|
||||
if (Aura* aura = itr->second->GetBase())
|
||||
if (!itr->second->IsPositive() && !aura->IsPermanent() && aura->GetDuration() < HOUR*IN_MILLISECONDS)
|
||||
if (!itr->second->IsPositive() && !aura->IsPermanent() && aura->GetDuration() < HOUR * IN_MILLISECONDS)
|
||||
{
|
||||
switch (aura->GetSpellInfo()->Id)
|
||||
{
|
||||
@@ -180,7 +180,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
|
||||
|
||||
bool bgPreparation = false;
|
||||
if ((!handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS) ||
|
||||
(handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS))
|
||||
(handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS))
|
||||
{
|
||||
bgPreparation = true;
|
||||
handler->SendSysMessage("Arena is not in progress yet. You will be invited as soon as it starts.");
|
||||
@@ -192,7 +192,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
|
||||
{
|
||||
handler->PSendSysMessage("To spectate, please fix the following:");
|
||||
for (std::list<std::string>::const_iterator itr = errors.begin(); itr != errors.end(); ++itr)
|
||||
handler->PSendSysMessage("- %s",(*itr).c_str());
|
||||
handler->PSendSysMessage("- %s", (*itr).c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -203,7 +203,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c
|
||||
player->SetPendingSpectatorForBG(spectate->GetBattlegroundId());
|
||||
player->SetBattlegroundId(spectate->GetBattlegroundId(), spectate->GetBattlegroundTypeId(), PLAYER_MAX_BATTLEGROUND_QUEUES, false, false, TEAM_NEUTRAL);
|
||||
player->SetEntryPoint();
|
||||
float z = spectate->GetMapId() == 618 ? std::max(28.27f, spectate->GetPositionZ()+0.25f) : spectate->GetPositionZ()+0.25f;
|
||||
float z = spectate->GetMapId() == 618 ? std::max(28.27f, spectate->GetPositionZ() + 0.25f) : spectate->GetPositionZ() + 0.25f;
|
||||
player->TeleportTo(spectate->GetMapId(), spectate->GetPositionX(), spectate->GetPositionY(), z, spectate->GetOrientation(), TELE_TO_GM_MODE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
GameTele const* tele = handler->extractGameTeleFromLink((char*)args);
|
||||
if (!tele)
|
||||
{
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
|
||||
handler->PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), handler->GetAcoreString(LANG_OFFLINE), tele->name.c_str());
|
||||
Player::SavePositionInDB(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation,
|
||||
sMapMgr->GetZoneId(tele->mapId, tele->position_x, tele->position_y, tele->position_z), target_guid);
|
||||
sMapMgr->GetZoneId(tele->mapId, tele->position_x, tele->position_y, tele->position_z), target_guid);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
|
||||
std::string const assignedName = ticket->GetAssignedToName();
|
||||
std::string msg = ticket->FormatMessageString(*handler, assignedName.empty() ? nullptr : assignedName.c_str(), nullptr, nullptr, nullptr);
|
||||
|
||||
|
||||
msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName().c_str() : "Console", comment);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
@@ -401,7 +401,7 @@ public:
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
std::string msg = ticket->FormatMessageString(*handler, nullptr, assignedTo.c_str(),
|
||||
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", nullptr);
|
||||
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", nullptr);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
return true;
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
uint32 maxpathid = result->Fetch()->GetInt32();
|
||||
pathid = maxpathid+1;
|
||||
pathid = maxpathid + 1;
|
||||
handler->PSendSysMessage("%s%s|r", "|cff00ff00", "New path started.");
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
|
||||
handler->PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point+1, "|r|cff00ff00 created. ");
|
||||
handler->PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point + 1, "|r|cff00ff00 created. ");
|
||||
return true;
|
||||
} // HandleWpAddCommand
|
||||
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
|
||||
handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: |r|cff00ffff", id+1);
|
||||
handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: |r|cff00ffff", id + 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -365,8 +365,7 @@ public:
|
||||
a11 = fields[9].GetFloat();
|
||||
|
||||
handler->PSendSysMessage("|cffff33ffid:|r|cff00ffff %u|r|cff00ff00, guid: |r|cff00ffff%u|r|cff00ff00, delay: |r|cff00ffff%u|r|cff00ff00, command: |r|cff00ffff%u|r|cff00ff00, datalong: |r|cff00ffff%u|r|cff00ff00, datalong2: |r|cff00ffff%u|r|cff00ff00, datatext: |r|cff00ffff%s|r|cff00ff00, posx: |r|cff00ffff%f|r|cff00ff00, posy: |r|cff00ffff%f|r|cff00ff00, posz: |r|cff00ffff%f|r|cff00ff00, orientation: |r|cff00ffff%f|r", id, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
if (show == "del")
|
||||
@@ -428,8 +427,8 @@ public:
|
||||
std::string arg_string = arg_2;
|
||||
|
||||
if ((arg_string != "setid") && (arg_string != "delay") && (arg_string != "command")
|
||||
&& (arg_string != "datalong") && (arg_string != "datalong2") && (arg_string != "dataint") && (arg_string != "posx")
|
||||
&& (arg_string != "posy") && (arg_string != "posz") && (arg_string != "orientation"))
|
||||
&& (arg_string != "datalong") && (arg_string != "datalong2") && (arg_string != "dataint") && (arg_string != "posx")
|
||||
&& (arg_string != "posy") && (arg_string != "posz") && (arg_string != "orientation"))
|
||||
{
|
||||
handler->SendSysMessage("|cffff33ffERROR: No valid argument present.|r");
|
||||
return true;
|
||||
@@ -554,8 +553,8 @@ public:
|
||||
// Check
|
||||
// Remember: "show" must also be the name of a column!
|
||||
if ((show != "delay") && (show != "action") && (show != "action_chance")
|
||||
&& (show != "move_type") && (show != "del") && (show != "move") && (show != "wpadd")
|
||||
)
|
||||
&& (show != "move_type") && (show != "del") && (show != "move") && (show != "wpadd")
|
||||
)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -619,8 +618,7 @@ public:
|
||||
Field* fields = result->Fetch();
|
||||
pathid = fields[0].GetUInt32();
|
||||
point = fields[1].GetUInt32();
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
// We have the waypoint number and the GUID of the "master npc"
|
||||
// Text is enclosed in "<>", all other arguments not
|
||||
@@ -719,7 +717,7 @@ public:
|
||||
return true;
|
||||
} // move
|
||||
|
||||
const char *text = arg_str;
|
||||
const char* text = arg_str;
|
||||
|
||||
if (text == 0)
|
||||
{
|
||||
@@ -824,8 +822,7 @@ public:
|
||||
handler->PSendSysMessage("|cff00ff00Show info: Move flag: |r|cff00ffff%u|r", flag);
|
||||
handler->PSendSysMessage("|cff00ff00Show info: Waypoint event: |r|cff00ffff%u|r", ev_id);
|
||||
handler->PSendSysMessage("|cff00ff00Show info: Event chance: |r|cff00ffff%u|r", ev_chance);
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -881,8 +878,7 @@ public:
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
|
||||
}
|
||||
while (result2->NextRow());
|
||||
} while (result2->NextRow());
|
||||
|
||||
if (hasError)
|
||||
{
|
||||
@@ -938,8 +934,7 @@ public:
|
||||
wpCreature->SetObjectScale(0.5f);
|
||||
wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point);
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
handler->SendSysMessage("|cff00ff00Showing the current creature's path.|r");
|
||||
return true;
|
||||
@@ -1079,8 +1074,7 @@ public:
|
||||
creature->DeleteFromDB();
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
// set "wpguid" column to "empty" - no visual waypoint spawned
|
||||
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID);
|
||||
|
||||
|
||||
@@ -68,76 +68,76 @@ SpellPair const _auraPairs[MAX_SPELL_PAIRS] =
|
||||
|
||||
class npc_av_marshal_or_warmaster : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_av_marshal_or_warmaster() : CreatureScript("npc_av_marshal_or_warmaster") { }
|
||||
public:
|
||||
npc_av_marshal_or_warmaster() : CreatureScript("npc_av_marshal_or_warmaster") { }
|
||||
|
||||
struct npc_av_marshal_or_warmasterAI : public ScriptedAI
|
||||
struct npc_av_marshal_or_warmasterAI : public ScriptedAI
|
||||
{
|
||||
npc_av_marshal_or_warmasterAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
npc_av_marshal_or_warmasterAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_CHARGE_TARGET, urand(2 * IN_MILLISECONDS, 12 * IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(1 * IN_MILLISECONDS, 11 * IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, 2000);
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, urand(5 * IN_MILLISECONDS, 20 * IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_ENRAGE, urand(5 * IN_MILLISECONDS, 20 * IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_CHECK_RESET, 5000);
|
||||
|
||||
void Reset()
|
||||
_hasAura = false;
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
// I have a feeling this isn't blizzlike, but owell, I'm only passing by and cleaning up.
|
||||
if (!_hasAura)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_CHARGE_TARGET, urand(2 * IN_MILLISECONDS, 12 * IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(1 * IN_MILLISECONDS, 11 * IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, 2000);
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, urand(5 * IN_MILLISECONDS, 20 * IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_ENRAGE, urand(5 * IN_MILLISECONDS, 20 * IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_CHECK_RESET, 5000);
|
||||
for (uint8 i = 0; i < MAX_SPELL_PAIRS; ++i)
|
||||
if (_auraPairs[i].npcEntry == me->GetEntry())
|
||||
DoCast(me, _auraPairs[i].spellId);
|
||||
|
||||
_hasAura = false;
|
||||
_hasAura = true;
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
// I have a feeling this isn't blizzlike, but owell, I'm only passing by and cleaning up.
|
||||
if (!_hasAura)
|
||||
switch (eventId)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_PAIRS; ++i)
|
||||
if (_auraPairs[i].npcEntry == me->GetEntry())
|
||||
DoCast(me, _auraPairs[i].spellId);
|
||||
|
||||
_hasAura = true;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_CHARGE_TARGET:
|
||||
DoCastVictim(SPELL_CHARGE);
|
||||
events.ScheduleEvent(EVENT_CHARGE, urand(10 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_CLEAVE:
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(10 * IN_MILLISECONDS, 16 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_DEMORALIZING_SHOUT:
|
||||
DoCast(me, SPELL_DEMORALIZING_SHOUT);
|
||||
events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_WHIRLWIND:
|
||||
DoCast(me, SPELL_WHIRLWIND);
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, urand(10 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, urand(10 * IN_MILLISECONDS, 30 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_CHECK_RESET:
|
||||
case EVENT_CHARGE_TARGET:
|
||||
DoCastVictim(SPELL_CHARGE);
|
||||
events.ScheduleEvent(EVENT_CHARGE, urand(10 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_CLEAVE:
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(10 * IN_MILLISECONDS, 16 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_DEMORALIZING_SHOUT:
|
||||
DoCast(me, SPELL_DEMORALIZING_SHOUT);
|
||||
events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_WHIRLWIND:
|
||||
DoCast(me, SPELL_WHIRLWIND);
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, urand(10 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, urand(10 * IN_MILLISECONDS, 30 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_CHECK_RESET:
|
||||
{
|
||||
Position const& _homePosition = me->GetHomePosition();
|
||||
if (me->GetDistance2d(_homePosition.GetPositionX(), _homePosition.GetPositionY()) > 50.0f)
|
||||
@@ -148,21 +148,21 @@ class npc_av_marshal_or_warmaster : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_CHECK_RESET, 5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
bool _hasAura;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_av_marshal_or_warmasterAI(creature);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
bool _hasAura;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_av_marshal_or_warmasterAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_alterac_valley()
|
||||
|
||||
@@ -61,7 +61,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_WATERBOLT);
|
||||
waterBoltTimer = 5 * IN_MILLISECONDS;
|
||||
} else waterBoltTimer -= diff;
|
||||
}
|
||||
else waterBoltTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (resetTimer < diff)
|
||||
@@ -70,7 +71,8 @@ public:
|
||||
if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
|
||||
EnterEvadeMode();
|
||||
resetTimer = 5 * IN_MILLISECONDS;
|
||||
} else resetTimer -= diff;
|
||||
}
|
||||
else resetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -145,31 +147,36 @@ public:
|
||||
if (summons.empty())
|
||||
me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45 * IN_MILLISECONDS);
|
||||
waterElementalTimer = 50 * IN_MILLISECONDS;
|
||||
} else waterElementalTimer -= diff;
|
||||
}
|
||||
else waterElementalTimer -= diff;
|
||||
|
||||
if (arcaneExplosionTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_ARCANE_EXPLOSION);
|
||||
arcaneExplosionTimer = urand(5 * IN_MILLISECONDS, 15 * IN_MILLISECONDS);
|
||||
} else arcaneExplosionTimer -= diff;
|
||||
}
|
||||
else arcaneExplosionTimer -= diff;
|
||||
|
||||
if (coneOfColdTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CONE_OF_COLD);
|
||||
coneOfColdTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
||||
} else coneOfColdTimer -= diff;
|
||||
}
|
||||
else coneOfColdTimer -= diff;
|
||||
|
||||
if (fireBoltTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FIREBALL);
|
||||
fireBoltTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
|
||||
} else fireBoltTimer -= diff;
|
||||
}
|
||||
else fireBoltTimer -= diff;
|
||||
|
||||
if (frostboltTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FROSTBOLT);
|
||||
frostboltTimer = urand(4 * IN_MILLISECONDS, 12 * IN_MILLISECONDS);
|
||||
} else frostboltTimer -= diff;
|
||||
}
|
||||
else frostboltTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (resetTimer < diff)
|
||||
@@ -180,7 +187,8 @@ public:
|
||||
Talk(YELL_EVADE);
|
||||
}
|
||||
resetTimer = 5 * IN_MILLISECONDS;
|
||||
} else resetTimer -= diff;
|
||||
}
|
||||
else resetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -73,31 +73,36 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_WHIRLWIND);
|
||||
WhirlwindTimer = urand(8 * IN_MILLISECONDS, 18 * IN_MILLISECONDS);
|
||||
} else WhirlwindTimer -= diff;
|
||||
}
|
||||
else WhirlwindTimer -= diff;
|
||||
|
||||
if (Whirlwind2Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_WHIRLWIND2);
|
||||
Whirlwind2Timer = urand(7 * IN_MILLISECONDS, 25 * IN_MILLISECONDS);
|
||||
} else Whirlwind2Timer -= diff;
|
||||
}
|
||||
else Whirlwind2Timer -= diff;
|
||||
|
||||
if (KnockdownTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_KNOCKDOWN);
|
||||
KnockdownTimer = urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS);
|
||||
} else KnockdownTimer -= diff;
|
||||
}
|
||||
else KnockdownTimer -= diff;
|
||||
|
||||
if (FrenzyTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FRENZY);
|
||||
FrenzyTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS);
|
||||
} else FrenzyTimer -= diff;
|
||||
}
|
||||
else FrenzyTimer -= diff;
|
||||
|
||||
if (YellTimer <= diff)
|
||||
{
|
||||
Talk(YELL_RANDOM);
|
||||
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
|
||||
} else YellTimer -= diff;
|
||||
}
|
||||
else YellTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (ResetTimer <= diff)
|
||||
@@ -108,7 +113,8 @@ public:
|
||||
Talk(YELL_EVADE);
|
||||
}
|
||||
ResetTimer = 5 * IN_MILLISECONDS;
|
||||
} else ResetTimer -= diff;
|
||||
}
|
||||
else ResetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -67,31 +67,36 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
CleaveTimer = urand(10 * IN_MILLISECONDS, 16 * IN_MILLISECONDS);
|
||||
} else CleaveTimer -= diff;
|
||||
}
|
||||
else CleaveTimer -= diff;
|
||||
|
||||
if (FrighteningShoutTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FRIGHTENING_SHOUT);
|
||||
FrighteningShoutTimer = urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS);
|
||||
} else FrighteningShoutTimer -= diff;
|
||||
}
|
||||
else FrighteningShoutTimer -= diff;
|
||||
|
||||
if (Whirlwind1Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_WHIRLWIND1);
|
||||
Whirlwind1Timer = urand(6 * IN_MILLISECONDS, 10 * IN_MILLISECONDS);
|
||||
} else Whirlwind1Timer -= diff;
|
||||
}
|
||||
else Whirlwind1Timer -= diff;
|
||||
|
||||
if (Whirlwind2Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_WHIRLWIND2);
|
||||
Whirlwind2Timer = urand(10 * IN_MILLISECONDS, 25 * IN_MILLISECONDS);
|
||||
} else Whirlwind2Timer -= diff;
|
||||
}
|
||||
else Whirlwind2Timer -= diff;
|
||||
|
||||
if (MortalStrikeTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MORTAL_STRIKE);
|
||||
MortalStrikeTimer = urand(10 * IN_MILLISECONDS, 30 * IN_MILLISECONDS);
|
||||
} else MortalStrikeTimer -= diff;
|
||||
}
|
||||
else MortalStrikeTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (ResetTimer <= diff)
|
||||
@@ -102,7 +107,8 @@ public:
|
||||
Talk(YELL_EVADE);
|
||||
}
|
||||
ResetTimer = 5 * IN_MILLISECONDS;
|
||||
} else ResetTimer -= diff;
|
||||
}
|
||||
else ResetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ enum Yells
|
||||
{
|
||||
YELL_AGGRO = 0,
|
||||
YELL_EVADE = 1,
|
||||
//YELL_RESPAWN1 = -1810010, // Missing in database
|
||||
//YELL_RESPAWN2 = -1810011, // Missing in database
|
||||
//YELL_RESPAWN1 = -1810010, // Missing in database
|
||||
//YELL_RESPAWN2 = -1810011, // Missing in database
|
||||
YELL_RANDOM = 2,
|
||||
YELL_SPELL = 3,
|
||||
};
|
||||
@@ -62,25 +62,29 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_AVATAR);
|
||||
AvatarTimer = urand(15 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
||||
} else AvatarTimer -= diff;
|
||||
}
|
||||
else AvatarTimer -= diff;
|
||||
|
||||
if (ThunderclapTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_THUNDERCLAP);
|
||||
ThunderclapTimer = urand(5 * IN_MILLISECONDS, 15 * IN_MILLISECONDS);
|
||||
} else ThunderclapTimer -= diff;
|
||||
}
|
||||
else ThunderclapTimer -= diff;
|
||||
|
||||
if (StormboltTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_STORMBOLT);
|
||||
StormboltTimer = urand(10 * IN_MILLISECONDS, 25 * IN_MILLISECONDS);
|
||||
} else StormboltTimer -= diff;
|
||||
}
|
||||
else StormboltTimer -= diff;
|
||||
|
||||
if (YellTimer <= diff)
|
||||
{
|
||||
Talk(YELL_RANDOM);
|
||||
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
|
||||
} else YellTimer -= diff;
|
||||
}
|
||||
else YellTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (ResetTimer <= diff)
|
||||
@@ -91,7 +95,8 @@ public:
|
||||
Talk(YELL_EVADE);
|
||||
}
|
||||
ResetTimer = 5 * IN_MILLISECONDS;
|
||||
} else ResetTimer -= diff;
|
||||
}
|
||||
else ResetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -29,18 +29,27 @@ public:
|
||||
else
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
// If used brazier open linked doors (North or South)
|
||||
if (go->GetGUID() == instance->GetData64(DATA_SF_BRAZIER_N)) {
|
||||
if (braziersUsed == 0) {
|
||||
if (go->GetGUID() == instance->GetData64(DATA_SF_BRAZIER_N))
|
||||
{
|
||||
if (braziersUsed == 0)
|
||||
{
|
||||
braziersUsed = 1;
|
||||
}else if(braziersUsed == 2){
|
||||
}
|
||||
else if(braziersUsed == 2)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_S), true);
|
||||
braziersUsed = 0;
|
||||
}
|
||||
}else if (go->GetGUID() == instance->GetData64(DATA_SF_BRAZIER_S)) {
|
||||
if (braziersUsed == 0) {
|
||||
}
|
||||
else if (go->GetGUID() == instance->GetData64(DATA_SF_BRAZIER_S))
|
||||
{
|
||||
if (braziersUsed == 0)
|
||||
{
|
||||
braziersUsed = 2;
|
||||
}else if (braziersUsed == 1) {
|
||||
}
|
||||
else if (braziersUsed == 1)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_S), true);
|
||||
braziersUsed = 0;
|
||||
@@ -66,7 +75,7 @@ uint32 theldrenTeam[] =
|
||||
16053, 16055, 16050, 16051, 16049, 16052, 16054, 16058
|
||||
};
|
||||
|
||||
uint32 RingMob[]=
|
||||
uint32 RingMob[] =
|
||||
{
|
||||
8925, // Dredge Worm
|
||||
8926, // Deep Stinger
|
||||
@@ -76,7 +85,7 @@ uint32 RingMob[]=
|
||||
8932, // Borer Beetle
|
||||
};
|
||||
|
||||
uint32 RingBoss[]=
|
||||
uint32 RingBoss[] =
|
||||
{
|
||||
9027, // Gorosh
|
||||
9028, // Grizzle
|
||||
@@ -133,7 +142,7 @@ public:
|
||||
npc_grimstoneAI(Creature* creature) : npc_escortAI(creature), summons(me)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
MobSpawnId = rand()%6;
|
||||
MobSpawnId = rand() % 6;
|
||||
eventPhase = 0;
|
||||
eventTimer = 1000;
|
||||
theldrenEvent = false;
|
||||
@@ -215,11 +224,11 @@ public:
|
||||
theldrenEvent = true;
|
||||
me->SummonCreature(NPC_THELDREN, 644.300f, -175.989f, -53.739f, 3.418f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
uint8 rand = urand(0, 4);
|
||||
for (uint8 i = rand; i < rand+4; ++i)
|
||||
for (uint8 i = rand; i < rand + 4; ++i)
|
||||
me->SummonCreature(theldrenTeam[i], 644.300f, -175.989f, -53.739f, 3.418f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
else
|
||||
me->SummonCreature(RingBoss[rand()%6], 644.300f, -175.989f, -53.739f, 3.418f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
me->SummonCreature(RingBoss[rand() % 6], 644.300f, -175.989f, -53.739f, 3.418f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
|
||||
void UpdateEscortAI(uint32 diff)
|
||||
@@ -287,7 +296,7 @@ public:
|
||||
if (GameObject* go = me->SummonGameObject(GO_ARENA_SPOILS, 596.48f, -187.91f, -54.14f, 4.9f, 0.0f, 0.0f, 0.0f, 0.0f, 300))
|
||||
go->SetOwnerGUID(0);
|
||||
|
||||
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
itr->GetSource()->KilledMonsterCredit(16166, 0);
|
||||
}
|
||||
@@ -351,7 +360,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_THUNDERCLAP);
|
||||
ThunderClap_Timer = 10000;
|
||||
} else ThunderClap_Timer -= diff;
|
||||
}
|
||||
else ThunderClap_Timer -= diff;
|
||||
|
||||
//FireballVolley_Timer
|
||||
if (HealthBelowPct(51))
|
||||
@@ -360,7 +370,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_FIREBALLVOLLEY);
|
||||
FireballVolley_Timer = 15000;
|
||||
} else FireballVolley_Timer -= diff;
|
||||
}
|
||||
else FireballVolley_Timer -= diff;
|
||||
}
|
||||
|
||||
//MightyBlow_Timer
|
||||
@@ -368,7 +379,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_MIGHTYBLOW);
|
||||
MightyBlow_Timer = 10000;
|
||||
} else MightyBlow_Timer -= diff;
|
||||
}
|
||||
else MightyBlow_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -418,11 +430,11 @@ public:
|
||||
|
||||
if (creature->IsVendor() && player->GetReputationRank(59) >= REP_FRIENDLY)
|
||||
AddGossipItemFor(player, 4781, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
|
||||
|
||||
if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
|
||||
!player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
|
||||
player->HasItemCount(ITEM_SULFURON_INGOT))
|
||||
!player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
|
||||
player->HasItemCount(ITEM_SULFURON_INGOT))
|
||||
{
|
||||
AddGossipItemFor(player, 4781, 1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
}
|
||||
@@ -1173,7 +1185,8 @@ public:
|
||||
DoGo(DATA_GO_BAR_KEG, 0);
|
||||
BreakKeg_Timer = 0;
|
||||
BreakDoor_Timer = 1000;
|
||||
} else BreakKeg_Timer -= diff;
|
||||
}
|
||||
else BreakKeg_Timer -= diff;
|
||||
}
|
||||
|
||||
if (BreakDoor_Timer)
|
||||
@@ -1192,7 +1205,8 @@ public:
|
||||
instance->SetData(TYPE_BAR, DONE);
|
||||
|
||||
BreakDoor_Timer = 0;
|
||||
} else BreakDoor_Timer -= diff;
|
||||
}
|
||||
else BreakDoor_Timer -= diff;
|
||||
}
|
||||
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
@@ -38,7 +38,7 @@ const Position SummonPositions[7] =
|
||||
{1012.252747f, -206.696487f, -61.980618f, 3.617599f},
|
||||
};
|
||||
|
||||
vector<int> gobjectDwarfRunesEntry { 170578, 170579, 170580, 170581, 170582, 170583, 170584 };
|
||||
vector<int> gobjectDwarfRunesEntry { 170578, 170579, 170580, 170581, 170582, 170583, 170584 };
|
||||
|
||||
class boss_ambassador_flamelash : public CreatureScript
|
||||
{
|
||||
@@ -88,14 +88,14 @@ public:
|
||||
{
|
||||
// Active makes the runes burn, ready turns them off
|
||||
GOState state = mode ? GO_STATE_ACTIVE : GO_STATE_READY;
|
||||
|
||||
|
||||
for (int RuneEntry : gobjectDwarfRunesEntry)
|
||||
if (GameObject* dwarfRune = me->FindNearestGameObject(RuneEntry, 200.0f))
|
||||
dwarfRune->SetGoState(state);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_SPELL_FIREBLAST, 2 * IN_MILLISECONDS);
|
||||
|
||||
// Spawn 7 Embers initially
|
||||
@@ -114,10 +114,10 @@ public:
|
||||
_events.Reset();
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
|
||||
int getValidRandomPosition()
|
||||
{
|
||||
/* Generate a random position which
|
||||
/* Generate a random position which
|
||||
* have not been used in 4 summonings.
|
||||
* Since we are calling the event whenever the Spirit
|
||||
* dies and not all at the time, we need to save at
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
switch(_events.ExecuteEvent())
|
||||
|
||||
@@ -58,7 +58,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_SHADOWBOLT);
|
||||
ShadowBolt_Timer = 7000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
}
|
||||
else ShadowBolt_Timer -= diff;
|
||||
|
||||
//CurseOfTongues_Timer
|
||||
if (CurseOfTongues_Timer <= diff)
|
||||
@@ -66,21 +67,24 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_CURSEOFTONGUES);
|
||||
CurseOfTongues_Timer = 18000;
|
||||
} else CurseOfTongues_Timer -= diff;
|
||||
}
|
||||
else CurseOfTongues_Timer -= diff;
|
||||
|
||||
//CurseOfWeakness_Timer
|
||||
if (CurseOfWeakness_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CURSEOFWEAKNESS);
|
||||
CurseOfWeakness_Timer = 45000;
|
||||
} else CurseOfWeakness_Timer -= diff;
|
||||
}
|
||||
else CurseOfWeakness_Timer -= diff;
|
||||
|
||||
//DemonArmor_Timer
|
||||
if (DemonArmor_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DEMONARMOR);
|
||||
DemonArmor_Timer = 300000;
|
||||
} else DemonArmor_Timer -= diff;
|
||||
}
|
||||
else DemonArmor_Timer -= diff;
|
||||
|
||||
//EnvelopingWeb_Timer
|
||||
if (EnvelopingWeb_Timer <= diff)
|
||||
@@ -88,7 +92,8 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_ENVELOPINGWEB);
|
||||
EnvelopingWeb_Timer = 12000;
|
||||
} else EnvelopingWeb_Timer -= diff;
|
||||
}
|
||||
else EnvelopingWeb_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -89,16 +89,18 @@ public:
|
||||
//else
|
||||
//{
|
||||
HandOfThaurissan_Timer = 5000;
|
||||
//Counter = 0;
|
||||
//Counter = 0;
|
||||
//}
|
||||
} else HandOfThaurissan_Timer -= diff;
|
||||
}
|
||||
else HandOfThaurissan_Timer -= diff;
|
||||
|
||||
//AvatarOfFlame_Timer
|
||||
if (AvatarOfFlame_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_AVATAROFFLAME);
|
||||
AvatarOfFlame_Timer = 18000;
|
||||
} else AvatarOfFlame_Timer -= diff;
|
||||
}
|
||||
else AvatarOfFlame_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -68,21 +68,24 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_MIGHTYBLOW);
|
||||
MightyBlow_Timer = 18000;
|
||||
} else MightyBlow_Timer -= diff;
|
||||
}
|
||||
else MightyBlow_Timer -= diff;
|
||||
|
||||
//HamString_Timer
|
||||
if (HamString_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_HAMSTRING);
|
||||
HamString_Timer = 15000;
|
||||
} else HamString_Timer -= diff;
|
||||
}
|
||||
else HamString_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
Cleave_Timer = 9000;
|
||||
} else Cleave_Timer -= diff;
|
||||
}
|
||||
else Cleave_Timer -= diff;
|
||||
|
||||
//Adds_Timer
|
||||
if (HealthBelowPct(21))
|
||||
@@ -95,7 +98,8 @@ public:
|
||||
SummonAdds(me->GetVictim());
|
||||
|
||||
Adds_Timer = 25000;
|
||||
} else Adds_Timer -= diff;
|
||||
}
|
||||
else Adds_Timer -= diff;
|
||||
}
|
||||
|
||||
//Summon Medics
|
||||
|
||||
@@ -51,14 +51,16 @@ public:
|
||||
{
|
||||
DoCast(me, SPELL_WHIRLWIND);
|
||||
WhirlWind_Timer = 15000;
|
||||
} else WhirlWind_Timer -= diff;
|
||||
}
|
||||
else WhirlWind_Timer -= diff;
|
||||
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = 15000;
|
||||
} else MortalStrike_Timer -= diff;
|
||||
}
|
||||
else MortalStrike_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
void Reset()
|
||||
{
|
||||
GroundTremor_Timer = 12000;
|
||||
Frenzy_Timer =0;
|
||||
Frenzy_Timer = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
@@ -50,7 +50,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_GROUNDTREMOR);
|
||||
GroundTremor_Timer = 8000;
|
||||
} else GroundTremor_Timer -= diff;
|
||||
}
|
||||
else GroundTremor_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (HealthBelowPct(51))
|
||||
@@ -61,7 +62,8 @@ public:
|
||||
Talk(EMOTE_FRENZY_KILL);
|
||||
|
||||
Frenzy_Timer = 15000;
|
||||
} else Frenzy_Timer -= diff;
|
||||
}
|
||||
else Frenzy_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -56,7 +56,8 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_SHADOWWORDPAIN);
|
||||
ShadowWordPain_Timer = 7000;
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
}
|
||||
else ShadowWordPain_Timer -= diff;
|
||||
|
||||
//ManaBurn_Timer
|
||||
if (ManaBurn_Timer <= diff)
|
||||
@@ -64,21 +65,24 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_MANABURN);
|
||||
ManaBurn_Timer = 10000;
|
||||
} else ManaBurn_Timer -= diff;
|
||||
}
|
||||
else ManaBurn_Timer -= diff;
|
||||
|
||||
//PsychicScream_Timer
|
||||
if (PsychicScream_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_PSYCHICSCREAM);
|
||||
PsychicScream_Timer = 30000;
|
||||
} else PsychicScream_Timer -= diff;
|
||||
}
|
||||
else PsychicScream_Timer -= diff;
|
||||
|
||||
//ShadowShield_Timer
|
||||
if (ShadowShield_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SHADOWSHIELD);
|
||||
ShadowShield_Timer = 25000;
|
||||
} else ShadowShield_Timer -= diff;
|
||||
}
|
||||
else ShadowShield_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
void Reset()
|
||||
{
|
||||
FieryBurst_Timer = 5000;
|
||||
WarStomp_Timer =0;
|
||||
WarStomp_Timer = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
@@ -54,7 +54,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_FIERYBURST);
|
||||
FieryBurst_Timer = 6000;
|
||||
} else FieryBurst_Timer -= diff;
|
||||
}
|
||||
else FieryBurst_Timer -= diff;
|
||||
|
||||
//WarStomp_Timer
|
||||
if (HealthBelowPct(51))
|
||||
@@ -63,7 +64,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_WARSTOMP);
|
||||
WarStomp_Timer = 8000;
|
||||
} else WarStomp_Timer -= diff;
|
||||
}
|
||||
else WarStomp_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -57,21 +57,24 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_MINDBLAST);
|
||||
MindBlast_Timer = 14000;
|
||||
} else MindBlast_Timer -= diff;
|
||||
}
|
||||
else MindBlast_Timer -= diff;
|
||||
|
||||
//ShadowWordPain_Timer
|
||||
if (ShadowWordPain_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHADOWWORDPAIN);
|
||||
ShadowWordPain_Timer = 18000;
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
}
|
||||
else ShadowWordPain_Timer -= diff;
|
||||
|
||||
//Smite_Timer
|
||||
if (Smite_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SMITE);
|
||||
Smite_Timer = 10000;
|
||||
} else Smite_Timer -= diff;
|
||||
}
|
||||
else Smite_Timer -= diff;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
//are 5 minutes expected? go template may have data to despawn when used at quest
|
||||
instance->DoRespawnGameObject(instance->GetData64(DATA_GO_CHALICE), MINUTE*5);
|
||||
instance->DoRespawnGameObject(instance->GetData64(DATA_GO_CHALICE), MINUTE * 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
|
||||
switch(_events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOWBOLTVOLLEY:
|
||||
@@ -199,8 +199,8 @@ public:
|
||||
case EVENT_SPELL_IMMOLATE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
DoCast(target, SPELL_IMMOLATE);
|
||||
_events.ScheduleEvent(EVENT_SPELL_IMMOLATE, 25000);
|
||||
DoCast(target, SPELL_IMMOLATE);
|
||||
_events.ScheduleEvent(EVENT_SPELL_IMMOLATE, 25000);
|
||||
}
|
||||
// Didn't get a target, try again in 1s
|
||||
_events.ScheduleEvent(EVENT_SPELL_IMMOLATE, 1000);
|
||||
|
||||
@@ -152,21 +152,41 @@ 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_ANGERREL: TombBossGUIDs[0] = creature->GetGUID(); break;
|
||||
case NPC_SEETHREL: TombBossGUIDs[1] = creature->GetGUID(); break;
|
||||
case NPC_DOPEREL: TombBossGUIDs[2] = creature->GetGUID(); break;
|
||||
case NPC_GLOOMREL: TombBossGUIDs[3] = creature->GetGUID(); break;
|
||||
case NPC_VILEREL: TombBossGUIDs[4] = creature->GetGUID(); break;
|
||||
case NPC_HATEREL: TombBossGUIDs[5] = creature->GetGUID(); break;
|
||||
case NPC_DOOMREL: TombBossGUIDs[6] = creature->GetGUID(); break;
|
||||
case NPC_MAGMUS:
|
||||
MagmusGUID = creature->GetGUID();
|
||||
if (!creature->IsAlive())
|
||||
HandleGameObject(GetData64(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_ANGERREL:
|
||||
TombBossGUIDs[0] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SEETHREL:
|
||||
TombBossGUIDs[1] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_DOPEREL:
|
||||
TombBossGUIDs[2] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_GLOOMREL:
|
||||
TombBossGUIDs[3] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_VILEREL:
|
||||
TombBossGUIDs[4] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HATEREL:
|
||||
TombBossGUIDs[5] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_DOOMREL:
|
||||
TombBossGUIDs[6] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_MAGMUS:
|
||||
MagmusGUID = creature->GetGUID();
|
||||
if (!creature->IsAlive())
|
||||
HandleGameObject(GetData64(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,33 +194,73 @@ 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(0, true, go);
|
||||
else
|
||||
HandleGameObject(0, 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(0, true, go);
|
||||
else
|
||||
HandleGameObject(0, 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +331,7 @@ public:
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << encounter[0] << ' ' << encounter[1] << ' ' << encounter[2] << ' '
|
||||
<< encounter[3] << ' ' << encounter[4] << ' ' << encounter[5] << ' ' << GhostKillCount;
|
||||
<< encounter[3] << ' ' << encounter[4] << ' ' << encounter[5] << ' ' << GhostKillCount;
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
@@ -284,23 +344,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;
|
||||
}
|
||||
@@ -309,40 +369,40 @@ public:
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_EMPEROR:
|
||||
return EmperorGUID;
|
||||
case DATA_PHALANX:
|
||||
return PhalanxGUID;
|
||||
case DATA_MOIRA:
|
||||
return MoiraGUID;
|
||||
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_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 0;
|
||||
}
|
||||
@@ -364,7 +424,7 @@ public:
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> encounter[0] >> encounter[1] >> encounter[2] >> encounter[3]
|
||||
>> encounter[4] >> encounter[5] >> GhostKillCount;
|
||||
>> encounter[4] >> encounter[5] >> GhostKillCount;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (encounter[i] == IN_PROGRESS)
|
||||
@@ -400,7 +460,8 @@ public:
|
||||
if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
|
||||
{
|
||||
if (!boss->IsAlive())
|
||||
{//do not call EnterEvadeMode(), it will create infinit loops
|
||||
{
|
||||
//do not call EnterEvadeMode(), it will create infinit loops
|
||||
boss->Respawn();
|
||||
boss->RemoveAllAuras();
|
||||
boss->DeleteThreatList();
|
||||
@@ -450,11 +511,12 @@ public:
|
||||
{
|
||||
if (!boss->IsAlive())
|
||||
{
|
||||
GhostKillCount = i+1;
|
||||
}
|
||||
GhostKillCount = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else TombTimer -= diff;
|
||||
}
|
||||
else TombTimer -= diff;
|
||||
}
|
||||
if (GhostKillCount >= 7 && TombEventStarterGUID)
|
||||
TombOfSevenEnd();
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
|
||||
struct boss_gizrul_the_slavenerAI : public BossAI
|
||||
{
|
||||
boss_gizrul_the_slavenerAI(Creature* creature) : BossAI(creature, DATA_GIZRUL_THE_SLAVENER) { }
|
||||
boss_gizrul_the_slavenerAI(Creature* creature) : BossAI(creature, DATA_GIZRUL_THE_SLAVENER) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -50,8 +50,8 @@ public:
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_FATAL_BITE, urand(17000,20000));
|
||||
events.ScheduleEvent(EVENT_INFECTED_BITE, urand(10000,12000));
|
||||
events.ScheduleEvent(EVENT_FATAL_BITE, urand(17000, 20000));
|
||||
events.ScheduleEvent(EVENT_INFECTED_BITE, urand(10000, 12000));
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
@@ -75,11 +75,11 @@ public:
|
||||
{
|
||||
case EVENT_FATAL_BITE:
|
||||
DoCastVictim(SPELL_FATAL_BITE);
|
||||
events.ScheduleEvent(EVENT_FATAL_BITE, urand(8000,10000));
|
||||
events.ScheduleEvent(EVENT_FATAL_BITE, urand(8000, 10000));
|
||||
break;
|
||||
case EVENT_INFECTED_BITE:
|
||||
DoCast(me, SPELL_INFECTED_BITE);
|
||||
events.ScheduleEvent(EVENT_FATAL_BITE, urand(8000,10000));
|
||||
events.ScheduleEvent(EVENT_FATAL_BITE, urand(8000, 10000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -45,8 +45,8 @@ public:
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_REND, urand(17000,20000));
|
||||
events.ScheduleEvent(EVENT_THRASH, urand(10000,12000));
|
||||
events.ScheduleEvent(EVENT_REND, urand(17000, 20000));
|
||||
events.ScheduleEvent(EVENT_THRASH, urand(10000, 12000));
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
{
|
||||
case EVENT_REND:
|
||||
DoCastVictim(SPELL_REND);
|
||||
events.ScheduleEvent(EVENT_REND, urand(8000,10000));
|
||||
events.ScheduleEvent(EVENT_REND, urand(8000, 10000));
|
||||
break;
|
||||
case EVENT_THRASH:
|
||||
DoCast(me, SPELL_THRASH);
|
||||
@@ -84,8 +84,8 @@ public:
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool Summoned;
|
||||
private:
|
||||
bool Summoned;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
|
||||
@@ -47,8 +47,8 @@ public:
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_SUMMON_SPECTRAL_ASSASSIN, urand(6000,8000));
|
||||
events.ScheduleEvent(EVENT_SHADOW_WRATH, urand(9000,18000));
|
||||
events.ScheduleEvent(EVENT_SUMMON_SPECTRAL_ASSASSIN, urand(6000, 8000));
|
||||
events.ScheduleEvent(EVENT_SHADOW_WRATH, urand(9000, 18000));
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
@@ -72,15 +72,15 @@ public:
|
||||
{
|
||||
case EVENT_SUMMON_SPECTRAL_ASSASSIN:
|
||||
DoCast(me, SPELL_SUMMON_SPECTRAL_ASSASSIN);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SPECTRAL_ASSASSIN, urand(30000,35000));
|
||||
events.ScheduleEvent(EVENT_SUMMON_SPECTRAL_ASSASSIN, urand(30000, 35000));
|
||||
break;
|
||||
case EVENT_SHADOW_BOLT_VOLLEY:
|
||||
DoCastVictim(SPELL_SHADOW_BOLT_VOLLEY);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, urand(4000,6000));
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, urand(4000, 6000));
|
||||
break;
|
||||
case EVENT_SHADOW_WRATH:
|
||||
DoCastVictim(SPELL_SHADOW_WRATH);
|
||||
events.ScheduleEvent(EVENT_SHADOW_WRATH, urand(19000,24000));
|
||||
events.ScheduleEvent(EVENT_SHADOW_WRATH, urand(19000, 24000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -102,16 +102,16 @@ public:
|
||||
if (HealthBelowPct(15))
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, urand(7000,14000));
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, urand(7000, 14000));
|
||||
frenzy15 = true;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool frenzy40;
|
||||
bool frenzy15;
|
||||
private:
|
||||
bool frenzy40;
|
||||
bool frenzy15;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
|
||||
@@ -92,13 +92,13 @@ public:
|
||||
events.ScheduleEvent(EVENT_PLAYER_CHECK, 5000);
|
||||
break;
|
||||
case 2:
|
||||
// Close these two doors on Blackhand Incarcerators aggro
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN)))
|
||||
if (door1->GetGoState() == GO_STATE_ACTIVE)
|
||||
door1->SetGoState(GO_STATE_READY);
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS)))
|
||||
if (door2->GetGoState() == GO_STATE_ACTIVE)
|
||||
door2->SetGoState(GO_STATE_READY);
|
||||
// Close these two doors on Blackhand Incarcerators aggro
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN)))
|
||||
if (door1->GetGoState() == GO_STATE_ACTIVE)
|
||||
door1->SetGoState(GO_STATE_READY);
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS)))
|
||||
if (door2->GetGoState() == GO_STATE_ACTIVE)
|
||||
door2->SetGoState(GO_STATE_READY);
|
||||
break;
|
||||
case 3:
|
||||
Reset();
|
||||
@@ -152,19 +152,19 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void OpenDoors(bool Boss_Killed)
|
||||
{
|
||||
// These two doors reopen on reset or boss kill
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN)))
|
||||
door1->SetGoState(GO_STATE_ACTIVE);
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS)))
|
||||
door2->SetGoState(GO_STATE_ACTIVE);
|
||||
void OpenDoors(bool Boss_Killed)
|
||||
{
|
||||
// These two doors reopen on reset or boss kill
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN)))
|
||||
door1->SetGoState(GO_STATE_ACTIVE);
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS)))
|
||||
door2->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
// This door opens on boss kill
|
||||
if (Boss_Killed)
|
||||
if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_OUT)))
|
||||
// This door opens on boss kill
|
||||
if (Boss_Killed)
|
||||
if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_OUT)))
|
||||
door3->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateRunes(GOState state)
|
||||
{
|
||||
@@ -196,35 +196,35 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_RESPAWN:
|
||||
{
|
||||
// Respawn all Blackhand Incarcerators
|
||||
std::list<Creature*> creatureList;
|
||||
GetCreatureListWithEntryInGrid(creatureList, me, NPC_BLACKHAND_INCARCERATOR, 35.0f);
|
||||
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
if (Creature* creature = *itr)
|
||||
{
|
||||
if (!creature->IsAlive())
|
||||
creature->Respawn();
|
||||
|
||||
creature->AI()->SetData(1, 2);
|
||||
}
|
||||
me->AddAura(SPELL_ENCAGED_EMBERSEER, me);
|
||||
instance->SetBossState(DATA_PYROGAURD_EMBERSEER, NOT_STARTED);
|
||||
break;
|
||||
}
|
||||
case EVENT_PRE_FIGHT_1:
|
||||
{
|
||||
// Set data on all Blackhand Incarcerators
|
||||
std::list<Creature*> creatureList;
|
||||
GetCreatureListWithEntryInGrid(creatureList, me, NPC_BLACKHAND_INCARCERATOR, 35.0f);
|
||||
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
if (Creature* creature = *itr)
|
||||
creature->AI()->SetData(1, 1);
|
||||
// Respawn all Blackhand Incarcerators
|
||||
std::list<Creature*> creatureList;
|
||||
GetCreatureListWithEntryInGrid(creatureList, me, NPC_BLACKHAND_INCARCERATOR, 35.0f);
|
||||
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
if (Creature* creature = *itr)
|
||||
{
|
||||
if (!creature->IsAlive())
|
||||
creature->Respawn();
|
||||
|
||||
creature->AI()->SetData(1, 2);
|
||||
}
|
||||
me->AddAura(SPELL_ENCAGED_EMBERSEER, me);
|
||||
instance->SetBossState(DATA_PYROGAURD_EMBERSEER, NOT_STARTED);
|
||||
break;
|
||||
}
|
||||
case EVENT_PRE_FIGHT_1:
|
||||
{
|
||||
// Set data on all Blackhand Incarcerators
|
||||
std::list<Creature*> creatureList;
|
||||
GetCreatureListWithEntryInGrid(creatureList, me, NPC_BLACKHAND_INCARCERATOR, 35.0f);
|
||||
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
if (Creature* creature = *itr)
|
||||
creature->AI()->SetData(1, 1);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_PRE_FIGHT_2, 32000);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_PRE_FIGHT_2, 32000);
|
||||
break;
|
||||
}
|
||||
case EVENT_PRE_FIGHT_2:
|
||||
me->CastSpell(me, SPELL_FREEZE_ANIM);
|
||||
me->CastSpell(me, SPELL_EMBERSEER_GROWING);
|
||||
@@ -236,22 +236,22 @@ public:
|
||||
events.ScheduleEvent(EVENT_FIRE_SHIELD, 3000);
|
||||
break;
|
||||
case EVENT_PLAYER_CHECK:
|
||||
{
|
||||
// Check to see if all players in instance have aura SPELL_EMBERSEER_START before starting event
|
||||
bool _hasAura = false;
|
||||
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))
|
||||
_hasAura = true;
|
||||
|
||||
if (_hasAura)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_PRE_FIGHT_1, 1000);
|
||||
instance->SetBossState(DATA_PYROGAURD_EMBERSEER, IN_PROGRESS);
|
||||
// Check to see if all players in instance have aura SPELL_EMBERSEER_START before starting event
|
||||
bool _hasAura = false;
|
||||
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))
|
||||
_hasAura = true;
|
||||
|
||||
if (_hasAura)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_PRE_FIGHT_1, 1000);
|
||||
instance->SetBossState(DATA_PYROGAURD_EMBERSEER, IN_PROGRESS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVENT_ENTER_COMBAT:
|
||||
AttackStart(me->SelectNearestPlayer(30.0f));
|
||||
break;
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
if (Creature* Emberseer = me->FindNearestCreature(NPC_PYROGAURD_EMBERSEER, 30.0f, true))
|
||||
Emberseer->AI()->SetData(1, 3);
|
||||
}
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
{
|
||||
if (data == 1 && value == 1)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||
_events.CancelEvent(EVENT_ENCAGED_EMBERSEER);
|
||||
}
|
||||
@@ -378,14 +378,14 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ENCAGED_EMBERSEER:
|
||||
{
|
||||
if (me->GetPositionX() == me->GetHomePosition().GetPositionX())
|
||||
if (!me->HasAura(SPELL_ENCAGE_EMBERSEER))
|
||||
if (Creature* Emberseer = me->FindNearestCreature(NPC_PYROGAURD_EMBERSEER, 30.0f, true))
|
||||
DoCast(Emberseer, SPELL_ENCAGE_EMBERSEER);
|
||||
break;
|
||||
{
|
||||
if (me->GetPositionX() == me->GetHomePosition().GetPositionX())
|
||||
if (!me->HasAura(SPELL_ENCAGE_EMBERSEER))
|
||||
if (Creature* Emberseer = me->FindNearestCreature(NPC_PYROGAURD_EMBERSEER, 30.0f, true))
|
||||
DoCast(Emberseer, SPELL_ENCAGE_EMBERSEER);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -413,8 +413,8 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
|
||||
@@ -61,7 +61,7 @@ struct Wave
|
||||
float y_pos;
|
||||
float z_pos;
|
||||
};
|
||||
|
||||
|
||||
static Wave Wave1[] = // 22 sec
|
||||
{
|
||||
{ 10447, 202.511f, -421.307f, 110.9877f },
|
||||
@@ -70,14 +70,14 @@ static Wave Wave1[] = // 22 sec
|
||||
{ 10442, 201.008f, -416.648f, 110.974f }
|
||||
};
|
||||
|
||||
static Wave Wave2[]= // 22 sec
|
||||
static Wave Wave2[] = // 22 sec
|
||||
{
|
||||
{ 10447, 209.8637f, -428.2729f, 110.9877f },
|
||||
{ 10442, 209.3122f, -430.8724f, 110.9814f },
|
||||
{ 10442, 211.3309f, -425.9111f, 111.0006f }
|
||||
};
|
||||
|
||||
static Wave Wave3[]= // 60 sec
|
||||
static Wave Wave3[] = // 60 sec
|
||||
{
|
||||
{ 10742, 208.6493f, -424.5787f, 110.9872f },
|
||||
{ 10447, 203.9482f, -428.9446f, 110.982f, },
|
||||
@@ -85,7 +85,7 @@ static Wave Wave3[]= // 60 sec
|
||||
{ 10442, 206.3079f, -424.7509f, 110.9943f }
|
||||
};
|
||||
|
||||
static Wave Wave4[]= // 49 sec
|
||||
static Wave Wave4[] = // 49 sec
|
||||
{
|
||||
{ 10742, 212.3541f, -412.6826f, 111.0352f },
|
||||
{ 10447, 212.5754f, -410.2841f, 111.0296f },
|
||||
@@ -93,7 +93,7 @@ static Wave Wave4[]= // 49 sec
|
||||
{ 10442, 210.6568f, -412.1552f, 111.0124f }
|
||||
};
|
||||
|
||||
static Wave Wave5[]= // 60 sec
|
||||
static Wave Wave5[] = // 60 sec
|
||||
{
|
||||
{ 10742, 210.2188f, -410.6686f, 111.0211f },
|
||||
{ 10447, 209.4078f, -414.13f, 111.0264f },
|
||||
@@ -102,7 +102,7 @@ static Wave Wave5[]= // 60 sec
|
||||
{ 10442, 208.0854f, -412.1505f, 111.0057f }
|
||||
};
|
||||
|
||||
static Wave Wave6[]= // 27 sec
|
||||
static Wave Wave6[] = // 27 sec
|
||||
{
|
||||
{ 10742, 213.9138f, -426.512f, 111.0013f },
|
||||
{ 10447, 213.7121f, -429.8102f, 110.9888f },
|
||||
@@ -334,12 +334,12 @@ public:
|
||||
victor->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION);
|
||||
break;
|
||||
case EVENT_WAVES_EMOTE_2:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
||||
break;
|
||||
case EVENT_WAVES_TEXT_1:
|
||||
events.ScheduleEvent(EVENT_TURN_TO_PLAYER, 0);
|
||||
if (Creature* victor = ObjectAccessor::GetCreature(*me, victorGUID))
|
||||
victor->AI()->Talk(SAY_NEFARIUS_2);
|
||||
victor->AI()->Talk(SAY_NEFARIUS_2);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
|
||||
events.ScheduleEvent(EVENT_TURN_TO_FACING_1, 4000);
|
||||
events.ScheduleEvent(EVENT_WAVES_EMOTE_1, 5000);
|
||||
@@ -413,22 +413,22 @@ public:
|
||||
me->SummonCreature(NPC_GYTH, 211.762f, -397.5885f, 111.1817f, 4.747295f);
|
||||
break;
|
||||
case EVENT_WAVE_1:
|
||||
SummonWave(Wave1,4);
|
||||
SummonWave(Wave1, 4);
|
||||
break;
|
||||
case EVENT_WAVE_2:
|
||||
SummonWave(Wave2,3);
|
||||
SummonWave(Wave2, 3);
|
||||
break;
|
||||
case EVENT_WAVE_3:
|
||||
SummonWave(Wave3,4);
|
||||
SummonWave(Wave3, 4);
|
||||
break;
|
||||
case EVENT_WAVE_4:
|
||||
SummonWave(Wave4,4);
|
||||
SummonWave(Wave4, 4);
|
||||
break;
|
||||
case EVENT_WAVE_5:
|
||||
SummonWave(Wave5,5);
|
||||
SummonWave(Wave5, 5);
|
||||
break;
|
||||
case EVENT_WAVE_6:
|
||||
SummonWave(Wave6,5);
|
||||
SummonWave(Wave6, 5);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -465,10 +465,10 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
bool gythEvent;
|
||||
uint64 victorGUID;
|
||||
uint64 waveDoorGUID;
|
||||
private:
|
||||
bool gythEvent;
|
||||
uint64 victorGUID;
|
||||
uint64 waveDoorGUID;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -52,8 +52,8 @@ public:
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(SPELL_REND, urand(17000,20000));
|
||||
events.ScheduleEvent(SPELL_STRIKE, urand(10000,12000));
|
||||
events.ScheduleEvent(SPELL_REND, urand(17000, 20000));
|
||||
events.ScheduleEvent(SPELL_STRIKE, urand(10000, 12000));
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
@@ -78,11 +78,11 @@ public:
|
||||
{
|
||||
case SPELL_REND:
|
||||
DoCastVictim(SPELL_REND);
|
||||
events.ScheduleEvent(SPELL_REND, urand(8000,10000));
|
||||
events.ScheduleEvent(SPELL_REND, urand(8000, 10000));
|
||||
break;
|
||||
case SPELL_STRIKE:
|
||||
DoCastVictim(SPELL_STRIKE);
|
||||
events.ScheduleEvent(SPELL_STRIKE, urand(8000,10000));
|
||||
events.ScheduleEvent(SPELL_STRIKE, urand(8000, 10000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -71,12 +71,12 @@ public:
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_THE_BEAST:
|
||||
if (loot == LOOT_SKINNING)
|
||||
{
|
||||
creature->CastSpell(creature, SPELL_FINKLE_IS_EINHORN, true);
|
||||
}
|
||||
break;
|
||||
case NPC_THE_BEAST:
|
||||
if (loot == LOOT_SKINNING)
|
||||
{
|
||||
creature->CastSpell(creature, SPELL_FINKLE_IS_EINHORN, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,8 +135,8 @@ public:
|
||||
if (GetBossState(DATA_GYTH) == DONE)
|
||||
creature->DisappearAndDie();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ProcessEvent(WorldObject* /*obj*/, uint32 eventId)
|
||||
@@ -409,7 +409,7 @@ public:
|
||||
Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_CHECK, 3000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,8 +497,8 @@ public:
|
||||
}
|
||||
|
||||
if (GetBossState(DATA_HALL_RUNE_1) == DONE && GetBossState(DATA_HALL_RUNE_2) == DONE && GetBossState(DATA_HALL_RUNE_3) == DONE &&
|
||||
GetBossState(DATA_HALL_RUNE_4) == DONE && GetBossState(DATA_HALL_RUNE_5) == DONE && GetBossState(DATA_HALL_RUNE_6) == DONE &&
|
||||
GetBossState(DATA_HALL_RUNE_7) == DONE)
|
||||
GetBossState(DATA_HALL_RUNE_4) == DONE && GetBossState(DATA_HALL_RUNE_5) == DONE && GetBossState(DATA_HALL_RUNE_6) == DONE &&
|
||||
GetBossState(DATA_HALL_RUNE_7) == DONE)
|
||||
{
|
||||
SetBossState(DATA_DRAGONSPIRE_ROOM, DONE);
|
||||
if (GameObject* door1 = instance->GetGameObject(go_emberseerin))
|
||||
@@ -554,33 +554,33 @@ public:
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
protected:
|
||||
EventMap Events;
|
||||
uint64 HighlordOmokk;
|
||||
uint64 ShadowHunterVoshgajin;
|
||||
uint64 WarMasterVoone;
|
||||
uint64 MotherSmolderweb;
|
||||
uint64 UrokDoomhowl;
|
||||
uint64 QuartermasterZigris;
|
||||
uint64 GizrultheSlavener;
|
||||
uint64 Halycon;
|
||||
uint64 OverlordWyrmthalak;
|
||||
uint64 PyroguardEmberseer;
|
||||
uint64 WarchiefRendBlackhand;
|
||||
uint64 Gyth;
|
||||
uint64 LordVictorNefarius;
|
||||
uint64 TheBeast;
|
||||
uint64 GeneralDrakkisath;
|
||||
uint64 go_emberseerin;
|
||||
uint64 go_doors;
|
||||
uint64 go_emberseerout;
|
||||
uint64 go_blackrockaltar;
|
||||
uint64 go_roomrunes[7];
|
||||
uint64 go_emberseerrunes[7];
|
||||
uint64 runecreaturelist[7][5];
|
||||
uint64 go_portcullis_active;
|
||||
uint64 go_portcullis_tobossrooms;
|
||||
uint64 go_urok_pile;
|
||||
protected:
|
||||
EventMap Events;
|
||||
uint64 HighlordOmokk;
|
||||
uint64 ShadowHunterVoshgajin;
|
||||
uint64 WarMasterVoone;
|
||||
uint64 MotherSmolderweb;
|
||||
uint64 UrokDoomhowl;
|
||||
uint64 QuartermasterZigris;
|
||||
uint64 GizrultheSlavener;
|
||||
uint64 Halycon;
|
||||
uint64 OverlordWyrmthalak;
|
||||
uint64 PyroguardEmberseer;
|
||||
uint64 WarchiefRendBlackhand;
|
||||
uint64 Gyth;
|
||||
uint64 LordVictorNefarius;
|
||||
uint64 TheBeast;
|
||||
uint64 GeneralDrakkisath;
|
||||
uint64 go_emberseerin;
|
||||
uint64 go_doors;
|
||||
uint64 go_emberseerout;
|
||||
uint64 go_blackrockaltar;
|
||||
uint64 go_roomrunes[7];
|
||||
uint64 go_emberseerrunes[7];
|
||||
uint64 runecreaturelist[7][5];
|
||||
uint64 go_portcullis_active;
|
||||
uint64 go_portcullis_tobossrooms;
|
||||
uint64 go_urok_pile;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
// B1 - TL
|
||||
// B1 - TL
|
||||
case 4:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Acid
|
||||
//B1 - Acid
|
||||
case 8:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Ignite
|
||||
//B1 - Ignite
|
||||
case 12:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Frost
|
||||
//B1 - Frost
|
||||
case 16:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
@@ -214,30 +214,30 @@ public:
|
||||
break;
|
||||
}
|
||||
case EVENT_BREATH_1:
|
||||
DoCastVictim(Breath1_Spell);
|
||||
events.ScheduleEvent(EVENT_BREATH_1, 60000);
|
||||
break;
|
||||
DoCastVictim(Breath1_Spell);
|
||||
events.ScheduleEvent(EVENT_BREATH_1, 60000);
|
||||
break;
|
||||
case EVENT_BREATH_2:
|
||||
DoCastVictim(Breath2_Spell);
|
||||
events.ScheduleEvent(EVENT_BREATH_2, 60000);
|
||||
break;
|
||||
DoCastVictim(Breath2_Spell);
|
||||
events.ScheduleEvent(EVENT_BREATH_2, 60000);
|
||||
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())
|
||||
{
|
||||
DoCast(player, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK, SPELL_BROODAF_RED, SPELL_BROODAF_BRONZE, SPELL_BROODAF_GREEN), true);
|
||||
|
||||
if (player->HasAura(SPELL_BROODAF_BLUE) &&
|
||||
if (player->HasAura(SPELL_BROODAF_BLUE) &&
|
||||
player->HasAura(SPELL_BROODAF_BLACK) &&
|
||||
player->HasAura(SPELL_BROODAF_RED) &&
|
||||
player->HasAura(SPELL_BROODAF_BRONZE) &&
|
||||
player->HasAura(SPELL_BROODAF_GREEN))
|
||||
{
|
||||
DoCast(player, SPELL_CHROMATIC_MUT_1);
|
||||
}
|
||||
{
|
||||
DoCast(player, SPELL_CHROMATIC_MUT_1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ enum Says
|
||||
// BWL
|
||||
SAY_GAMESBEGIN_1 = 12,
|
||||
SAY_GAMESBEGIN_2 = 13,
|
||||
// SAY_VAEL_INTRO = 14, Not used - when he corrupts Vaelastrasz
|
||||
// SAY_VAEL_INTRO = 14, Not used - when he corrupts Vaelastrasz
|
||||
|
||||
// Nefarian
|
||||
SAY_RANDOM = 0,
|
||||
@@ -65,8 +65,8 @@ enum Says
|
||||
|
||||
enum Gossip
|
||||
{
|
||||
GOSSIP_ID = 21332,
|
||||
GOSSIP_OPTION_ID = 0
|
||||
GOSSIP_ID = 21332,
|
||||
GOSSIP_OPTION_ID = 0
|
||||
};
|
||||
|
||||
enum Paths
|
||||
@@ -127,10 +127,10 @@ enum Spells
|
||||
SPELL_ROGUE = 23414, // Paralise
|
||||
SPELL_DEATH_KNIGHT = 49576 // Death Grip
|
||||
|
||||
// 19484
|
||||
// 22664
|
||||
// 22674
|
||||
// 22666
|
||||
// 19484
|
||||
// 22664
|
||||
// 22674
|
||||
// 22666
|
||||
};
|
||||
|
||||
Position const DrakeSpawnLoc[2] = // drakonid
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_MIND_CONTROL, urand(30000, 35000));
|
||||
break;
|
||||
case EVENT_SPAWN_ADD:
|
||||
for (uint8 i=0; i<2; ++i)
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
uint32 CreatureID;
|
||||
if (urand(0, 2) == 0)
|
||||
@@ -378,8 +378,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 SpawnedAdds;
|
||||
private:
|
||||
uint32 SpawnedAdds;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
@@ -428,7 +428,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (rand()%5)
|
||||
if (rand() % 5)
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY, victim);
|
||||
@@ -458,7 +458,8 @@ public:
|
||||
for (std::list<Creature*>::const_iterator itr = constructList.begin(); itr != constructList.end(); ++itr)
|
||||
(*itr)->DespawnOrUnsummon();
|
||||
|
||||
} else DespawnTimer -= diff;
|
||||
}
|
||||
else DespawnTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
@@ -499,50 +500,50 @@ public:
|
||||
case EVENT_CLASSCALL:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
switch (target->getClass())
|
||||
{
|
||||
case CLASS_MAGE:
|
||||
Talk(SAY_MAGE);
|
||||
DoCast(me, SPELL_MAGE);
|
||||
break;
|
||||
case CLASS_WARRIOR:
|
||||
Talk(SAY_WARRIOR);
|
||||
DoCast(me, SPELL_WARRIOR);
|
||||
break;
|
||||
case CLASS_DRUID:
|
||||
Talk(SAY_DRUID);
|
||||
DoCast(target, SPELL_DRUID);
|
||||
break;
|
||||
case CLASS_PRIEST:
|
||||
Talk(SAY_PRIEST);
|
||||
DoCast(me, SPELL_PRIEST);
|
||||
break;
|
||||
case CLASS_PALADIN:
|
||||
Talk(SAY_PALADIN);
|
||||
DoCast(me, SPELL_PALADIN);
|
||||
break;
|
||||
case CLASS_SHAMAN:
|
||||
Talk(SAY_SHAMAN);
|
||||
DoCast(me, SPELL_SHAMAN);
|
||||
break;
|
||||
case CLASS_WARLOCK:
|
||||
Talk(SAY_WARLOCK);
|
||||
DoCast(me, SPELL_WARLOCK);
|
||||
break;
|
||||
case CLASS_HUNTER:
|
||||
Talk(SAY_HUNTER);
|
||||
DoCast(me, SPELL_HUNTER);
|
||||
break;
|
||||
case CLASS_ROGUE:
|
||||
Talk(SAY_ROGUE);
|
||||
DoCast(me, SPELL_ROGUE);
|
||||
break;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
Talk(SAY_DEATH_KNIGHT);
|
||||
DoCast(me, SPELL_DEATH_KNIGHT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
{
|
||||
case CLASS_MAGE:
|
||||
Talk(SAY_MAGE);
|
||||
DoCast(me, SPELL_MAGE);
|
||||
break;
|
||||
case CLASS_WARRIOR:
|
||||
Talk(SAY_WARRIOR);
|
||||
DoCast(me, SPELL_WARRIOR);
|
||||
break;
|
||||
case CLASS_DRUID:
|
||||
Talk(SAY_DRUID);
|
||||
DoCast(target, SPELL_DRUID);
|
||||
break;
|
||||
case CLASS_PRIEST:
|
||||
Talk(SAY_PRIEST);
|
||||
DoCast(me, SPELL_PRIEST);
|
||||
break;
|
||||
case CLASS_PALADIN:
|
||||
Talk(SAY_PALADIN);
|
||||
DoCast(me, SPELL_PALADIN);
|
||||
break;
|
||||
case CLASS_SHAMAN:
|
||||
Talk(SAY_SHAMAN);
|
||||
DoCast(me, SPELL_SHAMAN);
|
||||
break;
|
||||
case CLASS_WARLOCK:
|
||||
Talk(SAY_WARLOCK);
|
||||
DoCast(me, SPELL_WARLOCK);
|
||||
break;
|
||||
case CLASS_HUNTER:
|
||||
Talk(SAY_HUNTER);
|
||||
DoCast(me, SPELL_HUNTER);
|
||||
break;
|
||||
case CLASS_ROGUE:
|
||||
Talk(SAY_ROGUE);
|
||||
DoCast(me, SPELL_ROGUE);
|
||||
break;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
Talk(SAY_DEATH_KNIGHT);
|
||||
DoCast(me, SPELL_DEATH_KNIGHT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CLASSCALL, urand(30000, 35000));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -166,29 +166,29 @@ public:
|
||||
|
||||
class spell_egg_event : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_egg_event() : SpellScriptLoader("spell_egg_event") { }
|
||||
public:
|
||||
spell_egg_event() : SpellScriptLoader("spell_egg_event") { }
|
||||
|
||||
class spell_egg_eventSpellScript : public SpellScript
|
||||
class spell_egg_eventSpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_egg_eventSpellScript);
|
||||
|
||||
void HandleOnHit()
|
||||
{
|
||||
PrepareSpellScript(spell_egg_eventSpellScript);
|
||||
|
||||
void HandleOnHit()
|
||||
{
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
instance->SetData(DATA_EGG_EVENT, SPECIAL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_egg_eventSpellScript::HandleOnHit);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_egg_eventSpellScript();
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
instance->SetData(DATA_EGG_EVENT, SPECIAL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_egg_eventSpellScript::HandleOnHit);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_egg_eventSpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_razorgore()
|
||||
|
||||
@@ -12,26 +12,26 @@
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_LINE1 = 0,
|
||||
SAY_LINE2 = 1,
|
||||
SAY_LINE3 = 2,
|
||||
SAY_HALFLIFE = 3,
|
||||
SAY_KILLTARGET = 4
|
||||
SAY_LINE1 = 0,
|
||||
SAY_LINE2 = 1,
|
||||
SAY_LINE3 = 2,
|
||||
SAY_HALFLIFE = 3,
|
||||
SAY_KILLTARGET = 4
|
||||
};
|
||||
|
||||
enum Gossip
|
||||
{
|
||||
GOSSIP_ID = 21334,
|
||||
GOSSIP_ID = 21334,
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ESSENCEOFTHERED = 23513,
|
||||
SPELL_FLAMEBREATH = 23461,
|
||||
SPELL_FIRENOVA = 23462,
|
||||
SPELL_TAILSWIPE = 15847,
|
||||
SPELL_BURNINGADRENALINE = 23620,
|
||||
SPELL_CLEAVE = 20684 //Chain cleave is most likely named something different and contains a dummy effect
|
||||
SPELL_ESSENCEOFTHERED = 23513,
|
||||
SPELL_FLAMEBREATH = 23461,
|
||||
SPELL_FIRENOVA = 23462,
|
||||
SPELL_TAILSWIPE = 15847,
|
||||
SPELL_BURNINGADRENALINE = 23620,
|
||||
SPELL_CLEAVE = 20684 //Chain cleave is most likely named something different and contains a dummy effect
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (rand()%5)
|
||||
if (rand() % 5)
|
||||
return;
|
||||
|
||||
Talk(SAY_KILLTARGET, victim);
|
||||
@@ -213,9 +213,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 PlayerGUID;
|
||||
bool HasYelled;
|
||||
private:
|
||||
uint64 PlayerGUID;
|
||||
bool HasYelled;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
nefarian->DespawnOrUnsummon();
|
||||
break;
|
||||
case FAIL:
|
||||
_events.ScheduleEvent(EVENT_RESPAWN_NEFARIUS, 15*IN_MILLISECONDS*MINUTE);
|
||||
_events.ScheduleEvent(EVENT_RESPAWN_NEFARIUS, 15 * IN_MILLISECONDS * MINUTE);
|
||||
SetBossState(BOSS_NEFARIAN, NOT_STARTED);
|
||||
break;
|
||||
default:
|
||||
@@ -213,15 +213,24 @@ public:
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case DATA_RAZORGORE_THE_UNTAMED: return RazorgoreTheUntamedGUID;
|
||||
case DATA_VAELASTRAZ_THE_CORRUPT: return VaelastraszTheCorruptGUID;
|
||||
case DATA_BROODLORD_LASHLAYER: return BroodlordLashlayerGUID;
|
||||
case DATA_FIRENAW: return FiremawGUID;
|
||||
case DATA_EBONROC: return EbonrocGUID;
|
||||
case DATA_FLAMEGOR: return FlamegorGUID;
|
||||
case DATA_CHROMAGGUS: return ChromaggusGUID;
|
||||
case DATA_LORD_VICTOR_NEFARIUS: return LordVictorNefariusGUID;
|
||||
case DATA_NEFARIAN: return NefarianGUID;
|
||||
case DATA_RAZORGORE_THE_UNTAMED:
|
||||
return RazorgoreTheUntamedGUID;
|
||||
case DATA_VAELASTRAZ_THE_CORRUPT:
|
||||
return VaelastraszTheCorruptGUID;
|
||||
case DATA_BROODLORD_LASHLAYER:
|
||||
return BroodlordLashlayerGUID;
|
||||
case DATA_FIRENAW:
|
||||
return FiremawGUID;
|
||||
case DATA_EBONROC:
|
||||
return EbonrocGUID;
|
||||
case DATA_FLAMEGOR:
|
||||
return FlamegorGUID;
|
||||
case DATA_CHROMAGGUS:
|
||||
return ChromaggusGUID;
|
||||
case DATA_LORD_VICTOR_NEFARIUS:
|
||||
return LordVictorNefariusGUID;
|
||||
case DATA_NEFARIAN:
|
||||
return NefarianGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -234,7 +243,7 @@ public:
|
||||
switch (data)
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
_events.ScheduleEvent(EVENT_RAZOR_SPAWN, 45*IN_MILLISECONDS);
|
||||
_events.ScheduleEvent(EVENT_RAZOR_SPAWN, 45 * IN_MILLISECONDS);
|
||||
EggEvent = data;
|
||||
EggCount = 0;
|
||||
break;
|
||||
|
||||
@@ -38,73 +38,73 @@ enum Events
|
||||
|
||||
class boss_baron_geddon : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_baron_geddon() : CreatureScript("boss_baron_geddon") { }
|
||||
public:
|
||||
boss_baron_geddon() : CreatureScript("boss_baron_geddon") { }
|
||||
|
||||
struct boss_baron_geddonAI : public BossAI
|
||||
struct boss_baron_geddonAI : public BossAI
|
||||
{
|
||||
boss_baron_geddonAI(Creature* creature) : BossAI(creature, BOSS_BARON_GEDDON)
|
||||
{
|
||||
boss_baron_geddonAI(Creature* creature) : BossAI(creature, BOSS_BARON_GEDDON)
|
||||
{
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_INFERNO, 45000);
|
||||
events.ScheduleEvent(EVENT_IGNITE_MANA, 30000);
|
||||
events.ScheduleEvent(EVENT_LIVING_BOMB, 35000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
// If we are <2% hp cast Armageddon
|
||||
if (!HealthAbovePct(2))
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_ARMAGEDDON);
|
||||
Talk(EMOTE_SERVICE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_INFERNO:
|
||||
DoCast(me, SPELL_INFERNO);
|
||||
events.ScheduleEvent(EVENT_INFERNO, 45000);
|
||||
break;
|
||||
case EVENT_IGNITE_MANA:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_IGNITE_MANA))
|
||||
DoCast(target, SPELL_IGNITE_MANA);
|
||||
events.ScheduleEvent(EVENT_IGNITE_MANA, 30000);
|
||||
break;
|
||||
case EVENT_LIVING_BOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
DoCast(target, SPELL_LIVING_BOMB);
|
||||
events.ScheduleEvent(EVENT_LIVING_BOMB, 35000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_baron_geddonAI(creature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_INFERNO, 45000);
|
||||
events.ScheduleEvent(EVENT_IGNITE_MANA, 30000);
|
||||
events.ScheduleEvent(EVENT_LIVING_BOMB, 35000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
// If we are <2% hp cast Armageddon
|
||||
if (!HealthAbovePct(2))
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_ARMAGEDDON);
|
||||
Talk(EMOTE_SERVICE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_INFERNO:
|
||||
DoCast(me, SPELL_INFERNO);
|
||||
events.ScheduleEvent(EVENT_INFERNO, 45000);
|
||||
break;
|
||||
case EVENT_IGNITE_MANA:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_IGNITE_MANA))
|
||||
DoCast(target, SPELL_IGNITE_MANA);
|
||||
events.ScheduleEvent(EVENT_IGNITE_MANA, 30000);
|
||||
break;
|
||||
case EVENT_LIVING_BOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
DoCast(target, SPELL_LIVING_BOMB);
|
||||
events.ScheduleEvent(EVENT_LIVING_BOMB, 35000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_baron_geddonAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_baron_geddon()
|
||||
|
||||
@@ -36,109 +36,109 @@ enum Events
|
||||
|
||||
class boss_garr : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_garr() : CreatureScript("boss_garr") { }
|
||||
public:
|
||||
boss_garr() : CreatureScript("boss_garr") { }
|
||||
|
||||
struct boss_garrAI : public BossAI
|
||||
struct boss_garrAI : public BossAI
|
||||
{
|
||||
boss_garrAI(Creature* creature) : BossAI(creature, BOSS_GARR)
|
||||
{
|
||||
boss_garrAI(Creature* creature) : BossAI(creature, BOSS_GARR)
|
||||
{
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_ANTIMAGIC_PULSE, 25000);
|
||||
events.ScheduleEvent(EVENT_MAGMA_SHACKLES, 15000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ANTIMAGIC_PULSE:
|
||||
DoCast(me, SPELL_ANTIMAGIC_PULSE);
|
||||
events.ScheduleEvent(EVENT_ANTIMAGIC_PULSE, urand(10000, 15000));
|
||||
break;
|
||||
case EVENT_MAGMA_SHACKLES:
|
||||
DoCast(me, SPELL_MAGMA_SHACKLES);
|
||||
events.ScheduleEvent(EVENT_MAGMA_SHACKLES, urand(8000, 12000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_garrAI(creature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_ANTIMAGIC_PULSE, 25000);
|
||||
events.ScheduleEvent(EVENT_MAGMA_SHACKLES, 15000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ANTIMAGIC_PULSE:
|
||||
DoCast(me, SPELL_ANTIMAGIC_PULSE);
|
||||
events.ScheduleEvent(EVENT_ANTIMAGIC_PULSE, urand(10000, 15000));
|
||||
break;
|
||||
case EVENT_MAGMA_SHACKLES:
|
||||
DoCast(me, SPELL_MAGMA_SHACKLES);
|
||||
events.ScheduleEvent(EVENT_MAGMA_SHACKLES, urand(8000, 12000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_garrAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_firesworn : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_firesworn() : CreatureScript("npc_firesworn") { }
|
||||
public:
|
||||
npc_firesworn() : CreatureScript("npc_firesworn") { }
|
||||
|
||||
struct npc_fireswornAI : public ScriptedAI
|
||||
struct npc_fireswornAI : public ScriptedAI
|
||||
{
|
||||
npc_fireswornAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 immolateTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
npc_fireswornAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 immolateTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
immolateTimer = 4000; //These times are probably wrong
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
uint32 const health10pct = me->CountPctFromMaxHealth(10);
|
||||
uint32 health = me->GetHealth();
|
||||
if (int32(health) - int32(damage) < int32(health10pct))
|
||||
{
|
||||
damage = 0;
|
||||
DoCastVictim(SPELL_ERUPTION);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (immolateTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_IMMOLATE);
|
||||
immolateTimer = urand(5000, 10000);
|
||||
}
|
||||
else
|
||||
immolateTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_fireswornAI(creature);
|
||||
immolateTimer = 4000; //These times are probably wrong
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
uint32 const health10pct = me->CountPctFromMaxHealth(10);
|
||||
uint32 health = me->GetHealth();
|
||||
if (int32(health) - int32(damage) < int32(health10pct))
|
||||
{
|
||||
damage = 0;
|
||||
DoCastVictim(SPELL_ERUPTION);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (immolateTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_IMMOLATE);
|
||||
immolateTimer = urand(5000, 10000);
|
||||
}
|
||||
else
|
||||
immolateTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_fireswornAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_garr()
|
||||
|
||||
@@ -32,64 +32,64 @@ enum Events
|
||||
|
||||
class boss_gehennas : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gehennas() : CreatureScript("boss_gehennas") { }
|
||||
public:
|
||||
boss_gehennas() : CreatureScript("boss_gehennas") { }
|
||||
|
||||
struct boss_gehennasAI : public BossAI
|
||||
struct boss_gehennasAI : public BossAI
|
||||
{
|
||||
boss_gehennasAI(Creature* creature) : BossAI(creature, BOSS_GEHENNAS)
|
||||
{
|
||||
boss_gehennasAI(Creature* creature) : BossAI(creature, BOSS_GEHENNAS)
|
||||
{
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_GEHENNAS_CURSE, 12000);
|
||||
events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 10000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT, 6000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_GEHENNAS_CURSE:
|
||||
DoCastVictim(SPELL_GEHENNAS_CURSE);
|
||||
events.ScheduleEvent(EVENT_GEHENNAS_CURSE, urand(22000, 30000));
|
||||
break;
|
||||
case EVENT_RAIN_OF_FIRE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_RAIN_OF_FIRE);
|
||||
events.ScheduleEvent(EVENT_RAIN_OF_FIRE, urand(4000, 12000));
|
||||
break;
|
||||
case EVENT_SHADOW_BOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_SHADOW_BOLT);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT, 7000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gehennasAI(creature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_GEHENNAS_CURSE, 12000);
|
||||
events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 10000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT, 6000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_GEHENNAS_CURSE:
|
||||
DoCastVictim(SPELL_GEHENNAS_CURSE);
|
||||
events.ScheduleEvent(EVENT_GEHENNAS_CURSE, urand(22000, 30000));
|
||||
break;
|
||||
case EVENT_RAIN_OF_FIRE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_RAIN_OF_FIRE);
|
||||
events.ScheduleEvent(EVENT_RAIN_OF_FIRE, urand(4000, 12000));
|
||||
break;
|
||||
case EVENT_SHADOW_BOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_SHADOW_BOLT);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT, 7000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gehennasAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gehennas()
|
||||
|
||||
@@ -42,144 +42,144 @@ enum Events
|
||||
|
||||
class boss_golemagg : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_golemagg() : CreatureScript("boss_golemagg") { }
|
||||
public:
|
||||
boss_golemagg() : CreatureScript("boss_golemagg") { }
|
||||
|
||||
struct boss_golemaggAI : public BossAI
|
||||
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()
|
||||
{
|
||||
BossAI::Reset();
|
||||
DoCast(me, SPELL_MAGMASPLASH, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_PYROBLAST, 7000);
|
||||
|
||||
// The two ragers should join the fight alongside me against my foes.
|
||||
std::list<Creature *> ragers;
|
||||
me->GetCreaturesWithEntryInRange(ragers, 100, NPC_CORE_RAGER);
|
||||
for (Creature * i : ragers)
|
||||
{
|
||||
if (i && i->IsAlive() && !i->IsInCombat())
|
||||
{
|
||||
i->AI()->AttackStart(victim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!HealthBelowPct(10) || me->HasAura(SPELL_ENRAGE))
|
||||
return;
|
||||
|
||||
DoCast(me, SPELL_ENRAGE, true);
|
||||
events.ScheduleEvent(EVENT_EARTHQUAKE, 3000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_PYROBLAST:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_PYROBLAST);
|
||||
events.ScheduleEvent(EVENT_PYROBLAST, 7000);
|
||||
break;
|
||||
case EVENT_EARTHQUAKE:
|
||||
DoCastVictim(SPELL_EARTHQUAKE);
|
||||
events.ScheduleEvent(EVENT_EARTHQUAKE, 3000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_golemaggAI(creature);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
DoCast(me, SPELL_MAGMASPLASH, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_PYROBLAST, 7000);
|
||||
|
||||
// The two ragers should join the fight alongside me against my foes.
|
||||
std::list<Creature*> ragers;
|
||||
me->GetCreaturesWithEntryInRange(ragers, 100, NPC_CORE_RAGER);
|
||||
for (Creature* i : ragers)
|
||||
{
|
||||
if (i && i->IsAlive() && !i->IsInCombat())
|
||||
{
|
||||
i->AI()->AttackStart(victim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!HealthBelowPct(10) || me->HasAura(SPELL_ENRAGE))
|
||||
return;
|
||||
|
||||
DoCast(me, SPELL_ENRAGE, true);
|
||||
events.ScheduleEvent(EVENT_EARTHQUAKE, 3000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_PYROBLAST:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_PYROBLAST);
|
||||
events.ScheduleEvent(EVENT_PYROBLAST, 7000);
|
||||
break;
|
||||
case EVENT_EARTHQUAKE:
|
||||
DoCastVictim(SPELL_EARTHQUAKE);
|
||||
events.ScheduleEvent(EVENT_EARTHQUAKE, 3000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_golemaggAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_core_rager : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_core_rager() : CreatureScript("npc_core_rager") { }
|
||||
public:
|
||||
npc_core_rager() : CreatureScript("npc_core_rager") { }
|
||||
|
||||
struct npc_core_ragerAI : public ScriptedAI
|
||||
struct npc_core_ragerAI : public ScriptedAI
|
||||
{
|
||||
npc_core_ragerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_core_ragerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
mangleTimer = 7*IN_MILLISECONDS; // These times are probably wrong
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (HealthAbovePct(50) || !instance)
|
||||
return;
|
||||
|
||||
if (Creature* pGolemagg = instance->instance->GetCreature(instance->GetData64(BOSS_GOLEMAGG_THE_INCINERATOR)))
|
||||
{
|
||||
if (pGolemagg->IsAlive())
|
||||
{
|
||||
me->AddAura(SPELL_GOLEMAGG_TRUST, me);
|
||||
Talk(EMOTE_LOWHP);
|
||||
me->SetFullHealth();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Mangle
|
||||
if (mangleTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MANGLE);
|
||||
mangleTimer = 10*IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
mangleTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
uint32 mangleTimer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_core_ragerAI>(creature);
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
mangleTimer = 7 * IN_MILLISECONDS; // These times are probably wrong
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (HealthAbovePct(50) || !instance)
|
||||
return;
|
||||
|
||||
if (Creature* pGolemagg = instance->instance->GetCreature(instance->GetData64(BOSS_GOLEMAGG_THE_INCINERATOR)))
|
||||
{
|
||||
if (pGolemagg->IsAlive())
|
||||
{
|
||||
me->AddAura(SPELL_GOLEMAGG_TRUST, me);
|
||||
Talk(EMOTE_LOWHP);
|
||||
me->SetFullHealth();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Mangle
|
||||
if (mangleTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MANGLE);
|
||||
mangleTimer = 10 * IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
mangleTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
uint32 mangleTimer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_core_ragerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_golemagg()
|
||||
|
||||
@@ -32,62 +32,62 @@ enum Events
|
||||
|
||||
class boss_lucifron : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_lucifron() : CreatureScript("boss_lucifron") { }
|
||||
public:
|
||||
boss_lucifron() : CreatureScript("boss_lucifron") { }
|
||||
|
||||
struct boss_lucifronAI : public BossAI
|
||||
struct boss_lucifronAI : public BossAI
|
||||
{
|
||||
boss_lucifronAI(Creature* creature) : BossAI(creature, BOSS_LUCIFRON)
|
||||
{
|
||||
boss_lucifronAI(Creature* creature) : BossAI(creature, BOSS_LUCIFRON)
|
||||
{
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_IMPENDING_DOOM, 10000);
|
||||
events.ScheduleEvent(EVENT_LUCIFRON_CURSE, 20000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_SHOCK, 6000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_IMPENDING_DOOM:
|
||||
DoCastVictim(SPELL_IMPENDING_DOOM);
|
||||
events.ScheduleEvent(EVENT_IMPENDING_DOOM, 20000);
|
||||
break;
|
||||
case EVENT_LUCIFRON_CURSE:
|
||||
DoCastVictim(SPELL_LUCIFRON_CURSE);
|
||||
events.ScheduleEvent(EVENT_LUCIFRON_CURSE, 15000);
|
||||
break;
|
||||
case EVENT_SHADOW_SHOCK:
|
||||
DoCastVictim(SPELL_SHADOW_SHOCK);
|
||||
events.ScheduleEvent(EVENT_SHADOW_SHOCK, 6000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_lucifronAI(creature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_IMPENDING_DOOM, 10000);
|
||||
events.ScheduleEvent(EVENT_LUCIFRON_CURSE, 20000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_SHOCK, 6000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_IMPENDING_DOOM:
|
||||
DoCastVictim(SPELL_IMPENDING_DOOM);
|
||||
events.ScheduleEvent(EVENT_IMPENDING_DOOM, 20000);
|
||||
break;
|
||||
case EVENT_LUCIFRON_CURSE:
|
||||
DoCastVictim(SPELL_LUCIFRON_CURSE);
|
||||
events.ScheduleEvent(EVENT_LUCIFRON_CURSE, 15000);
|
||||
break;
|
||||
case EVENT_SHADOW_SHOCK:
|
||||
DoCastVictim(SPELL_SHADOW_SHOCK);
|
||||
events.ScheduleEvent(EVENT_SHADOW_SHOCK, 6000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_lucifronAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_lucifron()
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Magmadar
|
||||
SD%Complete: 75
|
||||
SDComment: Conflag on ground nyi
|
||||
SDCategory: Molten Core
|
||||
EndScriptData */
|
||||
/* ScriptData
|
||||
SDName: Boss_Magmadar
|
||||
SD%Complete: 75
|
||||
SDComment: Conflag on ground nyi
|
||||
SDCategory: Molten Core
|
||||
EndScriptData */
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
@@ -80,22 +80,22 @@ public:
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_FRENZY:
|
||||
Talk(EMOTE_FRENZY);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
events.ScheduleEvent(EVENT_FRENZY, 15000);
|
||||
break;
|
||||
case EVENT_PANIC:
|
||||
DoCastVictim(SPELL_PANIC);
|
||||
events.ScheduleEvent(EVENT_PANIC, 35000);
|
||||
break;
|
||||
case EVENT_LAVA_BOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_LAVA_BOMB))
|
||||
DoCast(target, SPELL_LAVA_BOMB);
|
||||
events.ScheduleEvent(EVENT_LAVA_BOMB, 12000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case EVENT_FRENZY:
|
||||
Talk(EMOTE_FRENZY);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
events.ScheduleEvent(EVENT_FRENZY, 15000);
|
||||
break;
|
||||
case EVENT_PANIC:
|
||||
DoCastVictim(SPELL_PANIC);
|
||||
events.ScheduleEvent(EVENT_PANIC, 35000);
|
||||
break;
|
||||
case EVENT_LAVA_BOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_LAVA_BOMB))
|
||||
DoCast(target, SPELL_LAVA_BOMB);
|
||||
events.ScheduleEvent(EVENT_LAVA_BOMB, 12000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,11 +122,12 @@ public:
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
std::list<Creature *> hounds;
|
||||
std::list<Creature*> hounds;
|
||||
bool smoldering = false;
|
||||
Unit* killer;
|
||||
|
||||
void removeFeignDeath() {
|
||||
void removeFeignDeath()
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
@@ -161,11 +162,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void Reset() {
|
||||
void Reset()
|
||||
{
|
||||
removeFeignDeath();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) {
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
removeFeignDeath();
|
||||
}
|
||||
|
||||
@@ -185,47 +188,48 @@ public:
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SERRATED_BITE:
|
||||
if (UpdateVictim() && !smoldering) {
|
||||
DoCast(me->GetVictim(), SPELL_SERRATED_BITE);
|
||||
events.ScheduleEvent(EVENT_SERRATED_BITE, 10000); // again, timer may be wrong
|
||||
}
|
||||
break;
|
||||
case EVENT_IGNITE:
|
||||
smoldering = false;
|
||||
me->GetCreaturesWithEntryInRange(hounds, 80, NPC_CORE_HOUND);
|
||||
for (Creature * i : hounds)
|
||||
{
|
||||
if (i && i->IsAlive() && i->IsInCombat() && !i->HasUnitState(UNIT_STATE_DIED))
|
||||
case EVENT_SERRATED_BITE:
|
||||
if (UpdateVictim() && !smoldering)
|
||||
{
|
||||
Talk(EMOTE_IGNITE);
|
||||
me->SetFullHealth();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT);
|
||||
me->ClearUnitState(UNIT_STATE_DIED);
|
||||
me->ClearUnitState(UNIT_STATE_CANNOT_AUTOATTACK);
|
||||
me->DisableRotate(false);
|
||||
me->AI()->AttackStart(i->GetVictim());
|
||||
return;
|
||||
DoCast(me->GetVictim(), SPELL_SERRATED_BITE);
|
||||
events.ScheduleEvent(EVENT_SERRATED_BITE, 10000); // again, timer may be wrong
|
||||
}
|
||||
}
|
||||
if (me->HasUnitState(UNIT_STATE_DIED))
|
||||
{
|
||||
if (killer)
|
||||
break;
|
||||
case EVENT_IGNITE:
|
||||
smoldering = false;
|
||||
me->GetCreaturesWithEntryInRange(hounds, 80, NPC_CORE_HOUND);
|
||||
for (Creature* i : hounds)
|
||||
{
|
||||
me->Kill(killer, me);
|
||||
if (i && i->IsAlive() && i->IsInCombat() && !i->HasUnitState(UNIT_STATE_DIED))
|
||||
{
|
||||
Talk(EMOTE_IGNITE);
|
||||
me->SetFullHealth();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT);
|
||||
me->ClearUnitState(UNIT_STATE_DIED);
|
||||
me->ClearUnitState(UNIT_STATE_CANNOT_AUTOATTACK);
|
||||
me->DisableRotate(false);
|
||||
me->AI()->AttackStart(i->GetVictim());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (me->HasUnitState(UNIT_STATE_DIED))
|
||||
{
|
||||
me->Kill(me, me);
|
||||
if (killer)
|
||||
{
|
||||
me->Kill(killer, me);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->Kill(me, me);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,147 +56,147 @@ enum Events
|
||||
|
||||
class boss_majordomo : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_majordomo() : CreatureScript("boss_majordomo") { }
|
||||
public:
|
||||
boss_majordomo() : CreatureScript("boss_majordomo") { }
|
||||
|
||||
struct boss_majordomoAI : public BossAI
|
||||
struct boss_majordomoAI : public BossAI
|
||||
{
|
||||
boss_majordomoAI(Creature* creature) : BossAI(creature, BOSS_MAJORDOMO_EXECUTUS)
|
||||
{
|
||||
boss_majordomoAI(Creature* creature) : BossAI(creature, BOSS_MAJORDOMO_EXECUTUS)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (urand(0, 99) < 25)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (urand(0, 99) < 25)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) override
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_MAGIC_REFLECTION, 30000);
|
||||
events.ScheduleEvent(EVENT_DAMAGE_REFLECTION, 15000);
|
||||
events.ScheduleEvent(EVENT_BLAST_WAVE, 10000);
|
||||
events.ScheduleEvent(EVENT_TELEPORT, 20000);
|
||||
// Call every flamewaker around him
|
||||
me->CallForHelp(30);
|
||||
}
|
||||
void EnterCombat(Unit* who) override
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_MAGIC_REFLECTION, 30000);
|
||||
events.ScheduleEvent(EVENT_DAMAGE_REFLECTION, 15000);
|
||||
events.ScheduleEvent(EVENT_BLAST_WAVE, 10000);
|
||||
events.ScheduleEvent(EVENT_TELEPORT, 20000);
|
||||
// Call every flamewaker around him
|
||||
me->CallForHelp(30);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (instance->GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE)
|
||||
{
|
||||
if (instance->GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f))
|
||||
{
|
||||
me->GetMap()->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me);
|
||||
me->setFaction(35);
|
||||
EnterEvadeMode();
|
||||
Talk(SAY_DEFEAT);
|
||||
_JustDied();
|
||||
events.ScheduleEvent(EVENT_OUTRO_1, 32000);
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (HealthBelowPct(50))
|
||||
DoCast(me, SPELL_AEGIS_OF_RAGNAROS, true);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_MAGIC_REFLECTION:
|
||||
DoCast(me, SPELL_MAGIC_REFLECTION);
|
||||
events.ScheduleEvent(EVENT_MAGIC_REFLECTION, 30000);
|
||||
break;
|
||||
case EVENT_DAMAGE_REFLECTION:
|
||||
DoCast(me, SPELL_DAMAGE_REFLECTION);
|
||||
events.ScheduleEvent(EVENT_DAMAGE_REFLECTION, 30000);
|
||||
break;
|
||||
case EVENT_BLAST_WAVE:
|
||||
DoCastVictim(SPELL_BLAST_WAVE);
|
||||
events.ScheduleEvent(EVENT_BLAST_WAVE, 10000);
|
||||
break;
|
||||
case EVENT_TELEPORT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_TELEPORT);
|
||||
events.ScheduleEvent(EVENT_TELEPORT, 20000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_OUTRO_1:
|
||||
me->NearTeleportTo(RagnarosTelePos.GetPositionX(), RagnarosTelePos.GetPositionY(), RagnarosTelePos.GetPositionZ(), RagnarosTelePos.GetOrientation());
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
break;
|
||||
case EVENT_OUTRO_2:
|
||||
instance->instance->SummonCreature(NPC_RAGNAROS, RagnarosSummonPos);
|
||||
break;
|
||||
case EVENT_OUTRO_3:
|
||||
Talk(SAY_ARRIVAL2_MAJ);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_START_RAGNAROS && events.GetNextEventTime(EVENT_OUTRO_2) == 0)
|
||||
{
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
Talk(SAY_SUMMON_MAJ);
|
||||
events.ScheduleEvent(EVENT_OUTRO_2, 8000);
|
||||
events.ScheduleEvent(EVENT_OUTRO_3, 24000);
|
||||
}
|
||||
else if (action == ACTION_START_RAGNAROS_ALT)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f))
|
||||
{
|
||||
me->GetMap()->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me);
|
||||
me->setFaction(35);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
EnterEvadeMode();
|
||||
Talk(SAY_DEFEAT);
|
||||
_JustDied();
|
||||
events.ScheduleEvent(EVENT_OUTRO_1, 32000);
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (HealthBelowPct(50))
|
||||
DoCast(me, SPELL_AEGIS_OF_RAGNAROS, true);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_MAGIC_REFLECTION:
|
||||
DoCast(me, SPELL_MAGIC_REFLECTION);
|
||||
events.ScheduleEvent(EVENT_MAGIC_REFLECTION, 30000);
|
||||
break;
|
||||
case EVENT_DAMAGE_REFLECTION:
|
||||
DoCast(me, SPELL_DAMAGE_REFLECTION);
|
||||
events.ScheduleEvent(EVENT_DAMAGE_REFLECTION, 30000);
|
||||
break;
|
||||
case EVENT_BLAST_WAVE:
|
||||
DoCastVictim(SPELL_BLAST_WAVE);
|
||||
events.ScheduleEvent(EVENT_BLAST_WAVE, 10000);
|
||||
break;
|
||||
case EVENT_TELEPORT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_TELEPORT);
|
||||
events.ScheduleEvent(EVENT_TELEPORT, 20000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_OUTRO_1:
|
||||
me->NearTeleportTo(RagnarosTelePos.GetPositionX(), RagnarosTelePos.GetPositionY(), RagnarosTelePos.GetPositionZ(), RagnarosTelePos.GetOrientation());
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
break;
|
||||
case EVENT_OUTRO_2:
|
||||
instance->instance->SummonCreature(NPC_RAGNAROS, RagnarosSummonPos);
|
||||
break;
|
||||
case EVENT_OUTRO_3:
|
||||
Talk(SAY_ARRIVAL2_MAJ);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
AddGossipItemFor(player, 4093, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_HELLO, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
creature->AI()->DoAction(ACTION_START_RAGNAROS);
|
||||
return true;
|
||||
if (action == ACTION_START_RAGNAROS && events.GetNextEventTime(EVENT_OUTRO_2) == 0)
|
||||
{
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
Talk(SAY_SUMMON_MAJ);
|
||||
events.ScheduleEvent(EVENT_OUTRO_2, 8000);
|
||||
events.ScheduleEvent(EVENT_OUTRO_3, 24000);
|
||||
}
|
||||
else if (action == ACTION_START_RAGNAROS_ALT)
|
||||
{
|
||||
me->setFaction(35);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_majordomoAI>(creature);
|
||||
}
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
AddGossipItemFor(player, 4093, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_HELLO, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
creature->AI()->DoAction(ACTION_START_RAGNAROS);
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_majordomoAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_majordomo()
|
||||
|
||||
@@ -64,79 +64,79 @@ enum Events
|
||||
|
||||
class boss_ragnaros : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_ragnaros() : CreatureScript("boss_ragnaros") { }
|
||||
public:
|
||||
boss_ragnaros() : CreatureScript("boss_ragnaros") { }
|
||||
|
||||
struct boss_ragnarosAI : public BossAI
|
||||
struct boss_ragnarosAI : public BossAI
|
||||
{
|
||||
boss_ragnarosAI(Creature* creature) : BossAI(creature, BOSS_RAGNAROS)
|
||||
{
|
||||
boss_ragnarosAI(Creature* creature) : BossAI(creature, BOSS_RAGNAROS)
|
||||
{
|
||||
_introState = 0;
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
_introState = 0;
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
_emergeTimer = 90000;
|
||||
_hasYelledMagmaBurst = false;
|
||||
_hasSubmergedOnce = false;
|
||||
_isBanished = false;
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
}
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
_emergeTimer = 90000;
|
||||
_hasYelledMagmaBurst = false;
|
||||
_hasSubmergedOnce = false;
|
||||
_isBanished = false;
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim) override
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_ERUPTION, 15000);
|
||||
events.ScheduleEvent(EVENT_WRATH_OF_RAGNAROS, 30000);
|
||||
events.ScheduleEvent(EVENT_HAND_OF_RAGNAROS, 25000);
|
||||
events.ScheduleEvent(EVENT_LAVA_BURST, 10000);
|
||||
events.ScheduleEvent(EVENT_ELEMENTAL_FIRE, 3000);
|
||||
events.ScheduleEvent(EVENT_MAGMA_BLAST, 2000);
|
||||
events.ScheduleEvent(EVENT_SUBMERGE, 180000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
me->SetFacingTo(DEATH_ORIENTATION);
|
||||
}
|
||||
void EnterCombat(Unit* victim) override
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_ERUPTION, 15000);
|
||||
events.ScheduleEvent(EVENT_WRATH_OF_RAGNAROS, 30000);
|
||||
events.ScheduleEvent(EVENT_HAND_OF_RAGNAROS, 25000);
|
||||
events.ScheduleEvent(EVENT_LAVA_BURST, 10000);
|
||||
events.ScheduleEvent(EVENT_ELEMENTAL_FIRE, 3000);
|
||||
events.ScheduleEvent(EVENT_MAGMA_BLAST, 2000);
|
||||
events.ScheduleEvent(EVENT_SUBMERGE, 180000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (urand(0, 99) < 25)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
me->SetFacingTo(DEATH_ORIENTATION);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* target) override
|
||||
{
|
||||
if (target && me->Attack(target, true))
|
||||
DoStartNoMovement(target);
|
||||
}
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (urand(0, 99) < 25)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
void AttackStart(Unit* target) override
|
||||
{
|
||||
if (target && me->Attack(target, true))
|
||||
DoStartNoMovement(target);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (_introState != 2)
|
||||
{
|
||||
if (_introState != 2)
|
||||
if (!_introState)
|
||||
{
|
||||
if (!_introState)
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
events.ScheduleEvent(EVENT_INTRO_1, 4000);
|
||||
events.ScheduleEvent(EVENT_INTRO_2, 23000);
|
||||
events.ScheduleEvent(EVENT_INTRO_3, 42000);
|
||||
events.ScheduleEvent(EVENT_INTRO_4, 43000);
|
||||
events.ScheduleEvent(EVENT_INTRO_5, 53000);
|
||||
_introState = 1;
|
||||
}
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
events.ScheduleEvent(EVENT_INTRO_1, 4000);
|
||||
events.ScheduleEvent(EVENT_INTRO_2, 23000);
|
||||
events.ScheduleEvent(EVENT_INTRO_3, 42000);
|
||||
events.ScheduleEvent(EVENT_INTRO_4, 43000);
|
||||
events.ScheduleEvent(EVENT_INTRO_5, 53000);
|
||||
_introState = 1;
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_INTRO_1:
|
||||
Talk(SAY_ARRIVAL1_RAG);
|
||||
break;
|
||||
@@ -158,76 +158,76 @@ class boss_ragnaros : public CreatureScript
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_isBanished && ((_emergeTimer <= diff) || (instance->GetData(DATA_RAGNAROS_ADDS)) > 8))
|
||||
{
|
||||
if (_isBanished && ((_emergeTimer <= diff) || (instance->GetData(DATA_RAGNAROS_ADDS)) > 8))
|
||||
{
|
||||
//Become unbanished again
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(target);
|
||||
instance->SetData(DATA_RAGNAROS_ADDS, 0);
|
||||
_isBanished = false;
|
||||
}
|
||||
else if (_isBanished)
|
||||
{
|
||||
_emergeTimer -= diff;
|
||||
return;
|
||||
}
|
||||
//Become unbanished again
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(target);
|
||||
instance->SetData(DATA_RAGNAROS_ADDS, 0);
|
||||
_isBanished = false;
|
||||
}
|
||||
else if (_isBanished)
|
||||
{
|
||||
_emergeTimer -= diff;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ERUPTION:
|
||||
DoCastVictim(SPELL_ERRUPTION);
|
||||
events.ScheduleEvent(EVENT_ERUPTION, urand(20000, 45000));
|
||||
break;
|
||||
case EVENT_WRATH_OF_RAGNAROS:
|
||||
DoCastVictim(SPELL_WRATH_OF_RAGNAROS);
|
||||
if (urand(0, 1))
|
||||
Talk(SAY_WRATH);
|
||||
events.ScheduleEvent(EVENT_WRATH_OF_RAGNAROS, 25000);
|
||||
break;
|
||||
case EVENT_HAND_OF_RAGNAROS:
|
||||
DoCast(me, SPELL_HAND_OF_RAGNAROS);
|
||||
if (urand(0, 1))
|
||||
Talk(SAY_HAND);
|
||||
events.ScheduleEvent(EVENT_HAND_OF_RAGNAROS, 20000);
|
||||
break;
|
||||
case EVENT_LAVA_BURST:
|
||||
DoCastVictim(SPELL_LAVA_BURST);
|
||||
events.ScheduleEvent(EVENT_LAVA_BURST, 10000);
|
||||
break;
|
||||
case EVENT_ELEMENTAL_FIRE:
|
||||
DoCastVictim(SPELL_ELEMENTAL_FIRE);
|
||||
events.ScheduleEvent(EVENT_ELEMENTAL_FIRE, urand(10000, 14000));
|
||||
break;
|
||||
case EVENT_MAGMA_BLAST:
|
||||
if (!me->IsWithinMeleeRange(me->GetVictim()))
|
||||
case EVENT_ERUPTION:
|
||||
DoCastVictim(SPELL_ERRUPTION);
|
||||
events.ScheduleEvent(EVENT_ERUPTION, urand(20000, 45000));
|
||||
break;
|
||||
case EVENT_WRATH_OF_RAGNAROS:
|
||||
DoCastVictim(SPELL_WRATH_OF_RAGNAROS);
|
||||
if (urand(0, 1))
|
||||
Talk(SAY_WRATH);
|
||||
events.ScheduleEvent(EVENT_WRATH_OF_RAGNAROS, 25000);
|
||||
break;
|
||||
case EVENT_HAND_OF_RAGNAROS:
|
||||
DoCast(me, SPELL_HAND_OF_RAGNAROS);
|
||||
if (urand(0, 1))
|
||||
Talk(SAY_HAND);
|
||||
events.ScheduleEvent(EVENT_HAND_OF_RAGNAROS, 20000);
|
||||
break;
|
||||
case EVENT_LAVA_BURST:
|
||||
DoCastVictim(SPELL_LAVA_BURST);
|
||||
events.ScheduleEvent(EVENT_LAVA_BURST, 10000);
|
||||
break;
|
||||
case EVENT_ELEMENTAL_FIRE:
|
||||
DoCastVictim(SPELL_ELEMENTAL_FIRE);
|
||||
events.ScheduleEvent(EVENT_ELEMENTAL_FIRE, urand(10000, 14000));
|
||||
break;
|
||||
case EVENT_MAGMA_BLAST:
|
||||
if (!me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
DoCastVictim(SPELL_MAGMA_BLAST);
|
||||
if (!_hasYelledMagmaBurst)
|
||||
{
|
||||
DoCastVictim(SPELL_MAGMA_BLAST);
|
||||
if (!_hasYelledMagmaBurst)
|
||||
{
|
||||
Talk(SAY_MAGMABURST);
|
||||
_hasYelledMagmaBurst = true;
|
||||
}
|
||||
Talk(SAY_MAGMABURST);
|
||||
_hasYelledMagmaBurst = true;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MAGMA_BLAST, 2500);
|
||||
break;
|
||||
case EVENT_SUBMERGE:
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MAGMA_BLAST, 2500);
|
||||
break;
|
||||
case EVENT_SUBMERGE:
|
||||
{
|
||||
if (!_isBanished)
|
||||
{
|
||||
@@ -273,60 +273,60 @@ class boss_ragnaros : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_SUBMERGE, 180000);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
float const DEATH_ORIENTATION = 4.0f;
|
||||
uint32 _emergeTimer;
|
||||
uint8 _introState;
|
||||
bool _hasYelledMagmaBurst;
|
||||
bool _hasSubmergedOnce;
|
||||
bool _isBanished;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_ragnarosAI>(creature);
|
||||
}
|
||||
|
||||
private:
|
||||
float const DEATH_ORIENTATION = 4.0f;
|
||||
uint32 _emergeTimer;
|
||||
uint8 _introState;
|
||||
bool _hasYelledMagmaBurst;
|
||||
bool _hasSubmergedOnce;
|
||||
bool _isBanished;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_ragnarosAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_son_of_flame : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_son_of_flame() : CreatureScript("npc_SonOfFlame") { }
|
||||
public:
|
||||
npc_son_of_flame() : CreatureScript("npc_SonOfFlame") { }
|
||||
|
||||
struct npc_son_of_flameAI : public ScriptedAI
|
||||
struct npc_son_of_flameAI : public ScriptedAI
|
||||
{
|
||||
npc_son_of_flameAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_son_of_flameAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override { instance->SetData(DATA_RAGNAROS_ADDS, 1); }
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_son_of_flameAI>(creature);
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override { instance->SetData(DATA_RAGNAROS_ADDS, 1); }
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_son_of_flameAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_ragnaros()
|
||||
|
||||
@@ -31,128 +31,128 @@ enum Events
|
||||
|
||||
class boss_shazzrah : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_shazzrah() : CreatureScript("boss_shazzrah") { }
|
||||
public:
|
||||
boss_shazzrah() : CreatureScript("boss_shazzrah") { }
|
||||
|
||||
struct boss_shazzrahAI : public BossAI
|
||||
struct boss_shazzrahAI : public BossAI
|
||||
{
|
||||
boss_shazzrahAI(Creature* creature) : BossAI(creature, BOSS_SHAZZRAH) { }
|
||||
|
||||
void EnterCombat(Unit* target)
|
||||
{
|
||||
boss_shazzrahAI(Creature* creature) : BossAI(creature, BOSS_SHAZZRAH) { }
|
||||
|
||||
void EnterCombat(Unit* target)
|
||||
{
|
||||
BossAI::EnterCombat(target);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 6000);
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_CURSE, 10000);
|
||||
events.ScheduleEvent(EVENT_MAGIC_GROUNDING, 24000);
|
||||
events.ScheduleEvent(EVENT_COUNTERSPELL, 15000);
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_GATE, 45000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ARCANE_EXPLOSION:
|
||||
DoCastVictim(SPELL_ARCANE_EXPLOSION);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(4000, 7000));
|
||||
break;
|
||||
// Triggered subsequent to using "Gate of Shazzrah".
|
||||
case EVENT_ARCANE_EXPLOSION_TRIGGERED:
|
||||
DoCastVictim(SPELL_ARCANE_EXPLOSION);
|
||||
break;
|
||||
case EVENT_SHAZZRAH_CURSE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_SHAZZRAH_CURSE))
|
||||
DoCast(target, SPELL_SHAZZRAH_CURSE);
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_CURSE, urand(25000, 30000));
|
||||
break;
|
||||
case EVENT_MAGIC_GROUNDING:
|
||||
DoCast(me, SPELL_MAGIC_GROUNDING);
|
||||
events.ScheduleEvent(EVENT_MAGIC_GROUNDING, 35000);
|
||||
break;
|
||||
case EVENT_COUNTERSPELL:
|
||||
DoCastVictim(SPELL_COUNTERSPELL);
|
||||
events.ScheduleEvent(EVENT_COUNTERSPELL, urand(16000, 20000));
|
||||
break;
|
||||
case EVENT_SHAZZRAH_GATE:
|
||||
DoResetThreat();
|
||||
DoCastAOE(SPELL_SHAZZRAH_GATE_DUMMY);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION_TRIGGERED, 2000);
|
||||
events.RescheduleEvent(EVENT_ARCANE_EXPLOSION, urand(3000, 6000));
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_GATE, 45000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_shazzrahAI(creature);
|
||||
BossAI::EnterCombat(target);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 6000);
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_CURSE, 10000);
|
||||
events.ScheduleEvent(EVENT_MAGIC_GROUNDING, 24000);
|
||||
events.ScheduleEvent(EVENT_COUNTERSPELL, 15000);
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_GATE, 45000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ARCANE_EXPLOSION:
|
||||
DoCastVictim(SPELL_ARCANE_EXPLOSION);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(4000, 7000));
|
||||
break;
|
||||
// Triggered subsequent to using "Gate of Shazzrah".
|
||||
case EVENT_ARCANE_EXPLOSION_TRIGGERED:
|
||||
DoCastVictim(SPELL_ARCANE_EXPLOSION);
|
||||
break;
|
||||
case EVENT_SHAZZRAH_CURSE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_SHAZZRAH_CURSE))
|
||||
DoCast(target, SPELL_SHAZZRAH_CURSE);
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_CURSE, urand(25000, 30000));
|
||||
break;
|
||||
case EVENT_MAGIC_GROUNDING:
|
||||
DoCast(me, SPELL_MAGIC_GROUNDING);
|
||||
events.ScheduleEvent(EVENT_MAGIC_GROUNDING, 35000);
|
||||
break;
|
||||
case EVENT_COUNTERSPELL:
|
||||
DoCastVictim(SPELL_COUNTERSPELL);
|
||||
events.ScheduleEvent(EVENT_COUNTERSPELL, urand(16000, 20000));
|
||||
break;
|
||||
case EVENT_SHAZZRAH_GATE:
|
||||
DoResetThreat();
|
||||
DoCastAOE(SPELL_SHAZZRAH_GATE_DUMMY);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION_TRIGGERED, 2000);
|
||||
events.RescheduleEvent(EVENT_ARCANE_EXPLOSION, urand(3000, 6000));
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_GATE, 45000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_shazzrahAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// 23138 - Gate of Shazzrah
|
||||
class spell_shazzrah_gate_dummy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_shazzrah_gate_dummy() : SpellScriptLoader("spell_shazzrah_gate_dummy") { }
|
||||
public:
|
||||
spell_shazzrah_gate_dummy() : SpellScriptLoader("spell_shazzrah_gate_dummy") { }
|
||||
|
||||
class spell_shazzrah_gate_dummy_SpellScript : public SpellScript
|
||||
class spell_shazzrah_gate_dummy_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_shazzrah_gate_dummy_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
PrepareSpellScript(spell_shazzrah_gate_dummy_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAZZRAH_GATE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
WorldObject* target = acore::Containers::SelectRandomContainerElement(targets);
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->CastSpell(GetCaster(), SPELL_SHAZZRAH_GATE, true);
|
||||
if (Creature* creature = GetCaster()->ToCreature())
|
||||
creature->AI()->AttackStart(target); // Attack the target which caster will teleport to.
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_shazzrah_gate_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_shazzrah_gate_dummy_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_shazzrah_gate_dummy_SpellScript();
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAZZRAH_GATE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
WorldObject* target = acore::Containers::SelectRandomContainerElement(targets);
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->CastSpell(GetCaster(), SPELL_SHAZZRAH_GATE, true);
|
||||
if (Creature* creature = GetCaster()->ToCreature())
|
||||
creature->AI()->AttackStart(target); // Attack the target which caster will teleport to.
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_shazzrah_gate_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_shazzrah_gate_dummy_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_shazzrah_gate_dummy_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_shazzrah()
|
||||
|
||||
@@ -46,48 +46,48 @@ enum Events
|
||||
|
||||
class boss_sulfuron : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_sulfuron() : CreatureScript("boss_sulfuron") { }
|
||||
public:
|
||||
boss_sulfuron() : CreatureScript("boss_sulfuron") { }
|
||||
|
||||
struct boss_sulfuronAI : public BossAI
|
||||
struct boss_sulfuronAI : public BossAI
|
||||
{
|
||||
boss_sulfuronAI(Creature* creature) : BossAI(creature, BOSS_SULFURON_HARBINGER)
|
||||
{
|
||||
boss_sulfuronAI(Creature* creature) : BossAI(creature, BOSS_SULFURON_HARBINGER)
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_DARK_STRIKE, 10000);
|
||||
events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, 15000);
|
||||
events.ScheduleEvent(EVENT_INSPIRE, 13000);
|
||||
events.ScheduleEvent(EVENT_KNOCKDOWN, 6000);
|
||||
events.ScheduleEvent(EVENT_FLAMESPEAR, 2000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
BossAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_DARK_STRIKE, 10000);
|
||||
events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, 15000);
|
||||
events.ScheduleEvent(EVENT_INSPIRE, 13000);
|
||||
events.ScheduleEvent(EVENT_KNOCKDOWN, 6000);
|
||||
events.ScheduleEvent(EVENT_FLAMESPEAR, 2000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
switch (eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_DARK_STRIKE:
|
||||
DoCast(me, SPELL_DARK_STRIKE);
|
||||
events.ScheduleEvent(EVENT_DARK_STRIKE, urand(15000, 18000));
|
||||
break;
|
||||
case EVENT_DEMORALIZING_SHOUT:
|
||||
DoCastVictim(SPELL_DEMORALIZING_SHOUT);
|
||||
events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_INSPIRE:
|
||||
case EVENT_DARK_STRIKE:
|
||||
DoCast(me, SPELL_DARK_STRIKE);
|
||||
events.ScheduleEvent(EVENT_DARK_STRIKE, urand(15000, 18000));
|
||||
break;
|
||||
case EVENT_DEMORALIZING_SHOUT:
|
||||
DoCastVictim(SPELL_DEMORALIZING_SHOUT);
|
||||
events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_INSPIRE:
|
||||
{
|
||||
std::list<Creature*> healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE);
|
||||
if (!healers.empty())
|
||||
@@ -97,104 +97,104 @@ class boss_sulfuron : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_INSPIRE, urand(20000, 26000));
|
||||
break;
|
||||
}
|
||||
case EVENT_KNOCKDOWN:
|
||||
DoCastVictim(SPELL_KNOCKDOWN);
|
||||
events.ScheduleEvent(EVENT_KNOCKDOWN, urand(12000, 15000));
|
||||
break;
|
||||
case EVENT_FLAMESPEAR:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
DoCast(target, SPELL_FLAMESPEAR);
|
||||
events.ScheduleEvent(EVENT_FLAMESPEAR, urand(12000, 16000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case EVENT_KNOCKDOWN:
|
||||
DoCastVictim(SPELL_KNOCKDOWN);
|
||||
events.ScheduleEvent(EVENT_KNOCKDOWN, urand(12000, 15000));
|
||||
break;
|
||||
case EVENT_FLAMESPEAR:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
DoCast(target, SPELL_FLAMESPEAR);
|
||||
events.ScheduleEvent(EVENT_FLAMESPEAR, urand(12000, 16000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_sulfuronAI(creature);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_sulfuronAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_flamewaker_priest : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_flamewaker_priest() : CreatureScript("npc_flamewaker_priest") { }
|
||||
public:
|
||||
npc_flamewaker_priest() : CreatureScript("npc_flamewaker_priest") { }
|
||||
|
||||
struct npc_flamewaker_priestAI : public ScriptedAI
|
||||
struct npc_flamewaker_priestAI : public ScriptedAI
|
||||
{
|
||||
npc_flamewaker_priestAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
npc_flamewaker_priestAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
ScriptedAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_HEAL, urand(15000, 30000));
|
||||
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 2000);
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, 8000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_HEAL:
|
||||
if (Unit* target = DoSelectLowestHpFriendly(60.0f, 1))
|
||||
DoCast(target, SPELL_HEAL);
|
||||
events.ScheduleEvent(EVENT_HEAL, urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_SHADOW_WORD_PAIN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_SHADOWWORDPAIN))
|
||||
DoCast(target, SPELL_SHADOWWORDPAIN);
|
||||
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(18000, 26000));
|
||||
break;
|
||||
case EVENT_IMMOLATE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_IMMOLATE))
|
||||
DoCast(target, SPELL_IMMOLATE);
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, urand(15000, 25000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_flamewaker_priestAI(creature);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* victim)
|
||||
{
|
||||
ScriptedAI::EnterCombat(victim);
|
||||
events.ScheduleEvent(EVENT_HEAL, urand(15000, 30000));
|
||||
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 2000);
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, 8000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_HEAL:
|
||||
if (Unit* target = DoSelectLowestHpFriendly(60.0f, 1))
|
||||
DoCast(target, SPELL_HEAL);
|
||||
events.ScheduleEvent(EVENT_HEAL, urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_SHADOW_WORD_PAIN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_SHADOWWORDPAIN))
|
||||
DoCast(target, SPELL_SHADOWWORDPAIN);
|
||||
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(18000, 26000));
|
||||
break;
|
||||
case EVENT_IMMOLATE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_IMMOLATE))
|
||||
DoCast(target, SPELL_IMMOLATE);
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, urand(15000, 25000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_flamewaker_priestAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_sulfuron()
|
||||
|
||||
@@ -34,219 +34,220 @@ Position const SummonPositions[10] =
|
||||
|
||||
class instance_molten_core : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_molten_core() : InstanceMapScript("instance_molten_core", 409) { }
|
||||
public:
|
||||
instance_molten_core() : InstanceMapScript("instance_molten_core", 409) { }
|
||||
|
||||
struct instance_molten_core_InstanceMapScript : public InstanceScript
|
||||
struct instance_molten_core_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_molten_core_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
instance_molten_core_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
_golemaggTheIncineratorGUID = 0;
|
||||
_majordomoExecutusGUID = 0;
|
||||
_cacheOfTheFirelordGUID = 0;
|
||||
_deadBossCount = 0;
|
||||
_ragnarosAddDeaths = 0;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* /*player*/) override
|
||||
{
|
||||
if (CheckMajordomoExecutus())
|
||||
SummonMajordomoExecutus();
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
_golemaggTheIncineratorGUID = 0;
|
||||
_majordomoExecutusGUID = 0;
|
||||
_cacheOfTheFirelordGUID = 0;
|
||||
_deadBossCount = 0;
|
||||
_ragnarosAddDeaths = 0;
|
||||
case NPC_GOLEMAGG_THE_INCINERATOR:
|
||||
_golemaggTheIncineratorGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_MAJORDOMO_EXECUTUS:
|
||||
_majordomoExecutusGUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_CACHE_OF_THE_FIRELORD:
|
||||
_cacheOfTheFirelordGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_BARON:
|
||||
_circlesGUIDs[5] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_GARR:
|
||||
_circlesGUIDs[3] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_GEHENNAS:
|
||||
_circlesGUIDs[2] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_GOLEMAGG:
|
||||
_circlesGUIDs[7] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_MAGMADAR:
|
||||
_circlesGUIDs[1] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_SHAZZRAH:
|
||||
_circlesGUIDs[4] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_SULFURON:
|
||||
_circlesGUIDs[6] = go->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
if (type == DATA_RAGNAROS_ADDS)
|
||||
{
|
||||
if (data == 1)
|
||||
++_ragnarosAddDeaths;
|
||||
else if (data == 0)
|
||||
_ragnarosAddDeaths = 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_RAGNAROS_ADDS:
|
||||
return _ragnarosAddDeaths;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* /*player*/) override
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case BOSS_GOLEMAGG_THE_INCINERATOR:
|
||||
return _golemaggTheIncineratorGUID;
|
||||
case BOSS_MAJORDOMO_EXECUTUS:
|
||||
return _majordomoExecutusGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 bossId, EncounterState state) override
|
||||
{
|
||||
if (!InstanceScript::SetBossState(bossId, state))
|
||||
return false;
|
||||
|
||||
if (state == DONE && bossId < BOSS_MAJORDOMO_EXECUTUS)
|
||||
if (CheckMajordomoExecutus())
|
||||
SummonMajordomoExecutus();
|
||||
|
||||
if (bossId == BOSS_MAJORDOMO_EXECUTUS && state == DONE)
|
||||
{
|
||||
DoRespawnGameObject(_cacheOfTheFirelordGUID, 7 * DAY);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SummonMajordomoExecutus()
|
||||
{
|
||||
if (_majordomoExecutusGUID)
|
||||
return;
|
||||
|
||||
if (GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE)
|
||||
{
|
||||
instance->SummonCreature(NPC_MAJORDOMO_EXECUTUS, SummonPositions[0]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_HEALER, SummonPositions[1]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_HEALER, SummonPositions[2]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_HEALER, SummonPositions[3]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_HEALER, SummonPositions[4]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_ELITE, SummonPositions[5]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_ELITE, SummonPositions[6]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_ELITE, SummonPositions[7]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_ELITE, SummonPositions[8]);
|
||||
}
|
||||
else if (TempSummon* summon = instance->SummonCreature(NPC_MAJORDOMO_EXECUTUS, RagnarosTelePos))
|
||||
summon->AI()->DoAction(ACTION_START_RAGNAROS_ALT);
|
||||
}
|
||||
|
||||
bool CheckMajordomoExecutus() const
|
||||
{
|
||||
if (GetBossState(BOSS_RAGNAROS) == DONE)
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < BOSS_MAJORDOMO_EXECUTUS; ++i)
|
||||
if (GetBossState(i) != DONE)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData() override
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "M C " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(char const* data) override
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(data);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(data);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'M' && dataHead2 == 'C')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > TO_BE_DECIDED)
|
||||
tmpState = NOT_STARTED;
|
||||
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
|
||||
if (CheckMajordomoExecutus())
|
||||
SummonMajordomoExecutus();
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_GOLEMAGG_THE_INCINERATOR:
|
||||
_golemaggTheIncineratorGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_MAJORDOMO_EXECUTUS:
|
||||
_majordomoExecutusGUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_CACHE_OF_THE_FIRELORD:
|
||||
_cacheOfTheFirelordGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_BARON:
|
||||
_circlesGUIDs[5] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_GARR:
|
||||
_circlesGUIDs[3] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_GEHENNAS:
|
||||
_circlesGUIDs[2] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_GOLEMAGG:
|
||||
_circlesGUIDs[7] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_MAGMADAR:
|
||||
_circlesGUIDs[1] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_SHAZZRAH:
|
||||
_circlesGUIDs[4] = go->GetGUID();
|
||||
break;
|
||||
case GO_CIRCLE_SULFURON:
|
||||
_circlesGUIDs[6] = go->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
if (type == DATA_RAGNAROS_ADDS)
|
||||
{
|
||||
if (data == 1)
|
||||
++_ragnarosAddDeaths;
|
||||
else if (data == 0)
|
||||
_ragnarosAddDeaths = 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_RAGNAROS_ADDS:
|
||||
return _ragnarosAddDeaths;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case BOSS_GOLEMAGG_THE_INCINERATOR:
|
||||
return _golemaggTheIncineratorGUID;
|
||||
case BOSS_MAJORDOMO_EXECUTUS:
|
||||
return _majordomoExecutusGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 bossId, EncounterState state) override
|
||||
{
|
||||
if (!InstanceScript::SetBossState(bossId, state))
|
||||
return false;
|
||||
|
||||
if (state == DONE && bossId < BOSS_MAJORDOMO_EXECUTUS)
|
||||
if (CheckMajordomoExecutus())
|
||||
SummonMajordomoExecutus();
|
||||
|
||||
if (bossId == BOSS_MAJORDOMO_EXECUTUS && state == DONE) {
|
||||
DoRespawnGameObject(_cacheOfTheFirelordGUID, 7 * DAY);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SummonMajordomoExecutus()
|
||||
{
|
||||
if (_majordomoExecutusGUID)
|
||||
return;
|
||||
|
||||
if (GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE)
|
||||
{
|
||||
instance->SummonCreature(NPC_MAJORDOMO_EXECUTUS, SummonPositions[0]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_HEALER, SummonPositions[1]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_HEALER, SummonPositions[2]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_HEALER, SummonPositions[3]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_HEALER, SummonPositions[4]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_ELITE, SummonPositions[5]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_ELITE, SummonPositions[6]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_ELITE, SummonPositions[7]);
|
||||
instance->SummonCreature(NPC_FLAMEWAKER_ELITE, SummonPositions[8]);
|
||||
}
|
||||
else if (TempSummon* summon = instance->SummonCreature(NPC_MAJORDOMO_EXECUTUS, RagnarosTelePos))
|
||||
summon->AI()->DoAction(ACTION_START_RAGNAROS_ALT);
|
||||
}
|
||||
|
||||
bool CheckMajordomoExecutus() const
|
||||
{
|
||||
if (GetBossState(BOSS_RAGNAROS) == DONE)
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < BOSS_MAJORDOMO_EXECUTUS; ++i)
|
||||
if (GetBossState(i) != DONE)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData() override
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "M C " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(char const* data) override
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(data);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(data);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'M' && dataHead2 == 'C')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > TO_BE_DECIDED)
|
||||
tmpState = NOT_STARTED;
|
||||
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
|
||||
if (CheckMajordomoExecutus())
|
||||
SummonMajordomoExecutus();
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _golemaggTheIncineratorGUID;
|
||||
uint64 _majordomoExecutusGUID;
|
||||
uint64 _cacheOfTheFirelordGUID;
|
||||
uint8 _deadBossCount;
|
||||
uint8 _ragnarosAddDeaths;
|
||||
std::unordered_map<uint8, uint64> _circlesGUIDs;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_molten_core_InstanceMapScript(map);
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _golemaggTheIncineratorGUID;
|
||||
uint64 _majordomoExecutusGUID;
|
||||
uint64 _cacheOfTheFirelordGUID;
|
||||
uint8 _deadBossCount;
|
||||
uint8 _ragnarosAddDeaths;
|
||||
std::unordered_map<uint8, uint64> _circlesGUIDs;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_molten_core_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_molten_core()
|
||||
|
||||
@@ -28,124 +28,124 @@ enum Spels
|
||||
|
||||
class boss_mr_smite : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_mr_smite() : CreatureScript("boss_mr_smite") { }
|
||||
public:
|
||||
boss_mr_smite() : CreatureScript("boss_mr_smite") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_mr_smiteAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_mr_smiteAI : public ScriptedAI
|
||||
{
|
||||
boss_mr_smiteAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
return GetInstanceAI<boss_mr_smiteAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_mr_smiteAI : public ScriptedAI
|
||||
EventMap events;
|
||||
bool health67;
|
||||
bool health34;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
boss_mr_smiteAI(Creature* creature) : ScriptedAI(creature)
|
||||
health67 = false;
|
||||
health34 = false;
|
||||
me->LoadEquipment(EQUIP_SWORD);
|
||||
me->SetCanDualWield(false);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH1, 500);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH2, 500);
|
||||
events.ScheduleEvent(EVENT_SMITE_SLAM, 3000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SMITE_SLAM:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SMITE_SLAM, false);
|
||||
events.ScheduleEvent(EVENT_SMITE_SLAM, 15000);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH1:
|
||||
if (me->HealthBelowPct(67) && !health67)
|
||||
{
|
||||
me->CastSpell(me, SPELL_SMITE_STOMP, false);
|
||||
events.DelayEvents(10000);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(EQUIP_TWO_SWORDS, 1.859f, -780.72f, 9.831f);
|
||||
Talk(SAY_SWAP1);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
health67 = true;
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH1, 500);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH2:
|
||||
if (me->HealthBelowPct(34) && !health34)
|
||||
{
|
||||
me->CastSpell(me, SPELL_SMITE_STOMP, false);
|
||||
events.DelayEvents(10000);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(EQUIP_MACE, 1.859f, -780.72f, 9.831f);
|
||||
Talk(SAY_SWAP2);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
health34 = true;
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH2, 500);
|
||||
break;
|
||||
case EVENT_SWAP_WEAPON1:
|
||||
me->LoadEquipment(EQUIP_TWO_SWORDS);
|
||||
me->SetCanDualWield(true);
|
||||
break;
|
||||
case EVENT_SWAP_WEAPON2:
|
||||
me->LoadEquipment(EQUIP_MACE);
|
||||
me->SetCanDualWield(false);
|
||||
break;
|
||||
case EVENT_RESTORE_COMBAT:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
if (me->GetVictim())
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
me->SetTarget(me->GetVictim()->GetGUID());
|
||||
}
|
||||
break;
|
||||
case EVENT_KNEEL:
|
||||
me->SendMeleeAttackStop(me->GetVictim());
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
break;
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
bool health67;
|
||||
bool health34;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
health67 = false;
|
||||
health34 = false;
|
||||
me->LoadEquipment(EQUIP_SWORD);
|
||||
me->SetCanDualWield(false);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH1, 500);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH2, 500);
|
||||
events.ScheduleEvent(EVENT_SMITE_SLAM, 3000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SMITE_SLAM:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SMITE_SLAM, false);
|
||||
events.ScheduleEvent(EVENT_SMITE_SLAM, 15000);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH1:
|
||||
if (me->HealthBelowPct(67) && !health67)
|
||||
{
|
||||
me->CastSpell(me, SPELL_SMITE_STOMP, false);
|
||||
events.DelayEvents(10000);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(EQUIP_TWO_SWORDS, 1.859f, -780.72f, 9.831f);
|
||||
Talk(SAY_SWAP1);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
health67 = true;
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH1, 500);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH2:
|
||||
if (me->HealthBelowPct(34) && !health34)
|
||||
{
|
||||
me->CastSpell(me, SPELL_SMITE_STOMP, false);
|
||||
events.DelayEvents(10000);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(EQUIP_MACE, 1.859f, -780.72f, 9.831f);
|
||||
Talk(SAY_SWAP2);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
health34 = true;
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH2, 500);
|
||||
break;
|
||||
case EVENT_SWAP_WEAPON1:
|
||||
me->LoadEquipment(EQUIP_TWO_SWORDS);
|
||||
me->SetCanDualWield(true);
|
||||
break;
|
||||
case EVENT_SWAP_WEAPON2:
|
||||
me->LoadEquipment(EQUIP_MACE);
|
||||
me->SetCanDualWield(false);
|
||||
break;
|
||||
case EVENT_RESTORE_COMBAT:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
if (me->GetVictim())
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
me->SetTarget(me->GetVictim()->GetGUID());
|
||||
}
|
||||
break;
|
||||
case EVENT_KNEEL:
|
||||
me->SendMeleeAttackStop(me->GetVictim());
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
me->SetTarget(0);
|
||||
me->SetFacingTo(5.558f);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
events.ScheduleEvent(point == EQUIP_TWO_SWORDS ? EVENT_SWAP_WEAPON1 : EVENT_SWAP_WEAPON2, 1500);
|
||||
events.ScheduleEvent(EVENT_RESTORE_COMBAT, 3000);
|
||||
events.ScheduleEvent(EVENT_KNEEL, 0);
|
||||
}
|
||||
};
|
||||
me->SetTarget(0);
|
||||
me->SetFacingTo(5.558f);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
events.ScheduleEvent(point == EQUIP_TWO_SWORDS ? EVENT_SWAP_WEAPON1 : EVENT_SWAP_WEAPON2, 1500);
|
||||
events.ScheduleEvent(EVENT_RESTORE_COMBAT, 3000);
|
||||
events.ScheduleEvent(EVENT_KNEEL, 0);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_mr_smite()
|
||||
|
||||
@@ -8,83 +8,83 @@
|
||||
|
||||
class instance_deadmines : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_deadmines() : InstanceMapScript("instance_deadmines", 36) { }
|
||||
public:
|
||||
instance_deadmines() : InstanceMapScript("instance_deadmines", 36) { }
|
||||
|
||||
struct instance_deadmines_InstanceMapScript : public InstanceScript
|
||||
struct instance_deadmines_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_deadmines_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
instance_deadmines_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_FACTORY_DOOR:
|
||||
if (_encounters[TYPE_RHAHK_ZOR] == DONE)
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_IRON_CLAD_DOOR:
|
||||
if (_encounters[TYPE_CANNON] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_RHAHK_ZOR:
|
||||
case TYPE_CANNON:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D E " << _encounters[0] << ' ' << _encounters[1];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'D' && dataHead2 == 'E')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_deadmines_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_FACTORY_DOOR:
|
||||
if (_encounters[TYPE_RHAHK_ZOR] == DONE)
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_IRON_CLAD_DOOR:
|
||||
if (_encounters[TYPE_CANNON] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_RHAHK_ZOR:
|
||||
case TYPE_CANNON:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D E " << _encounters[0] << ' ' << _encounters[1];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'D' && dataHead2 == 'E')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_deadmines_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_deadmines()
|
||||
|
||||
@@ -10,20 +10,20 @@
|
||||
|
||||
class instance_gnomeregan : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_gnomeregan() : InstanceMapScript("instance_gnomeregan", 90) { }
|
||||
public:
|
||||
instance_gnomeregan() : InstanceMapScript("instance_gnomeregan", 90) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_gnomeregan_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_gnomeregan_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_gnomeregan_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
return new instance_gnomeregan_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_gnomeregan_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_gnomeregan_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
enum eKernobee
|
||||
@@ -33,83 +33,83 @@ enum eKernobee
|
||||
|
||||
class npc_kernobee : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_kernobee() : CreatureScript("npc_kernobee") { }
|
||||
public:
|
||||
npc_kernobee() : CreatureScript("npc_kernobee") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_kernobeeAI(creature);
|
||||
}
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_A_FINE_MESS)
|
||||
{
|
||||
return new npc_kernobeeAI(creature);
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
creature->AI()->SetGUID(player->GetGUID(), 0);
|
||||
creature->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, M_PI, MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_kernobeeAI : public PassiveAI
|
||||
{
|
||||
npc_kernobeeAI(Creature* creature) : PassiveAI(creature)
|
||||
{
|
||||
playerGUID = 0;
|
||||
checkTimer = 0;
|
||||
}
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
|
||||
uint32 checkTimer;
|
||||
uint64 playerGUID;
|
||||
|
||||
void SetGUID(uint64 guid, int32)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_A_FINE_MESS)
|
||||
{
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
creature->AI()->SetGUID(player->GetGUID(), 0);
|
||||
creature->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, M_PI, MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
return true;
|
||||
playerGUID = guid;
|
||||
}
|
||||
|
||||
struct npc_kernobeeAI : public PassiveAI
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
npc_kernobeeAI(Creature* creature) : PassiveAI(creature)
|
||||
checkTimer += diff;
|
||||
if (checkTimer >= 2000)
|
||||
{
|
||||
playerGUID = 0;
|
||||
checkTimer = 0;
|
||||
}
|
||||
|
||||
uint32 checkTimer;
|
||||
uint64 playerGUID;
|
||||
|
||||
void SetGUID(uint64 guid, int32)
|
||||
{
|
||||
playerGUID = guid;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
checkTimer += diff;
|
||||
if (checkTimer >= 2000)
|
||||
if (me->GetDistance(-332.2f, -2.8f, -152.8f) < 5.0f)
|
||||
{
|
||||
checkTimer = 0;
|
||||
if (me->GetDistance(-332.2f, -2.8f, -152.8f) < 5.0f)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
player->GroupEventHappens(QUEST_A_FINE_MESS, me);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
player->GroupEventHappens(QUEST_A_FINE_MESS, me);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_gnomeregan_radiation_bolt : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gnomeregan_radiation_bolt() : SpellScriptLoader("spell_gnomeregan_radiation_bolt") { }
|
||||
public:
|
||||
spell_gnomeregan_radiation_bolt() : SpellScriptLoader("spell_gnomeregan_radiation_bolt") { }
|
||||
|
||||
class spell_gnomeregan_radiation_bolt_SpellScript : public SpellScript
|
||||
class spell_gnomeregan_radiation_bolt_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gnomeregan_radiation_bolt_SpellScript);
|
||||
|
||||
void HandleTriggerSpell(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_gnomeregan_radiation_bolt_SpellScript);
|
||||
|
||||
void HandleTriggerSpell(SpellEffIndex effIndex)
|
||||
{
|
||||
if (roll_chance_i(80))
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_gnomeregan_radiation_bolt_SpellScript::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gnomeregan_radiation_bolt_SpellScript;
|
||||
if (roll_chance_i(80))
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_gnomeregan_radiation_bolt_SpellScript::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gnomeregan_radiation_bolt_SpellScript;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_gnomeregan()
|
||||
|
||||
@@ -35,93 +35,93 @@ enum Curator
|
||||
|
||||
class boss_curator : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_curator() : CreatureScript("boss_curator") { }
|
||||
public:
|
||||
boss_curator() : CreatureScript("boss_curator") { }
|
||||
|
||||
struct boss_curatorAI : public BossAI
|
||||
struct boss_curatorAI : public BossAI
|
||||
{
|
||||
boss_curatorAI(Creature* creature) : BossAI(creature, DATA_CURATOR) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
boss_curatorAI(Creature* creature) : BossAI(creature, DATA_CURATOR) { }
|
||||
BossAI::Reset();
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_MANA_LEECH, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_POWER_BURN, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_POWER_BURN, true);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_MANA_LEECH, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_POWER_BURN, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_POWER_BURN, true);
|
||||
Talk(SAY_KILL);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_HATEFUL_BOLT, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ASTRAL_FLARE, 6000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BERSERK, 600000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (Unit* target = summon->SelectNearbyTarget(nullptr, 40.0f))
|
||||
{
|
||||
summon->AI()->AttackStart(target);
|
||||
summon->AddThreat(target, 1000.0f);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_HATEFUL_BOLT, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ASTRAL_FLARE, 6000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BERSERK, 600000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (Unit* target = summon->SelectNearbyTarget(nullptr, 40.0f))
|
||||
{
|
||||
summon->AI()->AttackStart(target);
|
||||
summon->AddThreat(target, 1000.0f);
|
||||
}
|
||||
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(16))
|
||||
{
|
||||
events.CancelEvent(EVENT_SPELL_ASTRAL_FLARE);
|
||||
me->CastSpell(me, SPELL_ARCANE_INFUSION, true);
|
||||
Talk(SAY_ENRAGE);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_BERSERK:
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(16))
|
||||
{
|
||||
events.CancelEvent(EVENT_SPELL_ASTRAL_FLARE);
|
||||
me->CastSpell(me, SPELL_ARCANE_INFUSION, true);
|
||||
Talk(SAY_ENRAGE);
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
me->CastSpell(me, SPELL_ASTRAL_DECONSTRUCTION, true);
|
||||
break;
|
||||
case EVENT_SPELL_HATEFUL_BOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, urand(1, 2), 40.0f))
|
||||
me->CastSpell(target, SPELL_HATEFUL_BOLT, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_HATEFUL_BOLT, urand(5000, 7500) * (events.GetNextEventTime(EVENT_SPELL_BERSERK) == 0 ? 1 : 2));
|
||||
break;
|
||||
case EVENT_SPELL_ASTRAL_FLARE:
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_BERSERK:
|
||||
Talk(SAY_ENRAGE);
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
me->CastSpell(me, SPELL_ASTRAL_DECONSTRUCTION, true);
|
||||
break;
|
||||
case EVENT_SPELL_HATEFUL_BOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, urand(1, 2), 40.0f))
|
||||
me->CastSpell(target, SPELL_HATEFUL_BOLT, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_HATEFUL_BOLT, urand(5000, 7500) * (events.GetNextEventTime(EVENT_SPELL_BERSERK) == 0 ? 1 : 2));
|
||||
break;
|
||||
case EVENT_SPELL_ASTRAL_FLARE:
|
||||
{
|
||||
me->CastSpell(me, RAND(SPELL_SUMMON_ASTRAL_FLARE1, SPELL_SUMMON_ASTRAL_FLARE2, SPELL_SUMMON_ASTRAL_FLARE3, SPELL_SUMMON_ASTRAL_FLARE4), false);
|
||||
int32 mana = CalculatePct(me->GetMaxPower(POWER_MANA), 10);
|
||||
@@ -144,16 +144,16 @@ class boss_curator : public CreatureScript
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_curatorAI>(creature);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_curatorAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_curator()
|
||||
|
||||
@@ -28,84 +28,84 @@ enum MaidenOfVirtue
|
||||
|
||||
class boss_maiden_of_virtue : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_maiden_of_virtue() : CreatureScript("boss_maiden_of_virtue") { }
|
||||
public:
|
||||
boss_maiden_of_virtue() : CreatureScript("boss_maiden_of_virtue") { }
|
||||
|
||||
struct boss_maiden_of_virtueAI : public BossAI
|
||||
struct boss_maiden_of_virtueAI : public BossAI
|
||||
{
|
||||
boss_maiden_of_virtueAI(Creature* creature) : BossAI(creature, DATA_MAIDEN) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
boss_maiden_of_virtueAI(Creature* creature) : BossAI(creature, DATA_MAIDEN) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
me->CastSpell(me, SPELL_HOLY_GROUND, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_REPENTANCE, 25000);
|
||||
events.ScheduleEvent(EVENT_SPELL_HOLY_FIRE, 8000);
|
||||
events.ScheduleEvent(EVENT_SPELL_HOLY_WRATH, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_REPENTANCE:
|
||||
me->CastSpell(me, SPELL_REPENTANCE, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_REPENTANCE, urand(25000, 35000));
|
||||
break;
|
||||
case EVENT_SPELL_HOLY_FIRE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
|
||||
me->CastSpell(target, SPELL_HOLY_FIRE, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_HOLY_FIRE, urand(8000, 18000));
|
||||
break;
|
||||
case EVENT_SPELL_HOLY_WRATH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
|
||||
me->CastSpell(target, SPELL_HOLY_WRATH, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_HOLY_WRATH, urand(20000, 25000));
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_maiden_of_virtueAI>(creature);
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
me->CastSpell(me, SPELL_HOLY_GROUND, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_REPENTANCE, 25000);
|
||||
events.ScheduleEvent(EVENT_SPELL_HOLY_FIRE, 8000);
|
||||
events.ScheduleEvent(EVENT_SPELL_HOLY_WRATH, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_REPENTANCE:
|
||||
me->CastSpell(me, SPELL_REPENTANCE, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_REPENTANCE, urand(25000, 35000));
|
||||
break;
|
||||
case EVENT_SPELL_HOLY_FIRE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
|
||||
me->CastSpell(target, SPELL_HOLY_FIRE, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_HOLY_FIRE, urand(8000, 18000));
|
||||
break;
|
||||
case EVENT_SPELL_HOLY_WRATH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
|
||||
me->CastSpell(target, SPELL_HOLY_WRATH, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_HOLY_WRATH, urand(20000, 25000));
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_maiden_of_virtueAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_maiden_of_virtue()
|
||||
|
||||
@@ -68,381 +68,381 @@ enum eMisc
|
||||
|
||||
class boss_midnight : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_midnight() : CreatureScript("boss_midnight") { }
|
||||
public:
|
||||
boss_midnight() : CreatureScript("boss_midnight") { }
|
||||
|
||||
struct boss_midnightAI : public BossAI
|
||||
struct boss_midnightAI : public BossAI
|
||||
{
|
||||
boss_midnightAI(Creature* creature) : BossAI(creature, DATA_ATTUMEN) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
boss_midnightAI(Creature* creature) : BossAI(creature, DATA_ATTUMEN) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->SetVisible(true);
|
||||
_healthPct = 100.0f;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH_95, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 6000);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (Creature* attumen = summons.GetCreatureWithEntry(NPC_ATTUMEN_THE_HUNTSMAN))
|
||||
attumen->AI()->Talk(SAY_ATTUMEN_MIDNIGHT_KILL);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->SetInCombatWithZone();
|
||||
|
||||
if (summon->GetEntry() == NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED)
|
||||
{
|
||||
summon->SetHealth(summon->CountPctFromMaxHealth(_healthPct));
|
||||
summon->CastSpell(summon, SPELL_SPAWN_SMOKE2, true);
|
||||
}
|
||||
else
|
||||
summon->CastSpell(summon, SPELL_SPAWN_SMOKE1, true);
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 /*data*/)
|
||||
{
|
||||
if (type == DATA_ATTUMEN_READY)
|
||||
events.ScheduleEvent(EVENT_SUMMON_ATTUMEN_MOUNTED, 0);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit* /*killer*/)
|
||||
{
|
||||
if (summon->GetEntry() == NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED)
|
||||
{
|
||||
summons.clear();
|
||||
Unit::Kill(me, me);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH_95:
|
||||
if (me->HealthBelowPct(96))
|
||||
{
|
||||
me->CastSpell(me, SPELL_SUMMON_ATTUMEN, true);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 0);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH_95, 500);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH_25:
|
||||
if (me->HealthBelowPct(25))
|
||||
{
|
||||
Talk(SAY_MIDNIGHT_EMOTE);
|
||||
me->CastSpell(me, SPELL_MOUNT_TARGET_ATTUMEN, true);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 500);
|
||||
break;
|
||||
case EVENT_SPELL_KNOCKDOWN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_KNOCKDOWN, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 20000);
|
||||
break;
|
||||
case EVENT_SUMMON_ATTUMEN_MOUNTED:
|
||||
if (Creature* attumen = summons.GetCreatureWithEntry(NPC_ATTUMEN_THE_HUNTSMAN))
|
||||
{
|
||||
_healthPct = std::max<float>(me->GetHealthPct(), attumen->GetHealthPct());
|
||||
attumen->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
me->CastSpell(me, SPELL_SUMMON_ATTUMEN_MOUNTED, true);
|
||||
me->SetVisible(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->IsVisible())
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return me->GetHomePosition().GetExactDist2d(me) > 50.0f || me->GetPositionZ() > 60.0f;
|
||||
}
|
||||
|
||||
private:
|
||||
float _healthPct;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_midnightAI>(creature);
|
||||
BossAI::Reset();
|
||||
me->SetVisible(true);
|
||||
_healthPct = 100.0f;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH_95, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 6000);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (Creature* attumen = summons.GetCreatureWithEntry(NPC_ATTUMEN_THE_HUNTSMAN))
|
||||
attumen->AI()->Talk(SAY_ATTUMEN_MIDNIGHT_KILL);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->SetInCombatWithZone();
|
||||
|
||||
if (summon->GetEntry() == NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED)
|
||||
{
|
||||
summon->SetHealth(summon->CountPctFromMaxHealth(_healthPct));
|
||||
summon->CastSpell(summon, SPELL_SPAWN_SMOKE2, true);
|
||||
}
|
||||
else
|
||||
summon->CastSpell(summon, SPELL_SPAWN_SMOKE1, true);
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 /*data*/)
|
||||
{
|
||||
if (type == DATA_ATTUMEN_READY)
|
||||
events.ScheduleEvent(EVENT_SUMMON_ATTUMEN_MOUNTED, 0);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit* /*killer*/)
|
||||
{
|
||||
if (summon->GetEntry() == NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED)
|
||||
{
|
||||
summons.clear();
|
||||
Unit::Kill(me, me);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH_95:
|
||||
if (me->HealthBelowPct(96))
|
||||
{
|
||||
me->CastSpell(me, SPELL_SUMMON_ATTUMEN, true);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 0);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH_95, 500);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH_25:
|
||||
if (me->HealthBelowPct(25))
|
||||
{
|
||||
Talk(SAY_MIDNIGHT_EMOTE);
|
||||
me->CastSpell(me, SPELL_MOUNT_TARGET_ATTUMEN, true);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 500);
|
||||
break;
|
||||
case EVENT_SPELL_KNOCKDOWN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_KNOCKDOWN, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 20000);
|
||||
break;
|
||||
case EVENT_SUMMON_ATTUMEN_MOUNTED:
|
||||
if (Creature* attumen = summons.GetCreatureWithEntry(NPC_ATTUMEN_THE_HUNTSMAN))
|
||||
{
|
||||
_healthPct = std::max<float>(me->GetHealthPct(), attumen->GetHealthPct());
|
||||
attumen->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
me->CastSpell(me, SPELL_SUMMON_ATTUMEN_MOUNTED, true);
|
||||
me->SetVisible(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->IsVisible())
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return me->GetHomePosition().GetExactDist2d(me) > 50.0f || me->GetPositionZ() > 60.0f;
|
||||
}
|
||||
|
||||
private:
|
||||
float _healthPct;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_midnightAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_attumen : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_attumen() : CreatureScript("boss_attumen") { }
|
||||
public:
|
||||
boss_attumen() : CreatureScript("boss_attumen") { }
|
||||
|
||||
struct boss_attumenAI : public ScriptedAI
|
||||
struct boss_attumenAI : public ScriptedAI
|
||||
{
|
||||
boss_attumenAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
boss_attumenAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_ATTUMEN1_APPEAR);
|
||||
_events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 0);
|
||||
_events.ScheduleEvent(EVENT_SPELL_SHADOW_CLEAVE, 6000);
|
||||
_events.ScheduleEvent(EVENT_SPELL_INTANGIBLE_PRESENCE, 15000);
|
||||
_events.ScheduleEvent(EVENT_RANDOM_YELL, urand(25000, 45000));
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (_events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
Talk(SAY_ATTUMEN_KILL);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Mechanic == MECHANIC_DISARM && _events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
Talk(SAY_ATTUMEN_DISARM);
|
||||
}
|
||||
else if (spellInfo->Id == SPELL_MOUNT_TARGET_ATTUMEN)
|
||||
{
|
||||
me->CastSpell(me, SPELL_MOUNT_TARGET_MIDNIGHT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Id == SPELL_MOUNT_TARGET_MIDNIGHT)
|
||||
{
|
||||
Talk(SAY_ATTUMEN1_MOUNT);
|
||||
_events.Reset();
|
||||
me->GetMotionMaster()->MovePoint(POINT_MOVE_TO_MIDNIGHT, target->GetPositionX() + 2.0f*cos(target->GetAngle(me)), target->GetPositionY() + 2.0f*sin(target->GetAngle(me)), target->GetPositionZ()+0.2f, true, true, MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && point == POINT_MOVE_TO_MIDNIGHT)
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* midnight = summon->GetSummoner())
|
||||
midnight->GetAI()->SetData(DATA_ATTUMEN_READY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (_events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOW_CLEAVE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHADOW_CLEAVE, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_SHADOW_CLEAVE, urand(9000, 14000));
|
||||
break;
|
||||
case EVENT_SPELL_INTANGIBLE_PRESENCE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_INTANGIBLE_PRESENCE, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_INTANGIBLE_PRESENCE, 30000);
|
||||
break;
|
||||
case EVENT_RANDOM_YELL:
|
||||
Talk(SAY_ATTUMEN_RANDOM);
|
||||
_events.ScheduleEvent(EVENT_RANDOM_YELL, urand(30000, 70000));
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH_25:
|
||||
if (me->HealthBelowPct(25))
|
||||
{
|
||||
me->CastSpell(me, SPELL_MOUNT_TARGET_MIDNIGHT, true);
|
||||
break;
|
||||
}
|
||||
_events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_attumenAI>(creature);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_ATTUMEN1_APPEAR);
|
||||
_events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 0);
|
||||
_events.ScheduleEvent(EVENT_SPELL_SHADOW_CLEAVE, 6000);
|
||||
_events.ScheduleEvent(EVENT_SPELL_INTANGIBLE_PRESENCE, 15000);
|
||||
_events.ScheduleEvent(EVENT_RANDOM_YELL, urand(25000, 45000));
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (_events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
Talk(SAY_ATTUMEN_KILL);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Mechanic == MECHANIC_DISARM && _events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
Talk(SAY_ATTUMEN_DISARM);
|
||||
}
|
||||
else if (spellInfo->Id == SPELL_MOUNT_TARGET_ATTUMEN)
|
||||
{
|
||||
me->CastSpell(me, SPELL_MOUNT_TARGET_MIDNIGHT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Id == SPELL_MOUNT_TARGET_MIDNIGHT)
|
||||
{
|
||||
Talk(SAY_ATTUMEN1_MOUNT);
|
||||
_events.Reset();
|
||||
me->GetMotionMaster()->MovePoint(POINT_MOVE_TO_MIDNIGHT, target->GetPositionX() + 2.0f * cos(target->GetAngle(me)), target->GetPositionY() + 2.0f * sin(target->GetAngle(me)), target->GetPositionZ() + 0.2f, true, true, MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && point == POINT_MOVE_TO_MIDNIGHT)
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* midnight = summon->GetSummoner())
|
||||
midnight->GetAI()->SetData(DATA_ATTUMEN_READY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (_events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOW_CLEAVE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHADOW_CLEAVE, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_SHADOW_CLEAVE, urand(9000, 14000));
|
||||
break;
|
||||
case EVENT_SPELL_INTANGIBLE_PRESENCE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_INTANGIBLE_PRESENCE, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_INTANGIBLE_PRESENCE, 30000);
|
||||
break;
|
||||
case EVENT_RANDOM_YELL:
|
||||
Talk(SAY_ATTUMEN_RANDOM);
|
||||
_events.ScheduleEvent(EVENT_RANDOM_YELL, urand(30000, 70000));
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH_25:
|
||||
if (me->HealthBelowPct(25))
|
||||
{
|
||||
me->CastSpell(me, SPELL_MOUNT_TARGET_MIDNIGHT, true);
|
||||
break;
|
||||
}
|
||||
_events.ScheduleEvent(EVENT_CHECK_HEALTH_25, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_attumenAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_attumen_midnight : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_attumen_midnight() : CreatureScript("boss_attumen_midnight") { }
|
||||
public:
|
||||
boss_attumen_midnight() : CreatureScript("boss_attumen_midnight") { }
|
||||
|
||||
struct boss_attumen_midnightAI : public ScriptedAI
|
||||
struct boss_attumen_midnightAI : public ScriptedAI
|
||||
{
|
||||
boss_attumen_midnightAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
boss_attumen_midnightAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_SPELL_SHADOW_CLEAVE, 6000);
|
||||
_events.ScheduleEvent(EVENT_SPELL_INTANGIBLE_PRESENCE, 15000);
|
||||
_events.ScheduleEvent(EVENT_RANDOM_YELL, urand(25000, 45000));
|
||||
_events.ScheduleEvent(EVENT_SPELL_CHARGE, 20000);
|
||||
_events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 11000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (_events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
Talk(SAY_ATTUMEN_KILL);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_ATTUMEN2_DEATH);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Mechanic == MECHANIC_DISARM && _events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
Talk(SAY_ATTUMEN_DISARM);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && point == POINT_MOVE_TO_MIDNIGHT)
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* midnight = summon->GetSummoner())
|
||||
midnight->GetAI()->SetData(DATA_ATTUMEN_READY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (_events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOW_CLEAVE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHADOW_CLEAVE, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_SHADOW_CLEAVE, urand(9000, 14000));
|
||||
break;
|
||||
case EVENT_SPELL_INTANGIBLE_PRESENCE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_INTANGIBLE_PRESENCE, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_INTANGIBLE_PRESENCE, 30000);
|
||||
break;
|
||||
case EVENT_RANDOM_YELL:
|
||||
Talk(SAY_ATTUMEN_RANDOM);
|
||||
_events.ScheduleEvent(EVENT_RANDOM_YELL, urand(30000, 70000));
|
||||
break;
|
||||
case EVENT_SPELL_CHARGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 24.0f, true))
|
||||
me->CastSpell(target, SPELL_CHARGE_MIDNIGHT, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_CHARGE, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_KNOCKDOWN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_KNOCKDOWN, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 20000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_attumen_midnightAI>(creature);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_SPELL_SHADOW_CLEAVE, 6000);
|
||||
_events.ScheduleEvent(EVENT_SPELL_INTANGIBLE_PRESENCE, 15000);
|
||||
_events.ScheduleEvent(EVENT_RANDOM_YELL, urand(25000, 45000));
|
||||
_events.ScheduleEvent(EVENT_SPELL_CHARGE, 20000);
|
||||
_events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 11000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (_events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
Talk(SAY_ATTUMEN_KILL);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_ATTUMEN2_DEATH);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Mechanic == MECHANIC_DISARM && _events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
Talk(SAY_ATTUMEN_DISARM);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && point == POINT_MOVE_TO_MIDNIGHT)
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* midnight = summon->GetSummoner())
|
||||
midnight->GetAI()->SetData(DATA_ATTUMEN_READY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (_events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOW_CLEAVE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHADOW_CLEAVE, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_SHADOW_CLEAVE, urand(9000, 14000));
|
||||
break;
|
||||
case EVENT_SPELL_INTANGIBLE_PRESENCE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_INTANGIBLE_PRESENCE, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_INTANGIBLE_PRESENCE, 30000);
|
||||
break;
|
||||
case EVENT_RANDOM_YELL:
|
||||
Talk(SAY_ATTUMEN_RANDOM);
|
||||
_events.ScheduleEvent(EVENT_RANDOM_YELL, urand(30000, 70000));
|
||||
break;
|
||||
case EVENT_SPELL_CHARGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 24.0f, true))
|
||||
me->CastSpell(target, SPELL_CHARGE_MIDNIGHT, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_CHARGE, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_KNOCKDOWN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_KNOCKDOWN, false);
|
||||
_events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 20000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_attumen_midnightAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_midnight_fixate : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_midnight_fixate() : SpellScriptLoader("spell_midnight_fixate") { }
|
||||
public:
|
||||
spell_midnight_fixate() : SpellScriptLoader("spell_midnight_fixate") { }
|
||||
|
||||
class spell_midnight_fixate_AuraScript : public AuraScript
|
||||
class spell_midnight_fixate_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_midnight_fixate_AuraScript);
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_midnight_fixate_AuraScript);
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntApply(target);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntFadeOut(target);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_midnight_fixate_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_midnight_fixate_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_midnight_fixate_AuraScript();
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntApply(target);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntFadeOut(target);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_midnight_fixate_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_midnight_fixate_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_midnight_fixate_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_attumen()
|
||||
|
||||
@@ -55,7 +55,7 @@ const Position GuestsPosition[4] =
|
||||
{-10976.38f, -1882.59f, 81.73f, 2.31f},
|
||||
};
|
||||
|
||||
const uint32 GuestEntries[6]=
|
||||
const uint32 GuestEntries[6] =
|
||||
{
|
||||
17007,
|
||||
19872,
|
||||
@@ -67,217 +67,217 @@ const uint32 GuestEntries[6]=
|
||||
|
||||
class boss_moroes : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_moroes() : CreatureScript("boss_moroes") { }
|
||||
public:
|
||||
boss_moroes() : CreatureScript("boss_moroes") { }
|
||||
|
||||
struct boss_moroesAI : public BossAI
|
||||
struct boss_moroesAI : public BossAI
|
||||
{
|
||||
boss_moroesAI(Creature* creature) : BossAI(creature, DATA_MOROES)
|
||||
{
|
||||
boss_moroesAI(Creature* creature) : BossAI(creature, DATA_MOROES)
|
||||
{
|
||||
_activeGuests = 0;
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
BossAI::InitializeAI();
|
||||
InitializeGuests();
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
BossAI::JustReachedHome();
|
||||
InitializeGuests();
|
||||
}
|
||||
|
||||
void InitializeGuests()
|
||||
{
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
||||
if (_activeGuests == 0)
|
||||
{
|
||||
_activeGuests |= 0x3F;
|
||||
uint8 rand1 = RAND(0x01, 0x02, 0x04);
|
||||
uint8 rand2 = RAND(0x08, 0x10, 0x20);
|
||||
_activeGuests &= ~(rand1|rand2);
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < MAX_GUEST_COUNT; ++i)
|
||||
if ((1 << i) & _activeGuests)
|
||||
me->SummonCreature(GuestEntries[i], GuestsPosition[summons.size()], TEMPSUMMON_MANUAL_DESPAWN);
|
||||
|
||||
_events2.Reset();
|
||||
_events2.ScheduleEvent(EVENT_GUEST_TALK, 10000);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->CastSpell(me, SPELL_DUAL_WIELD, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_VANISH, 30000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLIND, 20000);
|
||||
events.ScheduleEvent(EVENT_SPELL_GOUGE, 13000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000);
|
||||
|
||||
_events2.Reset();
|
||||
me->CallForHelp(20.0f);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
summons.clear();
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
instance->SetBossState(DATA_MOROES, DONE);
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
Creature* GetRandomGuest()
|
||||
{
|
||||
std::list<Creature*> guestList;
|
||||
for (SummonList::const_iterator i = summons.begin(); i != summons.end(); ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
|
||||
guestList.push_back(summon);
|
||||
|
||||
return acore::Containers::SelectRandomContainerElement(guestList);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
_events2.Update(diff);
|
||||
switch (_events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_GUEST_TALK:
|
||||
if (Creature* guest = GetRandomGuest())
|
||||
guest->AI()->Talk(SAY_GUEST);
|
||||
_events2.ScheduleEvent(EVENT_GUEST_TALK2, 5000);
|
||||
break;
|
||||
case EVENT_GUEST_TALK2:
|
||||
Talk(SAY_OUT_OF_COMBAT);
|
||||
_events2.ScheduleEvent(EVENT_GUEST_TALK, urand(60000, 120000));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(31))
|
||||
{
|
||||
me->CastSpell(me, SPELL_FRENZY, true);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
case EVENT_SPELL_BLIND:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1, 10.0f, true))
|
||||
me->CastSpell(target, SPELL_BLIND, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLIND, urand(25000, 40000));
|
||||
break;
|
||||
case EVENT_SPELL_GOUGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_GOUGE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_GOUGE, urand(25000, 40000));
|
||||
return;
|
||||
case EVENT_SPELL_VANISH:
|
||||
events.DelayEvents(9000);
|
||||
events.SetPhase(1);
|
||||
me->CastSpell(me, SPELL_VANISH, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_VANISH, 30000);
|
||||
events.ScheduleEvent(EVENT_SPELL_GARROTE, urand(5000, 7000));
|
||||
return;
|
||||
case EVENT_SPELL_GARROTE:
|
||||
Talk(SAY_SPECIAL);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
target->CastSpell(target, SPELL_GARROTE, true);
|
||||
me->CastSpell(me, SPELL_VANISH_TELEPORT, false);
|
||||
events.SetPhase(0);
|
||||
break;
|
||||
}
|
||||
|
||||
// Xinef: not in vanish
|
||||
if (events.GetPhaseMask() == 0)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events2;
|
||||
uint8 _activeGuests;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_moroesAI>(creature);
|
||||
_activeGuests = 0;
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
BossAI::InitializeAI();
|
||||
InitializeGuests();
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
BossAI::JustReachedHome();
|
||||
InitializeGuests();
|
||||
}
|
||||
|
||||
void InitializeGuests()
|
||||
{
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
||||
if (_activeGuests == 0)
|
||||
{
|
||||
_activeGuests |= 0x3F;
|
||||
uint8 rand1 = RAND(0x01, 0x02, 0x04);
|
||||
uint8 rand2 = RAND(0x08, 0x10, 0x20);
|
||||
_activeGuests &= ~(rand1 | rand2);
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < MAX_GUEST_COUNT; ++i)
|
||||
if ((1 << i) & _activeGuests)
|
||||
me->SummonCreature(GuestEntries[i], GuestsPosition[summons.size()], TEMPSUMMON_MANUAL_DESPAWN);
|
||||
|
||||
_events2.Reset();
|
||||
_events2.ScheduleEvent(EVENT_GUEST_TALK, 10000);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->CastSpell(me, SPELL_DUAL_WIELD, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_VANISH, 30000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLIND, 20000);
|
||||
events.ScheduleEvent(EVENT_SPELL_GOUGE, 13000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000);
|
||||
|
||||
_events2.Reset();
|
||||
me->CallForHelp(20.0f);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
summons.clear();
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
instance->SetBossState(DATA_MOROES, DONE);
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
Creature* GetRandomGuest()
|
||||
{
|
||||
std::list<Creature*> guestList;
|
||||
for (SummonList::const_iterator i = summons.begin(); i != summons.end(); ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
|
||||
guestList.push_back(summon);
|
||||
|
||||
return acore::Containers::SelectRandomContainerElement(guestList);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
_events2.Update(diff);
|
||||
switch (_events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_GUEST_TALK:
|
||||
if (Creature* guest = GetRandomGuest())
|
||||
guest->AI()->Talk(SAY_GUEST);
|
||||
_events2.ScheduleEvent(EVENT_GUEST_TALK2, 5000);
|
||||
break;
|
||||
case EVENT_GUEST_TALK2:
|
||||
Talk(SAY_OUT_OF_COMBAT);
|
||||
_events2.ScheduleEvent(EVENT_GUEST_TALK, urand(60000, 120000));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(31))
|
||||
{
|
||||
me->CastSpell(me, SPELL_FRENZY, true);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
case EVENT_SPELL_BLIND:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1, 10.0f, true))
|
||||
me->CastSpell(target, SPELL_BLIND, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLIND, urand(25000, 40000));
|
||||
break;
|
||||
case EVENT_SPELL_GOUGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_GOUGE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_GOUGE, urand(25000, 40000));
|
||||
return;
|
||||
case EVENT_SPELL_VANISH:
|
||||
events.DelayEvents(9000);
|
||||
events.SetPhase(1);
|
||||
me->CastSpell(me, SPELL_VANISH, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_VANISH, 30000);
|
||||
events.ScheduleEvent(EVENT_SPELL_GARROTE, urand(5000, 7000));
|
||||
return;
|
||||
case EVENT_SPELL_GARROTE:
|
||||
Talk(SAY_SPECIAL);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
target->CastSpell(target, SPELL_GARROTE, true);
|
||||
me->CastSpell(me, SPELL_VANISH_TELEPORT, false);
|
||||
events.SetPhase(0);
|
||||
break;
|
||||
}
|
||||
|
||||
// Xinef: not in vanish
|
||||
if (events.GetPhaseMask() == 0)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events2;
|
||||
uint8 _activeGuests;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_moroesAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_moroes_vanish : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_moroes_vanish() : SpellScriptLoader("spell_moroes_vanish") { }
|
||||
public:
|
||||
spell_moroes_vanish() : SpellScriptLoader("spell_moroes_vanish") { }
|
||||
|
||||
class spell_moroes_vanish_SpellScript : public SpellScript
|
||||
class spell_moroes_vanish_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_moroes_vanish_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_moroes_vanish_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
Position pos;
|
||||
target->GetFirstCollisionPosition(pos, 5.0f, M_PI);
|
||||
GetCaster()->CastSpell(target, SPELL_GARROTE_DUMMY, true);
|
||||
GetCaster()->RemoveAurasDueToSpell(SPELL_VANISH);
|
||||
GetCaster()->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), target->GetOrientation());
|
||||
}
|
||||
|
||||
Position pos;
|
||||
target->GetFirstCollisionPosition(pos, 5.0f, M_PI);
|
||||
GetCaster()->CastSpell(target, SPELL_GARROTE_DUMMY, true);
|
||||
GetCaster()->RemoveAurasDueToSpell(SPELL_VANISH);
|
||||
GetCaster()->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), target->GetOrientation());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_moroes_vanish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_moroes_vanish_SpellScript();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_moroes_vanish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_moroes_vanish_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_moroes()
|
||||
|
||||
@@ -39,7 +39,8 @@ const float PortalCoord[3][3] =
|
||||
{-11094.493164f, -1591.969238f, 279.949188f} // Back side
|
||||
};
|
||||
|
||||
enum Netherspite_Portal{
|
||||
enum Netherspite_Portal
|
||||
{
|
||||
RED_PORTAL = 0, // Perseverence
|
||||
GREEN_PORTAL = 1, // Serenity
|
||||
BLUE_PORTAL = 2 // Dominance
|
||||
@@ -68,7 +69,7 @@ public:
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
PortalGUID[i] = 0;
|
||||
BeamTarget[i] = 0;
|
||||
@@ -107,12 +108,12 @@ public:
|
||||
if (dist(xn, yn, xh, yh) >= dist(xn, yn, xp, yp) || dist(xp, yp, xh, yh) >= dist(xn, yn, xp, yp))
|
||||
return false;
|
||||
// check distance from the beam
|
||||
return (abs((xn-xp)*yh+(yp-yn)*xh-xn*yp+xp*yn)/dist(xn, yn, xp, yp) < 1.5f);
|
||||
return (abs((xn - xp) * yh + (yp - yn) * xh - xn * yp + xp * yn) / dist(xn, yn, xp, yp) < 1.5f);
|
||||
}
|
||||
|
||||
float dist(float xa, float ya, float xb, float yb) // auxiliary method for distance
|
||||
{
|
||||
return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
|
||||
return sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
|
||||
}
|
||||
|
||||
void Reset()
|
||||
@@ -128,13 +129,13 @@ public:
|
||||
|
||||
void SummonPortals()
|
||||
{
|
||||
uint8 r = rand()%4;
|
||||
uint8 r = rand() % 4;
|
||||
uint8 pos[3];
|
||||
pos[RED_PORTAL] = ((r % 2) ? (r > 1 ? 2 : 1) : 0);
|
||||
pos[GREEN_PORTAL] = ((r % 2) ? 0 : (r > 1 ? 2 : 1));
|
||||
pos[BLUE_PORTAL] = (r > 1 ? 1 : 2); // Blue Portal not on the left side (0)
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
if (Creature* portal = me->SummonCreature(PortalID[i], PortalCoord[pos[i]][0], PortalCoord[pos[i]][1], PortalCoord[pos[i]][2], 0, TEMPSUMMON_TIMED_DESPAWN, 60000))
|
||||
{
|
||||
PortalGUID[i] = portal->GetGUID();
|
||||
@@ -144,7 +145,7 @@ public:
|
||||
|
||||
void DestroyPortals()
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Creature* portal = ObjectAccessor::GetCreature(*me, PortalGUID[i]))
|
||||
portal->DisappearAndDie();
|
||||
@@ -157,7 +158,7 @@ public:
|
||||
|
||||
void UpdatePortals() // Here we handle the beams' behavior
|
||||
{
|
||||
for (int j=0; j<3; ++j) // j = color
|
||||
for (int j = 0; j < 3; ++j) // j = color
|
||||
if (Creature* portal = ObjectAccessor::GetCreature(*me, PortalGUID[j]))
|
||||
{
|
||||
// the one who's been cast upon before
|
||||
@@ -174,11 +175,11 @@ public:
|
||||
{
|
||||
Player* p = i->GetSource();
|
||||
if (p && p->IsAlive() // alive
|
||||
&& (!target || target->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best
|
||||
&& !p->HasAura(PlayerDebuff[j], 0) // not exhausted
|
||||
&& !p->HasAura(PlayerBuff[(j+1)%3], 0) // not on another beam
|
||||
&& !p->HasAura(PlayerBuff[(j+2)%3], 0)
|
||||
&& IsBetween(me, p, portal)) // on the beam
|
||||
&& (!target || target->GetDistance2d(portal) > p->GetDistance2d(portal)) // closer than current best
|
||||
&& !p->HasAura(PlayerDebuff[j], 0) // not exhausted
|
||||
&& !p->HasAura(PlayerBuff[(j + 1) % 3], 0) // not on another beam
|
||||
&& !p->HasAura(PlayerBuff[(j + 2) % 3], 0)
|
||||
&& IsBetween(me, p, portal)) // on the beam
|
||||
target = p;
|
||||
}
|
||||
}
|
||||
@@ -208,7 +209,7 @@ public:
|
||||
}
|
||||
// aggro target if Red Beam
|
||||
if (j == RED_PORTAL && me->GetVictim() != target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
me->getThreatManager().addThreat(target, 100000.0f+DoGetThreat(me->GetVictim()));
|
||||
me->getThreatManager().addThreat(target, 100000.0f + DoGetThreat(me->GetVictim()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +269,8 @@ public:
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true), SPELL_VOIDZONE, true);
|
||||
VoidZoneTimer = 15000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
VoidZoneTimer -= diff;
|
||||
|
||||
// NetherInfusion Berserk
|
||||
@@ -277,7 +279,8 @@ public:
|
||||
me->AddAura(SPELL_NETHER_INFUSION, me);
|
||||
DoCast(me, SPELL_NETHERSPITE_ROAR);
|
||||
Berserk = true;
|
||||
} else
|
||||
}
|
||||
else
|
||||
NetherInfusionTimer -= diff;
|
||||
|
||||
if (PortalPhase) // PORTAL PHASE
|
||||
@@ -287,7 +290,8 @@ public:
|
||||
{
|
||||
UpdatePortals();
|
||||
PortalTimer = 1000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
PortalTimer -= diff;
|
||||
|
||||
// Empowerment & Nether Burn
|
||||
@@ -296,7 +300,8 @@ public:
|
||||
DoCast(me, SPELL_EMPOWERMENT);
|
||||
me->AddAura(SPELL_NETHERBURN_AURA, me);
|
||||
EmpowermentTimer = 90000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
EmpowermentTimer -= diff;
|
||||
|
||||
if (PhaseTimer <= diff)
|
||||
@@ -306,7 +311,8 @@ public:
|
||||
SwitchToBanishPhase();
|
||||
return;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
PhaseTimer -= diff;
|
||||
}
|
||||
else // BANISH PHASE
|
||||
@@ -317,7 +323,8 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true))
|
||||
DoCast(target, SPELL_NETHERBREATH);
|
||||
NetherbreathTimer = urand(5000, 7000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
NetherbreathTimer -= diff;
|
||||
|
||||
if (PhaseTimer <= diff)
|
||||
@@ -327,7 +334,8 @@ public:
|
||||
SwitchToPortalPhase();
|
||||
return;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
PhaseTimer -= diff;
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
instance->SetData64(DATA_NIGHTBANE, IN_PROGRESS);
|
||||
|
||||
HandleTerraceDoors(false);
|
||||
Talk(YELL_AGGRO);
|
||||
Talk(YELL_AGGRO);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
MovePhase = id+1;
|
||||
MovePhase = id + 1;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
}
|
||||
|
||||
if (id < 8)
|
||||
MovePhase = id+1;
|
||||
MovePhase = id + 1;
|
||||
else
|
||||
{
|
||||
Phase = 1;
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
RainofBonesTimer = 5000; //timer wrong (maybe)
|
||||
RainBones = false;
|
||||
Skeletons = false;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
@@ -295,14 +295,16 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_BELLOWING_ROAR);
|
||||
BellowingRoarTimer = urand(30000, 40000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
BellowingRoarTimer -= diff;
|
||||
|
||||
if (SmolderingBreathTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SMOLDERING_BREATH);
|
||||
SmolderingBreathTimer = 20000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
SmolderingBreathTimer -= diff;
|
||||
|
||||
if (CharredEarthTimer <= diff)
|
||||
@@ -310,7 +312,8 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_CHARRED_EARTH);
|
||||
CharredEarthTimer = 20000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
CharredEarthTimer -= diff;
|
||||
|
||||
if (TailSweepTimer <= diff)
|
||||
@@ -319,7 +322,8 @@ public:
|
||||
if (!me->HasInArc(M_PI, target))
|
||||
DoCast(target, SPELL_TAIL_SWEEP);
|
||||
TailSweepTimer = 15000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
TailSweepTimer -= diff;
|
||||
|
||||
if (SearingCindersTimer <= diff)
|
||||
@@ -327,7 +331,8 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_SEARING_CINDERS);
|
||||
SearingCindersTimer = 10000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
SearingCindersTimer -= diff;
|
||||
|
||||
uint32 Prozent = uint32(me->GetHealthPct());
|
||||
@@ -363,7 +368,8 @@ public:
|
||||
DoCastVictim(SPELL_RAIN_OF_BONES);
|
||||
RainBones = true;
|
||||
SmokingBlastTimer = 20000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
RainofBonesTimer -= diff;
|
||||
|
||||
if (DistractingAshTimer <= diff)
|
||||
@@ -371,17 +377,19 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_DISTRACTING_ASH);
|
||||
DistractingAshTimer = 2000; //timer wrong
|
||||
} else
|
||||
}
|
||||
else
|
||||
DistractingAshTimer -= diff;
|
||||
}
|
||||
|
||||
if (RainBones)
|
||||
{
|
||||
if (SmokingBlastTimer <= diff)
|
||||
{
|
||||
{
|
||||
DoCastVictim(SPELL_SMOKING_BLAST);
|
||||
SmokingBlastTimer = 1500; //timer wrong
|
||||
} else
|
||||
}
|
||||
else
|
||||
SmokingBlastTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -390,7 +398,8 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0))
|
||||
DoCast(target, SPELL_FIREBALL_BARRAGE);
|
||||
FireballBarrageTimer = 20000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
FireballBarrageTimer -= diff;
|
||||
|
||||
if (FlyTimer <= diff) //landing
|
||||
@@ -401,8 +410,9 @@ public:
|
||||
me->GetMotionMaster()->MovePoint(3, IntroWay[3][0], IntroWay[3][1], IntroWay[3][2]);
|
||||
|
||||
Flying = true;
|
||||
} else
|
||||
FlyTimer -= diff;
|
||||
}
|
||||
else
|
||||
FlyTimer -= diff;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -419,10 +429,10 @@ public:
|
||||
if (InstanceScript* pInstance = go->GetInstanceScript())
|
||||
{
|
||||
if (pInstance->GetData(DATA_NIGHTBANE) != DONE && !go->FindNearestCreature(NPC_NIGHTBANE, 40.0f))
|
||||
if (Creature *cr = ObjectAccessor::GetCreature(*player, pInstance->GetData64(DATA_NIGHTBANE)))
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*player, pInstance->GetData64(DATA_NIGHTBANE)))
|
||||
cr->GetMotionMaster()->MovePoint(0, IntroWay[0][0], IntroWay[0][1], IntroWay[0][2]);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
uint32 HellfireTimer;
|
||||
uint32 CleanupTimer;
|
||||
uint64 malchezaar;
|
||||
InfernalPoint *point;
|
||||
InfernalPoint* point;
|
||||
|
||||
void Reset() { }
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit* done_by, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!done_by || done_by->GetGUID() != malchezaar)
|
||||
damage = 0;
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit*> targets;
|
||||
|
||||
if (t_list.empty())
|
||||
@@ -290,7 +290,7 @@ public:
|
||||
|
||||
void SummonInfernal()
|
||||
{
|
||||
InfernalPoint *point = 0;
|
||||
InfernalPoint* point = 0;
|
||||
Position pos;
|
||||
|
||||
if ((me->GetMapId() == 532))
|
||||
@@ -442,82 +442,82 @@ public:
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
class prince_axes : public CreatureScript
|
||||
{
|
||||
public:
|
||||
prince_axes() : CreatureScript("prince_axes") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<prince_axesAI>(creature);
|
||||
}
|
||||
|
||||
struct prince_axesAI : public ScriptedAI
|
||||
{
|
||||
|
||||
prince_axesAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
uint32 AxesTargetSwitchTimer;
|
||||
InstanceScript* instance;
|
||||
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
AxesTargetSwitchTimer = 7500;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetCanDualWield(true);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void changetarget()
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
if (me->GetVictim())
|
||||
DoModifyThreatPercent(me->GetVictim(), -100);
|
||||
if (target)
|
||||
me->AddThreat(target, 1000000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (AxesTargetSwitchTimer <= diff)
|
||||
{
|
||||
AxesTargetSwitchTimer = urand(7500, 20000);
|
||||
changetarget();
|
||||
}
|
||||
else
|
||||
AxesTargetSwitchTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_malchezaar()
|
||||
class prince_axes : public CreatureScript
|
||||
{
|
||||
public:
|
||||
prince_axes() : CreatureScript("prince_axes") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
new boss_malchezaar();
|
||||
new prince_axes();
|
||||
new netherspite_infernal();
|
||||
return GetInstanceAI<prince_axesAI>(creature);
|
||||
}
|
||||
|
||||
struct prince_axesAI : public ScriptedAI
|
||||
{
|
||||
|
||||
prince_axesAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
uint32 AxesTargetSwitchTimer;
|
||||
InstanceScript* instance;
|
||||
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
AxesTargetSwitchTimer = 7500;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetCanDualWield(true);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void changetarget()
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
if (me->GetVictim())
|
||||
DoModifyThreatPercent(me->GetVictim(), -100);
|
||||
if (target)
|
||||
me->AddThreat(target, 1000000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (AxesTargetSwitchTimer <= diff)
|
||||
{
|
||||
AxesTargetSwitchTimer = urand(7500, 20000);
|
||||
changetarget();
|
||||
}
|
||||
else
|
||||
AxesTargetSwitchTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_malchezaar()
|
||||
{
|
||||
new boss_malchezaar();
|
||||
new prince_axes();
|
||||
new netherspite_infernal();
|
||||
}
|
||||
|
||||
@@ -37,126 +37,126 @@ enum ServantQuertersMisc
|
||||
|
||||
class boss_servant_quarters : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_servant_quarters() : CreatureScript("boss_servant_quarters") { }
|
||||
public:
|
||||
boss_servant_quarters() : CreatureScript("boss_servant_quarters") { }
|
||||
|
||||
struct boss_servant_quartersAI : public BossAI
|
||||
struct boss_servant_quartersAI : public BossAI
|
||||
{
|
||||
boss_servant_quartersAI(Creature* creature) : BossAI(creature, DATA_SERVANT_QUARTERS) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
boss_servant_quartersAI(Creature* creature) : BossAI(creature, DATA_SERVANT_QUARTERS) { }
|
||||
events.Reset();
|
||||
me->SetVisible(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->setFaction(35);
|
||||
_events2.Reset();
|
||||
_events2.ScheduleEvent(EVENT_CHECK_VISIBILITY, 5000);
|
||||
if (me->GetEntry() == NPC_HYAKISS_THE_LURKER)
|
||||
me->CastSpell(me, SPELL_SNEAK, true);
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
me->SetVisible(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->setFaction(35);
|
||||
_events2.Reset();
|
||||
_events2.ScheduleEvent(EVENT_CHECK_VISIBILITY, 5000);
|
||||
if (me->GetEntry() == NPC_HYAKISS_THE_LURKER)
|
||||
me->CastSpell(me, SPELL_SNEAK, true);
|
||||
|
||||
if (instance->GetData(DATA_SELECTED_RARE) != me->GetEntry())
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
me->setActive(true);
|
||||
if (me->GetEntry() == NPC_HYAKISS_THE_LURKER)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_ACIDIC_FANG, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_HYAKISS_WEB, 9000);
|
||||
}
|
||||
else if (me->GetEntry() == NPC_SHADIKITH_THE_GLIDER)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_SONIC_BURST, 4000);
|
||||
events.ScheduleEvent(EVENT_SPELL_WING_BUFFET, 7000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DIVE, 10000);
|
||||
}
|
||||
else // if (me->GetEntry() == NPC_ROKAD_THE_RAVAGER)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_RAVAGE, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && point == EVENT_CHARGE)
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, 0);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
_events2.Update(diff);
|
||||
switch (_events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_VISIBILITY:
|
||||
if (instance->GetBossState(DATA_SERVANT_QUARTERS) == DONE)
|
||||
{
|
||||
me->SetVisible(true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RestoreFaction();
|
||||
}
|
||||
else
|
||||
_events2.ScheduleEvent(EVENT_CHECK_VISIBILITY, 5000);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_ACIDIC_FANG:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ACIDIC_FANG, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ACIDIC_FANG, urand(12000, 18000));
|
||||
break;
|
||||
case EVENT_SPELL_HYAKISS_WEB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f))
|
||||
me->CastSpell(target, SPELL_HYAKISS_WEB, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_HYAKISS_WEB, 15000);
|
||||
break;
|
||||
case EVENT_SPELL_SONIC_BURST:
|
||||
me->CastSpell(me, SPELL_SONIC_BURST, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SONIC_BURST, urand(12000, 18000));
|
||||
break;
|
||||
case EVENT_SPELL_WING_BUFFET:
|
||||
me->CastSpell(me, SPELL_WING_BUFFET, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_WING_BUFFET, urand(12000, 18000));
|
||||
break;
|
||||
case EVENT_SPELL_DIVE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, FarthestTargetSelector(me, 40.0f, false, true)))
|
||||
me->CastSpell(target, SPELL_DIVE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_DIVE, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_FEAR:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FEAR, false);
|
||||
break;
|
||||
case EVENT_SPELL_RAVAGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_RAVAGE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_RAVAGE, 10500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events2;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_servant_quartersAI>(creature);
|
||||
if (instance->GetData(DATA_SELECTED_RARE) != me->GetEntry())
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
me->setActive(true);
|
||||
if (me->GetEntry() == NPC_HYAKISS_THE_LURKER)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_ACIDIC_FANG, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_HYAKISS_WEB, 9000);
|
||||
}
|
||||
else if (me->GetEntry() == NPC_SHADIKITH_THE_GLIDER)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_SONIC_BURST, 4000);
|
||||
events.ScheduleEvent(EVENT_SPELL_WING_BUFFET, 7000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DIVE, 10000);
|
||||
}
|
||||
else // if (me->GetEntry() == NPC_ROKAD_THE_RAVAGER)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_RAVAGE, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && point == EVENT_CHARGE)
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, 0);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
_events2.Update(diff);
|
||||
switch (_events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_VISIBILITY:
|
||||
if (instance->GetBossState(DATA_SERVANT_QUARTERS) == DONE)
|
||||
{
|
||||
me->SetVisible(true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RestoreFaction();
|
||||
}
|
||||
else
|
||||
_events2.ScheduleEvent(EVENT_CHECK_VISIBILITY, 5000);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_ACIDIC_FANG:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ACIDIC_FANG, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ACIDIC_FANG, urand(12000, 18000));
|
||||
break;
|
||||
case EVENT_SPELL_HYAKISS_WEB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f))
|
||||
me->CastSpell(target, SPELL_HYAKISS_WEB, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_HYAKISS_WEB, 15000);
|
||||
break;
|
||||
case EVENT_SPELL_SONIC_BURST:
|
||||
me->CastSpell(me, SPELL_SONIC_BURST, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SONIC_BURST, urand(12000, 18000));
|
||||
break;
|
||||
case EVENT_SPELL_WING_BUFFET:
|
||||
me->CastSpell(me, SPELL_WING_BUFFET, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_WING_BUFFET, urand(12000, 18000));
|
||||
break;
|
||||
case EVENT_SPELL_DIVE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, FarthestTargetSelector(me, 40.0f, false, true)))
|
||||
me->CastSpell(target, SPELL_DIVE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_DIVE, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_FEAR:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FEAR, false);
|
||||
break;
|
||||
case EVENT_SPELL_RAVAGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_RAVAGE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_RAVAGE, 10500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events2;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_servant_quartersAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_servant_quarters()
|
||||
|
||||
@@ -148,7 +148,7 @@ 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;
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
CloseDoorTimer = 0;
|
||||
}
|
||||
else
|
||||
else
|
||||
CloseDoorTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public:
|
||||
{
|
||||
if (ArcaneCooldown >= diff)
|
||||
ArcaneCooldown -= diff;
|
||||
else
|
||||
else
|
||||
ArcaneCooldown = 0;
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
{
|
||||
if (FireCooldown >= diff)
|
||||
FireCooldown -= diff;
|
||||
else
|
||||
else
|
||||
FireCooldown = 0;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public:
|
||||
{
|
||||
if (FrostCooldown >= diff)
|
||||
FrostCooldown -= diff;
|
||||
else
|
||||
else
|
||||
FrostCooldown = 0;
|
||||
}
|
||||
|
||||
@@ -305,24 +305,24 @@ public:
|
||||
}
|
||||
NormalCastTimer = 1000;
|
||||
}
|
||||
else
|
||||
else
|
||||
NormalCastTimer -= diff;
|
||||
|
||||
if (SecondarySpellTimer <= diff)
|
||||
{
|
||||
switch (urand(0, 1))
|
||||
{
|
||||
case 0:
|
||||
DoCast(me, SPELL_AOE_CS);
|
||||
break;
|
||||
case 1:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_CHAINSOFICE);
|
||||
break;
|
||||
case 0:
|
||||
DoCast(me, SPELL_AOE_CS);
|
||||
break;
|
||||
case 1:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_CHAINSOFICE);
|
||||
break;
|
||||
}
|
||||
SecondarySpellTimer = urand(5000, 20000);
|
||||
}
|
||||
else
|
||||
else
|
||||
SecondarySpellTimer -= diff;
|
||||
|
||||
if (SuperCastTimer <= diff)
|
||||
@@ -331,60 +331,60 @@ public:
|
||||
|
||||
switch (LastSuperSpell)
|
||||
{
|
||||
case SUPER_AE:
|
||||
Available[0] = SUPER_FLAME;
|
||||
Available[1] = SUPER_BLIZZARD;
|
||||
break;
|
||||
case SUPER_FLAME:
|
||||
Available[0] = SUPER_AE;
|
||||
Available[1] = SUPER_BLIZZARD;
|
||||
break;
|
||||
case SUPER_BLIZZARD:
|
||||
Available[0] = SUPER_FLAME;
|
||||
Available[1] = SUPER_AE;
|
||||
break;
|
||||
case SUPER_AE:
|
||||
Available[0] = SUPER_FLAME;
|
||||
Available[1] = SUPER_BLIZZARD;
|
||||
break;
|
||||
case SUPER_FLAME:
|
||||
Available[0] = SUPER_AE;
|
||||
Available[1] = SUPER_BLIZZARD;
|
||||
break;
|
||||
case SUPER_BLIZZARD:
|
||||
Available[0] = SUPER_FLAME;
|
||||
Available[1] = SUPER_AE;
|
||||
break;
|
||||
}
|
||||
|
||||
LastSuperSpell = Available[urand(0, 1)];
|
||||
|
||||
switch (LastSuperSpell)
|
||||
{
|
||||
case SUPER_AE:
|
||||
Talk(SAY_EXPLOSION);
|
||||
case SUPER_AE:
|
||||
Talk(SAY_EXPLOSION);
|
||||
|
||||
DoCast(me, SPELL_BLINK_CENTER, true);
|
||||
DoCast(me, SPELL_PLAYERPULL, true);
|
||||
DoCast(me, SPELL_MASSSLOW, true);
|
||||
DoCast(me, SPELL_AEXPLOSION, false);
|
||||
break;
|
||||
DoCast(me, SPELL_BLINK_CENTER, true);
|
||||
DoCast(me, SPELL_PLAYERPULL, true);
|
||||
DoCast(me, SPELL_MASSSLOW, true);
|
||||
DoCast(me, SPELL_AEXPLOSION, false);
|
||||
break;
|
||||
|
||||
case SUPER_FLAME:
|
||||
Talk(SAY_FLAMEWREATH);
|
||||
case SUPER_FLAME:
|
||||
Talk(SAY_FLAMEWREATH);
|
||||
|
||||
FlameWreathTimer = 20000;
|
||||
FlameWreathCheckTime = 500;
|
||||
FlameWreathTimer = 20000;
|
||||
FlameWreathCheckTime = 500;
|
||||
|
||||
FlameWreathTarget[0] = 0;
|
||||
FlameWreathTarget[1] = 0;
|
||||
FlameWreathTarget[2] = 0;
|
||||
FlameWreathTarget[0] = 0;
|
||||
FlameWreathTarget[1] = 0;
|
||||
FlameWreathTarget[2] = 0;
|
||||
|
||||
FlameWreathEffect();
|
||||
break;
|
||||
FlameWreathEffect();
|
||||
break;
|
||||
|
||||
case SUPER_BLIZZARD:
|
||||
Talk(SAY_BLIZZARD);
|
||||
case SUPER_BLIZZARD:
|
||||
Talk(SAY_BLIZZARD);
|
||||
|
||||
if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
|
||||
{
|
||||
pSpawn->setFaction(me->getFaction());
|
||||
pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
|
||||
}
|
||||
break;
|
||||
if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
|
||||
{
|
||||
pSpawn->setFaction(me->getFaction());
|
||||
pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SuperCastTimer = urand(35000, 40000);
|
||||
}
|
||||
else
|
||||
else
|
||||
SuperCastTimer -= diff;
|
||||
|
||||
if (!ElementalsSpawned && HealthBelowPct(40))
|
||||
@@ -479,7 +479,7 @@ public:
|
||||
|
||||
BerserkTimer = 60000;
|
||||
}
|
||||
else
|
||||
else
|
||||
BerserkTimer -= diff;
|
||||
|
||||
//Flame Wreath check
|
||||
@@ -487,7 +487,7 @@ public:
|
||||
{
|
||||
if (FlameWreathTimer >= diff)
|
||||
FlameWreathTimer -= diff;
|
||||
else
|
||||
else
|
||||
FlameWreathTimer = 0;
|
||||
|
||||
if (FlameWreathCheckTime <= diff)
|
||||
@@ -507,7 +507,7 @@ public:
|
||||
}
|
||||
FlameWreathCheckTime = 500;
|
||||
}
|
||||
else
|
||||
else
|
||||
FlameWreathCheckTime -= diff;
|
||||
}
|
||||
|
||||
@@ -515,7 +515,7 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!DrinkInturrupted && Drinking && damage)
|
||||
DrinkInturrupted = true;
|
||||
@@ -525,8 +525,8 @@ public:
|
||||
{
|
||||
//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 &&
|
||||
Spell->Effects[1].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCast(false))
|
||||
Spell->Effects[1].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCast(false))
|
||||
return;
|
||||
|
||||
//Interrupt effect
|
||||
@@ -537,9 +537,15 @@ public:
|
||||
|
||||
switch (CurrentNormalSpell)
|
||||
{
|
||||
case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break;
|
||||
case SPELL_FIREBALL: FireCooldown = 5000; break;
|
||||
case SPELL_FROSTBOLT: FrostCooldown = 5000; break;
|
||||
case SPELL_ARCMISSLE:
|
||||
ArcaneCooldown = 5000;
|
||||
break;
|
||||
case SPELL_FIREBALL:
|
||||
FireCooldown = 5000;
|
||||
break;
|
||||
case SPELL_FROSTBOLT:
|
||||
FrostCooldown = 5000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -108,7 +108,8 @@ public:
|
||||
DoCastVictim(SPELL_AMPLIFY_FLAMES);
|
||||
|
||||
AmplifyTimer = urand(10000, 20000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
AmplifyTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -166,7 +167,7 @@ public:
|
||||
|
||||
struct npc_fiendish_portalAI : public PassiveAI
|
||||
{
|
||||
npc_fiendish_portalAI(Creature* creature) : PassiveAI(creature), summons(me){ }
|
||||
npc_fiendish_portalAI(Creature* creature) : PassiveAI(creature), summons(me) { }
|
||||
|
||||
SummonList summons;
|
||||
|
||||
@@ -223,7 +224,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_FIREBOLT);
|
||||
FireboltTimer = 2200;
|
||||
} else
|
||||
}
|
||||
else
|
||||
FireboltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -302,7 +304,7 @@ public:
|
||||
DoCast(me, SPELL_SUMMON_IMP, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
DoCast(me, SPELL_SUMMON_IMP, true);
|
||||
}
|
||||
|
||||
@@ -362,16 +364,16 @@ public:
|
||||
SummonKilrekTimer = 45000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (SummonKilrekTimer <= diff)
|
||||
{
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_IMP, true);
|
||||
me->RemoveAura(SPELL_BROKEN_PACT);
|
||||
}
|
||||
else
|
||||
else
|
||||
SummonKilrekTimer -= diff;
|
||||
|
||||
|
||||
if (SacrificeTimer <= diff)
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
@@ -389,14 +391,16 @@ public:
|
||||
SacrificeTimer = 30000;
|
||||
}
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
SacrificeTimer -= diff;
|
||||
|
||||
if (ShadowboltTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT);
|
||||
ShadowboltTimer = 10000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
ShadowboltTimer -= diff;
|
||||
|
||||
if (SummonTimer <= diff)
|
||||
@@ -413,7 +417,8 @@ public:
|
||||
pPortal->CastSpell(me->GetVictim(), SPELL_SUMMON_FIENDISIMP, false);
|
||||
SummonTimer = 5000;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
SummonTimer -= diff;
|
||||
|
||||
if (!Berserk)
|
||||
@@ -422,7 +427,8 @@ public:
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
Berserk = true;
|
||||
} else
|
||||
}
|
||||
else
|
||||
BerserkTimer -= diff;
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,8 @@ public:
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
AggroTimer = 0;
|
||||
} else
|
||||
}
|
||||
else
|
||||
AggroTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -204,14 +205,16 @@ public:
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_WATERBOLT);
|
||||
WaterBoltTimer = TitoDied ? 1500 : 5000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
WaterBoltTimer -= diff;
|
||||
|
||||
if (FearTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SCREAM);
|
||||
FearTimer = 30000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
FearTimer -= diff;
|
||||
|
||||
if (!SummonedTito)
|
||||
@@ -277,7 +280,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_YIPPING);
|
||||
YipTimer = 10000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
YipTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -357,7 +361,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* Spell)
|
||||
{
|
||||
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
|
||||
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand() % 10)))
|
||||
{
|
||||
/*
|
||||
if (not direct damage(aoe, dot))
|
||||
@@ -388,7 +392,8 @@ public:
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
AggroTimer = 0;
|
||||
} else
|
||||
}
|
||||
else
|
||||
AggroTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -399,7 +404,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_BRAIN_BASH);
|
||||
BrainBashTimer = 15000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
BrainBashTimer -= diff;
|
||||
|
||||
if (BrainWipeTimer <= diff)
|
||||
@@ -407,7 +413,8 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_BRAIN_WIPE);
|
||||
BrainWipeTimer = 20000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
BrainWipeTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -497,7 +504,8 @@ public:
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
AggroTimer = 0;
|
||||
} else
|
||||
}
|
||||
else
|
||||
AggroTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -508,7 +516,8 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
CleaveTimer = 5000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
CleaveTimer -= diff;
|
||||
|
||||
if (RustCount < 8)
|
||||
@@ -519,7 +528,8 @@ public:
|
||||
Talk(EMOTE_RUST);
|
||||
DoCast(me, SPELL_RUST);
|
||||
RustTimer = 6000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
RustTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -608,7 +618,8 @@ public:
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
AggroTimer = 0;
|
||||
} else
|
||||
}
|
||||
else
|
||||
AggroTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -619,21 +630,24 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_MANGLE);
|
||||
MangleTimer = urand(5000, 8000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
MangleTimer -= diff;
|
||||
|
||||
if (ShredTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHRED);
|
||||
ShredTimer = urand(10000, 15000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
ShredTimer -= diff;
|
||||
|
||||
if (ScreamTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FRIGHTENED_SCREAM);
|
||||
ScreamTimer = urand(20000, 30000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
ScreamTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -677,7 +691,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_CRONE_SLAY);
|
||||
Talk(SAY_CRONE_SLAY);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
@@ -703,14 +717,16 @@ public:
|
||||
if (Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, float(urand(0, 9)), float(urand(0, 9)), 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true);
|
||||
CycloneTimer = 22000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
CycloneTimer -= diff;
|
||||
|
||||
if (ChainLightningTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CHAIN_LIGHTNING);
|
||||
ChainLightningTimer = 8000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
ChainLightningTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -757,7 +773,8 @@ public:
|
||||
me->GetRandomNearPosition(pos, 10);
|
||||
me->GetMotionMaster()->MovePoint(0, pos);
|
||||
MoveTimer = urand(3000, 5000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
MoveTimer -= diff;
|
||||
}
|
||||
};
|
||||
@@ -795,7 +812,7 @@ public:
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
{
|
||||
if (Creature* pBigBadWolf = creature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
|
||||
if (Creature* pBigBadWolf = creature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR * 2 * IN_MILLISECONDS))
|
||||
pBigBadWolf->AI()->AttackStart(player);
|
||||
|
||||
creature->DespawnOrUnsummon();
|
||||
@@ -915,7 +932,8 @@ public:
|
||||
|
||||
ChaseTimer = 40000;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
ChaseTimer -= diff;
|
||||
|
||||
if (IsChasing)
|
||||
@@ -925,14 +943,16 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_TERRIFYING_HOWL);
|
||||
FearTimer = urand(25000, 35000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
FearTimer -= diff;
|
||||
|
||||
if (SwipeTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_WIDE_SWIPE);
|
||||
SwipeTimer = urand(25000, 30000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
SwipeTimer -= diff;
|
||||
}
|
||||
};
|
||||
@@ -1007,8 +1027,8 @@ void Resurrect(Creature* target)
|
||||
target->GetMotionMaster()->MoveChase(target->GetVictim());
|
||||
target->AI()->AttackStart(target->GetVictim());
|
||||
}
|
||||
else
|
||||
target->GetMotionMaster()->Initialize();
|
||||
else
|
||||
target->GetMotionMaster()->Initialize();
|
||||
}
|
||||
|
||||
class boss_julianne : public CreatureScript
|
||||
@@ -1112,7 +1132,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask);
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask);
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
@@ -1123,7 +1143,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_JULIANNE_SLAY);
|
||||
Talk(SAY_JULIANNE_SLAY);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff);
|
||||
@@ -1185,7 +1205,7 @@ public:
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage < me->GetHealth())
|
||||
return;
|
||||
@@ -1293,7 +1313,8 @@ public:
|
||||
JulianneDead = false;
|
||||
ResurrectTimer = 10000;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
ResurrectTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1305,14 +1326,16 @@ public:
|
||||
DoCast(target, SPELL_BACKWARD_LUNGE);
|
||||
BackwardLungeTimer = urand(15000, 30000);
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
BackwardLungeTimer -= diff;
|
||||
|
||||
if (DaringTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DARING);
|
||||
DaringTimer = urand(20000, 40000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
DaringTimer -= diff;
|
||||
|
||||
if (DeadlySwatheTimer <= diff)
|
||||
@@ -1320,14 +1343,16 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_DEADLY_SWATHE);
|
||||
DeadlySwatheTimer = urand(15000, 25000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
DeadlySwatheTimer -= diff;
|
||||
|
||||
if (PoisonThrustTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_POISON_THRUST);
|
||||
PoisonThrustTimer = urand(10000, 20000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
PoisonThrustTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -1343,7 +1368,8 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
{
|
||||
Talk(SAY_JULIANNE_ENTER);
|
||||
EntryYellTimer = 0;
|
||||
} else
|
||||
}
|
||||
else
|
||||
EntryYellTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1355,7 +1381,8 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->setFaction(16);
|
||||
AggroYellTimer = 0;
|
||||
} else
|
||||
}
|
||||
else
|
||||
AggroYellTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1368,7 +1395,8 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
Phase = PHASE_ROMULO;
|
||||
SummonRomuloTimer = 10000;
|
||||
DrinkPoisonTimer = 0;
|
||||
} else
|
||||
}
|
||||
else
|
||||
DrinkPoisonTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1376,7 +1404,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
{
|
||||
if (SummonRomuloTimer <= diff)
|
||||
{
|
||||
if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
|
||||
if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR * 2 * IN_MILLISECONDS))
|
||||
{
|
||||
RomuloGUID = pRomulo->GetGUID();
|
||||
CAST_AI(boss_romulo::boss_romuloAI, pRomulo->AI())->JulianneGUID = me->GetGUID();
|
||||
@@ -1386,7 +1414,8 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
pRomulo->setFaction(16);
|
||||
}
|
||||
SummonedRomulo = true;
|
||||
} else
|
||||
}
|
||||
else
|
||||
SummonRomuloTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1403,7 +1432,8 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
|
||||
ResurrectSelfTimer = 0;
|
||||
ResurrectTimer = 1000;
|
||||
} else
|
||||
}
|
||||
else
|
||||
ResurrectSelfTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1423,7 +1453,8 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
RomuloDead = false;
|
||||
ResurrectTimer = 10000;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
ResurrectTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1432,21 +1463,24 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(target, SPELL_BLINDING_PASSION);
|
||||
BlindingPassionTimer = urand(30000, 45000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
BlindingPassionTimer -= diff;
|
||||
|
||||
if (DevotionTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DEVOTION);
|
||||
DevotionTimer = urand(15000, 45000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
DevotionTimer -= diff;
|
||||
|
||||
if (PowerfulAttractionTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION);
|
||||
PowerfulAttractionTimer = urand(5000, 30000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
PowerfulAttractionTimer -= diff;
|
||||
|
||||
if (EternalAffectionTimer <= diff)
|
||||
@@ -1456,16 +1490,18 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
|
||||
Creature* Romulo = (ObjectAccessor::GetCreature((*me), RomuloGUID));
|
||||
if (Romulo && Romulo->IsAlive() && !RomuloDead)
|
||||
DoCast(Romulo, SPELL_ETERNAL_AFFECTION);
|
||||
} else DoCast(me, SPELL_ETERNAL_AFFECTION);
|
||||
}
|
||||
else DoCast(me, SPELL_ETERNAL_AFFECTION);
|
||||
|
||||
EternalAffectionTimer = urand(45000, 60000);
|
||||
} else
|
||||
}
|
||||
else
|
||||
EternalAffectionTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage < me->GetHealth())
|
||||
return;
|
||||
|
||||
@@ -68,36 +68,36 @@ public:
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_COLDMIST_WIDOW:
|
||||
case NPC_COLDMIST_STALKER:
|
||||
case NPC_SHADOWBAT:
|
||||
case NPC_VAMPIRIC_SHADOWBAT:
|
||||
case NPC_GREATER_SHADOWBAT:
|
||||
case NPC_PHASE_HOUND:
|
||||
case NPC_DREADBEAST:
|
||||
case NPC_SHADOWBEAST:
|
||||
if (GetBossState(DATA_OPTIONAL_BOSS) == TO_BE_DECIDED)
|
||||
{
|
||||
++OptionalBossCount;
|
||||
if (OptionalBossCount == OPTIONAL_BOSS_REQUIRED_DEATH_COUNT)
|
||||
case NPC_COLDMIST_WIDOW:
|
||||
case NPC_COLDMIST_STALKER:
|
||||
case NPC_SHADOWBAT:
|
||||
case NPC_VAMPIRIC_SHADOWBAT:
|
||||
case NPC_GREATER_SHADOWBAT:
|
||||
case NPC_PHASE_HOUND:
|
||||
case NPC_DREADBEAST:
|
||||
case NPC_SHADOWBEAST:
|
||||
if (GetBossState(DATA_OPTIONAL_BOSS) == TO_BE_DECIDED)
|
||||
{
|
||||
switch (urand(NPC_HYAKISS_THE_LURKER, NPC_ROKAD_THE_RAVAGER))
|
||||
++OptionalBossCount;
|
||||
if (OptionalBossCount == OPTIONAL_BOSS_REQUIRED_DEATH_COUNT)
|
||||
{
|
||||
case NPC_HYAKISS_THE_LURKER:
|
||||
instance->SummonCreature(NPC_HYAKISS_THE_LURKER, OptionalSpawn[0]);
|
||||
break;
|
||||
case NPC_SHADIKITH_THE_GLIDER:
|
||||
instance->SummonCreature(NPC_SHADIKITH_THE_GLIDER, OptionalSpawn[1]);
|
||||
break;
|
||||
case NPC_ROKAD_THE_RAVAGER:
|
||||
instance->SummonCreature(NPC_ROKAD_THE_RAVAGER, OptionalSpawn[2]);
|
||||
break;
|
||||
switch (urand(NPC_HYAKISS_THE_LURKER, NPC_ROKAD_THE_RAVAGER))
|
||||
{
|
||||
case NPC_HYAKISS_THE_LURKER:
|
||||
instance->SummonCreature(NPC_HYAKISS_THE_LURKER, OptionalSpawn[0]);
|
||||
break;
|
||||
case NPC_SHADIKITH_THE_GLIDER:
|
||||
instance->SummonCreature(NPC_SHADIKITH_THE_GLIDER, OptionalSpawn[1]);
|
||||
break;
|
||||
case NPC_ROKAD_THE_RAVAGER:
|
||||
instance->SummonCreature(NPC_ROKAD_THE_RAVAGER, OptionalSpawn[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,12 +105,12 @@ public:
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_OPERA_OZ_DEATHCOUNT:
|
||||
if (data == SPECIAL)
|
||||
++OzDeathCount;
|
||||
else if (data == IN_PROGRESS)
|
||||
OzDeathCount = 0;
|
||||
break;
|
||||
case DATA_OPERA_OZ_DEATHCOUNT:
|
||||
if (data == SPECIAL)
|
||||
++OzDeathCount;
|
||||
else if (data == IN_PROGRESS)
|
||||
OzDeathCount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,22 +121,22 @@ public:
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DATA_OPERA_PERFORMANCE:
|
||||
if (state == DONE)
|
||||
{
|
||||
HandleGameObject(m_uiStageDoorLeftGUID, true);
|
||||
HandleGameObject(m_uiStageDoorRightGUID, true);
|
||||
if (GameObject* sideEntrance = instance->GetGameObject(m_uiSideEntranceDoor))
|
||||
sideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, nullptr);
|
||||
}
|
||||
break;
|
||||
case DATA_CHESS:
|
||||
if (state == DONE)
|
||||
DoRespawnGameObject(DustCoveredChest, DAY);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case DATA_OPERA_PERFORMANCE:
|
||||
if (state == DONE)
|
||||
{
|
||||
HandleGameObject(m_uiStageDoorLeftGUID, true);
|
||||
HandleGameObject(m_uiStageDoorRightGUID, true);
|
||||
if (GameObject* sideEntrance = instance->GetGameObject(m_uiSideEntranceDoor))
|
||||
sideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, nullptr);
|
||||
}
|
||||
break;
|
||||
case DATA_CHESS:
|
||||
if (state == DONE)
|
||||
DoRespawnGameObject(DustCoveredChest, DAY);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -152,71 +152,71 @@ public:
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_STAGE_CURTAIN:
|
||||
m_uiCurtainGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_STAGE_DOOR_LEFT:
|
||||
m_uiStageDoorLeftGUID = go->GetGUID();
|
||||
if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_STAGE_DOOR_RIGHT:
|
||||
m_uiStageDoorRightGUID = go->GetGUID();
|
||||
if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_PRIVATE_LIBRARY_DOOR:
|
||||
m_uiLibraryDoor = go->GetGUID();
|
||||
break;
|
||||
case GO_MASSIVE_DOOR:
|
||||
m_uiMassiveDoor = go->GetGUID();
|
||||
if (GetBossState(DATA_ARAN) != IN_PROGRESS)
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
else
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
break;
|
||||
case GO_GAMESMAN_HALL_DOOR:
|
||||
m_uiGamesmansDoor = go->GetGUID();
|
||||
break;
|
||||
case GO_GAMESMAN_HALL_EXIT_DOOR:
|
||||
m_uiGamesmansExitDoor = go->GetGUID();
|
||||
break;
|
||||
case GO_NETHERSPACE_DOOR:
|
||||
m_uiNetherspaceDoor = go->GetGUID();
|
||||
if (GetBossState(DATA_PRINCE) != IN_PROGRESS)
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
else
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
break;
|
||||
case GO_MASTERS_TERRACE_DOOR:
|
||||
MastersTerraceDoor[0] = go->GetGUID();
|
||||
break;
|
||||
case GO_MASTERS_TERRACE_DOOR2:
|
||||
MastersTerraceDoor[1] = go->GetGUID();
|
||||
break;
|
||||
case GO_SIDE_ENTRANCE_DOOR:
|
||||
m_uiSideEntranceDoor = go->GetGUID();
|
||||
if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
else
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
break;
|
||||
case GO_DUST_COVERED_CHEST:
|
||||
DustCoveredChest = go->GetGUID();
|
||||
break;
|
||||
case GO_STAGE_CURTAIN:
|
||||
m_uiCurtainGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_STAGE_DOOR_LEFT:
|
||||
m_uiStageDoorLeftGUID = go->GetGUID();
|
||||
if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_STAGE_DOOR_RIGHT:
|
||||
m_uiStageDoorRightGUID = go->GetGUID();
|
||||
if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_PRIVATE_LIBRARY_DOOR:
|
||||
m_uiLibraryDoor = go->GetGUID();
|
||||
break;
|
||||
case GO_MASSIVE_DOOR:
|
||||
m_uiMassiveDoor = go->GetGUID();
|
||||
if (GetBossState(DATA_ARAN) != IN_PROGRESS)
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
else
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
break;
|
||||
case GO_GAMESMAN_HALL_DOOR:
|
||||
m_uiGamesmansDoor = go->GetGUID();
|
||||
break;
|
||||
case GO_GAMESMAN_HALL_EXIT_DOOR:
|
||||
m_uiGamesmansExitDoor = go->GetGUID();
|
||||
break;
|
||||
case GO_NETHERSPACE_DOOR:
|
||||
m_uiNetherspaceDoor = go->GetGUID();
|
||||
if (GetBossState(DATA_PRINCE) != IN_PROGRESS)
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
else
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
break;
|
||||
case GO_MASTERS_TERRACE_DOOR:
|
||||
MastersTerraceDoor[0] = go->GetGUID();
|
||||
break;
|
||||
case GO_MASTERS_TERRACE_DOOR2:
|
||||
MastersTerraceDoor[1] = go->GetGUID();
|
||||
break;
|
||||
case GO_SIDE_ENTRANCE_DOOR:
|
||||
m_uiSideEntranceDoor = go->GetGUID();
|
||||
if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
else
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
break;
|
||||
case GO_DUST_COVERED_CHEST:
|
||||
DustCoveredChest = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (OperaEvent)
|
||||
{
|
||||
/// @todo Set Object visibilities for Opera based on performance
|
||||
case EVENT_OZ:
|
||||
break;
|
||||
case EVENT_OZ:
|
||||
break;
|
||||
|
||||
case EVENT_HOOD:
|
||||
break;
|
||||
case EVENT_HOOD:
|
||||
break;
|
||||
|
||||
case EVENT_RAJ:
|
||||
break;
|
||||
case EVENT_RAJ:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,41 +224,41 @@ public:
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_OPERA_PERFORMANCE:
|
||||
return OperaEvent;
|
||||
case DATA_OPERA_OZ_DEATHCOUNT:
|
||||
return OzDeathCount;
|
||||
case DATA_OPERA_PERFORMANCE:
|
||||
return OperaEvent;
|
||||
case DATA_OPERA_OZ_DEATHCOUNT:
|
||||
return OzDeathCount;
|
||||
|
||||
case DATA_KILREK:
|
||||
return m_uiKilrekGUID;
|
||||
case DATA_TERESTIAN:
|
||||
return m_uiTerestianGUID;
|
||||
case DATA_MOROES:
|
||||
return m_uiMoroesGUID;
|
||||
case DATA_GO_STAGEDOORLEFT:
|
||||
return m_uiStageDoorLeftGUID;
|
||||
case DATA_GO_STAGEDOORRIGHT:
|
||||
return m_uiStageDoorRightGUID;
|
||||
case DATA_GO_CURTAINS:
|
||||
return m_uiCurtainGUID;
|
||||
case DATA_GO_LIBRARY_DOOR:
|
||||
return m_uiLibraryDoor;
|
||||
case DATA_GO_MASSIVE_DOOR:
|
||||
return m_uiMassiveDoor;
|
||||
case DATA_GO_SIDE_ENTRANCE_DOOR:
|
||||
return m_uiSideEntranceDoor;
|
||||
case DATA_GO_GAME_DOOR:
|
||||
return m_uiGamesmansDoor;
|
||||
case DATA_GO_GAME_EXIT_DOOR:
|
||||
return m_uiGamesmansExitDoor;
|
||||
case DATA_GO_NETHER_DOOR:
|
||||
return m_uiNetherspaceDoor;
|
||||
case DATA_MASTERS_TERRACE_DOOR_1:
|
||||
return MastersTerraceDoor[0];
|
||||
case DATA_MASTERS_TERRACE_DOOR_2:
|
||||
return MastersTerraceDoor[1];
|
||||
case DATA_IMAGE_OF_MEDIVH:
|
||||
return ImageGUID;
|
||||
case DATA_KILREK:
|
||||
return m_uiKilrekGUID;
|
||||
case DATA_TERESTIAN:
|
||||
return m_uiTerestianGUID;
|
||||
case DATA_MOROES:
|
||||
return m_uiMoroesGUID;
|
||||
case DATA_GO_STAGEDOORLEFT:
|
||||
return m_uiStageDoorLeftGUID;
|
||||
case DATA_GO_STAGEDOORRIGHT:
|
||||
return m_uiStageDoorRightGUID;
|
||||
case DATA_GO_CURTAINS:
|
||||
return m_uiCurtainGUID;
|
||||
case DATA_GO_LIBRARY_DOOR:
|
||||
return m_uiLibraryDoor;
|
||||
case DATA_GO_MASSIVE_DOOR:
|
||||
return m_uiMassiveDoor;
|
||||
case DATA_GO_SIDE_ENTRANCE_DOOR:
|
||||
return m_uiSideEntranceDoor;
|
||||
case DATA_GO_GAME_DOOR:
|
||||
return m_uiGamesmansDoor;
|
||||
case DATA_GO_GAME_EXIT_DOOR:
|
||||
return m_uiGamesmansExitDoor;
|
||||
case DATA_GO_NETHER_DOOR:
|
||||
return m_uiNetherspaceDoor;
|
||||
case DATA_MASTERS_TERRACE_DOOR_1:
|
||||
return MastersTerraceDoor[0];
|
||||
case DATA_MASTERS_TERRACE_DOOR_2:
|
||||
return MastersTerraceDoor[1];
|
||||
case DATA_IMAGE_OF_MEDIVH:
|
||||
return ImageGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -268,22 +268,38 @@ public:
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_KILREK: return m_uiKilrekGUID;
|
||||
case DATA_TERESTIAN: return m_uiTerestianGUID;
|
||||
case DATA_MOROES: return m_uiMoroesGUID;
|
||||
case DATA_GO_STAGEDOORLEFT: return m_uiStageDoorLeftGUID;
|
||||
case DATA_GO_STAGEDOORRIGHT: return m_uiStageDoorRightGUID;
|
||||
case DATA_GO_CURTAINS: return m_uiCurtainGUID;
|
||||
case DATA_GO_LIBRARY_DOOR: return m_uiLibraryDoor;
|
||||
case DATA_GO_MASSIVE_DOOR: return m_uiMassiveDoor;
|
||||
case DATA_GO_SIDE_ENTRANCE_DOOR: return m_uiSideEntranceDoor;
|
||||
case DATA_GO_GAME_DOOR: return m_uiGamesmansDoor;
|
||||
case DATA_GO_GAME_EXIT_DOOR: return m_uiGamesmansExitDoor;
|
||||
case DATA_GO_NETHER_DOOR: return m_uiNetherspaceDoor;
|
||||
case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0];
|
||||
case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1];
|
||||
case DATA_IMAGE_OF_MEDIVH: return ImageGUID;
|
||||
case DATA_NIGHTBANE: return m_uiNightBaneGUID;
|
||||
case DATA_KILREK:
|
||||
return m_uiKilrekGUID;
|
||||
case DATA_TERESTIAN:
|
||||
return m_uiTerestianGUID;
|
||||
case DATA_MOROES:
|
||||
return m_uiMoroesGUID;
|
||||
case DATA_GO_STAGEDOORLEFT:
|
||||
return m_uiStageDoorLeftGUID;
|
||||
case DATA_GO_STAGEDOORRIGHT:
|
||||
return m_uiStageDoorRightGUID;
|
||||
case DATA_GO_CURTAINS:
|
||||
return m_uiCurtainGUID;
|
||||
case DATA_GO_LIBRARY_DOOR:
|
||||
return m_uiLibraryDoor;
|
||||
case DATA_GO_MASSIVE_DOOR:
|
||||
return m_uiMassiveDoor;
|
||||
case DATA_GO_SIDE_ENTRANCE_DOOR:
|
||||
return m_uiSideEntranceDoor;
|
||||
case DATA_GO_GAME_DOOR:
|
||||
return m_uiGamesmansDoor;
|
||||
case DATA_GO_GAME_EXIT_DOOR:
|
||||
return m_uiGamesmansExitDoor;
|
||||
case DATA_GO_NETHER_DOOR:
|
||||
return m_uiNetherspaceDoor;
|
||||
case DATA_MASTERS_TERRACE_DOOR_1:
|
||||
return MastersTerraceDoor[0];
|
||||
case DATA_MASTERS_TERRACE_DOOR_2:
|
||||
return MastersTerraceDoor[1];
|
||||
case DATA_IMAGE_OF_MEDIVH:
|
||||
return ImageGUID;
|
||||
case DATA_NIGHTBANE:
|
||||
return m_uiNightBaneGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Karazhan
|
||||
@@ -71,7 +71,7 @@ struct Dialogue
|
||||
uint32 timer;
|
||||
};
|
||||
|
||||
static Dialogue OzDialogue[]=
|
||||
static Dialogue OzDialogue[] =
|
||||
{
|
||||
{0, 6000},
|
||||
{1, 18000},
|
||||
@@ -79,7 +79,7 @@ static Dialogue OzDialogue[]=
|
||||
{3, 15000}
|
||||
};
|
||||
|
||||
static Dialogue HoodDialogue[]=
|
||||
static Dialogue HoodDialogue[] =
|
||||
{
|
||||
{4, 6000},
|
||||
{5, 10000},
|
||||
@@ -87,7 +87,7 @@ static Dialogue HoodDialogue[]=
|
||||
{7, 15000}
|
||||
};
|
||||
|
||||
static Dialogue RAJDialogue[]=
|
||||
static Dialogue RAJDialogue[] =
|
||||
{
|
||||
{8, 5000},
|
||||
{9, 7000},
|
||||
@@ -96,7 +96,7 @@ static Dialogue RAJDialogue[]=
|
||||
};
|
||||
|
||||
// Entries and spawn locations for creatures in Oz event
|
||||
float Spawns[6][2]=
|
||||
float Spawns[6][2] =
|
||||
{
|
||||
{17535, -10896}, // Dorothee
|
||||
{17546, -10891}, // Roar
|
||||
@@ -175,8 +175,8 @@ public:
|
||||
SetEscortPaused(true);
|
||||
|
||||
if (Creature* spotlight = me->SummonCreature(NPC_SPOTLIGHT,
|
||||
me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f,
|
||||
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000))
|
||||
me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f,
|
||||
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000))
|
||||
{
|
||||
spotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
spotlight->CastSpell(spotlight, SPELL_SPOTLIGHT, false);
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
{
|
||||
case EVENT_OZ:
|
||||
if (OzDialogue[count].textid)
|
||||
text = OzDialogue[count].textid;
|
||||
text = OzDialogue[count].textid;
|
||||
if (OzDialogue[count].timer)
|
||||
TalkTimer = OzDialogue[count].timer;
|
||||
break;
|
||||
@@ -215,15 +215,15 @@ public:
|
||||
break;
|
||||
|
||||
case EVENT_RAJ:
|
||||
if (RAJDialogue[count].textid)
|
||||
text = RAJDialogue[count].textid;
|
||||
if (RAJDialogue[count].textid)
|
||||
text = RAJDialogue[count].textid;
|
||||
if (RAJDialogue[count].timer)
|
||||
TalkTimer = RAJDialogue[count].timer;
|
||||
break;
|
||||
}
|
||||
|
||||
if (text)
|
||||
CreatureAI::Talk(text);
|
||||
CreatureAI::Talk(text);
|
||||
}
|
||||
|
||||
void PrepareEncounter()
|
||||
@@ -242,11 +242,11 @@ public:
|
||||
break;
|
||||
case EVENT_HOOD:
|
||||
index = 4;
|
||||
count = index+1;
|
||||
count = index + 1;
|
||||
break;
|
||||
case EVENT_RAJ:
|
||||
index = 5;
|
||||
count = index+1;
|
||||
count = index + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
uint32 entry = ((uint32)Spawns[index][0]);
|
||||
float PosX = Spawns[index][1];
|
||||
|
||||
if (Creature* creature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
|
||||
if (Creature* creature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR * 2 * IN_MILLISECONDS))
|
||||
{
|
||||
// In case database has bad flags
|
||||
creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
|
||||
@@ -285,7 +285,8 @@ public:
|
||||
|
||||
Talk(TalkCount);
|
||||
++TalkCount;
|
||||
} else TalkTimer -= diff;
|
||||
}
|
||||
else TalkTimer -= diff;
|
||||
}
|
||||
|
||||
if (PerformanceReady)
|
||||
@@ -298,7 +299,7 @@ public:
|
||||
if (!map->IsDungeon())
|
||||
return;
|
||||
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
Map::PlayerList const& PlayerList = map->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -320,7 +321,8 @@ public:
|
||||
}
|
||||
|
||||
WipeTimer = 15000;
|
||||
} else WipeTimer -= diff;
|
||||
}
|
||||
else WipeTimer -= diff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,7 +336,7 @@ public:
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, 8971, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
@@ -479,80 +481,80 @@ public:
|
||||
{
|
||||
switch(Step)
|
||||
{
|
||||
case 1:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL, 0);
|
||||
return 10000;
|
||||
case 2:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 3:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, 0);
|
||||
return 10000;
|
||||
case 4:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 5:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 6:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0);
|
||||
case 1:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL, 0);
|
||||
return 10000;
|
||||
case 2:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 3:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, 0);
|
||||
return 10000;
|
||||
case 4:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 5:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 6:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0);
|
||||
|
||||
ATimer = 5500;
|
||||
MTimer = 6600;
|
||||
return 10000;
|
||||
case 7:
|
||||
return 1000;
|
||||
case 8:
|
||||
me->CastSpell(me, SPELL_MANA_SHIELD, true);
|
||||
return 5500;
|
||||
case 9:
|
||||
me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
|
||||
me->CastSpell(me, 30972, true);
|
||||
return 10000;
|
||||
case 10:
|
||||
me->RemoveAurasDueToSpell(30972);
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
me->CastSpell(arca, SPELL_CONFLAGRATION_BLAST, false);
|
||||
return 1000;
|
||||
case 11:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0);
|
||||
return 5000;
|
||||
case 12:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
{
|
||||
arca->SetSpeed(MOVE_RUN, 2.0f);
|
||||
arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f);
|
||||
arca->InterruptNonMeleeSpells(true);
|
||||
}
|
||||
return 10000;
|
||||
case 13:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, 0);
|
||||
return 10000;
|
||||
case 14:
|
||||
if (me->GetMap()->IsDungeon())
|
||||
{
|
||||
InstanceMap::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
|
||||
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
ATimer = 5500;
|
||||
MTimer = 6600;
|
||||
return 10000;
|
||||
case 7:
|
||||
return 1000;
|
||||
case 8:
|
||||
me->CastSpell(me, SPELL_MANA_SHIELD, true);
|
||||
return 5500;
|
||||
case 9:
|
||||
me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
|
||||
me->CastSpell(me, 30972, true);
|
||||
return 10000;
|
||||
case 10:
|
||||
me->RemoveAurasDueToSpell(30972);
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
me->CastSpell(arca, SPELL_CONFLAGRATION_BLAST, false);
|
||||
return 1000;
|
||||
case 11:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0);
|
||||
return 5000;
|
||||
case 12:
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
{
|
||||
if (i->GetSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE)
|
||||
arca->SetSpeed(MOVE_RUN, 2.0f);
|
||||
arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f);
|
||||
arca->InterruptNonMeleeSpells(true);
|
||||
}
|
||||
return 10000;
|
||||
case 13:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, 0);
|
||||
return 10000;
|
||||
case 14:
|
||||
if (me->GetMap()->IsDungeon())
|
||||
{
|
||||
InstanceMap::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
|
||||
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
i->GetSource()->GroupEventHappens(9645, me);
|
||||
break;
|
||||
if (i->GetSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
i->GetSource()->GroupEventHappens(9645, me);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon(100);
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->DespawnOrUnsummon(100);
|
||||
me->DespawnOrUnsummon(100);
|
||||
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
|
||||
arca->DespawnOrUnsummon(100);
|
||||
|
||||
return 5000;
|
||||
default:
|
||||
return 2000;
|
||||
return 5000;
|
||||
default:
|
||||
return 2000;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -564,7 +566,8 @@ public:
|
||||
{
|
||||
if (EventStarted)
|
||||
YellTimer = NextStep(Step++);
|
||||
} else YellTimer -= diff;
|
||||
}
|
||||
else YellTimer -= diff;
|
||||
|
||||
if (Step >= 7 && Step <= 8)
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
summons.DespawnAll();
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
|
||||
instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
void InitializeAI()
|
||||
{
|
||||
ScriptedAI::InitializeAI();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
@@ -146,11 +146,11 @@ public:
|
||||
{
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
damage = me->GetHealth()-1;
|
||||
damage = me->GetHealth() - 1;
|
||||
if (me->isRegeneratingHealth())
|
||||
{
|
||||
me->SetRegeneratingHealth(false);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->CombatStop();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
LapseAction(ACTION_REMOVE_FLY);
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LapseAction(uint8 action)
|
||||
{
|
||||
uint8 counter = 0;
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
if (Player* player = itr->GetSource())
|
||||
{
|
||||
if (action == ACTION_TELEPORT_PLAYERS)
|
||||
me->CastSpell(player, SPELL_GRAVITY_LAPSE_PLAYER+counter, true);
|
||||
me->CastSpell(player, SPELL_GRAVITY_LAPSE_PLAYER + counter, true);
|
||||
else if (action == ACTION_KNOCKUP)
|
||||
player->CastSpell(player, SPELL_GRAVITY_LAPSE_DOT, true, nullptr, nullptr, me->GetGUID());
|
||||
else if (action == ACTION_ALLOW_FLY)
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_INIT_COMBAT:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
if (Unit* target = SelectTargetFromPlayerList(50.0f))
|
||||
AttackStart(target);
|
||||
return;
|
||||
@@ -285,29 +285,29 @@ public:
|
||||
|
||||
class spell_mt_phoenix_burn : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mt_phoenix_burn() : SpellScriptLoader("spell_mt_phoenix_burn") { }
|
||||
public:
|
||||
spell_mt_phoenix_burn() : SpellScriptLoader("spell_mt_phoenix_burn") { }
|
||||
|
||||
class spell_mt_phoenix_burn_SpellScript : public SpellScript
|
||||
class spell_mt_phoenix_burn_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mt_phoenix_burn_SpellScript);
|
||||
|
||||
void HandleAfterCast()
|
||||
{
|
||||
PrepareSpellScript(spell_mt_phoenix_burn_SpellScript);
|
||||
|
||||
void HandleAfterCast()
|
||||
{
|
||||
uint32 damage = CalculatePct(GetCaster()->GetMaxHealth(), 5);
|
||||
Unit::DealDamage(GetCaster(), GetCaster(), damage);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterCast += SpellCastFn(spell_mt_phoenix_burn_SpellScript::HandleAfterCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mt_phoenix_burn_SpellScript();
|
||||
uint32 damage = CalculatePct(GetCaster()->GetMaxHealth(), 5);
|
||||
Unit::DealDamage(GetCaster(), GetCaster(), damage);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterCast += SpellCastFn(spell_mt_phoenix_burn_SpellScript::HandleAfterCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mt_phoenix_burn_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_felblood_kaelthas()
|
||||
|
||||
@@ -33,7 +33,7 @@ enum Misc
|
||||
MAX_HELPERS_COUNT = 8
|
||||
};
|
||||
|
||||
const Position helpersLocations[MAX_ACTIVE_HELPERS]=
|
||||
const Position helpersLocations[MAX_ACTIVE_HELPERS] =
|
||||
{
|
||||
{123.77f, 17.6007f, -19.921f, 4.98f},
|
||||
{131.731f, 15.0827f, -19.921f, 4.98f},
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (HelpersKilled == MAX_ACTIVE_HELPERS+1)
|
||||
if (HelpersKilled == MAX_ACTIVE_HELPERS + 1)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
}
|
||||
|
||||
@@ -197,28 +197,34 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPELL_RENEW, 7000);
|
||||
break;
|
||||
case EVENT_SPELL_PW_SHIELD:
|
||||
{
|
||||
std::list<Creature*> cList = DoFindFriendlyMissingBuff(40.0f, DUNGEON_MODE(SPELL_POWER_WORD_SHIELD_N, SPELL_POWER_WORD_SHIELD_H));
|
||||
if (Unit* target = acore::Containers::SelectRandomContainerElement(cList))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_POWER_WORD_SHIELD_N, SPELL_POWER_WORD_SHIELD_H), false);
|
||||
events.ScheduleEvent(EVENT_SPELL_PW_SHIELD, 10000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SPELL_DISPEL:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
switch (urand(0, 2))
|
||||
{
|
||||
case 0: target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true); break;
|
||||
case 1: target = me; break;
|
||||
case 2: target = ObjectAccessor::GetCreature(*me, acore::Containers::SelectRandomContainerElement(summons)); break;
|
||||
std::list<Creature*> cList = DoFindFriendlyMissingBuff(40.0f, DUNGEON_MODE(SPELL_POWER_WORD_SHIELD_N, SPELL_POWER_WORD_SHIELD_H));
|
||||
if (Unit* target = acore::Containers::SelectRandomContainerElement(cList))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_POWER_WORD_SHIELD_N, SPELL_POWER_WORD_SHIELD_H), false);
|
||||
events.ScheduleEvent(EVENT_SPELL_PW_SHIELD, 10000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SPELL_DISPEL:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
switch (urand(0, 2))
|
||||
{
|
||||
case 0:
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true);
|
||||
break;
|
||||
case 1:
|
||||
target = me;
|
||||
break;
|
||||
case 2:
|
||||
target = ObjectAccessor::GetCreature(*me, acore::Containers::SelectRandomContainerElement(summons));
|
||||
break;
|
||||
}
|
||||
|
||||
if (target)
|
||||
me->CastSpell(target, SPELL_DISPEL_MAGIC, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_DISPEL, 12000);
|
||||
break;
|
||||
}
|
||||
if (target)
|
||||
me->CastSpell(target, SPELL_DISPEL_MAGIC, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_DISPEL, 12000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SPELL_IMMUNITY:
|
||||
if (me->HasUnitState(UNIT_STATE_LOST_CONTROL))
|
||||
{
|
||||
@@ -269,11 +275,12 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
float GetThreatMod(float dist, float /*armor*/, uint32 health, uint32 /*maxhealth*/, Unit* target)
|
||||
{
|
||||
float unimportant_dist = (aiType == AI_TYPE_MELEE ? 5.0f : 25.0f);
|
||||
if (dist > unimportant_dist) dist -= unimportant_dist; else dist = 0.0f;
|
||||
if (dist > unimportant_dist) dist -= unimportant_dist;
|
||||
else dist = 0.0f;
|
||||
const float dist_factor = (aiType == AI_TYPE_MELEE ? 15.0f : 25.0f);
|
||||
float mod_dist = dist_factor/(dist_factor + dist); // 0.2 .. 1.0
|
||||
float mod_health = health > 20000 ? 2.0f : (40000-health)/10000.0f; // 2.0 .. 4.0
|
||||
float mod_armor = aiType == AI_TYPE_MELEE ? Unit::CalcArmorReducedDamage(me, target, 10000, nullptr)/10000.0f : 1.0f;
|
||||
float mod_dist = dist_factor / (dist_factor + dist); // 0.2 .. 1.0
|
||||
float mod_health = health > 20000 ? 2.0f : (40000 - health) / 10000.0f; // 2.0 .. 4.0
|
||||
float mod_armor = aiType == AI_TYPE_MELEE ? Unit::CalcArmorReducedDamage(me, target, 10000, nullptr) / 10000.0f : 1.0f;
|
||||
return mod_dist * mod_health * mod_armor;
|
||||
}
|
||||
|
||||
@@ -299,7 +306,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
summons.DespawnAll();
|
||||
actualEventId = 0;
|
||||
}
|
||||
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
@@ -496,7 +503,7 @@ enum WarlockEnum
|
||||
|
||||
EVENT_SPELL_IMMOLATE = 1,
|
||||
EVENT_SPELL_SHADOW_BOLT = 2,
|
||||
EVENT_SPELL_SEED_OF_CORRUPTION= 3,
|
||||
EVENT_SPELL_SEED_OF_CORRUPTION = 3,
|
||||
EVENT_SPELL_CURSE_OF_AGONY = 4,
|
||||
EVENT_SPELL_FEAR = 5,
|
||||
};
|
||||
@@ -721,22 +728,22 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPELL_FROSTBOLT, 8000);
|
||||
break;
|
||||
case EVENT_SPELL_BLINK:
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (target->IsWithinMeleeRange(me))
|
||||
{
|
||||
InMeleeRange = true;
|
||||
break;
|
||||
}
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
ThreatContainer::StorageType const& t_list = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (target->IsWithinMeleeRange(me))
|
||||
{
|
||||
InMeleeRange = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (InMeleeRange)
|
||||
me->CastSpell(me, SPELL_BLINK, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLINK, 15000);
|
||||
break;
|
||||
}
|
||||
if (InMeleeRange)
|
||||
me->CastSpell(me, SPELL_BLINK, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLINK, 15000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -1083,17 +1090,17 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPELL_IRON_BOMB, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_RECOMBOBULATE:
|
||||
{
|
||||
std::list<Creature*> cList = DoFindFriendlyMissingBuff(30.0f, SPELL_RECOMBOBULATE);
|
||||
for (std::list<Creature*>::const_iterator itr = cList.begin(); itr != cList.end(); ++itr)
|
||||
if ((*itr)->IsPolymorphed())
|
||||
{
|
||||
me->CastSpell(*itr, SPELL_RECOMBOBULATE, false);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_RECOMBOBULATE, 10000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
std::list<Creature*> cList = DoFindFriendlyMissingBuff(30.0f, SPELL_RECOMBOBULATE);
|
||||
for (std::list<Creature*>::const_iterator itr = cList.begin(); itr != cList.end(); ++itr)
|
||||
if ((*itr)->IsPolymorphed())
|
||||
{
|
||||
me->CastSpell(*itr, SPELL_RECOMBOBULATE, false);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_RECOMBOBULATE, 10000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SPELL_EXPLOSIVE_SHEEP:
|
||||
me->CastSpell(me, SPELL_HIGH_EXPLOSIVE_SHEEP, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_EXPLOSIVE_SHEEP, 60000);
|
||||
|
||||
@@ -106,10 +106,10 @@ public:
|
||||
events.ScheduleEvent(EVENT_SPELL_DRAIN_LIFE, 2500, 1);
|
||||
events.ScheduleEvent(EVENT_SPELL_FEL_EXPLOSION, 2000);
|
||||
events.ScheduleEvent(EVENT_DRAIN_CRYSTAL, 14000);
|
||||
|
||||
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 7500, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
me->CastSpell(me, SPELL_OVERLOAD, true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Talk(SAY_ENERGY);
|
||||
Talk(EMOTE_DISCHARGE_ENERGY);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
void Initialize()
|
||||
{
|
||||
memset(&Encounter, 0, sizeof(Encounter));
|
||||
|
||||
|
||||
VexallusDoorGUID = 0;
|
||||
SelinDoorGUID = 0;
|
||||
SelinEncounterDoorGUID = 0;
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
HandleGameObject(0, true, go);
|
||||
VexallusDoorGUID = go->GetGUID();
|
||||
break;
|
||||
|
||||
|
||||
case GO_DELRISSA_DOOR:
|
||||
if (GetData(DATA_DELRISSA_EVENT) == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
void SetControl(Player* player, bool on)
|
||||
{
|
||||
WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, me->GetPackGUID().size()+1);
|
||||
WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, me->GetPackGUID().size() + 1);
|
||||
data.append(me->GetPackGUID());
|
||||
data << uint8(on ? 1 : 0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
@@ -100,16 +100,16 @@ public:
|
||||
Talk(EYE_TEXT_LAUNCH, me->GetCharmerOrOwnerPlayerOrPlayerItself());
|
||||
break;
|
||||
case EVENT_LAUNCH:
|
||||
{
|
||||
me->SetSpeed(MOVE_FLIGHT, 5.0f, true);
|
||||
{
|
||||
me->SetSpeed(MOVE_FLIGHT, 5.0f, true);
|
||||
|
||||
const Position EYE_DESTINATION_1 = { me->GetPositionX()-40.0f, me->GetPositionY(), me->GetPositionZ()+10.0f, 0.0f };
|
||||
const Position EYE_DESTINATION_2 = { 1768.0f, -5876.0f, 153.0f, 0.0f };
|
||||
const Position EYE_DESTINATION_1 = { me->GetPositionX() - 40.0f, me->GetPositionY(), me->GetPositionZ() + 10.0f, 0.0f };
|
||||
const Position EYE_DESTINATION_2 = { 1768.0f, -5876.0f, 153.0f, 0.0f };
|
||||
|
||||
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_1, EYE_DESTINATION_1);
|
||||
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_2, EYE_DESTINATION_2);
|
||||
break;
|
||||
}
|
||||
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_1, EYE_DESTINATION_1);
|
||||
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_2, EYE_DESTINATION_2);
|
||||
break;
|
||||
}
|
||||
case EVENT_REGAIN_CONTROL:
|
||||
if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
{
|
||||
@@ -127,30 +127,30 @@ public:
|
||||
|
||||
class spell_q12641_death_comes_from_on_high_summon_ghouls : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q12641_death_comes_from_on_high_summon_ghouls() : SpellScriptLoader("spell_q12641_death_comes_from_on_high_summon_ghouls") { }
|
||||
public:
|
||||
spell_q12641_death_comes_from_on_high_summon_ghouls() : SpellScriptLoader("spell_q12641_death_comes_from_on_high_summon_ghouls") { }
|
||||
|
||||
class spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript : public SpellScript
|
||||
class spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 54522, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript();
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 54522, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum deathsChallenge
|
||||
@@ -261,11 +261,11 @@ public:
|
||||
me->GetMotionMaster()->MoveFollow(caster, 2.0f, 0.0f);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPEAK, 3000);
|
||||
events.ScheduleEvent(EVENT_SPEAK+1, 7000);
|
||||
events.ScheduleEvent(EVENT_SPEAK+2, 8000);
|
||||
events.ScheduleEvent(EVENT_SPEAK+3, 9000);
|
||||
events.ScheduleEvent(EVENT_SPEAK+4, 10000);
|
||||
events.ScheduleEvent(EVENT_SPEAK+5, 11000);
|
||||
events.ScheduleEvent(EVENT_SPEAK + 1, 7000);
|
||||
events.ScheduleEvent(EVENT_SPEAK + 2, 8000);
|
||||
events.ScheduleEvent(EVENT_SPEAK + 3, 9000);
|
||||
events.ScheduleEvent(EVENT_SPEAK + 4, 10000);
|
||||
events.ScheduleEvent(EVENT_SPEAK + 5, 11000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ public:
|
||||
{
|
||||
damage = 0;
|
||||
events.ScheduleEvent(EVENT_DUEL_LOST, 2000);
|
||||
events.ScheduleEvent(EVENT_DUEL_LOST+1, 6000);
|
||||
events.ScheduleEvent(EVENT_DUEL_LOST + 1, 6000);
|
||||
_duelGUID = 0;
|
||||
_duelInProgress = 0;
|
||||
|
||||
@@ -315,16 +315,16 @@ public:
|
||||
Talk(SAY_DUEL, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
break;
|
||||
case EVENT_SPEAK+1:
|
||||
Talk(SAY_DUEL+1, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
Talk(SAY_DUEL + 1, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
break;
|
||||
case EVENT_SPEAK+2:
|
||||
Talk(SAY_DUEL+2, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
Talk(SAY_DUEL + 2, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
break;
|
||||
case EVENT_SPEAK+3:
|
||||
Talk(SAY_DUEL+3, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
Talk(SAY_DUEL + 3, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
break;
|
||||
case EVENT_SPEAK+4:
|
||||
Talk(SAY_DUEL+4, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
Talk(SAY_DUEL + 4, ObjectAccessor::GetPlayer(*me, _duelGUID));
|
||||
break;
|
||||
case EVENT_SPEAK+5:
|
||||
me->setFaction(FACTION_HOSTILE);
|
||||
@@ -377,63 +377,63 @@ enum GiftOfTheHarvester
|
||||
|
||||
class spell_item_gift_of_the_harvester : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_gift_of_the_harvester() : SpellScriptLoader("spell_item_gift_of_the_harvester") { }
|
||||
public:
|
||||
spell_item_gift_of_the_harvester() : SpellScriptLoader("spell_item_gift_of_the_harvester") { }
|
||||
|
||||
class spell_item_gift_of_the_harvester_SpellScript : public SpellScript
|
||||
class spell_item_gift_of_the_harvester_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_gift_of_the_harvester_SpellScript);
|
||||
|
||||
SpellCastResult CheckRequirement()
|
||||
{
|
||||
PrepareSpellScript(spell_item_gift_of_the_harvester_SpellScript);
|
||||
|
||||
SpellCastResult CheckRequirement()
|
||||
std::list<Creature*> ghouls;
|
||||
GetCaster()->GetAllMinionsByEntry(ghouls, NPC_GHOUL);
|
||||
if (ghouls.size() >= MAX_GHOULS)
|
||||
{
|
||||
std::list<Creature*> ghouls;
|
||||
GetCaster()->GetAllMinionsByEntry(ghouls, NPC_GHOUL);
|
||||
if (ghouls.size() >= MAX_GHOULS)
|
||||
{
|
||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS);
|
||||
return SPELL_FAILED_CUSTOM_ERROR;
|
||||
}
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS);
|
||||
return SPELL_FAILED_CUSTOM_ERROR;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_gift_of_the_harvester_SpellScript::CheckRequirement);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_item_gift_of_the_harvester_SpellScript();
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_gift_of_the_harvester_SpellScript::CheckRequirement);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_item_gift_of_the_harvester_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q12698_the_gift_that_keeps_on_giving : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q12698_the_gift_that_keeps_on_giving() : SpellScriptLoader("spell_q12698_the_gift_that_keeps_on_giving") { }
|
||||
public:
|
||||
spell_q12698_the_gift_that_keeps_on_giving() : SpellScriptLoader("spell_q12698_the_gift_that_keeps_on_giving") { }
|
||||
|
||||
class spell_q12698_the_gift_that_keeps_on_giving_SpellScript : public SpellScript
|
||||
class spell_q12698_the_gift_that_keeps_on_giving_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12698_the_gift_that_keeps_on_giving_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_q12698_the_gift_that_keeps_on_giving_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetOriginalCaster() && GetHitUnit())
|
||||
GetOriginalCaster()->CastSpell(GetHitUnit(), urand(0, 1) ? GetEffectValue() : SPELL_SUMMON_SCARLET_GHOST, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12698_the_gift_that_keeps_on_giving_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12698_the_gift_that_keeps_on_giving_SpellScript();
|
||||
if (GetOriginalCaster() && GetHitUnit())
|
||||
GetOriginalCaster()->CastSpell(GetHitUnit(), urand(0, 1) ? GetEffectValue() : SPELL_SUMMON_SCARLET_GHOST, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12698_the_gift_that_keeps_on_giving_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12698_the_gift_that_keeps_on_giving_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class npc_scarlet_ghoul : public CreatureScript
|
||||
@@ -507,7 +507,7 @@ public:
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, frand(0.0f, 2*M_PI));
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, frand(0.0f, 2 * M_PI));
|
||||
events.PopEvent();
|
||||
events.ScheduleEvent(EVENT_GHOUL_CHECK_COMBAT, 1000);
|
||||
return;
|
||||
@@ -567,7 +567,7 @@ public:
|
||||
creature->CastSpell(owner, 52517, true);
|
||||
|
||||
creature->AI()->SetGUID(me->GetGUID());
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ public:
|
||||
if (summonAttackers >= 15000)
|
||||
{
|
||||
for (uint8 i = 0; i < 15; ++i)
|
||||
if (Creature* summon = me->SummonCreature(28834 /*NPC_SCARLET_FLEET_DEFENDER*/, 2192.56f+irand(-10, 10), -6147.90f+irand(-10, 10), 5.2f, 4.7f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 45000))
|
||||
if (Creature* summon = me->SummonCreature(28834 /*NPC_SCARLET_FLEET_DEFENDER*/, 2192.56f + irand(-10, 10), -6147.90f + irand(-10, 10), 5.2f, 4.7f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 45000))
|
||||
{
|
||||
summon->SetHomePosition(me->GetHomePosition());
|
||||
summon->AI()->AttackStart(me);
|
||||
@@ -770,103 +770,103 @@ public:
|
||||
{
|
||||
switch (phase)
|
||||
{
|
||||
case PHASE_CHAINED:
|
||||
if (!anchorGUID)
|
||||
{
|
||||
if (Creature* anchor = me->FindNearestCreature(29521, 30))
|
||||
case PHASE_CHAINED:
|
||||
if (!anchorGUID)
|
||||
{
|
||||
anchor->AI()->SetGUID(me->GetGUID());
|
||||
anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true);
|
||||
anchorGUID = anchor->GetGUID();
|
||||
}
|
||||
|
||||
float dist = 99.0f;
|
||||
GameObject* prison = nullptr;
|
||||
|
||||
for (uint8 i = 0; i < 12; ++i)
|
||||
{
|
||||
if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i], 100))
|
||||
if (Creature* anchor = me->FindNearestCreature(29521, 30))
|
||||
{
|
||||
if (temp_prison && me->IsWithinDist(temp_prison, dist, false))
|
||||
anchor->AI()->SetGUID(me->GetGUID());
|
||||
anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true);
|
||||
anchorGUID = anchor->GetGUID();
|
||||
}
|
||||
|
||||
float dist = 99.0f;
|
||||
GameObject* prison = nullptr;
|
||||
|
||||
for (uint8 i = 0; i < 12; ++i)
|
||||
{
|
||||
if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i], 100))
|
||||
{
|
||||
dist = me->GetDistance2d(temp_prison);
|
||||
prison = temp_prison;
|
||||
if (temp_prison && me->IsWithinDist(temp_prison, dist, false))
|
||||
{
|
||||
dist = me->GetDistance2d(temp_prison);
|
||||
prison = temp_prison;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (prison)
|
||||
prison->ResetDoorOrButton();
|
||||
}
|
||||
break;
|
||||
case PHASE_TO_EQUIP:
|
||||
if (wait_timer)
|
||||
{
|
||||
if (wait_timer > diff)
|
||||
wait_timer -= diff;
|
||||
else
|
||||
{
|
||||
me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ());
|
||||
//sLog->outDebug(LOG_FILTER_TSCR, "npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ());
|
||||
phase = PHASE_EQUIPING;
|
||||
wait_timer = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PHASE_TO_ATTACK:
|
||||
if (wait_timer)
|
||||
{
|
||||
if (wait_timer > diff)
|
||||
wait_timer -= diff;
|
||||
else
|
||||
{
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
phase = PHASE_ATTACKING;
|
||||
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
AttackStart(target);
|
||||
wait_timer = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PHASE_ATTACKING:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ICY_TOUCH:
|
||||
DoCastVictim(SPELL_ICY_TOUCH);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST);
|
||||
break;
|
||||
case EVENT_PLAGUE_STRIKE:
|
||||
DoCastVictim(SPELL_PLAGUE_STRIKE);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_PLAGUE_STRIKE, 5000, GCD_CAST);
|
||||
break;
|
||||
case EVENT_BLOOD_STRIKE:
|
||||
DoCastVictim(SPELL_BLOOD_STRIKE);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST);
|
||||
break;
|
||||
case EVENT_DEATH_COIL:
|
||||
DoCastVictim(SPELL_DEATH_COIL);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (prison)
|
||||
prison->ResetDoorOrButton();
|
||||
}
|
||||
break;
|
||||
case PHASE_TO_EQUIP:
|
||||
if (wait_timer)
|
||||
{
|
||||
if (wait_timer > diff)
|
||||
wait_timer -= diff;
|
||||
else
|
||||
{
|
||||
me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ());
|
||||
//sLog->outDebug(LOG_FILTER_TSCR, "npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ());
|
||||
phase = PHASE_EQUIPING;
|
||||
wait_timer = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PHASE_TO_ATTACK:
|
||||
if (wait_timer)
|
||||
{
|
||||
if (wait_timer > diff)
|
||||
wait_timer -= diff;
|
||||
else
|
||||
{
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
phase = PHASE_ATTACKING;
|
||||
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
AttackStart(target);
|
||||
wait_timer = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PHASE_ATTACKING:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ICY_TOUCH:
|
||||
DoCastVictim(SPELL_ICY_TOUCH);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST);
|
||||
break;
|
||||
case EVENT_PLAGUE_STRIKE:
|
||||
DoCastVictim(SPELL_PLAGUE_STRIKE);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_PLAGUE_STRIKE, 5000, GCD_CAST);
|
||||
break;
|
||||
case EVENT_BLOOD_STRIKE:
|
||||
DoCastVictim(SPELL_BLOOD_STRIKE);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST);
|
||||
break;
|
||||
case EVENT_DEATH_COIL:
|
||||
DoCastVictim(SPELL_DEATH_COIL);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -942,7 +942,7 @@ public:
|
||||
{
|
||||
npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature), minerGUID(0)
|
||||
{
|
||||
me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->setFaction(35);
|
||||
me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse.
|
||||
}
|
||||
@@ -965,7 +965,7 @@ public:
|
||||
me->SetSpeed(MOVE_RUN, 1.25f);
|
||||
|
||||
me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0);
|
||||
me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->setFaction(35);
|
||||
}
|
||||
}
|
||||
@@ -1076,7 +1076,7 @@ public:
|
||||
{
|
||||
me->SetFacingToObject(car);
|
||||
// xinef: add some flags
|
||||
car->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
car->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
car->setFaction(35);
|
||||
}
|
||||
Talk(SAY_SCARLET_MINER_0);
|
||||
@@ -1118,7 +1118,8 @@ public:
|
||||
car->AI()->DoAction(0);
|
||||
IntroPhase = 0;
|
||||
}
|
||||
} else IntroTimer-=diff;
|
||||
}
|
||||
else IntroTimer -= diff;
|
||||
}
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
@@ -1158,7 +1159,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,8 @@ public:
|
||||
++speechCounter;
|
||||
DoCastAOE(SPELL_THREAT_PULSE, true);
|
||||
|
||||
} else
|
||||
}
|
||||
else
|
||||
speechTimer -= diff;
|
||||
|
||||
return;
|
||||
@@ -347,29 +348,29 @@ public:
|
||||
m_uiWave_Timer = 1000;
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
Creature* temp = ObjectAccessor::GetCreature(*me, m_uiValrothGUID);
|
||||
{
|
||||
Creature* temp = ObjectAccessor::GetCreature(*me, m_uiValrothGUID);
|
||||
|
||||
if (!temp || !temp->IsAlive())
|
||||
{
|
||||
Talk(SAY_BREAKOUT8);
|
||||
m_uiWave_Timer = 5000;
|
||||
}
|
||||
else
|
||||
{
|
||||
// xinef: despawn check
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player || me->GetDistance(player) > 60.0f)
|
||||
if (!temp || !temp->IsAlive())
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
Talk(SAY_BREAKOUT8);
|
||||
m_uiWave_Timer = 5000;
|
||||
}
|
||||
else
|
||||
{
|
||||
// xinef: despawn check
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player || me->GetDistance(player) > 60.0f)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
|
||||
m_uiWave_Timer = 2500;
|
||||
return; //return, we don't want m_uiWave to increment now
|
||||
m_uiWave_Timer = 2500;
|
||||
return; //return, we don't want m_uiWave to increment now
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
Talk(SAY_BREAKOUT9);
|
||||
me->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE);
|
||||
@@ -450,25 +451,26 @@ public:
|
||||
{
|
||||
switch (uiStage)
|
||||
{
|
||||
case 1:
|
||||
me->SetWalk(true);
|
||||
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
|
||||
{
|
||||
Talk(SAY_TREE1);
|
||||
float x, y, z;
|
||||
tree->GetContactPoint(me, x, y, z);
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
|
||||
if (Unit* unit = tree->GetOwner())
|
||||
AttackStart(unit);
|
||||
break;
|
||||
case 1:
|
||||
me->SetWalk(true);
|
||||
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
|
||||
{
|
||||
Talk(SAY_TREE1);
|
||||
float x, y, z;
|
||||
tree->GetContactPoint(me, x, y, z);
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
|
||||
if (Unit* unit = tree->GetOwner())
|
||||
AttackStart(unit);
|
||||
break;
|
||||
}
|
||||
uiStage_timer = 3000;
|
||||
uiStage = 0;
|
||||
} else uiStage_timer -= diff;
|
||||
}
|
||||
else uiStage_timer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
@@ -484,7 +486,7 @@ public:
|
||||
|
||||
enum valroth
|
||||
{
|
||||
//SAY_VALROTH1 = 0, Unused
|
||||
//SAY_VALROTH1 = 0, Unused
|
||||
SAY_VALROTH_AGGRO = 1,
|
||||
SAY_VALROTH_RAND = 2,
|
||||
SAY_VALROTH_DEATH = 3,
|
||||
@@ -532,28 +534,31 @@ public:
|
||||
Shout();
|
||||
DoCast(me, SPELL_RENEW);
|
||||
uiRenew_timer = urand(1000, 6000);
|
||||
} else uiRenew_timer -= diff;
|
||||
}
|
||||
else uiRenew_timer -= diff;
|
||||
|
||||
if (uiInquisitor_Penance_timer <= diff)
|
||||
{
|
||||
Shout();
|
||||
DoCastVictim(SPELL_INQUISITOR_PENANCE);
|
||||
uiInquisitor_Penance_timer = urand(2000, 7000);
|
||||
} else uiInquisitor_Penance_timer -= diff;
|
||||
}
|
||||
else uiInquisitor_Penance_timer -= diff;
|
||||
|
||||
if (uiValroth_Smite_timer <= diff)
|
||||
{
|
||||
Shout();
|
||||
DoCastVictim(SPELL_VALROTH_SMITE);
|
||||
uiValroth_Smite_timer = urand(1000, 6000);
|
||||
} else uiValroth_Smite_timer -= diff;
|
||||
}
|
||||
else uiValroth_Smite_timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void Shout()
|
||||
{
|
||||
if (rand()%100 < 15)
|
||||
if (rand() % 100 < 15)
|
||||
Talk(SAY_VALROTH_RAND);
|
||||
}
|
||||
|
||||
@@ -737,14 +742,30 @@ public:
|
||||
case RACE_HUMAN:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_1, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_5, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_1, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_5, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_7, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_1, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_5, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_1, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_5, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_7, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_1, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -767,14 +788,30 @@ public:
|
||||
case RACE_ORC:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_1, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_6, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_1, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_7, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_8, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_1, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_6, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_1, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_7, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_8, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_1, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -797,14 +834,30 @@ public:
|
||||
case RACE_DWARF:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_2, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_2, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_3, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_2, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_5, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_2, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_2, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_2, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_3, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_2, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_5, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_2, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -827,14 +880,30 @@ public:
|
||||
case RACE_NIGHTELF:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_1, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_5, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_1, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_6, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_2, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_1, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_5, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_1, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_6, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_2, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_1, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -857,14 +926,30 @@ public:
|
||||
case RACE_UNDEAD_PLAYER:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_1, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_3, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_4, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_3, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_1, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_3, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_1, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_3, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_4, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_3, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_1, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_3, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -887,14 +972,30 @@ public:
|
||||
case RACE_TAUREN:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_1, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_1, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_5, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_8, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_9, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_1, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_1, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_5, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_8, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_9, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_1, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -917,14 +1018,30 @@ public:
|
||||
case RACE_GNOME:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_1, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_4, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_1, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_4, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_6, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_1, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_4, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_1, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_4, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_6, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_1, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -947,14 +1064,30 @@ public:
|
||||
case RACE_TROLL:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_3, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_7, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_2, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_6, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_9, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_10, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_4, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_3, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_7, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_2, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_6, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_9, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_10, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_4, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -977,14 +1110,28 @@ public:
|
||||
case RACE_BLOODELF:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_1, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_1, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_1, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_1, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_1, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_1, player);
|
||||
break;
|
||||
//case 5: //unknown
|
||||
case 6: Talk(SAY_EXEC_THINK_3, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_3, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_1, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -1007,14 +1154,30 @@ public:
|
||||
case RACE_DRAENEI:
|
||||
switch (ExecuteSpeech_Counter)
|
||||
{
|
||||
case 0: Talk(SAY_EXEC_START_1, player); break;
|
||||
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
|
||||
case 2: Talk(SAY_EXEC_PROG_1, player); break;
|
||||
case 3: Talk(SAY_EXEC_NAME_1, player); break;
|
||||
case 4: Talk(SAY_EXEC_RECOG_2, player); break;
|
||||
case 5: Talk(SAY_EXEC_NOREM_1, player); break;
|
||||
case 6: Talk(SAY_EXEC_THINK_4, player); break;
|
||||
case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
|
||||
case 0:
|
||||
Talk(SAY_EXEC_START_1, player);
|
||||
break;
|
||||
case 1:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_EXEC_PROG_1, player);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_EXEC_NAME_1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_EXEC_RECOG_2, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_EXEC_NOREM_1, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_EXEC_THINK_4, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_EXEC_LISTEN_1, player);
|
||||
break;
|
||||
case 8:
|
||||
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
|
||||
Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
|
||||
@@ -1052,29 +1215,29 @@ public:
|
||||
|
||||
class spell_q12779_an_end_to_all_things : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q12779_an_end_to_all_things() : SpellScriptLoader("spell_q12779_an_end_to_all_things") { }
|
||||
public:
|
||||
spell_q12779_an_end_to_all_things() : SpellScriptLoader("spell_q12779_an_end_to_all_things") { }
|
||||
|
||||
class spell_q12779_an_end_to_all_things_SpellScript : public SpellScript
|
||||
class spell_q12779_an_end_to_all_things_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12779_an_end_to_all_things_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_q12779_an_end_to_all_things_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetHitUnit())
|
||||
GetHitUnit()->CastSpell(GetCaster(), GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12779_an_end_to_all_things_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12779_an_end_to_all_things_SpellScript();
|
||||
if (GetHitUnit())
|
||||
GetHitUnit()->CastSpell(GetCaster(), GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12779_an_end_to_all_things_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12779_an_end_to_all_things_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_the_scarlet_enclave_c2()
|
||||
|
||||
@@ -302,19 +302,19 @@ const Position LightOfDawnFightPos[] =
|
||||
|
||||
class DelayedSummonEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
DelayedSummonEvent(Unit* owner, uint32 entry, Position pos) : _owner(owner), _entry(entry), _pos(pos) { }
|
||||
public:
|
||||
DelayedSummonEvent(Unit* owner, uint32 entry, Position pos) : _owner(owner), _entry(entry), _pos(pos) { }
|
||||
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
|
||||
{
|
||||
_owner->SummonCreature(_entry, _pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
return true;
|
||||
}
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
|
||||
{
|
||||
_owner->SummonCreature(_entry, _pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _owner;
|
||||
uint32 _entry;
|
||||
Position _pos;
|
||||
private:
|
||||
Unit* _owner;
|
||||
uint32 _entry;
|
||||
Position _pos;
|
||||
};
|
||||
|
||||
class npc_highlord_darion_mograine : public CreatureScript
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
|
||||
if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE && !creature->AI()->GetData(WORLD_STATE_SOLDIERS_ENABLE))
|
||||
AddGossipItemFor(player, 9795, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
@@ -342,7 +342,7 @@ public:
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
CloseGossipMenuFor(player);
|
||||
@@ -356,8 +356,8 @@ public:
|
||||
npc_highlord_darion_mograineAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
battleStarted = ENCOUNTER_STATE_NONE;
|
||||
me->SetCorpseDelay(3*60);
|
||||
me->SetRespawnTime(3*60);
|
||||
me->SetCorpseDelay(3 * 60);
|
||||
me->SetRespawnTime(3 * 60);
|
||||
resetExecuted = false;
|
||||
}
|
||||
|
||||
@@ -403,12 +403,18 @@ public:
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case WORLD_STATE_DEFENDERS_COUNT: return defendersRemaining;
|
||||
case WORLD_STATE_SCOURGE_COUNT: return scourgeRemaining;
|
||||
case WORLD_STATE_SOLDIERS_ENABLE: return me->IsAlive() && (startTimeRemaining || battleStarted);
|
||||
case WORLD_STATE_COUNTDOWN_ENABLE: return me->IsAlive() && startTimeRemaining;
|
||||
case WORLD_STATE_COUNTDOWN_TIME: return startTimeRemaining;
|
||||
case WORLD_STATE_EVENT_BEGIN_ENABLE: return me->IsAlive() && !startTimeRemaining && battleStarted;
|
||||
case WORLD_STATE_DEFENDERS_COUNT:
|
||||
return defendersRemaining;
|
||||
case WORLD_STATE_SCOURGE_COUNT:
|
||||
return scourgeRemaining;
|
||||
case WORLD_STATE_SOLDIERS_ENABLE:
|
||||
return me->IsAlive() && (startTimeRemaining || battleStarted);
|
||||
case WORLD_STATE_COUNTDOWN_ENABLE:
|
||||
return me->IsAlive() && startTimeRemaining;
|
||||
case WORLD_STATE_COUNTDOWN_TIME:
|
||||
return startTimeRemaining;
|
||||
case WORLD_STATE_EVENT_BEGIN_ENABLE:
|
||||
return me->IsAlive() && !startTimeRemaining && battleStarted;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -449,7 +455,7 @@ public:
|
||||
if (battleStarted == ENCOUNTER_STATE_OUTRO && cr->GetEntry() == NPC_DEFENDER_OF_THE_LIGHT)
|
||||
{
|
||||
cr->SetReactState(REACT_PASSIVE);
|
||||
cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
cr->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY1H);
|
||||
cr->HandleEmoteCommand(EMOTE_STATE_READY1H);
|
||||
}
|
||||
@@ -480,8 +486,8 @@ public:
|
||||
void JustDied(Unit*) override
|
||||
{
|
||||
summons.DespawnAll();
|
||||
me->SetCorpseDelay(3*60);
|
||||
me->SetRespawnTime(3*60);
|
||||
me->SetCorpseDelay(3 * 60);
|
||||
me->SetRespawnTime(3 * 60);
|
||||
}
|
||||
|
||||
void FinishFight()
|
||||
@@ -530,8 +536,8 @@ public:
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP|UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetVisible(true);
|
||||
me->setActive(true);
|
||||
@@ -634,27 +640,27 @@ public:
|
||||
summons.DoAction(ACTION_PLAY_EMOTE);
|
||||
break;
|
||||
case EVENT_START_COUNTDOWN_13:
|
||||
{
|
||||
uint8 first = 1;
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
{
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
uint8 first = 1;
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
{
|
||||
Position pos = LightOfDawnPos[first];
|
||||
summon->SetHomePosition(pos);
|
||||
summon->GetMotionMaster()->MovePoint(1, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, false);
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
Position pos = LightOfDawnPos[first];
|
||||
summon->SetHomePosition(pos);
|
||||
summon->GetMotionMaster()->MovePoint(1, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, false);
|
||||
}
|
||||
first = first == 0 ? 1 : 0;
|
||||
}
|
||||
first = first == 0 ? 1 : 0;
|
||||
Position pos = LightOfDawnPos[first];
|
||||
me->SetHomePosition(pos);
|
||||
me->SetWalk(false);
|
||||
me->GetMotionMaster()->MovePoint(1, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, true);
|
||||
me->CastSpell(me, SPELL_THE_MIGHT_OF_MOGRAINE, true);
|
||||
break;
|
||||
}
|
||||
Position pos = LightOfDawnPos[first];
|
||||
me->SetHomePosition(pos);
|
||||
me->SetWalk(false);
|
||||
me->GetMotionMaster()->MovePoint(1, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, true);
|
||||
me->CastSpell(me, SPELL_THE_MIGHT_OF_MOGRAINE, true);
|
||||
break;
|
||||
}
|
||||
case EVENT_START_COUNTDOWN_14:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SummonCreatureGroup(5);
|
||||
return;
|
||||
case EVENT_FINISH_FIGHT_1:
|
||||
@@ -662,45 +668,45 @@ public:
|
||||
battleStarted = ENCOUNTER_STATE_OUTRO;
|
||||
break;
|
||||
case EVENT_FINISH_FIGHT_2:
|
||||
{
|
||||
summons.DespawnEntry(NPC_RAMPAGING_ABOMINATION);
|
||||
summons.DespawnEntry(NPC_ACHERUS_GHOUL);
|
||||
summons.DespawnEntry(NPC_WARRIOR_OF_THE_FROZEN_WASTES);
|
||||
summons.DespawnEntry(NPC_FLESH_BEHEMOTH);
|
||||
summons.DespawnEntry(NPC_DEFENDER_OF_THE_LIGHT);
|
||||
|
||||
if (Creature* orbaz = GetEntryFromSummons(NPC_ORBAZ_BLOODBANE))
|
||||
{
|
||||
orbaz->SetReactState(REACT_PASSIVE);
|
||||
orbaz->AI()->Talk(EMOTE_LIGHT_OF_DAWN04);
|
||||
orbaz->GetMotionMaster()->MovePoint(2, LightOfDawnPos[2], true, true);
|
||||
orbaz->DespawnOrUnsummon(7000);
|
||||
}
|
||||
summons.DespawnEntry(NPC_RAMPAGING_ABOMINATION);
|
||||
summons.DespawnEntry(NPC_ACHERUS_GHOUL);
|
||||
summons.DespawnEntry(NPC_WARRIOR_OF_THE_FROZEN_WASTES);
|
||||
summons.DespawnEntry(NPC_FLESH_BEHEMOTH);
|
||||
summons.DespawnEntry(NPC_DEFENDER_OF_THE_LIGHT);
|
||||
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (Creature* orbaz = GetEntryFromSummons(NPC_ORBAZ_BLOODBANE))
|
||||
{
|
||||
summon->CombatStop(true);
|
||||
summon->DeleteThreatList();
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->GetMotionMaster()->Clear(false);
|
||||
orbaz->SetReactState(REACT_PASSIVE);
|
||||
orbaz->AI()->Talk(EMOTE_LIGHT_OF_DAWN04);
|
||||
orbaz->GetMotionMaster()->MovePoint(2, LightOfDawnPos[2], true, true);
|
||||
orbaz->DespawnOrUnsummon(7000);
|
||||
}
|
||||
me->CombatStop(true);
|
||||
me->DeleteThreatList();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
|
||||
// Position main stars
|
||||
summons.DoAction(ACTION_POSITION_NPCS);
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
summon->CombatStop(true);
|
||||
summon->DeleteThreatList();
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->GetMotionMaster()->Clear(false);
|
||||
}
|
||||
me->CombatStop(true);
|
||||
me->DeleteThreatList();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
|
||||
me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, 2276.66f, -5273.60f, 81.86f, 5.14f, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, 2272.11f, -5279.08f, 82.01f, 5.69f, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, 2285.11f, -5276.73f, 82.08f, 4.23f, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, 2290.06f, -5286.41f, 82.51f, 3.16f, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
break;
|
||||
}
|
||||
// Position main stars
|
||||
summons.DoAction(ACTION_POSITION_NPCS);
|
||||
|
||||
me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, 2276.66f, -5273.60f, 81.86f, 5.14f, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, 2272.11f, -5279.08f, 82.01f, 5.69f, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, 2285.11f, -5276.73f, 82.08f, 4.23f, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, 2290.06f, -5286.41f, 82.51f, 3.16f, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
break;
|
||||
}
|
||||
case EVENT_FINISH_FIGHT_3:
|
||||
if (Creature* koltira = GetEntryFromSummons(NPC_KOLTIRA_DEATHWEAVER))
|
||||
{
|
||||
@@ -927,7 +933,7 @@ public:
|
||||
if (summon->GetEntry() <= NPC_RIMBLAT_EARTHSHATTER && summon->GetEntry() != NPC_HIGHLORD_TIRION_FORDRING)
|
||||
{
|
||||
float o = lk->GetAngle(summon);
|
||||
summon->GetMotionMaster()->MovePoint(3, lk->GetPositionX() + 2.0f*cos(o), lk->GetPositionY() + 2.0f*sin(o), lk->GetPositionZ());
|
||||
summon->GetMotionMaster()->MovePoint(3, lk->GetPositionX() + 2.0f * cos(o), lk->GetPositionY() + 2.0f * sin(o), lk->GetPositionZ());
|
||||
summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
|
||||
}
|
||||
}
|
||||
@@ -1011,7 +1017,7 @@ public:
|
||||
{
|
||||
tirion->CastSpell(tirion, SPELL_TIRION_CHARGE, true);
|
||||
tirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
|
||||
tirion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
tirion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
break;
|
||||
case EVENT_OUTRO_SCENE_44:
|
||||
@@ -1036,7 +1042,7 @@ public:
|
||||
if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING))
|
||||
{
|
||||
float o = me->GetAngle(tirion);
|
||||
tirion->GetMotionMaster()->MovePoint(4, me->GetPositionX() + 2.0f*cos(o), me->GetPositionY() + 2.0f*sin(o), me->GetPositionZ(), false);
|
||||
tirion->GetMotionMaster()->MovePoint(4, me->GetPositionX() + 2.0f * cos(o), me->GetPositionY() + 2.0f * sin(o), me->GetPositionZ(), false);
|
||||
tirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
tirion->setFaction(35);
|
||||
}
|
||||
@@ -1107,17 +1113,17 @@ public:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case EVENT_OUTRO_SCENE_60:
|
||||
{
|
||||
Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (i->GetSource()->IsAlive() && me->IsWithinDistInMap(i->GetSource(), 100))
|
||||
i->GetSource()->CastSpell(i->GetSource(), SPELL_THE_LIGHT_OF_DAWN_Q, false);
|
||||
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (i->GetSource()->IsAlive() && me->IsWithinDistInMap(i->GetSource(), 100))
|
||||
i->GetSource()->CastSpell(i->GetSource(), SPELL_THE_LIGHT_OF_DAWN_Q, false);
|
||||
}
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
break;
|
||||
}
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP|UNIT_NPC_FLAG_QUESTGIVER);
|
||||
break;
|
||||
}
|
||||
case EVENT_OUTRO_SCENE_61:
|
||||
summons.DespawnAll();
|
||||
me->DespawnOrUnsummon(1);
|
||||
@@ -1162,68 +1168,68 @@ public:
|
||||
|
||||
class spell_chapter5_light_of_dawn_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_chapter5_light_of_dawn_aura() : SpellScriptLoader("spell_chapter5_light_of_dawn_aura") { }
|
||||
public:
|
||||
spell_chapter5_light_of_dawn_aura() : SpellScriptLoader("spell_chapter5_light_of_dawn_aura") { }
|
||||
|
||||
class spell_chapter5_light_of_dawn_aura_AuraScript : public AuraScript
|
||||
class spell_chapter5_light_of_dawn_aura_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_chapter5_light_of_dawn_aura_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_chapter5_light_of_dawn_aura_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->Dismount();
|
||||
GetUnitOwner()->SetCanFly(true);
|
||||
GetUnitOwner()->SetDisableGravity(true);
|
||||
GetUnitOwner()->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->SetCanFly(false);
|
||||
GetUnitOwner()->SetDisableGravity(false);
|
||||
GetUnitOwner()->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
GetUnitOwner()->GetMotionMaster()->MoveFall();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_chapter5_light_of_dawn_aura_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_chapter5_light_of_dawn_aura_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_chapter5_light_of_dawn_aura_AuraScript();
|
||||
GetUnitOwner()->Dismount();
|
||||
GetUnitOwner()->SetCanFly(true);
|
||||
GetUnitOwner()->SetDisableGravity(true);
|
||||
GetUnitOwner()->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->SetCanFly(false);
|
||||
GetUnitOwner()->SetDisableGravity(false);
|
||||
GetUnitOwner()->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
GetUnitOwner()->GetMotionMaster()->MoveFall();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_chapter5_light_of_dawn_aura_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_chapter5_light_of_dawn_aura_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_chapter5_light_of_dawn_aura_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_chapter5_rebuke : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_chapter5_rebuke() : SpellScriptLoader("spell_chapter5_rebuke") { }
|
||||
public:
|
||||
spell_chapter5_rebuke() : SpellScriptLoader("spell_chapter5_rebuke") { }
|
||||
|
||||
class spell_chapter5_rebuke_SpellScript : public SpellScript
|
||||
class spell_chapter5_rebuke_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_chapter5_rebuke_SpellScript);
|
||||
|
||||
void HandleLeapBack(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_chapter5_rebuke_SpellScript);
|
||||
|
||||
void HandleLeapBack(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
unitTarget->KnockbackFrom(2282.86f, -5263.45f, 40.0f, 8.0f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectLaunchTarget += SpellEffectFn(spell_chapter5_rebuke_SpellScript::HandleLeapBack, EFFECT_0, SPELL_EFFECT_LEAP_BACK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_chapter5_rebuke_SpellScript();
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
unitTarget->KnockbackFrom(2282.86f, -5263.45f, 40.0f, 8.0f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectLaunchTarget += SpellEffectFn(spell_chapter5_rebuke_SpellScript::HandleLeapBack, EFFECT_0, SPELL_EFFECT_LEAP_BACK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_chapter5_rebuke_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_the_scarlet_enclave_c5()
|
||||
|
||||
@@ -108,7 +108,8 @@ public:
|
||||
break;
|
||||
}
|
||||
++phase;
|
||||
} else FlyBackTimer-=diff;
|
||||
}
|
||||
else FlyBackTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -106,7 +106,9 @@ public:
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
//case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID(); break;
|
||||
case DOOR_HIGH_INQUISITOR_ID: DoorHighInquisitorGUID = go->GetGUID(); break;
|
||||
case DOOR_HIGH_INQUISITOR_ID:
|
||||
DoorHighInquisitorGUID = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,8 +116,12 @@ public:
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_COMMANDER_MOGRAINE: MograineGUID = creature->GetGUID(); break;
|
||||
case NPC_INQUISITOR_WHITEMANE: WhitemaneGUID = creature->GetGUID(); break;
|
||||
case NPC_COMMANDER_MOGRAINE:
|
||||
MograineGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_INQUISITOR_WHITEMANE:
|
||||
WhitemaneGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,20 +129,20 @@ public:
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case TYPE_MOGRAINE_AND_WHITE_EVENT:
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
DoUseDoorOrButton(DoorHighInquisitorGUID);
|
||||
encounter = IN_PROGRESS;
|
||||
}
|
||||
if (data == FAIL)
|
||||
{
|
||||
DoUseDoorOrButton(DoorHighInquisitorGUID);
|
||||
encounter = FAIL;
|
||||
}
|
||||
if (data == SPECIAL)
|
||||
encounter = SPECIAL;
|
||||
break;
|
||||
case TYPE_MOGRAINE_AND_WHITE_EVENT:
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
DoUseDoorOrButton(DoorHighInquisitorGUID);
|
||||
encounter = IN_PROGRESS;
|
||||
}
|
||||
if (data == FAIL)
|
||||
{
|
||||
DoUseDoorOrButton(DoorHighInquisitorGUID);
|
||||
encounter = FAIL;
|
||||
}
|
||||
if (data == SPECIAL)
|
||||
encounter = SPECIAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,9 +150,12 @@ public:
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_MOGRAINE: return MograineGUID;
|
||||
case DATA_WHITEMANE: return WhitemaneGUID;
|
||||
case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID;
|
||||
case DATA_MOGRAINE:
|
||||
return MograineGUID;
|
||||
case DATA_WHITEMANE:
|
||||
return WhitemaneGUID;
|
||||
case DATA_DOOR_WHITEMANE:
|
||||
return DoorHighInquisitorGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -284,57 +293,57 @@ public:
|
||||
|
||||
switch (uiSteps)
|
||||
{
|
||||
case 1:
|
||||
me->GetMotionMaster()->MovePoint(0, 1152.039795f, 1398.405518f, 32.527878f);
|
||||
return 2 * IN_MILLISECONDS;
|
||||
case 2:
|
||||
me->SetSheath(SHEATH_STATE_UNARMED);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
return 2 * IN_MILLISECONDS;
|
||||
case 3:
|
||||
Talk(3);
|
||||
return 10 * IN_MILLISECONDS;
|
||||
case 4:
|
||||
me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1065.130737f, 1399.350586f, 30.763723f, 6.282961f, TEMPSUMMON_TIMED_DESPAWN, 400000)->SetName("Highlord Mograine");
|
||||
me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 200.0f)->setFaction(FACTION_FRIENDLY_TO_ALL);
|
||||
return 30 * IN_MILLISECONDS;
|
||||
case 5:
|
||||
mograine->StopMovingOnCurrentPos();
|
||||
mograine->AI()->Talk(0);
|
||||
mograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
|
||||
return 4 * IN_MILLISECONDS;
|
||||
case 6:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
return 2 * IN_MILLISECONDS;
|
||||
case 7:
|
||||
Talk(4);
|
||||
return 4 * IN_MILLISECONDS;
|
||||
case 8:
|
||||
mograine->AI()->Talk(1);
|
||||
return 11 * IN_MILLISECONDS;
|
||||
case 9:
|
||||
mograine->HandleEmoteCommand(EMOTE_ONESHOT_BATTLE_ROAR);
|
||||
return 4 * IN_MILLISECONDS;
|
||||
case 10:
|
||||
me->SetSheath(SHEATH_STATE_UNARMED);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
Talk(5);
|
||||
return 2 * IN_MILLISECONDS;
|
||||
case 11:
|
||||
mograine->CastSpell(me, SPELL_FORGIVENESS, false);
|
||||
return 1 * IN_MILLISECONDS;
|
||||
case 12:
|
||||
mograine->CastSpell(me, SPELL_COSMETIC_CHAIN, true);
|
||||
return 0.5 * IN_MILLISECONDS;
|
||||
case 13:
|
||||
mograine->AI()->Talk(2);
|
||||
mograine->DespawnOrUnsummon(3 * IN_MILLISECONDS);
|
||||
mograine->Kill(me, me, true);
|
||||
return 0;
|
||||
default:
|
||||
if(mograine)
|
||||
mograine->DespawnOrUnsummon(0);
|
||||
return 0;
|
||||
case 1:
|
||||
me->GetMotionMaster()->MovePoint(0, 1152.039795f, 1398.405518f, 32.527878f);
|
||||
return 2 * IN_MILLISECONDS;
|
||||
case 2:
|
||||
me->SetSheath(SHEATH_STATE_UNARMED);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
return 2 * IN_MILLISECONDS;
|
||||
case 3:
|
||||
Talk(3);
|
||||
return 10 * IN_MILLISECONDS;
|
||||
case 4:
|
||||
me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1065.130737f, 1399.350586f, 30.763723f, 6.282961f, TEMPSUMMON_TIMED_DESPAWN, 400000)->SetName("Highlord Mograine");
|
||||
me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 200.0f)->setFaction(FACTION_FRIENDLY_TO_ALL);
|
||||
return 30 * IN_MILLISECONDS;
|
||||
case 5:
|
||||
mograine->StopMovingOnCurrentPos();
|
||||
mograine->AI()->Talk(0);
|
||||
mograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
|
||||
return 4 * IN_MILLISECONDS;
|
||||
case 6:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
return 2 * IN_MILLISECONDS;
|
||||
case 7:
|
||||
Talk(4);
|
||||
return 4 * IN_MILLISECONDS;
|
||||
case 8:
|
||||
mograine->AI()->Talk(1);
|
||||
return 11 * IN_MILLISECONDS;
|
||||
case 9:
|
||||
mograine->HandleEmoteCommand(EMOTE_ONESHOT_BATTLE_ROAR);
|
||||
return 4 * IN_MILLISECONDS;
|
||||
case 10:
|
||||
me->SetSheath(SHEATH_STATE_UNARMED);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
Talk(5);
|
||||
return 2 * IN_MILLISECONDS;
|
||||
case 11:
|
||||
mograine->CastSpell(me, SPELL_FORGIVENESS, false);
|
||||
return 1 * IN_MILLISECONDS;
|
||||
case 12:
|
||||
mograine->CastSpell(me, SPELL_COSMETIC_CHAIN, true);
|
||||
return 0.5 * IN_MILLISECONDS;
|
||||
case 13:
|
||||
mograine->AI()->Talk(2);
|
||||
mograine->DespawnOrUnsummon(3 * IN_MILLISECONDS);
|
||||
mograine->Kill(me, me, true);
|
||||
return 0;
|
||||
default:
|
||||
if(mograine)
|
||||
mograine->DespawnOrUnsummon(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -659,88 +668,88 @@ public:
|
||||
|
||||
switch (uiAction)
|
||||
{
|
||||
case 1:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "Mograine?", GOSSIP_SENDER_MAIN, 2);
|
||||
SendGossipMenuFor(player, 100101, creature->GetGUID());
|
||||
return true;
|
||||
case 2:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "What do you mean?", GOSSIP_SENDER_MAIN, 3);
|
||||
SendGossipMenuFor(player, 100102, creature->GetGUID());
|
||||
return true;
|
||||
case 3:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "I still do not fully understand.", GOSSIP_SENDER_MAIN, 4);
|
||||
SendGossipMenuFor(player, 100103, creature->GetGUID());
|
||||
return true;
|
||||
case 4:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "Incredible story. So how did he die?", GOSSIP_SENDER_MAIN, 5);
|
||||
SendGossipMenuFor(player, 100104, creature->GetGUID());
|
||||
return true;
|
||||
case 5:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "You mean...", GOSSIP_SENDER_MAIN, 6);
|
||||
SendGossipMenuFor(player, 100105, creature->GetGUID());
|
||||
return true;
|
||||
case 6:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "How do you know all of this?", GOSSIP_SENDER_MAIN, 7);
|
||||
SendGossipMenuFor(player, 100106, creature->GetGUID());
|
||||
return true;
|
||||
case 7:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "A thousand? For one man?", GOSSIP_SENDER_MAIN, 8);
|
||||
SendGossipMenuFor(player, 100107, creature->GetGUID());
|
||||
return true;
|
||||
case 8:
|
||||
creature->HandleEmoteCommand(5);
|
||||
AddGossipItemFor(player, 0, "Yet? Yet what?", GOSSIP_SENDER_MAIN, 9);
|
||||
SendGossipMenuFor(player, 100108, creature->GetGUID());
|
||||
return true;
|
||||
case 9:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "And did he?", GOSSIP_SENDER_MAIN, 10);
|
||||
SendGossipMenuFor(player, 100109, creature->GetGUID());
|
||||
return true;
|
||||
case 10:
|
||||
creature->HandleEmoteCommand(274);
|
||||
AddGossipItemFor(player, 0, "Continue please, Fairbanks.", GOSSIP_SENDER_MAIN, 11);
|
||||
SendGossipMenuFor(player, 100110, creature->GetGUID());
|
||||
return true;
|
||||
case 11:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "You mean...", GOSSIP_SENDER_MAIN, 12);
|
||||
SendGossipMenuFor(player, 100111, creature->GetGUID());
|
||||
return true;
|
||||
case 12:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "You were right, Fairbanks. That is tragic.", GOSSIP_SENDER_MAIN, 13);
|
||||
SendGossipMenuFor(player, 100112, creature->GetGUID());
|
||||
return true;
|
||||
case 13:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "And you did...", GOSSIP_SENDER_MAIN, 14);
|
||||
SendGossipMenuFor(player, 100113, creature->GetGUID());
|
||||
return true;
|
||||
case 14:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "You tell an incredible tale, Fairbanks. What of the blade? Is it beyond redemption?", GOSSIP_SENDER_MAIN, 15);
|
||||
SendGossipMenuFor(player, 100114, creature->GetGUID());
|
||||
return true;
|
||||
case 15:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "But his son is dead.", GOSSIP_SENDER_MAIN, 16);
|
||||
SendGossipMenuFor(player, 100115, creature->GetGUID());
|
||||
return true;
|
||||
case 16:
|
||||
SendGossipMenuFor(player, 100116, creature->GetGUID());
|
||||
// todo: we need to play these 3 emote in sequence, we play only the last one right now.
|
||||
creature->HandleEmoteCommand(274);
|
||||
creature->HandleEmoteCommand(1);
|
||||
creature->HandleEmoteCommand(397);
|
||||
return true;
|
||||
case 1:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "Mograine?", GOSSIP_SENDER_MAIN, 2);
|
||||
SendGossipMenuFor(player, 100101, creature->GetGUID());
|
||||
return true;
|
||||
case 2:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "What do you mean?", GOSSIP_SENDER_MAIN, 3);
|
||||
SendGossipMenuFor(player, 100102, creature->GetGUID());
|
||||
return true;
|
||||
case 3:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "I still do not fully understand.", GOSSIP_SENDER_MAIN, 4);
|
||||
SendGossipMenuFor(player, 100103, creature->GetGUID());
|
||||
return true;
|
||||
case 4:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "Incredible story. So how did he die?", GOSSIP_SENDER_MAIN, 5);
|
||||
SendGossipMenuFor(player, 100104, creature->GetGUID());
|
||||
return true;
|
||||
case 5:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "You mean...", GOSSIP_SENDER_MAIN, 6);
|
||||
SendGossipMenuFor(player, 100105, creature->GetGUID());
|
||||
return true;
|
||||
case 6:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "How do you know all of this?", GOSSIP_SENDER_MAIN, 7);
|
||||
SendGossipMenuFor(player, 100106, creature->GetGUID());
|
||||
return true;
|
||||
case 7:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "A thousand? For one man?", GOSSIP_SENDER_MAIN, 8);
|
||||
SendGossipMenuFor(player, 100107, creature->GetGUID());
|
||||
return true;
|
||||
case 8:
|
||||
creature->HandleEmoteCommand(5);
|
||||
AddGossipItemFor(player, 0, "Yet? Yet what?", GOSSIP_SENDER_MAIN, 9);
|
||||
SendGossipMenuFor(player, 100108, creature->GetGUID());
|
||||
return true;
|
||||
case 9:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "And did he?", GOSSIP_SENDER_MAIN, 10);
|
||||
SendGossipMenuFor(player, 100109, creature->GetGUID());
|
||||
return true;
|
||||
case 10:
|
||||
creature->HandleEmoteCommand(274);
|
||||
AddGossipItemFor(player, 0, "Continue please, Fairbanks.", GOSSIP_SENDER_MAIN, 11);
|
||||
SendGossipMenuFor(player, 100110, creature->GetGUID());
|
||||
return true;
|
||||
case 11:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "You mean...", GOSSIP_SENDER_MAIN, 12);
|
||||
SendGossipMenuFor(player, 100111, creature->GetGUID());
|
||||
return true;
|
||||
case 12:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "You were right, Fairbanks. That is tragic.", GOSSIP_SENDER_MAIN, 13);
|
||||
SendGossipMenuFor(player, 100112, creature->GetGUID());
|
||||
return true;
|
||||
case 13:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "And you did...", GOSSIP_SENDER_MAIN, 14);
|
||||
SendGossipMenuFor(player, 100113, creature->GetGUID());
|
||||
return true;
|
||||
case 14:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "You tell an incredible tale, Fairbanks. What of the blade? Is it beyond redemption?", GOSSIP_SENDER_MAIN, 15);
|
||||
SendGossipMenuFor(player, 100114, creature->GetGUID());
|
||||
return true;
|
||||
case 15:
|
||||
creature->HandleEmoteCommand(1);
|
||||
AddGossipItemFor(player, 0, "But his son is dead.", GOSSIP_SENDER_MAIN, 16);
|
||||
SendGossipMenuFor(player, 100115, creature->GetGUID());
|
||||
return true;
|
||||
case 16:
|
||||
SendGossipMenuFor(player, 100116, creature->GetGUID());
|
||||
// todo: we need to play these 3 emote in sequence, we play only the last one right now.
|
||||
creature->HandleEmoteCommand(274);
|
||||
creature->HandleEmoteCommand(1);
|
||||
creature->HandleEmoteCommand(397);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -44,7 +44,7 @@ enum Misc
|
||||
WEAPON_KIRTONOS_STAFF = 11365,
|
||||
POINT_KIRTONOS_LAND = 13,
|
||||
KIRTONOS_PATH = 105061,
|
||||
|
||||
|
||||
EMOTE_SUMMONED = 0
|
||||
};
|
||||
|
||||
@@ -56,163 +56,164 @@ Position const PosMove[2] =
|
||||
|
||||
class boss_kirtonos_the_herald : public CreatureScript
|
||||
{
|
||||
public: boss_kirtonos_the_herald() : CreatureScript("boss_kirtonos_the_herald") { }
|
||||
public:
|
||||
boss_kirtonos_the_herald() : CreatureScript("boss_kirtonos_the_herald") { }
|
||||
|
||||
struct boss_kirtonos_the_heraldAI : public ScriptedAI
|
||||
struct boss_kirtonos_the_heraldAI : public ScriptedAI
|
||||
{
|
||||
boss_kirtonos_the_heraldAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
boss_kirtonos_the_heraldAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
EventMap events2;
|
||||
InstanceScript* instance;
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 2000);
|
||||
events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 6000);
|
||||
events.ScheduleEvent(EVENT_DOMINATE_MIND, 20000);
|
||||
events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, 5000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
instance->SetData(DATA_KIRTONOS_THE_HERALD, DONE);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
instance->SetData(DATA_KIRTONOS_THE_HERALD, NOT_STARTED);
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/)
|
||||
{
|
||||
events2.Reset();
|
||||
events2.ScheduleEvent(INTRO_1, 500);
|
||||
me->SetDisableGravity(true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
|
||||
Talk(EMOTE_SUMMONED);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == WAYPOINT_MOTION_TYPE && id == POINT_KIRTONOS_LAND)
|
||||
{
|
||||
events2.ScheduleEvent(INTRO_2, 1500);
|
||||
events2.ScheduleEvent(INTRO_3, 2500);
|
||||
events2.ScheduleEvent(INTRO_4, 5500);
|
||||
events2.ScheduleEvent(INTRO_5, 6500);
|
||||
events2.ScheduleEvent(INTRO_6, 11500);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case INTRO_1:
|
||||
me->GetMotionMaster()->MovePath(KIRTONOS_PATH, false);
|
||||
break;
|
||||
case INTRO_2:
|
||||
me->GetMotionMaster()->MovePoint(0, PosMove[0]);
|
||||
break;
|
||||
case INTRO_3:
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
|
||||
gate->SetGoState(GO_STATE_READY);
|
||||
me->SetFacingTo(0.01745329f);
|
||||
break;
|
||||
case INTRO_4:
|
||||
me->SetWalk(true);
|
||||
me->SetDisableGravity(false);
|
||||
me->CastSpell(me, SPELL_KIRTONOS_TRANSFORM, true);
|
||||
me->SetCanFly(false);
|
||||
break;
|
||||
case INTRO_5:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF));
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
break;
|
||||
case INTRO_6:
|
||||
me->GetMotionMaster()->MovePoint(0, PosMove[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SWOOP:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SWOOP, false);
|
||||
events.ScheduleEvent(EVENT_SWOOP, 15000);
|
||||
break;
|
||||
case EVENT_WING_FLAP:
|
||||
me->CastSpell(me, SPELL_WING_FLAP, false);
|
||||
events.ScheduleEvent(EVENT_WING_FLAP, 13000);
|
||||
break;
|
||||
case EVENT_PIERCE_ARMOR:
|
||||
me->CastSpell(me->GetVictim(), SPELL_PIERCE_ARMOR, false);
|
||||
events.ScheduleEvent(EVENT_PIERCE_ARMOR, 12000);
|
||||
break;
|
||||
case EVENT_DISARM:
|
||||
me->CastSpell(me->GetVictim(), SPELL_DISARM, false);
|
||||
events.ScheduleEvent(EVENT_DISARM, 11000);
|
||||
break;
|
||||
case EVENT_SHADOW_BOLT_VOLLEY:
|
||||
me->CastSpell(me, SPELL_SHADOW_BOLT_VOLLEY, false);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 10000);
|
||||
break;
|
||||
case EVENT_CURSE_OF_TONGUES:
|
||||
me->CastSpell(me, SPELL_CURSE_OF_TONGUES, false);
|
||||
events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 20000);
|
||||
break;
|
||||
case EVENT_DOMINATE_MIND:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 20.0f, true))
|
||||
me->CastSpell(target, SPELL_DOMINATE_MIND, false);
|
||||
events.ScheduleEvent(EVENT_DOMINATE_MIND, urand(44000, 48000));
|
||||
break;
|
||||
case EVENT_KIRTONOS_TRANSFORM:
|
||||
if (me->HealthBelowPct(50))
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SWOOP, 4000);
|
||||
events.ScheduleEvent(EVENT_WING_FLAP, 7000);
|
||||
events.ScheduleEvent(EVENT_PIERCE_ARMOR, 11000);
|
||||
events.ScheduleEvent(EVENT_DISARM, 15000);
|
||||
me->RemoveAura(SPELL_KIRTONOS_TRANSFORM);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0));
|
||||
break;
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, 2000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_kirtonos_the_heraldAI>(creature);
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
EventMap events2;
|
||||
InstanceScript* instance;
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 2000);
|
||||
events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 6000);
|
||||
events.ScheduleEvent(EVENT_DOMINATE_MIND, 20000);
|
||||
events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, 5000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
instance->SetData(DATA_KIRTONOS_THE_HERALD, DONE);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
instance->SetData(DATA_KIRTONOS_THE_HERALD, NOT_STARTED);
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/)
|
||||
{
|
||||
events2.Reset();
|
||||
events2.ScheduleEvent(INTRO_1, 500);
|
||||
me->SetDisableGravity(true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
Talk(EMOTE_SUMMONED);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == WAYPOINT_MOTION_TYPE && id == POINT_KIRTONOS_LAND)
|
||||
{
|
||||
events2.ScheduleEvent(INTRO_2, 1500);
|
||||
events2.ScheduleEvent(INTRO_3, 2500);
|
||||
events2.ScheduleEvent(INTRO_4, 5500);
|
||||
events2.ScheduleEvent(INTRO_5, 6500);
|
||||
events2.ScheduleEvent(INTRO_6, 11500);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case INTRO_1:
|
||||
me->GetMotionMaster()->MovePath(KIRTONOS_PATH, false);
|
||||
break;
|
||||
case INTRO_2:
|
||||
me->GetMotionMaster()->MovePoint(0, PosMove[0]);
|
||||
break;
|
||||
case INTRO_3:
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
|
||||
gate->SetGoState(GO_STATE_READY);
|
||||
me->SetFacingTo(0.01745329f);
|
||||
break;
|
||||
case INTRO_4:
|
||||
me->SetWalk(true);
|
||||
me->SetDisableGravity(false);
|
||||
me->CastSpell(me, SPELL_KIRTONOS_TRANSFORM, true);
|
||||
me->SetCanFly(false);
|
||||
break;
|
||||
case INTRO_5:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF));
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
break;
|
||||
case INTRO_6:
|
||||
me->GetMotionMaster()->MovePoint(0, PosMove[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SWOOP:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SWOOP, false);
|
||||
events.ScheduleEvent(EVENT_SWOOP, 15000);
|
||||
break;
|
||||
case EVENT_WING_FLAP:
|
||||
me->CastSpell(me, SPELL_WING_FLAP, false);
|
||||
events.ScheduleEvent(EVENT_WING_FLAP, 13000);
|
||||
break;
|
||||
case EVENT_PIERCE_ARMOR:
|
||||
me->CastSpell(me->GetVictim(), SPELL_PIERCE_ARMOR, false);
|
||||
events.ScheduleEvent(EVENT_PIERCE_ARMOR, 12000);
|
||||
break;
|
||||
case EVENT_DISARM:
|
||||
me->CastSpell(me->GetVictim(), SPELL_DISARM, false);
|
||||
events.ScheduleEvent(EVENT_DISARM, 11000);
|
||||
break;
|
||||
case EVENT_SHADOW_BOLT_VOLLEY:
|
||||
me->CastSpell(me, SPELL_SHADOW_BOLT_VOLLEY, false);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 10000);
|
||||
break;
|
||||
case EVENT_CURSE_OF_TONGUES:
|
||||
me->CastSpell(me, SPELL_CURSE_OF_TONGUES, false);
|
||||
events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 20000);
|
||||
break;
|
||||
case EVENT_DOMINATE_MIND:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 20.0f, true))
|
||||
me->CastSpell(target, SPELL_DOMINATE_MIND, false);
|
||||
events.ScheduleEvent(EVENT_DOMINATE_MIND, urand(44000, 48000));
|
||||
break;
|
||||
case EVENT_KIRTONOS_TRANSFORM:
|
||||
if (me->HealthBelowPct(50))
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SWOOP, 4000);
|
||||
events.ScheduleEvent(EVENT_WING_FLAP, 7000);
|
||||
events.ScheduleEvent(EVENT_PIERCE_ARMOR, 11000);
|
||||
events.ScheduleEvent(EVENT_DISARM, 15000);
|
||||
me->RemoveAura(SPELL_KIRTONOS_TRANSFORM);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0));
|
||||
break;
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, 2000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_kirtonos_the_heraldAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_kirtonos_the_herald()
|
||||
|
||||
@@ -12,245 +12,245 @@
|
||||
|
||||
class instance_scholomance : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_scholomance() : InstanceMapScript("instance_scholomance", 289) { }
|
||||
public:
|
||||
instance_scholomance() : InstanceMapScript("instance_scholomance", 289) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_scholomance_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_scholomance_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_scholomance_InstanceMapScript(Map* map) : InstanceScript(map),
|
||||
GateKirtonosGUID { 0 },
|
||||
GateMiliciaGUID { 0 },
|
||||
GateTheolenGUID { 0 },
|
||||
GatePolkeltGUID { 0 },
|
||||
GateRavenianGUID { 0 },
|
||||
GateBarovGUID { 0 },
|
||||
GateIlluciaGUID { 0 },
|
||||
_kirtonosState { 0 },
|
||||
_miniBosses { 0 },
|
||||
_rasHuman { 0 }
|
||||
{ }
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
return new instance_scholomance_InstanceMapScript(map);
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_GATE_KIRTONOS:
|
||||
GateKirtonosGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_MALICIA:
|
||||
GateMiliciaGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_THEOLEN:
|
||||
GateTheolenGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_POLKELT:
|
||||
GatePolkeltGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_RAVENIAN:
|
||||
GateRavenianGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_BAROV:
|
||||
GateBarovGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_ILLUCIA:
|
||||
GateIlluciaGUID = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
struct instance_scholomance_InstanceMapScript : public InstanceScript
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
instance_scholomance_InstanceMapScript(Map* map) : InstanceScript(map),
|
||||
GateKirtonosGUID { 0 },
|
||||
GateMiliciaGUID { 0 },
|
||||
GateTheolenGUID { 0 },
|
||||
GatePolkeltGUID { 0 },
|
||||
GateRavenianGUID { 0 },
|
||||
GateBarovGUID { 0 },
|
||||
GateIlluciaGUID { 0 },
|
||||
_kirtonosState { 0 },
|
||||
_miniBosses { 0 },
|
||||
_rasHuman { 0 }
|
||||
{ }
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
switch (type)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_GATE_KIRTONOS:
|
||||
GateKirtonosGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_MALICIA:
|
||||
GateMiliciaGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_THEOLEN:
|
||||
GateTheolenGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_POLKELT:
|
||||
GatePolkeltGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_RAVENIAN:
|
||||
GateRavenianGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_BAROV:
|
||||
GateBarovGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_ILLUCIA:
|
||||
GateIlluciaGUID = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
case GO_GATE_KIRTONOS:
|
||||
return GateKirtonosGUID;
|
||||
case GO_GATE_MALICIA:
|
||||
return GateMiliciaGUID;
|
||||
case GO_GATE_THEOLEN:
|
||||
return GateTheolenGUID;
|
||||
case GO_GATE_POLKELT:
|
||||
return GatePolkeltGUID;
|
||||
case GO_GATE_RAVENIAN:
|
||||
return GateRavenianGUID;
|
||||
case GO_GATE_BAROV:
|
||||
return GateBarovGUID;
|
||||
case GO_GATE_ILLUCIA:
|
||||
return GateIlluciaGUID;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GO_GATE_KIRTONOS:
|
||||
return GateKirtonosGUID;
|
||||
case GO_GATE_MALICIA:
|
||||
return GateMiliciaGUID;
|
||||
case GO_GATE_THEOLEN:
|
||||
return GateTheolenGUID;
|
||||
case GO_GATE_POLKELT:
|
||||
return GatePolkeltGUID;
|
||||
case GO_GATE_RAVENIAN:
|
||||
return GateRavenianGUID;
|
||||
case GO_GATE_BAROV:
|
||||
return GateBarovGUID;
|
||||
case GO_GATE_ILLUCIA:
|
||||
return GateIlluciaGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_KIRTONOS_THE_HERALD:
|
||||
_kirtonosState = data;
|
||||
break;
|
||||
case DATA_MINI_BOSSES:
|
||||
++_miniBosses;
|
||||
break;
|
||||
case DATA_RAS_HUMAN:
|
||||
_rasHuman = data;
|
||||
break;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_KIRTONOS_THE_HERALD:
|
||||
_kirtonosState = data;
|
||||
break;
|
||||
case DATA_MINI_BOSSES:
|
||||
++_miniBosses;
|
||||
break;
|
||||
case DATA_RAS_HUMAN:
|
||||
_rasHuman = data;
|
||||
break;
|
||||
}
|
||||
|
||||
SaveToDB();
|
||||
case DATA_KIRTONOS_THE_HERALD:
|
||||
return _kirtonosState;
|
||||
case DATA_MINI_BOSSES:
|
||||
return _miniBosses;
|
||||
case DATA_RAS_HUMAN:
|
||||
return _rasHuman;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S O " << _kirtonosState << ' ' << _miniBosses;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'S' && dataHead2 == 'O')
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_KIRTONOS_THE_HERALD:
|
||||
return _kirtonosState;
|
||||
case DATA_MINI_BOSSES:
|
||||
return _miniBosses;
|
||||
case DATA_RAS_HUMAN:
|
||||
return _rasHuman;
|
||||
}
|
||||
return 0;
|
||||
loadStream >> _kirtonosState;
|
||||
loadStream >> _miniBosses;
|
||||
|
||||
if (_kirtonosState == IN_PROGRESS)
|
||||
_kirtonosState = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S O " << _kirtonosState << ' ' << _miniBosses;
|
||||
return saveStream.str();
|
||||
}
|
||||
protected:
|
||||
uint64 GateKirtonosGUID;
|
||||
uint64 GateMiliciaGUID;
|
||||
uint64 GateTheolenGUID;
|
||||
uint64 GatePolkeltGUID;
|
||||
uint64 GateRavenianGUID;
|
||||
uint64 GateBarovGUID;
|
||||
uint64 GateIlluciaGUID;
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'S' && dataHead2 == 'O')
|
||||
{
|
||||
loadStream >> _kirtonosState;
|
||||
loadStream >> _miniBosses;
|
||||
|
||||
if (_kirtonosState == IN_PROGRESS)
|
||||
_kirtonosState = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64 GateKirtonosGUID;
|
||||
uint64 GateMiliciaGUID;
|
||||
uint64 GateTheolenGUID;
|
||||
uint64 GatePolkeltGUID;
|
||||
uint64 GateRavenianGUID;
|
||||
uint64 GateBarovGUID;
|
||||
uint64 GateIlluciaGUID;
|
||||
|
||||
uint32 _kirtonosState;
|
||||
uint32 _miniBosses;
|
||||
uint32 _rasHuman;
|
||||
};
|
||||
uint32 _kirtonosState;
|
||||
uint32 _miniBosses;
|
||||
uint32 _rasHuman;
|
||||
};
|
||||
};
|
||||
|
||||
class spell_scholomance_fixate : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_scholomance_fixate() : SpellScriptLoader("spell_scholomance_fixate") { }
|
||||
public:
|
||||
spell_scholomance_fixate() : SpellScriptLoader("spell_scholomance_fixate") { }
|
||||
|
||||
class spell_scholomance_fixate_AuraScript : public AuraScript
|
||||
class spell_scholomance_fixate_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_scholomance_fixate_AuraScript);
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_scholomance_fixate_AuraScript);
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntApply(target);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntFadeOut(target);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_scholomance_fixate_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_scholomance_fixate_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_scholomance_fixate_AuraScript();
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntApply(target);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntFadeOut(target);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_scholomance_fixate_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_scholomance_fixate_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_scholomance_fixate_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_kormok_summon_bone_mages : SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_kormok_summon_bone_mages() : SpellScriptLoader("spell_kormok_summon_bone_mages") { }
|
||||
public:
|
||||
spell_kormok_summon_bone_mages() : SpellScriptLoader("spell_kormok_summon_bone_mages") { }
|
||||
|
||||
class spell_kormok_summon_bone_magesSpellScript : public SpellScript
|
||||
class spell_kormok_summon_bone_magesSpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_kormok_summon_bone_magesSpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_kormok_summon_bone_magesSpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_BONE_MAGE_FRONT_LEFT+urand(0, 3), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_kormok_summon_bone_magesSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_kormok_summon_bone_magesSpellScript();
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_BONE_MAGE_FRONT_LEFT + urand(0, 3), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_kormok_summon_bone_magesSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_kormok_summon_bone_magesSpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_kormok_summon_bone_minions : SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_kormok_summon_bone_minions() : SpellScriptLoader("spell_kormok_summon_bone_minions") { }
|
||||
public:
|
||||
spell_kormok_summon_bone_minions() : SpellScriptLoader("spell_kormok_summon_bone_minions") { }
|
||||
|
||||
class spell_kormok_summon_bone_minionsSpellScript : public SpellScript
|
||||
class spell_kormok_summon_bone_minionsSpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_kormok_summon_bone_minionsSpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_kormok_summon_bone_minionsSpellScript);
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
for (uint32 i = 0; i < 4; ++i)
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_BONE_MINION1+i, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_kormok_summon_bone_minionsSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_kormok_summon_bone_minionsSpellScript();
|
||||
for (uint32 i = 0; i < 4; ++i)
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_BONE_MINION1 + i, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_kormok_summon_bone_minionsSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_kormok_summon_bone_minionsSpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum Rooms
|
||||
@@ -266,93 +266,93 @@ enum Rooms
|
||||
|
||||
class spell_scholomance_shadow_portal : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_scholomance_shadow_portal() : SpellScriptLoader("spell_scholomance_shadow_portal") { }
|
||||
public:
|
||||
spell_scholomance_shadow_portal() : SpellScriptLoader("spell_scholomance_shadow_portal") { }
|
||||
|
||||
class spell_scholomance_shadow_portal_SpellScript : public SpellScript
|
||||
class spell_scholomance_shadow_portal_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_scholomance_shadow_portal_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
PrepareSpellScript(spell_scholomance_shadow_portal_SpellScript);
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Creature* caster = GetCaster()->ToCreature();
|
||||
uint8 attempts = 0;
|
||||
uint8 room = urand(ROOM_HALL_OF_SECRETS, ROOM_VAULT_OF_THE_RAVENIAN);
|
||||
uint32 spellId = 0;
|
||||
|
||||
while (attempts < ROOM_MAX)
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Creature* caster = GetCaster()->ToCreature();
|
||||
uint8 attempts = 0;
|
||||
uint8 room = urand(ROOM_HALL_OF_SECRETS, ROOM_VAULT_OF_THE_RAVENIAN);
|
||||
uint32 spellId = 0;
|
||||
|
||||
while (attempts < ROOM_MAX)
|
||||
switch (room)
|
||||
{
|
||||
switch (room)
|
||||
{
|
||||
case ROOM_HALL_OF_SECRETS:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_RAVENIAN)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_HALLOFSECRETS;
|
||||
break;
|
||||
case ROOM_HALL_OF_THE_DAMNED:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_THEOLEN)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_HALLOFTHEDAMNED;
|
||||
break;
|
||||
case ROOM_THE_COVEN:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_MALICIA)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_THECOVEN;
|
||||
break;
|
||||
case ROOM_THE_SHADOW_VAULT:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_ILLUCIA)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_THESHADOWVAULT;
|
||||
break;
|
||||
case ROOM_BAROV_FAMILY_VAULT:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_BAROV)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_BAROVFAMILYVAULT;
|
||||
break;
|
||||
case ROOM_VAULT_OF_THE_RAVENIAN:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_POLKELT)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_VAULTOFTHERAVENIAN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (spellId)
|
||||
{
|
||||
caster->CastSpell(GetHitUnit(), spellId, true);
|
||||
case ROOM_HALL_OF_SECRETS:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_RAVENIAN)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_HALLOFSECRETS;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
room = (room+1)%ROOM_MAX;
|
||||
++attempts;
|
||||
}
|
||||
case ROOM_HALL_OF_THE_DAMNED:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_THEOLEN)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_HALLOFTHEDAMNED;
|
||||
break;
|
||||
case ROOM_THE_COVEN:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_MALICIA)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_THECOVEN;
|
||||
break;
|
||||
case ROOM_THE_SHADOW_VAULT:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_ILLUCIA)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_THESHADOWVAULT;
|
||||
break;
|
||||
case ROOM_BAROV_FAMILY_VAULT:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_BAROV)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_BAROVFAMILYVAULT;
|
||||
break;
|
||||
case ROOM_VAULT_OF_THE_RAVENIAN:
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(GO_GATE_POLKELT)))
|
||||
if (gate->GetGoState() == GO_STATE_ACTIVE)
|
||||
spellId = SPELL_SHADOW_PORTAL_VAULTOFTHERAVENIAN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (spellId)
|
||||
{
|
||||
caster->CastSpell(GetHitUnit(), spellId, true);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
room = (room + 1) % ROOM_MAX;
|
||||
++attempts;
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_scholomance_shadow_portal_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_scholomance_shadow_portal_SpellScript();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_scholomance_shadow_portal_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_scholomance_shadow_portal_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
Position const SummonPos[3*ROOM_MAX] =
|
||||
Position const SummonPos[3 * ROOM_MAX] =
|
||||
{
|
||||
// Hall of Secrects
|
||||
{ 230.80f, 0.138f, 85.23f, 0.0f },
|
||||
@@ -382,131 +382,131 @@ Position const SummonPos[3*ROOM_MAX] =
|
||||
|
||||
class spell_scholomance_shadow_portal_rooms : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_scholomance_shadow_portal_rooms() : SpellScriptLoader("spell_scholomance_shadow_portal_rooms") { }
|
||||
public:
|
||||
spell_scholomance_shadow_portal_rooms() : SpellScriptLoader("spell_scholomance_shadow_portal_rooms") { }
|
||||
|
||||
class spell_scholomance_shadow_portal_rooms_SpellScript : public SpellScript
|
||||
class spell_scholomance_shadow_portal_rooms_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_scholomance_shadow_portal_rooms_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
PrepareSpellScript(spell_scholomance_shadow_portal_rooms_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleSendEvent(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
Creature* caster = GetCaster()->ToCreature();
|
||||
|
||||
uint8 summonPos = 0;
|
||||
uint32 gateId = 0;
|
||||
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
case SPELL_SHADOW_PORTAL_HALLOFSECRETS:
|
||||
summonPos = ROOM_HALL_OF_SECRETS*3;
|
||||
gateId = GO_GATE_POLKELT;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_HALLOFTHEDAMNED:
|
||||
summonPos = ROOM_HALL_OF_THE_DAMNED*3;
|
||||
gateId = GO_GATE_THEOLEN;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_THECOVEN:
|
||||
summonPos = ROOM_THE_COVEN*3;
|
||||
gateId = GO_GATE_MALICIA;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_THESHADOWVAULT:
|
||||
summonPos = ROOM_THE_SHADOW_VAULT*3;
|
||||
gateId = GO_GATE_ILLUCIA;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_BAROVFAMILYVAULT:
|
||||
summonPos = ROOM_BAROV_FAMILY_VAULT*4;
|
||||
gateId = GO_GATE_BAROV;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_VAULTOFTHERAVENIAN:
|
||||
summonPos = ROOM_VAULT_OF_THE_RAVENIAN*3;
|
||||
gateId = GO_GATE_RAVENIAN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gateId && (GetCaster()->GetMap()->GetId() == 289))
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Creature* summon = GetCaster()->SummonCreature(NPC_RISEN_GUARDIAN, SummonPos[summonPos+i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
|
||||
{
|
||||
summon->GetMotionMaster()->MoveRandom(8.0f);
|
||||
summon->AI()->SetData(0, summonPos/3 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(gateId)))
|
||||
{
|
||||
gate->SetGoState(GO_STATE_READY);
|
||||
gate->AI()->SetData(1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_scholomance_shadow_portal_rooms_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_scholomance_shadow_portal_rooms_SpellScript();
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleSendEvent(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
Creature* caster = GetCaster()->ToCreature();
|
||||
|
||||
uint8 summonPos = 0;
|
||||
uint32 gateId = 0;
|
||||
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
case SPELL_SHADOW_PORTAL_HALLOFSECRETS:
|
||||
summonPos = ROOM_HALL_OF_SECRETS * 3;
|
||||
gateId = GO_GATE_POLKELT;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_HALLOFTHEDAMNED:
|
||||
summonPos = ROOM_HALL_OF_THE_DAMNED * 3;
|
||||
gateId = GO_GATE_THEOLEN;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_THECOVEN:
|
||||
summonPos = ROOM_THE_COVEN * 3;
|
||||
gateId = GO_GATE_MALICIA;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_THESHADOWVAULT:
|
||||
summonPos = ROOM_THE_SHADOW_VAULT * 3;
|
||||
gateId = GO_GATE_ILLUCIA;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_BAROVFAMILYVAULT:
|
||||
summonPos = ROOM_BAROV_FAMILY_VAULT * 4;
|
||||
gateId = GO_GATE_BAROV;
|
||||
break;
|
||||
case SPELL_SHADOW_PORTAL_VAULTOFTHERAVENIAN:
|
||||
summonPos = ROOM_VAULT_OF_THE_RAVENIAN * 3;
|
||||
gateId = GO_GATE_RAVENIAN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gateId && (GetCaster()->GetMap()->GetId() == 289))
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Creature* summon = GetCaster()->SummonCreature(NPC_RISEN_GUARDIAN, SummonPos[summonPos + i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
|
||||
{
|
||||
summon->GetMotionMaster()->MoveRandom(8.0f);
|
||||
summon->AI()->SetData(0, summonPos / 3 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, instance->GetData64(gateId)))
|
||||
{
|
||||
gate->SetGoState(GO_STATE_READY);
|
||||
gate->AI()->SetData(1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_scholomance_shadow_portal_rooms_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_scholomance_shadow_portal_rooms_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_scholomance_boon_of_life : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_scholomance_boon_of_life() : SpellScriptLoader("spell_scholomance_boon_of_life") { }
|
||||
public:
|
||||
spell_scholomance_boon_of_life() : SpellScriptLoader("spell_scholomance_boon_of_life") { }
|
||||
|
||||
class spell_scholomance_boon_of_life_AuraScript : public AuraScript
|
||||
class spell_scholomance_boon_of_life_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_scholomance_boon_of_life_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_scholomance_boon_of_life_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
if (Creature* creature = target->ToCreature())
|
||||
{
|
||||
creature->AI()->AttackStart(caster);
|
||||
creature->AddThreat(caster, 10000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
if (Creature* creature = target->ToCreature())
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_CANCEL)
|
||||
{
|
||||
creature->AI()->Talk(TALK_RAS_HUMAN);
|
||||
creature->SetDisplayId(MODEL_RAS_HUMAN);
|
||||
creature->SetHealth(target->GetMaxHealth());
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
instance->SetData(DATA_RAS_HUMAN,1);
|
||||
{
|
||||
creature->AI()->AttackStart(caster);
|
||||
creature->AddThreat(caster, 10000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_scholomance_boon_of_life_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_scholomance_boon_of_life_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_scholomance_boon_of_life_AuraScript();
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (Creature* creature = target->ToCreature())
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_CANCEL)
|
||||
{
|
||||
creature->AI()->Talk(TALK_RAS_HUMAN);
|
||||
creature->SetDisplayId(MODEL_RAS_HUMAN);
|
||||
creature->SetHealth(target->GetMaxHealth());
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
instance->SetData(DATA_RAS_HUMAN, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_scholomance_boon_of_life_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_scholomance_boon_of_life_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_scholomance_boon_of_life_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_scholomance()
|
||||
|
||||
@@ -19,126 +19,126 @@ enum Creatures
|
||||
|
||||
class instance_shadowfang_keep : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_shadowfang_keep() : InstanceMapScript("instance_shadowfang_keep", 33) { }
|
||||
public:
|
||||
instance_shadowfang_keep() : InstanceMapScript("instance_shadowfang_keep", 33) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_shadowfang_keep_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_shadowfang_keep_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_shadowfang_keep_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
return new instance_shadowfang_keep_InstanceMapScript(map);
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
}
|
||||
|
||||
struct instance_shadowfang_keep_InstanceMapScript : public InstanceScript
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
instance_shadowfang_keep_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
memset(&_encounters, 0, sizeof(_encounters));
|
||||
case GO_COURTYARD_DOOR:
|
||||
if (_encounters[TYPE_COURTYARD] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
case GO_SORCERER_DOOR:
|
||||
if (_encounters[TYPE_FENRUS_THE_DEVOURER] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
case GO_ARUGAL_DOOR:
|
||||
if (_encounters[TYPE_WOLF_MASTER_NANDOS] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_COURTYARD:
|
||||
case TYPE_FENRUS_THE_DEVOURER:
|
||||
case TYPE_WOLF_MASTER_NANDOS:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S K " << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'S' && dataHead2 == 'K')
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
case GO_COURTYARD_DOOR:
|
||||
if (_encounters[TYPE_COURTYARD] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
case GO_SORCERER_DOOR:
|
||||
if (_encounters[TYPE_FENRUS_THE_DEVOURER] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
case GO_ARUGAL_DOOR:
|
||||
if (_encounters[TYPE_WOLF_MASTER_NANDOS] == DONE)
|
||||
HandleGameObject(0, true, gameobject);
|
||||
break;
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_COURTYARD:
|
||||
case TYPE_FENRUS_THE_DEVOURER:
|
||||
case TYPE_WOLF_MASTER_NANDOS:
|
||||
_encounters[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S K " << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2];
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'S' && dataHead2 == 'K')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
loadStream >> _encounters[i];
|
||||
if (_encounters[i] == IN_PROGRESS)
|
||||
_encounters[i] = NOT_STARTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
};
|
||||
private:
|
||||
uint32 _encounters[MAX_ENCOUNTERS];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class spell_shadowfang_keep_haunting_spirits : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_shadowfang_keep_haunting_spirits() : SpellScriptLoader("spell_shadowfang_keep_haunting_spirits") { }
|
||||
public:
|
||||
spell_shadowfang_keep_haunting_spirits() : SpellScriptLoader("spell_shadowfang_keep_haunting_spirits") { }
|
||||
|
||||
class spell_shadowfang_keep_haunting_spirits_AuraScript : public AuraScript
|
||||
class spell_shadowfang_keep_haunting_spirits_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_shadowfang_keep_haunting_spirits_AuraScript);
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
PrepareAuraScript(spell_shadowfang_keep_haunting_spirits_AuraScript);
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
isPeriodic = true;
|
||||
amplitude = irand(30*IN_MILLISECONDS, 90*IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* aurEff)
|
||||
{
|
||||
GetTarget()->CastSpell((Unit*)NULL, aurEff->GetAmount(), true);
|
||||
}
|
||||
|
||||
void HandleUpdatePeriodic(AuraEffect* aurEff)
|
||||
{
|
||||
aurEff->CalculatePeriodic(GetCaster());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_shadowfang_keep_haunting_spirits_AuraScript();
|
||||
isPeriodic = true;
|
||||
amplitude = irand(30 * IN_MILLISECONDS, 90 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* aurEff)
|
||||
{
|
||||
GetTarget()->CastSpell((Unit*)NULL, aurEff->GetAmount(), true);
|
||||
}
|
||||
|
||||
void HandleUpdatePeriodic(AuraEffect* aurEff)
|
||||
{
|
||||
aurEff->CalculatePeriodic(GetCaster());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_shadowfang_keep_haunting_spirits_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum ForsakenSpells
|
||||
@@ -149,51 +149,51 @@ enum ForsakenSpells
|
||||
|
||||
class spell_shadowfang_keep_forsaken_skills : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_shadowfang_keep_forsaken_skills() : SpellScriptLoader("spell_shadowfang_keep_forsaken_skills") { }
|
||||
public:
|
||||
spell_shadowfang_keep_forsaken_skills() : SpellScriptLoader("spell_shadowfang_keep_forsaken_skills") { }
|
||||
|
||||
class spell_shadowfang_keep_forsaken_skills_AuraScript : public AuraScript
|
||||
class spell_shadowfang_keep_forsaken_skills_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_shadowfang_keep_forsaken_skills_AuraScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
PrepareAuraScript(spell_shadowfang_keep_forsaken_skills_AuraScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
_forsakenSpell = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
_forsakenSpell = urand(SPELL_FORSAKEN_SKILL_SWORD, SPELL_FORSAKEN_SKILL_SHADOW);
|
||||
if (_forsakenSpell == SPELL_FORSAKEN_SKILL_SHADOW - 1)
|
||||
++_forsakenSpell;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _forsakenSpell, true);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(_forsakenSpell);
|
||||
_forsakenSpell = urand(SPELL_FORSAKEN_SKILL_SWORD, SPELL_FORSAKEN_SKILL_SHADOW);
|
||||
if (_forsakenSpell == SPELL_FORSAKEN_SKILL_SHADOW - 1)
|
||||
++_forsakenSpell;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _forsakenSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_shadowfang_keep_forsaken_skills_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_forsaken_skills_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _forsakenSpell;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_shadowfang_keep_forsaken_skills_AuraScript();
|
||||
_forsakenSpell = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
_forsakenSpell = urand(SPELL_FORSAKEN_SKILL_SWORD, SPELL_FORSAKEN_SKILL_SHADOW);
|
||||
if (_forsakenSpell == SPELL_FORSAKEN_SKILL_SHADOW - 1)
|
||||
++_forsakenSpell;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _forsakenSpell, true);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(_forsakenSpell);
|
||||
_forsakenSpell = urand(SPELL_FORSAKEN_SKILL_SWORD, SPELL_FORSAKEN_SKILL_SHADOW);
|
||||
if (_forsakenSpell == SPELL_FORSAKEN_SKILL_SHADOW - 1)
|
||||
++_forsakenSpell;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _forsakenSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_shadowfang_keep_forsaken_skills_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_forsaken_skills_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _forsakenSpell;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_shadowfang_keep_forsaken_skills_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_shadowfang_keep()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user