Restore Exile's Reach stage phasing and the ship-to-citadel quest events.
Stage phases turn off again when that quest step is over, without dropping the general ship phase. Warming Up is no longer granted automatically. The training dummy, spar, crash movie, beach scene, campfire, vendor sale, citadel entrance, and citadel escort path follow the quest scripts instead of a forced complete.
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WaypointDefines.h"
|
||||
#include "ZoneScript.h"
|
||||
|
||||
enum ExileReachHelpers
|
||||
@@ -144,6 +145,9 @@ enum ExileReachHelpers
|
||||
SCENE_FLY_TO_STORMWIND = 2499,
|
||||
SCENE_FLY_TO_ORGRIMMAR = 2498,
|
||||
|
||||
MOVIE_ALLIANCE_SHIP_CRASH = 895,
|
||||
MOVIE_HORDE_SHIP_CRASH = 931,
|
||||
|
||||
ITEM_RAW_MEAT = 174072,
|
||||
ITEM_COOKED_MEAT = 174074,
|
||||
ITEM_WARD_STONE_1 = 168599,
|
||||
@@ -1025,8 +1029,21 @@ public:
|
||||
|
||||
bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override
|
||||
{
|
||||
// _creature->GetMotionMaster()->MoveSmoothPath(_pointId, _pathPoints, _pathSize, _walk, _fly);
|
||||
if (!_creature || !_creature->IsInWorld() || !_pathPoints || !_pathSize)
|
||||
return true;
|
||||
|
||||
std::vector<WaypointNode> nodes;
|
||||
nodes.reserve(_pathSize);
|
||||
for (size_t i = 0; i < _pathSize; ++i)
|
||||
{
|
||||
Position const& pos = _pathPoints[i];
|
||||
nodes.emplace_back(uint32(i), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation());
|
||||
}
|
||||
|
||||
WaypointPath path(_pointId ? _pointId : 1, std::move(nodes), _walk ? WaypointMoveType::Walk : WaypointMoveType::Run,
|
||||
_fly ? WaypointPathFlags::FlyingPath : WaypointPathFlags::None);
|
||||
_creature->SetWalk(_walk);
|
||||
_creature->GetMotionMaster()->MovePath(path, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1067,6 +1084,32 @@ static void StartPrivateConversation(Player* player, uint32 conversationId, std:
|
||||
conversation->Start();
|
||||
}
|
||||
|
||||
void ArriveExileBeach(Player* player);
|
||||
|
||||
// The sell-to-vendor step is a criteria objective. Credit that tree when the
|
||||
// sell criteria fires. Item and kill objectives stay untouched.
|
||||
static void CreditCriteriaTreeObjectives(Player* player, uint32 questId)
|
||||
{
|
||||
if (!player || player->GetQuestStatus(questId) != QUEST_STATUS_INCOMPLETE)
|
||||
return;
|
||||
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
|
||||
if (!quest)
|
||||
return;
|
||||
|
||||
uint16 const slot = player->FindQuestSlot(questId);
|
||||
for (QuestObjective const& obj : quest->GetObjectives())
|
||||
{
|
||||
if (obj.Type != QUEST_OBJECTIVE_CRITERIA_TREE)
|
||||
continue;
|
||||
|
||||
if (slot < MAX_QUEST_LOG_SIZE && player->IsQuestObjectiveComplete(slot, quest, obj))
|
||||
continue;
|
||||
|
||||
player->KillCreditCriteriaTreeObjective(obj);
|
||||
}
|
||||
}
|
||||
|
||||
static void AddCreditForQuestObjective(Player* player, uint32 questId, int32 objectiveId)
|
||||
{
|
||||
if (player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
|
||||
|
||||
@@ -131,7 +131,8 @@ struct npc_exiles_reach_abandoned_camp_166854_156607 : public ScriptedAI
|
||||
|
||||
if (player->IsInDist(me, 10.0f))
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_FINDING_THE_LOST_EXPEDITION) || player->GetQuestStatus(QUEST_H_FINDING_THE_LOST_EXPEDITION))
|
||||
if (player->GetQuestStatus(QUEST_FINDING_THE_LOST_EXPEDITION) == QUEST_STATUS_INCOMPLETE
|
||||
|| player->GetQuestStatus(QUEST_H_FINDING_THE_LOST_EXPEDITION) == QUEST_STATUS_INCOMPLETE)
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
|
||||
if (player->HasItemCount(ITEM_COOKED_MEAT, 2, false))
|
||||
@@ -576,13 +577,32 @@ struct go_campfire_339769 : public GameObjectAI
|
||||
|
||||
bool OnGossipHello(Player* player) override
|
||||
{
|
||||
uint32 const questId = player->IsInHorde() ? QUEST_H_COOKING_MEAT : QUEST_COOKING_MEAT;
|
||||
if (player->GetQuestStatus(questId) != QUEST_STATUS_INCOMPLETE)
|
||||
return true;
|
||||
|
||||
if (player->hasQuest(QUEST_COOKING_MEAT) || player->hasQuest(QUEST_H_COOKING_MEAT))
|
||||
player->ForceCompleteQuest(QUEST_COOKING_MEAT);
|
||||
uint32 needRaw = 5;
|
||||
bool cookIsCriteria = false;
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
|
||||
{
|
||||
for (QuestObjective const& obj : quest->GetObjectives())
|
||||
{
|
||||
if (obj.Type == QUEST_OBJECTIVE_ITEM && obj.ObjectID == ITEM_RAW_MEAT && obj.Amount > 0)
|
||||
needRaw = uint32(obj.Amount);
|
||||
if (obj.Type == QUEST_OBJECTIVE_CRITERIA_TREE || obj.Type == QUEST_OBJECTIVE_GAMEOBJECT)
|
||||
cookIsCriteria = true;
|
||||
}
|
||||
}
|
||||
|
||||
player->AddItem(174074, 1);
|
||||
if (player->GetItemCount(ITEM_RAW_MEAT) < needRaw)
|
||||
return true;
|
||||
|
||||
me->DespawnOrUnsummon(0s);
|
||||
player->KillCreditGO(me->GetEntry(), me->GetGUID());
|
||||
if (cookIsCriteria)
|
||||
CreditCriteriaTreeObjectives(player, questId);
|
||||
|
||||
if (!player->HasItemCount(ITEM_COOKED_MEAT))
|
||||
player->AddItem(ITEM_COOKED_MEAT, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -457,14 +457,14 @@ struct npc_exiles_reach_darkmaul_citadel_156954_167646 : public ScriptedAI
|
||||
{
|
||||
if (QuestAccepted(player, QUEST_RIGHT_BENEATH_THEIR_EYES))
|
||||
{
|
||||
//AddCreditForQuestObjective(player, QUEST_RIGHT_BENEATH_THEIR_EYES, QUEST_OBJECTIVE_RIGHT_BENEATH_THEIR_EYES_REACH_CITADEL);
|
||||
player->ForceCompleteQuest(QUEST_RIGHT_BENEATH_THEIR_EYES);
|
||||
AddCreditForQuestObjective(player, QUEST_RIGHT_BENEATH_THEIR_EYES, QUEST_OBJECTIVE_RIGHT_BENEATH_THEIR_EYES_REACH_CITADEL);
|
||||
AddCreditForQuestObjective(player, QUEST_RIGHT_BENEATH_THEIR_EYES, QUEST_OBJECTIVE_RIGHT_BENEATH_THEIR_EYES_REACHED_DARKMAUL_CITADEL_ENTRANCE);
|
||||
}
|
||||
|
||||
if (QuestAccepted(player, QUEST_H_RIGHT_BENEATH_THEIR_EYES))
|
||||
{
|
||||
//AddCreditForQuestObjective(player, QUEST_H_RIGHT_BENEATH_THEIR_EYES, QUEST_OBJECTIVE_RIGHT_BENEATH_THEIR_EYES_REACH_CITADEL);
|
||||
player->ForceCompleteQuest(QUEST_H_RIGHT_BENEATH_THEIR_EYES);
|
||||
AddCreditForQuestObjective(player, QUEST_H_RIGHT_BENEATH_THEIR_EYES, QUEST_OBJECTIVE_RIGHT_BENEATH_THEIR_EYES_REACH_CITADEL);
|
||||
AddCreditForQuestObjective(player, QUEST_H_RIGHT_BENEATH_THEIR_EYES, QUEST_OBJECTIVE_RIGHT_BENEATH_THEIR_EYES_REACHED_DARKMAUL_CITADEL_ENTRANCE);
|
||||
}
|
||||
|
||||
player->m_Events.AddEventAtOffset(new ReachCitadelEntranceEvent(player), 2s);
|
||||
@@ -537,16 +537,14 @@ struct go_exiles_reach_ogre_runestone_351476_339865 : public GameObjectAI
|
||||
player->KillCreditGO(me->GetEntry());
|
||||
invisibleStalker->DespawnOrUnsummon(200ms, 60s);
|
||||
|
||||
if (player->GetQuestObjectiveProgress(QUEST_CONTROLLING_THEIR_STONES, 4) == 3)
|
||||
if (QuestCompleted(player, QUEST_CONTROLLING_THEIR_STONES) || player->GetQuestObjectiveProgress(QUEST_CONTROLLING_THEIR_STONES, 4) >= 3)
|
||||
{
|
||||
player->ForceCompleteQuest(QUEST_CONTROLLING_THEIR_STONES);
|
||||
player->RemoveAura(SPELL_RITUAL_SCENE_OGRE_CITADEL);
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_DARKMAUL_CITADEL_MULGRIN_RITUAL }, false);
|
||||
}
|
||||
|
||||
if (player->GetQuestObjectiveProgress(QUEST_H_CONTROLLING_THEIR_STONES, 4) == 3)
|
||||
if (QuestCompleted(player, QUEST_H_CONTROLLING_THEIR_STONES) || player->GetQuestObjectiveProgress(QUEST_H_CONTROLLING_THEIR_STONES, 4) >= 3)
|
||||
{
|
||||
player->ForceCompleteQuest(QUEST_H_CONTROLLING_THEIR_STONES);
|
||||
player->RemoveAura(SPELL_RITUAL_SCENE_OGRE_CITADEL);
|
||||
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_DARKMAUL_CITADEL_KEIRA_RITUAL }, false);
|
||||
}
|
||||
|
||||
@@ -623,7 +623,8 @@ struct go_exiles_reach_harpy_roost_350803_327146 : public GameObjectAI
|
||||
|
||||
bool OnGossipHello(Player* player) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_H_PURGE_THE_TOTEMS) || player->GetQuestStatus(QUEST_PURGE_THE_TOTEMS))
|
||||
if (player->GetQuestStatus(QUEST_H_PURGE_THE_TOTEMS) == QUEST_STATUS_INCOMPLETE
|
||||
|| player->GetQuestStatus(QUEST_PURGE_THE_TOTEMS) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (Creature* burningTotem = player->SummonCreature(NPC_HARPY_ROOST_BURNING_TOTEM, me->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0U, 0U, player->GetGUID()))
|
||||
{
|
||||
|
||||
@@ -163,10 +163,10 @@ public:
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
if (player->GetQuestStatus(QUEST_WHO_LURKS_IN_THE_PIT))
|
||||
if (player->GetQuestStatus(QUEST_WHO_LURKS_IN_THE_PIT) == QUEST_STATUS_INCOMPLETE)
|
||||
player->SummonCreature(NPC_HRUNS_BARROW_RALIA_TRAVEL_FORM, RescuedFromHrun, TEMPSUMMON_MANUAL_DESPAWN, 0s, 0U, 0U, player->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(QUEST_H_WHO_LURKS_IN_THE_PIT))
|
||||
if (player->GetQuestStatus(QUEST_H_WHO_LURKS_IN_THE_PIT) == QUEST_STATUS_INCOMPLETE)
|
||||
player->SummonCreature(NPC_HRUNS_BARROW_CRENNA_TRAVEL_FORM, RescuedFromHrun, TEMPSUMMON_MANUAL_DESPAWN, 0s, 0U, 0U, player->GetGUID());
|
||||
|
||||
if (player->HasAura(SPELL_RITUAL_SCENE_HRUN_BEAM))
|
||||
@@ -350,7 +350,7 @@ struct go_exiles_reach_hruns_barrow_339568_350796 : public GameObjectAI
|
||||
bool OnGossipHello(Player* player) override
|
||||
{
|
||||
// horde
|
||||
if (player->GetQuestStatus(QUEST_H_WHO_LURKS_IN_THE_PIT))
|
||||
if (player->GetQuestStatus(QUEST_H_WHO_LURKS_IN_THE_PIT) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
player->KillCreditGO(GAMEOBJECT_THICK_COCOON_H);
|
||||
player->CastSpell(player, SPELL_FREED_EXPEDITION_MEMBER_H, true);
|
||||
@@ -359,7 +359,7 @@ struct go_exiles_reach_hruns_barrow_339568_350796 : public GameObjectAI
|
||||
}
|
||||
|
||||
// alli
|
||||
if (player->GetQuestStatus(QUEST_WHO_LURKS_IN_THE_PIT))
|
||||
if (player->GetQuestStatus(QUEST_WHO_LURKS_IN_THE_PIT) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
player->KillCreditGO(GAMEOBJECT_THICK_COCOON_A);
|
||||
player->CastSpell(player, SPELL_FREED_EXPEDITION_MEMBER_A, true);
|
||||
|
||||
@@ -23,6 +23,31 @@
|
||||
|
||||
#include "exiles_reach.h"
|
||||
|
||||
void ArriveExileBeach(Player* player)
|
||||
{
|
||||
if (!player || !player->IsInWorld() || player->GetMapId() != MAP_EXILES_REACH)
|
||||
return;
|
||||
|
||||
if (player->HasAura(SPELL_KNOCKED_DOWN))
|
||||
return;
|
||||
|
||||
uint32 const area = player->GetAreaId();
|
||||
if (area != AREA_NORTH_SEA_A && area != AREA_NORTH_SEA_H && area != AREA_MURLOC_HIDEAWAY)
|
||||
return;
|
||||
|
||||
if (area == AREA_NORTH_SEA_A || area == AREA_NORTH_SEA_H)
|
||||
{
|
||||
player->TeleportTo(MAP_EXILES_REACH, -462.722f, -2620.544f, 0.472f, 0.760f);
|
||||
player->CastSpell(player, player->IsInHorde() ? SPELL_H_SHIP_CRASH : SPELL_A_SHIP_CRASH, true);
|
||||
}
|
||||
|
||||
player->GetSceneMgr().PlaySceneByPackageId(SCENE_ALI_HORDE_CRASHED_ON_ISLAND, SceneFlag::NotCancelable);
|
||||
if (player->HasAura(SPELL_HEAVY_FOG_AND_RAIN))
|
||||
player->RemoveAura(SPELL_HEAVY_FOG_AND_RAIN);
|
||||
player->CastSpell(player, SPELL_MEDIUM_FOG_AND_RAIN, true);
|
||||
player->CastSpell(player, SPELL_KNOCKED_DOWN, true);
|
||||
}
|
||||
|
||||
class exiles_reach_murloc_hideaway_playerscript : public PlayerScript
|
||||
{
|
||||
public:
|
||||
@@ -31,14 +56,8 @@ public:
|
||||
// after the ship crash movie play the tiny murloc scene
|
||||
void OnMovieComplete(Player* player, uint32 movieId) override
|
||||
{
|
||||
if (movieId == 931 || movieId == 895)
|
||||
{
|
||||
player->GetSceneMgr().PlaySceneByPackageId(SCENE_ALI_HORDE_CRASHED_ON_ISLAND, SceneFlag::NotCancelable);
|
||||
if (player->HasAura(SPELL_HEAVY_FOG_AND_RAIN))
|
||||
player->RemoveAura(SPELL_HEAVY_FOG_AND_RAIN);
|
||||
player->CastSpell(player, SPELL_MEDIUM_FOG_AND_RAIN, true);
|
||||
player->CastSpell(player, SPELL_KNOCKED_DOWN, true);
|
||||
}
|
||||
if (movieId == MOVIE_HORDE_SHIP_CRASH || movieId == MOVIE_ALLIANCE_SHIP_CRASH)
|
||||
ArriveExileBeach(player);
|
||||
}
|
||||
|
||||
void CheckExilesReachPhaseShift(Player* player)
|
||||
@@ -53,15 +72,14 @@ public:
|
||||
|
||||
if (player->IsInHorde())
|
||||
{
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHORE_BREKA_AND_FRIENDS_INJURED }, !player->GetQuestStatus(QUEST_H_EMERGENCY_FIRST_AID));
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHORE_BREKA_AND_FRIENDS_INJURED }, !QuestRewarded(player, QUEST_H_EMERGENCY_FIRST_AID));
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_SHORE_BREKA_AND_FRIENDS_HEALED }, QuestRewarded(player, QUEST_H_EMERGENCY_FIRST_AID) && !QuestAccepted(player, QUEST_H_FINDING_THE_LOST_EXPEDITION) && !player->GetSummonedCreatureByEntry(NPC_MURLOC_HIDEAWAY_BREKA));
|
||||
WowCommunity::PhaseShift(player, { PHASE_HORDE_ABANDONED_CAMP_WONSA_STARVING }, !player->GetSummonedCreatureByEntry(NPC_MURLOC_HIDEAWAY_BREKA));
|
||||
}
|
||||
|
||||
if (player->IsInAlliance())
|
||||
{
|
||||
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_SHORE_GARRICK_AND_FRIENDS_INJURED }, !player->GetQuestStatus(QUEST_EMERGENCY_FIRST_AID));
|
||||
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_SHIP_13619 }, !QuestAccepted(player, QUEST_MURLOC_MANIA));
|
||||
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_SHORE_GARRICK_AND_FRIENDS_INJURED }, !QuestRewarded(player, QUEST_EMERGENCY_FIRST_AID));
|
||||
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_SHORE_GARRICK_AND_FRIENDS_HEALED }, QuestRewarded(player, QUEST_EMERGENCY_FIRST_AID) && !QuestAccepted(player, QUEST_FINDING_THE_LOST_EXPEDITION) && !player->GetSummonedCreatureByEntry(NPC_MURLOC_HIDEAWAY_GARRICK));
|
||||
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_SHORE_12940, PHASE_ALLIANCE_SHORE_13157, PHASE_ALLIANCE_SHORE_13503 }, QuestRewarded(player, QUEST_MURLOC_MANIA));
|
||||
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_ABANDONED_CAMP_ALARIA_STARVING }, !player->GetSummonedCreatureByEntry(NPC_MURLOC_HIDEAWAY_GARRICK));
|
||||
@@ -283,6 +301,7 @@ struct npc_exiles_reach_shore_injured_buddie : public ScriptedAI
|
||||
{
|
||||
npc_exiles_reach_shore_injured_buddie(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
me->SetUninteractible(false);
|
||||
if (me->GetPhaseShift().HasPhase(PHASE_ALLIANCE_SHORE_GARRICK_AND_FRIENDS_INJURED) || me->GetPhaseShift().HasPhase(PHASE_HORDE_SHORE_BREKA_AND_FRIENDS_INJURED))
|
||||
me->SetEmoteState(EMOTE_ONESHOT_SLEEP);
|
||||
}
|
||||
@@ -338,7 +357,10 @@ struct npc_exiles_reach_shore_injured_buddie : public ScriptedAI
|
||||
// Throg 166784, Jin'Hake 166800, Cole 149917, Richter 156622 (murloc hideaway)
|
||||
struct npc_exiles_reach_shore_other_two_injured : public ScriptedAI
|
||||
{
|
||||
npc_exiles_reach_shore_other_two_injured(Creature* creature) : ScriptedAI(creature) {}
|
||||
npc_exiles_reach_shore_other_two_injured(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
me->SetUninteractible(false);
|
||||
}
|
||||
|
||||
void SpellHit(WorldObject* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
|
||||
@@ -142,6 +142,14 @@ struct npc_exiles_reach_ship_166573_156280 : public ScriptedAI
|
||||
case QUEST_H_WARMING_UP:
|
||||
// Conversation 12818 is played from the quest-status script.
|
||||
break;
|
||||
case QUEST_BRACE_FOR_IMPACT:
|
||||
player->CastSpell(player, SPELL_HEAVY_FOG_AND_RAIN, true);
|
||||
Talk(4, player); // Everyone below decks! Now
|
||||
break;
|
||||
case QUEST_H_BRACE_FOR_IMPACT:
|
||||
player->CastSpell(player, SPELL_HEAVY_FOG_AND_RAIN, true);
|
||||
Talk(4, player); // Soldiers, brace yourselves!
|
||||
break;
|
||||
case QUEST_RIDE_OF_THE_SCIENTIFICALLY_ENHANCED_BOAR:
|
||||
if (Creature* clone = player->SummonCreature(NPC_OGRE_RUINS_TORGOK_FIGHTER_A, FindSummonPosition(player, NPC_DARKMAUL_PLAINS_GARRICK), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0U, 0U, player->GetGUID()))
|
||||
clone->FollowTarget(player);
|
||||
@@ -158,13 +166,13 @@ struct npc_exiles_reach_ship_166573_156280 : public ScriptedAI
|
||||
// Completion conversation 12798 is played from the quest-status script.
|
||||
break;
|
||||
case QUEST_BRACE_FOR_IMPACT:
|
||||
player->TeleportTo(2175, -462.722f, -2620.544f, 0.472f, 0.760f);
|
||||
player->CastSpell(player, SPELL_A_SHIP_CRASH);
|
||||
break;
|
||||
case QUEST_H_BRACE_FOR_IMPACT:
|
||||
player->TeleportTo(2175, -462.722f, -2620.544f, 0.472f, 0.760f);
|
||||
player->CastSpell(player, SPELL_H_SHIP_CRASH);
|
||||
player->RemoveAllAuras();
|
||||
player->SendMovieStart(player->IsInHorde() ? MOVIE_HORDE_SHIP_CRASH : MOVIE_ALLIANCE_SHIP_CRASH);
|
||||
// If the client never finishes the movie, still put them on the beach.
|
||||
player->GetScheduler().Schedule(120s, [player](TaskContext /*context*/)
|
||||
{
|
||||
ArriveExileBeach(player);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -193,18 +201,48 @@ private:
|
||||
};
|
||||
|
||||
// Training Dummy - 160737,
|
||||
static void GrantWarmingUpDummyCredit(Player* player, Creature* dummy)
|
||||
{
|
||||
if (!player || !dummy)
|
||||
return;
|
||||
|
||||
uint32 const questId = player->IsInHorde() ? QUEST_H_WARMING_UP : QUEST_WARMING_UP;
|
||||
if (player->GetQuestStatus(questId) != QUEST_STATUS_INCOMPLETE)
|
||||
return;
|
||||
|
||||
player->KilledMonsterCredit(dummy->GetEntry(), dummy->GetGUID());
|
||||
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
|
||||
if (!quest)
|
||||
return;
|
||||
|
||||
for (QuestObjective const& obj : quest->GetObjectives())
|
||||
if (obj.Type == QUEST_OBJECTIVE_MONSTER && uint32(obj.ObjectID) != dummy->GetEntry())
|
||||
player->KilledMonsterCredit(uint32(obj.ObjectID));
|
||||
}
|
||||
|
||||
struct npc_exiles_reach_ship_training_dummy : public ScriptedAI
|
||||
{
|
||||
npc_exiles_reach_ship_training_dummy(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void JustDied(Unit* killer /*killer*/) override
|
||||
void SpellHit(WorldObject* caster, SpellInfo const* spell) override
|
||||
{
|
||||
Player* player = killer->ToPlayer();
|
||||
if (!player)
|
||||
if (!caster || !spell || spell->IsPositive())
|
||||
return;
|
||||
|
||||
if (player->GetQuestStatus(QUEST_H_WARMING_UP) || player->GetQuestStatus(QUEST_WARMING_UP))
|
||||
player->CastSpell(player, SPELL_MEDIUM_FOG_AND_RAIN, true);
|
||||
Unit* unit = caster->ToUnit();
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
GrantWarmingUpDummyCredit(unit->GetCharmerOrOwnerPlayerOrPlayerItself(), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
if (!killer)
|
||||
return;
|
||||
|
||||
GrantWarmingUpDummyCredit(killer->GetCharmerOrOwnerPlayerOrPlayerItself(), me);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -213,6 +251,8 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI
|
||||
{
|
||||
npc_exiles_reach_ship_166583_160664(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
bool _jumpedBehind = false;
|
||||
|
||||
void BeFriendly()
|
||||
{
|
||||
me->AttackStop();
|
||||
@@ -283,10 +323,12 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
if (damage > me->GetHealth())
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
damage = 0;
|
||||
me->SetFullHealth();
|
||||
me->SetHealth(1);
|
||||
me->SetImmuneToPC(true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFaction(35);
|
||||
me->AttackStop();
|
||||
player->KilledMonsterCredit(155607);
|
||||
@@ -299,9 +341,12 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI
|
||||
me->DespawnOrUnsummon();
|
||||
});
|
||||
}
|
||||
else
|
||||
else if (!_jumpedBehind && (me->GetHealth() - damage) < uint32(me->GetMaxHealth() * 0.65f))
|
||||
{
|
||||
_jumpedBehind = true;
|
||||
me->CastSpell(player, SPELL_JUMP_BEHIND, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_exiles_reach_north_sea()
|
||||
|
||||
@@ -157,11 +157,11 @@ public:
|
||||
{
|
||||
if (QuestAccepted(player, QUEST_STOCKING_UP_ON_SUPPLIES))
|
||||
if (criteria->Entry->ID == 47940 || criteria->Entry->ID == 48009) // item sold to vendor
|
||||
player->ForceCompleteQuest(QUEST_STOCKING_UP_ON_SUPPLIES);
|
||||
CreditCriteriaTreeObjectives(player, QUEST_STOCKING_UP_ON_SUPPLIES);
|
||||
|
||||
if (QuestAccepted(player, QUEST_H_STOCKING_UP_ON_SUPPLIES))
|
||||
if (criteria->Entry->ID == 47940 || criteria->Entry->ID == 48009) // item sold to vendor
|
||||
player->ForceCompleteQuest(QUEST_H_STOCKING_UP_ON_SUPPLIES);
|
||||
CreditCriteriaTreeObjectives(player, QUEST_H_STOCKING_UP_ON_SUPPLIES);
|
||||
}
|
||||
|
||||
// Phase Update in every 1sec
|
||||
@@ -390,17 +390,15 @@ class Exiles_Reach_AchievementScript : public AchievementScript
|
||||
public:
|
||||
Exiles_Reach_AchievementScript() : AchievementScript("Exiles_Reach_AchievementScript") {}
|
||||
|
||||
// @todo make a hook for criteria update and use that
|
||||
|
||||
void OnCompleted(Player* player, AchievementEntry const* achievement) override
|
||||
{
|
||||
if (achievement->ID == ACHIEVEMENT_NPE_SOLD_ITEM)
|
||||
{
|
||||
if (QuestAccepted(player, QUEST_STOCKING_UP_ON_SUPPLIES))
|
||||
player->ForceCompleteQuest(QUEST_STOCKING_UP_ON_SUPPLIES);
|
||||
CreditCriteriaTreeObjectives(player, QUEST_STOCKING_UP_ON_SUPPLIES);
|
||||
|
||||
if (QuestAccepted(player, QUEST_H_STOCKING_UP_ON_SUPPLIES))
|
||||
player->ForceCompleteQuest(QUEST_H_STOCKING_UP_ON_SUPPLIES);
|
||||
CreditCriteriaTreeObjectives(player, QUEST_H_STOCKING_UP_ON_SUPPLIES);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user