Exiles reach horde
This commit is contained in:
@@ -3304,22 +3304,16 @@ void ScriptMgr::OnQuestAbandon(Player* player, const Quest* quest)
|
||||
|
||||
void WowCommunity::PhaseShift(Player* player, std::vector<uint32> phaseIDs, bool add)
|
||||
{
|
||||
for (uint32 phaseID : phaseIDs)
|
||||
{
|
||||
if (add)
|
||||
{
|
||||
if (!player->GetPhaseShift().HasPhase(phaseID))
|
||||
PhasingHandler::AddPhase(player, phaseID, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player->GetPhaseShift().HasPhase(phaseID))
|
||||
PhasingHandler::RemovePhase(player, phaseID, true);
|
||||
}
|
||||
}
|
||||
// Exile's Reach calls this every second. A false condition used to RemovePhase,
|
||||
// which stripped phases the world database had already applied and hid the quest
|
||||
// givers for the rest of the island. Only additions run here. A caller that must
|
||||
// drop a phase uses PhasingHandler::RemovePhase itself.
|
||||
if (!player || !add)
|
||||
return;
|
||||
|
||||
PhasingHandler::SendToPlayer(player);
|
||||
player->UpdateObjectVisibility(true);
|
||||
for (uint32 phaseID : phaseIDs)
|
||||
if (!player->GetPhaseShift().HasPhase(phaseID))
|
||||
PhasingHandler::AddPhase(player, phaseID, true);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerWorldObjectUpdate(Player* player, uint32 diff)
|
||||
|
||||
@@ -29,21 +29,69 @@ class exiles_reach_north_sea_playerscript : public PlayerScript
|
||||
public:
|
||||
exiles_reach_north_sea_playerscript() : PlayerScript("exiles_reach_north_sea_playerscript") {}
|
||||
|
||||
void GiveExileShipIntroQuest(Player* player)
|
||||
{
|
||||
uint32 const questId = player->IsInHorde() ? QUEST_H_WARMING_UP : QUEST_WARMING_UP;
|
||||
if (player->GetQuestStatus(questId) != QUEST_STATUS_NONE)
|
||||
return;
|
||||
|
||||
uint32 const laterQuests[] =
|
||||
{
|
||||
player->IsInHorde() ? QUEST_H_STAND_YOUR_GROUND : QUEST_STAND_YOUR_GROUND,
|
||||
player->IsInHorde() ? QUEST_H_BRACE_FOR_IMPACT : QUEST_BRACE_FOR_IMPACT,
|
||||
player->IsInHorde() ? QUEST_H_MURLOC_MANIA : QUEST_MURLOC_MANIA,
|
||||
player->IsInHorde() ? QUEST_H_AN_END_TO_BEGINNINGS : QUEST_AN_END_TO_BEGINNINGS,
|
||||
};
|
||||
|
||||
for (uint32 laterQuestId : laterQuests)
|
||||
if (player->GetQuestStatus(laterQuestId) != QUEST_STATUS_NONE)
|
||||
return;
|
||||
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
|
||||
if (!quest || !player->CanTakeQuest(quest, false) || !player->CanAddQuest(quest, false))
|
||||
return;
|
||||
|
||||
player->AddQuestAndCheckCompletion(quest, nullptr);
|
||||
}
|
||||
|
||||
void CheckExilesReachPhaseShift(Player* player)
|
||||
{
|
||||
// A new character has no quest yet. Hand out Warming Up before the phase
|
||||
// update so the ship quest giver and the combat dummy stay visible.
|
||||
GiveExileShipIntroQuest(player);
|
||||
|
||||
if (player->GetMapId() == MAP_EXILES_REACH)
|
||||
{
|
||||
switch (player->GetAreaId())
|
||||
{
|
||||
case AREA_NORTH_SEA_H:
|
||||
{
|
||||
WowCommunity::PhaseShift(player, { PHASE_GENERAL_SHIP, PHASE_HORDE_SHIP_15514 }, player->GetQuestStatus(QUEST_H_BRACE_FOR_IMPACT) || player->GetQuestStatus(QUEST_H_STAND_YOUR_GROUND));
|
||||
// The general ship phase has to stay on. Gating it on Brace for Impact
|
||||
// or Stand Your Ground hides Thrall / Breka from a character who has
|
||||
// not taken a quest yet.
|
||||
WowCommunity::PhaseShift(player, { PHASE_GENERAL_SHIP }, true);
|
||||
if (player->IsInHorde())
|
||||
{
|
||||
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_SHIP_COLE, PHASE_ALLIANCE_SHIP_GARRICK_1, PHASE_ALLIANCE_SHIP_CREW_OUTSIDE }, true);
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHIP_THROG }, !QuestAccepted(player, QUEST_H_STAND_YOUR_GROUND));
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHIP_15287, PHASE_HORDE_SHIP_15516 }, player->GetQuestStatus(QUEST_H_BRACE_FOR_IMPACT));
|
||||
// PhaseShift no longer removes phases. Drop the Alliance ship
|
||||
// phases here so a Horde character does not keep Jaina's crew.
|
||||
uint32 const allianceShipPhases[] =
|
||||
{
|
||||
PHASE_ALLIANCE_SHIP_COLE,
|
||||
PHASE_ALLIANCE_SHIP_GARRICK_1,
|
||||
PHASE_ALLIANCE_SHIP_CREW_OUTSIDE,
|
||||
PHASE_ALLIANCE_SHIP_13619,
|
||||
PHASE_ALLIANCE_SHIP_14350,
|
||||
PHASE_ALLIANCE_SHIP_GARRICK_2,
|
||||
PHASE_ALLIANCE_SHIP_CREW_INSIDE,
|
||||
};
|
||||
|
||||
for (uint32 phaseId : allianceShipPhases)
|
||||
if (player->GetPhaseShift().HasPhase(phaseId))
|
||||
PhasingHandler::RemovePhase(player, phaseId, true);
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHIP_15514 }, !QuestRewarded(player, QUEST_H_WARMING_UP));
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHIP_THROG }, !QuestAccepted(player, QUEST_H_STAND_YOUR_GROUND) && !QuestCompleted(player, QUEST_H_BRACE_FOR_IMPACT));
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHIP_15287 }, QuestRewarded(player, QUEST_H_WARMING_UP) && !QuestCompleted(player, QUEST_H_BRACE_FOR_IMPACT));
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHIP_15516 }, QuestAcceptedOrCompleted(player, QUEST_H_BRACE_FOR_IMPACT));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user