Merge branch 'master' into Playerbot
This commit is contained in:
@@ -292,7 +292,7 @@ public:
|
||||
Player const* target = player->GetConnectedPlayer();
|
||||
|
||||
LocaleConstant loc = handler->GetSessionDbcLocale();
|
||||
char const* knownStr = handler->GetAcoreString(LANG_KNOWN);
|
||||
std::string knownStr = handler->GetAcoreString(LANG_KNOWN);
|
||||
|
||||
// Search in CharTitles.dbc
|
||||
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
|
||||
@@ -308,7 +308,7 @@ public:
|
||||
if (!*name)
|
||||
continue;
|
||||
|
||||
char const* activeStr = "";
|
||||
std::string activeStr = "";
|
||||
if (target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index)
|
||||
activeStr = handler->GetAcoreString(LANG_ACTIVE);
|
||||
|
||||
|
||||
@@ -61,28 +61,22 @@ public:
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
|
||||
|
||||
char const* active = handler->GetAcoreString(LANG_ACTIVE);
|
||||
std::string active = handler->GetAcoreString(LANG_ACTIVE);
|
||||
|
||||
for (uint16 eventId : activeEvents)
|
||||
{
|
||||
GameEventData const& eventData = events[eventId];
|
||||
|
||||
if (handler->GetSession())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, eventId, eventId, eventData.description, active);
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, eventId, eventData.description, active);
|
||||
}
|
||||
|
||||
++counter;
|
||||
}
|
||||
|
||||
if (counter == 0)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NOEVENTFOUND);
|
||||
}
|
||||
|
||||
handler->SetSentErrorMessage(true);
|
||||
|
||||
@@ -108,7 +102,7 @@ public:
|
||||
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
|
||||
bool active = activeEvents.find(eventId) != activeEvents.end();
|
||||
char const* activeStr = active ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
std::string activeStr = active ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
|
||||
std::string startTimeStr = Acore::Time::TimeToTimestampStr(Seconds(eventData.start));
|
||||
std::string endTimeStr = Acore::Time::TimeToTimestampStr(Seconds(eventData.end));
|
||||
|
||||
@@ -460,8 +460,8 @@ public:
|
||||
|
||||
wstrToLower(namePart);
|
||||
|
||||
char const* talentStr = handler->GetAcoreString(LANG_TALENT);
|
||||
char const* passiveStr = handler->GetAcoreString(LANG_PASSIVE);
|
||||
std::string talentStr = handler->GetAcoreString(LANG_TALENT);
|
||||
std::string passiveStr = handler->GetAcoreString(LANG_PASSIVE);
|
||||
|
||||
Unit::AuraApplicationMap const& auras = unit->GetAppliedAuras();
|
||||
handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size());
|
||||
|
||||
@@ -308,7 +308,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* active = activeEvents.find(id) != activeEvents.end() ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
std::string active = activeEvents.find(id) != activeEvents.end() ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
|
||||
if (handler->GetSession())
|
||||
{
|
||||
@@ -806,7 +806,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* statusStr = "";
|
||||
std::string statusStr = "";
|
||||
|
||||
if (target)
|
||||
{
|
||||
@@ -862,7 +862,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* statusStr = "";
|
||||
std::string statusStr = "";
|
||||
|
||||
if (target)
|
||||
{
|
||||
@@ -1498,20 +1498,16 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
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) : "";
|
||||
std::string knownStr = target && target->HasTitle(titleInfo) ? handler->GetAcoreString(LANG_KNOWN) : "";
|
||||
std::string activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
|
||||
std::string titleNameStr = Acore::StringFormat(name, targetName);
|
||||
|
||||
// send title in "id (idx:idx) - [namedlink locale]" format
|
||||
if (handler->GetSession())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, titleInfo->ID, titleInfo->bit_index, titleInfo->ID, titleNameStr, localeNames[locale], knownStr, activeStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, titleInfo->ID, titleInfo->bit_index, titleNameStr, localeNames[locale], knownStr, activeStr);
|
||||
}
|
||||
|
||||
++counter;
|
||||
}
|
||||
|
||||
@@ -1992,8 +1992,8 @@ public:
|
||||
uint32 mapId;
|
||||
uint32 areaId;
|
||||
uint32 phase = 0;
|
||||
char const* areaName = nullptr;
|
||||
char const* zoneName = nullptr;
|
||||
std::string areaName = "";
|
||||
std::string zoneName = "";
|
||||
|
||||
// Guild data print variables defined so that they exist, but are not necessarily used
|
||||
uint32 guildId = 0;
|
||||
@@ -2325,19 +2325,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (!zoneName)
|
||||
{
|
||||
if (zoneName.empty())
|
||||
zoneName = handler->GetAcoreString(LANG_UNKNOWN);
|
||||
}
|
||||
|
||||
if (areaName)
|
||||
{
|
||||
if (!areaName.empty())
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAP_WITH_AREA, map->name[locale], zoneName, areaName);
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name[locale], zoneName);
|
||||
}
|
||||
|
||||
// Output XVII. - XVIX. if they are not empty
|
||||
if (!guildName.empty())
|
||||
@@ -3022,18 +3016,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* str = sObjectMgr->GetAcoreString(id, locale ? static_cast<LocaleConstant>(*locale) : DEFAULT_LOCALE);
|
||||
|
||||
if (!strcmp(str, "<error>"))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_NO_ACORE_STRING_FOUND, id);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->SendSysMessage(str);
|
||||
return true;
|
||||
}
|
||||
std::string str = sObjectMgr->GetAcoreString(id, locale ? static_cast<LocaleConstant>(*locale) : DEFAULT_LOCALE);
|
||||
handler->SendSysMessage(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleOpenDoorCommand(ChatHandler* handler, Optional<float> range)
|
||||
|
||||
@@ -217,8 +217,7 @@ public:
|
||||
static bool HandleMmapStatsCommand(ChatHandler* handler)
|
||||
{
|
||||
handler->PSendSysMessage("mmap stats:");
|
||||
//handler->PSendSysMessage(" global mmap pathfinding is {}abled", DisableMgr::IsPathfindingEnabled(mapId) ? "en" : "dis");
|
||||
|
||||
//handler->PSendSysMessage(" global mmap pathfinding is {}abled", sDisableMgr->IsPathfindingEnabled(mapId) ? "en" : "dis");
|
||||
MMAP::MMapMgr* manager = MMAP::MMapFactory::createOrGetMMapMgr();
|
||||
handler->PSendSysMessage(" {} maps loaded with {} tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount());
|
||||
|
||||
|
||||
@@ -1063,9 +1063,9 @@ public:
|
||||
static bool HandleReloadDisablesCommand(ChatHandler* handler)
|
||||
{
|
||||
LOG_INFO("server.loading", "Reloading disables table...");
|
||||
DisableMgr::LoadDisables();
|
||||
sDisableMgr->LoadDisables();
|
||||
LOG_INFO("server.loading", "Checking quest disables...");
|
||||
DisableMgr::CheckQuestDisables();
|
||||
sDisableMgr->CheckQuestDisables();
|
||||
handler->SendGlobalGMSysMessage("DB table `disables` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ void AddSC_wp_commandscript();
|
||||
void AddSC_cache_commandscript();
|
||||
void AddSC_item_commandscript();
|
||||
void AddSC_player_settings_commandscript();
|
||||
void AddSC_worldstate_commandscript();
|
||||
|
||||
// The name of this function should match:
|
||||
// void Add${NameOfDirectory}Scripts()
|
||||
@@ -113,4 +114,5 @@ void AddCommandsScripts()
|
||||
AddSC_cache_commandscript();
|
||||
AddSC_item_commandscript();
|
||||
AddSC_player_settings_commandscript();
|
||||
AddSC_worldstate_commandscript();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
Name: worldstate_commandscript
|
||||
%Complete: 100
|
||||
Comment: All worldstate related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "Chat.h"
|
||||
#include "CommandScript.h"
|
||||
#include "Common.h"
|
||||
#include "WorldState.h"
|
||||
|
||||
using namespace Acore::ChatCommands;
|
||||
|
||||
class worldstate_commandscript : public CommandScript
|
||||
{
|
||||
public:
|
||||
worldstate_commandscript() : CommandScript("worldstate_commandscript") { }
|
||||
|
||||
ChatCommandTable GetCommands() const override
|
||||
{
|
||||
static ChatCommandTable sunsreachCommandTable =
|
||||
{
|
||||
{ "status", HandleSunsReachReclamationStatusCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "phase", HandleSunsReachReclamationPhaseCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "subphase", HandleSunsReachReclamationSubPhaseCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "counter", HandleSunsReachReclamationCounterCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "gate", HandleSunwellGateCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "gatecounter", HandleSunwellGateCounterCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
};
|
||||
|
||||
static ChatCommandTable worldStateCommandTable =
|
||||
{
|
||||
{ "sunsreach", sunsreachCommandTable }
|
||||
};
|
||||
|
||||
static ChatCommandTable commandTable =
|
||||
{
|
||||
{ "worldstate", worldStateCommandTable }
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static bool HandleSunsReachReclamationStatusCommand(ChatHandler* handler )
|
||||
{
|
||||
handler->PSendSysMessage(sWorldState->GetSunsReachPrintout());
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleSunsReachReclamationPhaseCommand(ChatHandler* handler, uint32 phase)
|
||||
{
|
||||
if (phase > SUNS_REACH_PHASE_4_HARBOR)
|
||||
{
|
||||
handler->PSendSysMessage("Invalid phase, see \".worldstate sunsreach phase\" for usage");
|
||||
return false;
|
||||
}
|
||||
sWorldState->HandleSunsReachPhaseTransition(phase);
|
||||
handler->PSendSysMessage(sWorldState->GetSunsReachPrintout());
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleSunsReachReclamationSubPhaseCommand(ChatHandler* handler, uint32 subphase)
|
||||
{
|
||||
if (subphase > SUBPHASE_ALL)
|
||||
{
|
||||
handler->PSendSysMessage("Invalid subphase, see \".worldstate sunsreach subphase\" for usage");
|
||||
return false;
|
||||
}
|
||||
sWorldState->HandleSunsReachSubPhaseTransition(subphase);;
|
||||
handler->PSendSysMessage(sWorldState->GetSunsReachPrintout());
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleSunsReachReclamationCounterCommand(ChatHandler* handler, Optional<uint32> index, Optional<uint32> value)
|
||||
{
|
||||
if (!index || !value || index.value() >= COUNTERS_MAX)
|
||||
{
|
||||
handler->PSendSysMessage("Syntax: .worldstate sunsreach counter <index> <value>.");
|
||||
handler->PSendSysMessage(sWorldState->GetSunsReachPrintout());
|
||||
return true;
|
||||
}
|
||||
sWorldState->SetSunsReachCounter(SunsReachCounters(index.value()), value.value());
|
||||
handler->PSendSysMessage(sWorldState->GetSunsReachPrintout());
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleSunwellGateCommand(ChatHandler* handler, uint32 newGate)
|
||||
{
|
||||
if (newGate > SUNWELL_ARCHONISUS_GATE3_OPEN)
|
||||
{
|
||||
handler->PSendSysMessage("Invalid phase, see \".worldstate sunsreach gate\" for usage");
|
||||
return false;
|
||||
}
|
||||
sWorldState->HandleSunwellGateTransition(newGate);
|
||||
handler->PSendSysMessage(sWorldState->GetSunsReachPrintout());
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleSunwellGateCounterCommand(ChatHandler* handler, Optional<uint32> index, Optional<uint32> value)
|
||||
{
|
||||
if (!index || !value || index.value() >= COUNTERS_MAX_GATES)
|
||||
{
|
||||
handler->PSendSysMessage("Syntax: .worldstate sunsreach gatecounter <index> <value>.");
|
||||
handler->PSendSysMessage(sWorldState->GetSunsReachPrintout());
|
||||
return true;
|
||||
}
|
||||
sWorldState->SetSunwellGateCounter(SunwellGateCounters(index.value()), value.value());
|
||||
handler->PSendSysMessage(sWorldState->GetSunsReachPrintout());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_worldstate_commandscript()
|
||||
{
|
||||
new worldstate_commandscript();
|
||||
}
|
||||
@@ -21,102 +21,120 @@
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_ENERGY = 1,
|
||||
SAY_OVERLOAD = 2,
|
||||
SAY_KILL = 3,
|
||||
EMOTE_DISCHARGE_ENERGY = 4
|
||||
SAY_AGGRO = 0, // Combat start
|
||||
SAY_ENERGY = 1, // Pure energy spawn
|
||||
SAY_OVERLOAD = 2, // Final phase
|
||||
SAY_KILL = 3, // Player kill
|
||||
EMOTE_DISCHARGE_ENERGY = 4, // Energy discharge warning
|
||||
EMOTE_OVERLOAD = 5 // Overload emote
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
// Pure energy spell info
|
||||
SPELL_ENERGY_FEEDBACK_CHANNEL = 44328,
|
||||
SPELL_ENERGY_FEEDBACK = 44335,
|
||||
|
||||
// Vexallus spell info
|
||||
SPELL_CHAIN_LIGHTNING = 44318,
|
||||
SPELL_OVERLOAD = 44352,
|
||||
SPELL_ARCANE_SHOCK = 44319,
|
||||
|
||||
SPELL_SUMMON_PURE_ENERGY_N = 44322,
|
||||
SPELL_SUMMON_PURE_ENERGY_H1 = 46154,
|
||||
SPELL_SUMMON_PURE_ENERGY_H2 = 46159
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
NPC_PURE_ENERGY = 24745
|
||||
SPELL_ENERGY_FEEDBACK_CHANNEL = 44328, // Pure energy channel
|
||||
SPELL_ENERGY_FEEDBACK = 44335, // Pure energy death effect
|
||||
SPELL_CHAIN_LIGHTNING = 44318, // Basic attack
|
||||
SPELL_OVERLOAD = 44352, // Enrage ability
|
||||
SPELL_ARCANE_SHOCK = 44319, // Basic attack
|
||||
SPELL_SUMMON_PURE_ENERGY_N = 44322, // Normal mode summon
|
||||
SPELL_SUMMON_PURE_ENERGY_H1 = 46154, // Heroic mode summon 1
|
||||
SPELL_SUMMON_PURE_ENERGY_H2 = 46159 // Heroic mode summon 2
|
||||
};
|
||||
|
||||
struct boss_vexallus : public BossAI
|
||||
{
|
||||
boss_vexallus(Creature* creature) : BossAI(creature, DATA_VEXALLUS), _energyCooldown(false) { }
|
||||
boss_vexallus(Creature* creature) : BossAI(creature, DATA_VEXALLUS), _energyCooldown(false), _energyCount(0) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
_energyCooldown = false;
|
||||
_energyCount = 0;
|
||||
|
||||
ScheduleHealthCheckEvent({ 85, 70, 55, 40, 25 }, [&]
|
||||
{
|
||||
if (!_energyCooldown)
|
||||
scheduler.Schedule(1s, [this](TaskContext context)
|
||||
{
|
||||
Talk(SAY_ENERGY);
|
||||
Talk(EMOTE_DISCHARGE_ENERGY);
|
||||
|
||||
if (IsHeroic())
|
||||
if (!_energyCooldown)
|
||||
{
|
||||
DoCastSelf(SPELL_SUMMON_PURE_ENERGY_H1);
|
||||
DoCastSelf(SPELL_SUMMON_PURE_ENERGY_H2);
|
||||
Talk(SAY_ENERGY);
|
||||
Talk(EMOTE_DISCHARGE_ENERGY);
|
||||
if (IsHeroic())
|
||||
{
|
||||
DoCastSelf(SPELL_SUMMON_PURE_ENERGY_H1);
|
||||
DoCastSelf(SPELL_SUMMON_PURE_ENERGY_H2);
|
||||
}
|
||||
else
|
||||
DoCastSelf(SPELL_SUMMON_PURE_ENERGY_N);
|
||||
|
||||
_energyCooldown = true;
|
||||
++_energyCount;
|
||||
|
||||
me->m_Events.AddEventAtOffset([&]
|
||||
{
|
||||
_energyCooldown = false;
|
||||
}, 5s);
|
||||
}
|
||||
else
|
||||
DoCastSelf(SPELL_SUMMON_PURE_ENERGY_N);
|
||||
context.Repeat(5s);
|
||||
|
||||
_energyCooldown = true;
|
||||
scheduler.Schedule(5s, [this](TaskContext)
|
||||
{
|
||||
_energyCooldown = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ScheduleHealthCheckEvent(20, [&]
|
||||
{
|
||||
scheduler.CancelAll();
|
||||
DoCastSelf(SPELL_OVERLOAD, true);
|
||||
scheduler.Schedule(1s, [this](TaskContext context)
|
||||
{
|
||||
if (_energyCount == 5 && !_energyCooldown)
|
||||
{
|
||||
scheduler.CancelAll();
|
||||
Talk(SAY_OVERLOAD);
|
||||
Talk(EMOTE_OVERLOAD);
|
||||
DoCastSelf(SPELL_OVERLOAD, true);
|
||||
}
|
||||
else
|
||||
context.Repeat(5s);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
void JustDied(Unit*) override
|
||||
{
|
||||
_JustDied();
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_ENERGY_FEEDBACK);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->IsPlayer())
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
void JustEngagedWith(Unit*) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
ScheduleTimedEvent(8s, [&]
|
||||
ScheduleTimedEvent(5s, [&]
|
||||
{
|
||||
DoCastRandomTarget(SPELL_CHAIN_LIGHTNING);
|
||||
}, 8s, 8s);
|
||||
}, 8s);
|
||||
|
||||
ScheduleTimedEvent(5s, [&]
|
||||
{
|
||||
DoCastRandomTarget(SPELL_ARCANE_SHOCK);
|
||||
}, 8s, 8s);
|
||||
}, 5s);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
{
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f);
|
||||
summon->CastSpell(target, SPELL_ENERGY_FEEDBACK_CHANNEL, false);
|
||||
}
|
||||
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
@@ -130,6 +148,7 @@ struct boss_vexallus : public BossAI
|
||||
|
||||
private:
|
||||
bool _energyCooldown;
|
||||
uint8 _energyCount;
|
||||
};
|
||||
|
||||
void AddSC_boss_vexallus()
|
||||
|
||||
@@ -96,14 +96,6 @@ public:
|
||||
if (GameObject* gobj = GetGameObject(DATA_ICEBARRIER))
|
||||
gobj->SendUpdateToPlayer(player);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
if (creature->GetSpawnId() > 0 || !creature->GetOwnerGUID().IsPlayer())
|
||||
creature->CastSpell(creature, SPELL_SUNWELL_RADIANCE, true);
|
||||
|
||||
InstanceScript::OnCreatureCreate(creature);
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -106,11 +106,6 @@ enum GameObjectIds
|
||||
GO_ORB_OF_THE_BLUE_DRAGONFLIGHT4 = 188116
|
||||
};
|
||||
|
||||
enum SpellIds
|
||||
{
|
||||
SPELL_SUNWELL_RADIANCE = 45769,
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetSunwellPlateauAI(T* obj)
|
||||
{
|
||||
|
||||
@@ -115,11 +115,13 @@ public:
|
||||
|
||||
for (uint8 i = 0; i < RAND_VENDOR; ++i)
|
||||
RandVendor[i] = NOT_STARTED;
|
||||
|
||||
StorePersistentData(DATA_TIMED_RUN, 0);
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* /*player*/) override
|
||||
{
|
||||
if (!scheduler.IsGroupScheduled(GROUP_TIMED_RUN))
|
||||
if (!scheduler.IsGroupScheduled(GROUP_TIMED_RUN) && GetPersistentData(DATA_TIMED_RUN))
|
||||
DoAction(ACTION_START_TIMED_RUN);
|
||||
}
|
||||
|
||||
@@ -293,53 +295,36 @@ public:
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
switch (type)
|
||||
if (state == DONE)
|
||||
{
|
||||
case DATA_NALORAKK:
|
||||
if (state == DONE)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_NALORAKK:
|
||||
if (uint32 timer = GetPersistentData(DATA_TIMED_RUN))
|
||||
{
|
||||
StorePersistentData(DATA_TIMED_RUN, timer += 15);
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer);
|
||||
}
|
||||
SummonHostage(0);
|
||||
}
|
||||
break;
|
||||
case DATA_AKILZON:
|
||||
if (state == DONE)
|
||||
{
|
||||
SummonHostage(type);
|
||||
break;
|
||||
case DATA_AKILZON:
|
||||
if (uint32 timer = GetPersistentData(DATA_TIMED_RUN))
|
||||
{
|
||||
StorePersistentData(DATA_TIMED_RUN, timer += 10);
|
||||
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer);
|
||||
}
|
||||
SummonHostage(1);
|
||||
}
|
||||
break;
|
||||
case DATA_JANALAI:
|
||||
if (state == DONE)
|
||||
SummonHostage(2);
|
||||
break;
|
||||
case DATA_HALAZZI:
|
||||
if (state == DONE)
|
||||
SummonHostage(3);
|
||||
break;
|
||||
case DATA_HEXLORD:
|
||||
if (state == IN_PROGRESS)
|
||||
HandleGameObject(ObjectGuid::Empty, false, GetGameObject(DATA_HEXLORD_GATE));
|
||||
else if (state == NOT_STARTED)
|
||||
CheckInstanceStatus();
|
||||
else if (state == DONE)
|
||||
{
|
||||
SummonHostage(type);
|
||||
break;
|
||||
case DATA_JANALAI:
|
||||
case DATA_HALAZZI:
|
||||
SummonHostage(type);
|
||||
break;
|
||||
case DATA_HEXLORD:
|
||||
if (GameObject* zuljinGate = GetGameObject(DATA_ZULJIN_GATE))
|
||||
zuljinGate->RemoveGameObjectFlag(GO_FLAG_LOCKED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (state == DONE)
|
||||
{
|
||||
if (GetPersistentData(DATA_TIMED_RUN) && AllBossesDone({ DATA_NALORAKK, DATA_AKILZON, DATA_JANALAI, DATA_HALAZZI }))
|
||||
{
|
||||
StorePersistentData(DATA_TIMED_RUN, 0);
|
||||
@@ -348,6 +333,16 @@ public:
|
||||
|
||||
CheckInstanceStatus();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (type == DATA_HEXLORD)
|
||||
{
|
||||
if (state == IN_PROGRESS)
|
||||
HandleGameObject(ObjectGuid::Empty, false, GetGameObject(DATA_HEXLORD_GATE));
|
||||
else if (state == NOT_STARTED)
|
||||
CheckInstanceStatus();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
if (creature->IsSummon() && _bossWave != TO_BE_DECIDED)
|
||||
{
|
||||
if (_currentWave == 0)
|
||||
creature->SetDisableReputationGain(true);
|
||||
creature->SetReputationRewardDisabled(true);
|
||||
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, ++trash); // Update the instance wave count on new trash spawn
|
||||
_encounterNPCs.insert(creature->GetGUID()); // Used for despawning on wipe
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
bool lock;
|
||||
bool lock, inCenter;
|
||||
float x, y, z;
|
||||
int32 releaseLockTimer;
|
||||
|
||||
@@ -134,6 +134,7 @@ public:
|
||||
me->CastSpell(me, SPELL_EVOCATION, true);
|
||||
events.Reset();
|
||||
lock = false;
|
||||
inCenter = false;
|
||||
x = 0.0f;
|
||||
y = 0.0f;
|
||||
z = 0.0f;
|
||||
@@ -222,9 +223,14 @@ public:
|
||||
{
|
||||
pInstance->SetData(DATA_UROM, DONE);
|
||||
}
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->NearTeleportTo(x, y, z, 0.0f);
|
||||
|
||||
// Body teleportation required only when boss is flying in the center
|
||||
if (inCenter)
|
||||
{
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->NearTeleportTo(x, y, z, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
@@ -281,6 +287,7 @@ public:
|
||||
me->SetCanFly(true);
|
||||
me->SetDisableGravity(true);
|
||||
me->NearTeleportTo(1103.69f, 1048.76f, 512.279f, 1.16f);
|
||||
inCenter = true;
|
||||
|
||||
Talk(SAY_ARCANE_EXPLOSION);
|
||||
Talk(EMOTE_ARCANE_EXPLOSION);
|
||||
@@ -356,6 +363,7 @@ public:
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
inCenter = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -365,6 +373,7 @@ public:
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
inCenter = false;
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "CreatureScript.h"
|
||||
#include "WorldState.h"
|
||||
|
||||
class npc_suns_reach_reclamation : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_suns_reach_reclamation() : CreatureScript("npc_suns_reach_reclamation") { }
|
||||
|
||||
bool OnQuestReward(Player* /*player*/, Creature* /*creature*/, const Quest* quest, uint32 /*slot*/) override
|
||||
{
|
||||
sWorldState->AddSunsReachProgress(quest->GetQuestId());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class npc_sunwell_gate : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_sunwell_gate() : CreatureScript("npc_sunwell_gate") { }
|
||||
|
||||
bool OnQuestReward(Player* /*player*/, Creature* /*creature*/, const Quest* quest, uint32 /*slot*/) override
|
||||
{
|
||||
sWorldState->AddSunwellGateProgress(quest->GetQuestId());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_suns_reach_reclamation()
|
||||
{
|
||||
new npc_suns_reach_reclamation();
|
||||
new npc_sunwell_gate();
|
||||
}
|
||||
@@ -33,6 +33,7 @@ void AddSC_player_scripts();
|
||||
void AddSC_npc_stave_of_ancients();
|
||||
void AddSC_server_mail();
|
||||
void AddSC_transport_zeppelins();
|
||||
void AddSC_suns_reach_reclamation();
|
||||
|
||||
// The name of this function should match:
|
||||
// void Add${NameOfDirectory}Scripts()
|
||||
@@ -55,4 +56,5 @@ void AddWorldScripts()
|
||||
AddSC_npc_stave_of_ancients();
|
||||
AddSC_server_mail();
|
||||
AddSC_transport_zeppelins();
|
||||
AddSC_suns_reach_reclamation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user