mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/ExilesReach: Implemented quests Murloc Mania and Emergency First Aid (#29090)
This commit is contained in:
142
sql/updates/world/master/2023_07_01_00_world.sql
Normal file
142
sql/updates/world/master/2023_07_01_00_world.sql
Normal file
@@ -0,0 +1,142 @@
|
||||
-- Misc
|
||||
UPDATE `conditions` SET `ElseGroup`=0 WHERE `SourceTypeOrReferenceId`=32 AND `SourceGroup`=5 AND `SourceEntry` IN (149917,156622);
|
||||
UPDATE `creature_template` SET `RegenHealth`=0 WHERE `entry` IN (149917,156622,156612,156609,156610,166784,166800,166786,166791,166796);
|
||||
UPDATE `creature_template` SET `npcflag`=2, `unit_flags`=768, `unit_flags2`=34816 WHERE entry=156626;
|
||||
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` IN (156626,166782,166787,166792,166797) AND `GroupID`=0;
|
||||
INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
|
||||
(156626, 0, 0, '$n! Thank the Light! Are you injured?', 12, 0, 100, 3, 0, 152736, 178506, 0, 'Captain Garrick'),
|
||||
(166782, 0, 0, '$n! You survived! We need to regroup at once.', 12, 0, 100, 3, 0, 156954, 195918, 0, 'Warlord Breka Grimaxe'),
|
||||
(166787, 0, 0, 'My thanks. We\'ll find the expedition yet.', 12, 0, 100, 0, 0, 156979, 195930, 0, 'Bo'),
|
||||
(166792, 0, 0, 'Mark my words, that storm was unnatural.', 12, 0, 100, 0, 0, 156978, 195932, 0, 'Mithdran Dawntracker'),
|
||||
(166797, 0, 0, 'Quite the storm. Probably hit the first boat, too.', 12, 0, 100, 0, 0, 155934, 195924, 0, 'Lana Jordan');
|
||||
|
||||
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin`=10, `LevelScalingDeltaMax`=10 WHERE `Entry`=165359;
|
||||
|
||||
-- Questing
|
||||
|
||||
DELETE FROM `creature_queststarter` WHERE `id`=156626 AND `quest` IN (55122,54951);
|
||||
DELETE FROM `creature_queststarter` WHERE `id`=166782 AND `quest` IN (59929,59930);
|
||||
INSERT INTO `creature_queststarter` (`id`, `quest`, `VerifiedBuild`) VALUES
|
||||
(156626, 55122, 45745), -- Alliance
|
||||
(156626, 54951, 45745),
|
||||
(166782, 59929, 46455), -- Horde
|
||||
(166782, 59930, 46455);
|
||||
|
||||
DELETE FROM `creature_questender` WHERE `id` IN (156626,166782);
|
||||
INSERT INTO `creature_questender` (`id`, `quest`, `VerifiedBuild`) VALUES
|
||||
(156626, 55122, 45745), -- Alliance
|
||||
(156626, 54951, 45745),
|
||||
(166782, 59929, 46455), -- Horde
|
||||
(166782, 59930, 46455);
|
||||
|
||||
DELETE FROM `quest_template_addon` WHERE `ID` IN (55122,54951,59929,59930);
|
||||
INSERT INTO `quest_template_addon` (`ID`,`NextQuestID`) VALUES
|
||||
(55122,54951), -- Alliance
|
||||
(54951,54952),
|
||||
(59929,59930), -- Horde
|
||||
(59930,59931);
|
||||
|
||||
-- Conversations
|
||||
|
||||
-- Alliance conversation for Captain Garrick, Kee-La, Bjorn Stouthands, Austin Huxworth
|
||||
DELETE FROM `conversation_actors` WHERE `ConversationId` IN (12043,12044,12127,11685,12128,14432,14437,12058);
|
||||
INSERT INTO `conversation_actors` (`ConversationId`,`ConversationActorId`,`ConversationActorGuid`,`Idx`,`CreatureId`,`CreatureDisplayInfoId`,`NoActorObject`,`ActivePlayerObject`,`VerifiedBuild`) VALUES
|
||||
(12043,71223,1052006,0,0,0,0,0,45745), -- Alliance
|
||||
(12044,0,0,0,0,0,0,1,45745),
|
||||
(12044,69830,0,1,0,0,0,0,45745),
|
||||
(12127,71535,1052012,1,0,0,0,0,45745),
|
||||
(11685,71536,1052013,1,0,0,0,0,45745),
|
||||
(12128,71534,1052014,1,0,0,0,0,45745),
|
||||
(14432,75904,1052015,1,0,0,0,0,45745), -- Horde
|
||||
(14437,76283,0,2,0,0,0,0,45745), -- Horde
|
||||
(12058,71297,0,0,0,0,0,0,45745), -- Alliance
|
||||
(12058,69830,0,1,0,0,0,0,45745), -- Alliance
|
||||
(12058,76284,0,2,0,0,0,0,45745), -- Horde
|
||||
(12058,76283,0,3,0,0,0,0,45745); -- Horde
|
||||
|
||||
DELETE FROM `conversation_line_template` WHERE `Id` IN (29262,29305,29263,29559,29556,29561,29322,34645,36134,36151,36152,36153);
|
||||
INSERT INTO `conversation_line_template` (`Id`,`UiCameraID`,`ActorIdx`,`Flags`,`VerifiedBuild`) VALUES
|
||||
(29262,0,0,0,45745), -- Alliance
|
||||
(29305,0,0,0,45745),
|
||||
(29263,0,1,0,45745),
|
||||
(29559,0,1,0,45745),
|
||||
(29556,0,1,0,45745),
|
||||
(29561,0,1,0,45745),
|
||||
(29322,0,0,0,45745),
|
||||
(34645,0,1,0,45745),
|
||||
(36134,0,1,0,45745), -- Horde
|
||||
(36151,0,2,0,45745),
|
||||
(36152,0,2,0,45745),
|
||||
(36153,0,3,0,45745);
|
||||
|
||||
DELETE FROM `conversation_template` WHERE `Id` IN (12043,12044,12127,11685,12128,14432,14437,12058);
|
||||
INSERT INTO `conversation_template` (`Id`,`FirstLineId`,`TextureKitId`,`ScriptName`,`VerifiedBuild`) VALUES
|
||||
(12043,29262,0,'',45745), -- Alliance
|
||||
(12044,29305,0,'',45745),
|
||||
(12127,29558,0,'',45745),
|
||||
(11685,29557,0,'',45745),
|
||||
(12128,29560,0,'',45745),
|
||||
(14432,36133,0,'',45745), -- Horde
|
||||
(14437,36149,0,'',45745),
|
||||
(12058,29322,0,'',45745);
|
||||
|
||||
-- Beach alliance scripting
|
||||
UPDATE `creature_template` SET `npcflag`=2, `unit_flags`=768, `unit_flags2`=34816, AIName="",`ScriptName`="npc_captain_garrick_beach" WHERE entry=156626;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_warlord_grimaxe_beach" WHERE `entry`=166782;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_healed_by_leader_alliance_beach" WHERE `entry` IN (149917,156622);
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_healed_by_leader_horde_beach" WHERE `entry` IN (166784,166800);
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_bjorn_stouthands_beach_laying" WHERE `entry`=156609;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_austin_huxworth_beach_laying" WHERE `entry`=156610;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_kee_la_beach_laying" WHERE `entry`=156612;
|
||||
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_bo_beach_laying" WHERE `entry`=166786;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_mithran_dawntracker_beach_laying" WHERE `entry`=166791;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_lana_jordan_beach_laying" WHERE `entry`=166796;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_bo_beach_standing" WHERE `entry`=166787;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_mithdran_dawntracker_beach_standing" WHERE `entry`=166792;
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_lana_jordan_beach_standing" WHERE `entry`=166797;
|
||||
|
||||
UPDATE `creature_template` SET `ScriptName`="npc_murloc_spearhunter_watershaper" WHERE `entry` IN (150228,150229);
|
||||
UPDATE `creature` SET `ScriptName`='npc_murloc_spearhunter_watershaper_higher_ground' WHERE `guid` IN(1051092, 1051082, 1051068, 1051081, 1051120, 1051117, 1051094, 1051084, 1051102);
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (305464,325136);
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(305464,'spell_crash_landed_alliance'),
|
||||
(325136,'spell_crash_landed_horde');
|
||||
|
||||
-- Pathing
|
||||
|
||||
-- Pathing for Private Cole 149917 and Grunt Throg 166784 "Emergency First Aid"
|
||||
SET @PATH := 1052007 * 10;
|
||||
DELETE FROM `waypoint_data` WHERE `id` IN (@PATH);
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,-425.59723,-2607.6094,0.6097671,NULL,0,0,0,100,0),
|
||||
(@PATH,2,-416.96875,-2603.981,0.6097671,NULL,0,0,0,100,0),
|
||||
(@PATH,3,-405.7066,-2599.0903,1.5887985,NULL,0,0,0,100,0),
|
||||
(@PATH,4,-396.3125,-2595.6328,2.8700066,NULL,0,0,0,100,0);
|
||||
|
||||
-- Pathing for Quartermaster Richter 156622 and Provisioner Jin'hake 166800 "Emergency First Aid"
|
||||
SET @PATH := 1052008 * 10;
|
||||
DELETE FROM `waypoint_data` WHERE `id` IN (@PATH);
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,-399.375,-2597.3906,2.019909,NULL,0,0,0,100,0),
|
||||
(@PATH,2,-391.84723,-2593.486,3.8800163,NULL,0,0,0,100,0);
|
||||
|
||||
-- Pathing for Bo quest "Emergency First Aid"
|
||||
SET @PATH := 1052021 * 10;
|
||||
DELETE FROM `waypoint_data` WHERE `id` IN (@PATH);
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,-437.55035,-2610.1511,0.5548096,NULL,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Mithdran Dawntracker "Emergency First Aid"
|
||||
SET @PATH := 1052022 * 10;
|
||||
DELETE FROM `waypoint_data` WHERE `id` IN (@PATH);
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,-436.05557,-2607.8057,0.39855957,NULL,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Lana Jordan "Emergency First Aid"
|
||||
SET @PATH := 1052023 * 10;
|
||||
DELETE FROM `waypoint_data` WHERE `id` IN (@PATH);
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,-433.9479,-2608.7449,0.5111084,NULL,0,1,0,100,0);
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "SpellScript.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Transport.h"
|
||||
#include "Loot.h"
|
||||
|
||||
template<class privateAI, class publicAI>
|
||||
CreatureAI* GetPrivatePublicPairAISelector(Creature* creature)
|
||||
@@ -1042,6 +1043,596 @@ CreatureAI* CaptainGarrickShipAISelector(Creature* creature)
|
||||
return new NullCreatureAI(creature);
|
||||
};
|
||||
|
||||
enum SpellCrashLandedData
|
||||
{
|
||||
NPC_CAPTAIN_GARRICK_BEACH = 156626,
|
||||
NPC_WARLORD_BREKA_GRIMAXE_BEACH = 166782
|
||||
};
|
||||
|
||||
// 305464 - Crash Landed
|
||||
// 325136 - Crash Landed
|
||||
template<uint32 StaticCaptainNPCId>
|
||||
class spell_crash_landed_generic : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_crash_landed_generic);
|
||||
|
||||
void HandleEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
if (Creature* creature = player->FindNearestCreature(StaticCaptainNPCId, 50.0f))
|
||||
creature->SummonPersonalClone(creature->GetPosition(), TempSummonType(TEMPSUMMON_MANUAL_DESPAWN), 0s, 0, 0, player);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_crash_landed_generic::HandleEffect, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
enum ExilesReachCaptainsBeachData
|
||||
{
|
||||
CONVERSATION_QUEST_MURLOC_MANIA_ALLIANCE = 12043,
|
||||
CONVERSATION_QUEST_MURLOC_MANIA_HORDE = 14432,
|
||||
|
||||
EVENT_EMERGENCY_FIRST_AID_SCRIPT_SHEATH = 1,
|
||||
EVENT_EMERGENCY_FIRST_AID_SCRIPT_BANDAGE,
|
||||
EVENT_EMERGENCY_FIRST_AID_SCRIPT_MOVE_SECOND_SURVIVOR,
|
||||
EVENT_EMERGENCY_FIRST_AID_SCRIPT_MOVE_HOME_BEACH,
|
||||
|
||||
POINT_SECOND_SURVIVOR = 0,
|
||||
POINT_BEACH_HOME = 1,
|
||||
|
||||
QUEST_MURLOC_MANIA_ALLIANCE = 55122,
|
||||
QUEST_EMERGENCY_FIRST_AID_ALLIANCE = 54951,
|
||||
QUEST_MURLOC_MANIA_HORDE = 59929,
|
||||
QUEST_EMERGENCY_FIRST_AID_HORDE = 59930,
|
||||
|
||||
SPELL_BANDAGING = 305584,
|
||||
|
||||
TALK_ARRIVED_AT_BEACH = 0
|
||||
};
|
||||
|
||||
// 156626 - Captain Garrick
|
||||
// 166782 - Warlord Breka Grimaxe
|
||||
struct npc_captain_warlord_beach_arrive_private : public ScriptedAI
|
||||
{
|
||||
npc_captain_warlord_beach_arrive_private(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void IsSummonedBy(WorldObject* summonerWO) override
|
||||
{
|
||||
Player* summoner = summonerWO->ToPlayer();
|
||||
if (!summoner)
|
||||
return;
|
||||
|
||||
me->SetFacingToObject(summoner);
|
||||
Talk(TALK_ARRIVED_AT_BEACH, summoner);
|
||||
me->DespawnOrUnsummon(5s);
|
||||
}
|
||||
};
|
||||
|
||||
// 156626 - Captain Garrick
|
||||
// 166782 - Warlord Breka Grimaxe
|
||||
// for Emergency first aid quest 54951
|
||||
struct npc_captain_warlord_first_aid_private : public ScriptedAI
|
||||
{
|
||||
npc_captain_warlord_first_aid_private(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
|
||||
}
|
||||
|
||||
void IsSummonedBy(WorldObject* summonerWO) override
|
||||
{
|
||||
Player* summoner = summonerWO->ToPlayer();
|
||||
if (!summoner)
|
||||
return;
|
||||
|
||||
_events.ScheduleEvent(EVENT_EMERGENCY_FIRST_AID_SCRIPT_SHEATH, 2s);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiId) override
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
switch (uiId)
|
||||
{
|
||||
case POINT_SECOND_SURVIVOR:
|
||||
if (Creature* mate = ObjectAccessor::GetCreature(*me, _quartermasterGUID))
|
||||
me->CastSpell(mate, SPELL_BANDAGING);
|
||||
_events.ScheduleEvent(EVENT_EMERGENCY_FIRST_AID_SCRIPT_MOVE_HOME_BEACH, 6s);
|
||||
break;
|
||||
case POINT_BEACH_HOME:
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_EMERGENCY_FIRST_AID_SCRIPT_SHEATH:
|
||||
me->SetSheath(SHEATH_STATE_UNARMED);
|
||||
_events.ScheduleEvent(EVENT_EMERGENCY_FIRST_AID_SCRIPT_BANDAGE, 1s);
|
||||
break;
|
||||
case EVENT_EMERGENCY_FIRST_AID_SCRIPT_BANDAGE:
|
||||
if (Creature* mate = ObjectAccessor::GetCreature(*me, _firstMateGUID))
|
||||
me->CastSpell(mate, SPELL_BANDAGING);
|
||||
_events.ScheduleEvent(EVENT_EMERGENCY_FIRST_AID_SCRIPT_MOVE_SECOND_SURVIVOR, 5s);
|
||||
break;
|
||||
case EVENT_EMERGENCY_FIRST_AID_SCRIPT_MOVE_SECOND_SURVIVOR:
|
||||
me->GetMotionMaster()->MovePoint(POINT_SECOND_SURVIVOR, -414.15277f, -2605.2014f, 0.91079247f, false);
|
||||
break;
|
||||
case EVENT_EMERGENCY_FIRST_AID_SCRIPT_MOVE_HOME_BEACH:
|
||||
me->GetMotionMaster()->MovePoint(POINT_BEACH_HOME, -435.15277f, -2610.9915f, 0.649292f, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
void SetFirstMateGUID(ObjectGuid coleGUID)
|
||||
{
|
||||
_firstMateGUID = coleGUID;
|
||||
}
|
||||
|
||||
void SetQuartermasterGUID(ObjectGuid richterGUID)
|
||||
{
|
||||
_quartermasterGUID = richterGUID;
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
ObjectGuid _firstMateGUID;
|
||||
ObjectGuid _quartermasterGUID;
|
||||
};
|
||||
|
||||
// 156626 - Captain Garrick
|
||||
struct npc_captain_garrick_beach : public ScriptedAI
|
||||
{
|
||||
npc_captain_garrick_beach(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void OnQuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
switch (quest->GetQuestId())
|
||||
{
|
||||
case QUEST_MURLOC_MANIA_ALLIANCE:
|
||||
Conversation::CreateConversation(CONVERSATION_QUEST_MURLOC_MANIA_ALLIANCE, player, *player, player->GetGUID(), nullptr);
|
||||
break;
|
||||
case QUEST_EMERGENCY_FIRST_AID_ALLIANCE:
|
||||
{
|
||||
Creature* cole = FindCreatureIgnorePhase(player, "private_cole_beach", 50.0f);
|
||||
Creature* richter = FindCreatureIgnorePhase(player, "quartermaster_richter_beach", 50.0f);
|
||||
if (!cole || !richter)
|
||||
return;
|
||||
|
||||
Creature* colePersonal = cole->SummonPersonalClone(cole->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
Creature* richterPersonal = richter->SummonPersonalClone(richter->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
Creature* mePersonal = me->SummonPersonalClone(me->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
if (!colePersonal || !richterPersonal || !mePersonal)
|
||||
return;
|
||||
|
||||
if (npc_captain_warlord_first_aid_private* personalAI = CAST_AI(npc_captain_warlord_first_aid_private, mePersonal->GetAI()))
|
||||
{
|
||||
personalAI->SetFirstMateGUID(colePersonal->GetGUID());
|
||||
personalAI->SetQuartermasterGUID(richterPersonal->GetGUID());
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 166782 - Warlord Breka Grimaxe
|
||||
struct npc_warlord_grimaxe_beach : public ScriptedAI
|
||||
{
|
||||
npc_warlord_grimaxe_beach(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void OnQuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
switch (quest->GetQuestId())
|
||||
{
|
||||
case QUEST_MURLOC_MANIA_HORDE:
|
||||
Conversation::CreateConversation(CONVERSATION_QUEST_MURLOC_MANIA_HORDE, player, *player, player->GetGUID(), nullptr);
|
||||
break;
|
||||
case QUEST_EMERGENCY_FIRST_AID_HORDE:
|
||||
{
|
||||
Creature* throg = FindCreatureIgnorePhase(player, "grunt_throg_beach", 50.0f);
|
||||
Creature* jinhake = FindCreatureIgnorePhase(player, "jin_hake_beach", 50.0f);
|
||||
if (!throg || !jinhake)
|
||||
return;
|
||||
|
||||
Creature* throgPersonal = throg->SummonPersonalClone(throg->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
Creature* jinhakePersonal = jinhake->SummonPersonalClone(jinhake->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
Creature* mePersonal = me->SummonPersonalClone(me->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
if (!throgPersonal || !jinhakePersonal || !mePersonal)
|
||||
return;
|
||||
|
||||
if (npc_captain_warlord_first_aid_private* personalAI = CAST_AI(npc_captain_warlord_first_aid_private, mePersonal->AI()))
|
||||
{
|
||||
personalAI->SetFirstMateGUID(throgPersonal->GetGUID());
|
||||
personalAI->SetQuartermasterGUID(jinhakePersonal->GetGUID());
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* CaptainGarrickBeachAISelector(Creature* creature)
|
||||
{
|
||||
if (creature->IsPrivateObject())
|
||||
{
|
||||
if (Player* privateObjectOwner = ObjectAccessor::GetPlayer(*creature, creature->GetPrivateObjectOwner()))
|
||||
{
|
||||
if (privateObjectOwner->GetQuestStatus(QUEST_MURLOC_MANIA_ALLIANCE) == QUEST_STATUS_NONE)
|
||||
return new npc_captain_warlord_beach_arrive_private(creature);
|
||||
else
|
||||
return new npc_captain_warlord_first_aid_private(creature);
|
||||
}
|
||||
}
|
||||
return new npc_captain_garrick_beach(creature);
|
||||
};
|
||||
|
||||
CreatureAI* WarlordGrimaxeBeachAISelector(Creature* creature)
|
||||
{
|
||||
if (creature->IsPrivateObject())
|
||||
{
|
||||
if (Player* privateObjectOwner = ObjectAccessor::GetPlayer(*creature, creature->GetPrivateObjectOwner()))
|
||||
{
|
||||
if (privateObjectOwner->GetQuestStatus(QUEST_MURLOC_MANIA_HORDE) == QUEST_STATUS_NONE)
|
||||
return new npc_captain_warlord_beach_arrive_private(creature);
|
||||
else
|
||||
return new npc_captain_warlord_first_aid_private(creature);
|
||||
}
|
||||
}
|
||||
return new npc_warlord_grimaxe_beach(creature);
|
||||
};
|
||||
|
||||
enum HealedByLeaderBeachData
|
||||
{
|
||||
EVENT_SALUTE = 1,
|
||||
EVENT_LEAVE_BEACH,
|
||||
|
||||
NPC_COLE_BEACH = 149917,
|
||||
NPC_RICHTER_BEACH = 156622,
|
||||
NPC_THROG_BEACH = 166784,
|
||||
NPC_JINHAKE_BEACH = 166800,
|
||||
|
||||
PATH_LONG_BEACH = 10520070,
|
||||
PATH_SHORT_BEACH = 10520080
|
||||
};
|
||||
|
||||
// 149917 - Private Cole
|
||||
// 156622 - Quartermaster Richter
|
||||
// 166784 - Grunt Throg
|
||||
// 166800 - Provisioner Jin'hake
|
||||
// for Emergency first aid quest
|
||||
template<uint32 PathId, uint32 WaitTime>
|
||||
struct npc_survivors_healed_by_leader_beach_private : public ScriptedAI
|
||||
{
|
||||
npc_survivors_healed_by_leader_beach_private(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_SLEEP);
|
||||
}
|
||||
|
||||
void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (spellInfo->Id != SPELL_BANDAGING)
|
||||
return;
|
||||
|
||||
_casterGUID = caster->GetGUID();
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
_events.ScheduleEvent(EVENT_SALUTE, 2s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SALUTE:
|
||||
if (Creature* caster = ObjectAccessor::GetCreature(*me, _casterGUID))
|
||||
me->SetFacingToObject(caster);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
|
||||
_events.ScheduleEvent(EVENT_LEAVE_BEACH, 2s);
|
||||
break;
|
||||
case EVENT_LEAVE_BEACH:
|
||||
me->GetMotionMaster()->MovePath(PathId, false);
|
||||
me->DespawnOrUnsummon(Milliseconds(WaitTime));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
private:
|
||||
EventMap _events;
|
||||
ObjectGuid _casterGUID;
|
||||
};
|
||||
|
||||
CreatureAI* HealedByLeaderAllianceAISelector(Creature* creature)
|
||||
{
|
||||
if (creature->IsPrivateObject())
|
||||
return new npc_survivors_healed_by_leader_beach_private<PATH_LONG_BEACH, 16 * IN_MILLISECONDS>(creature);
|
||||
return new NullCreatureAI(creature);
|
||||
};
|
||||
|
||||
CreatureAI* HealedByLeaderHordeAISelector(Creature* creature)
|
||||
{
|
||||
if (creature->IsPrivateObject())
|
||||
return new npc_survivors_healed_by_leader_beach_private<PATH_SHORT_BEACH, 9 * IN_MILLISECONDS>(creature);
|
||||
return new NullCreatureAI(creature);
|
||||
};
|
||||
|
||||
enum ExilesReachAllianceSurvivorsBeachData
|
||||
{
|
||||
CONVERSATION_STOUTHANDS_BEACH = 11685,
|
||||
CONVERSATION_HUXWORTH_BEACH = 12128,
|
||||
CONVERSATION_KEE_LA_BEACH = 12127,
|
||||
|
||||
NPC_BJORN_STOUTHANDS_LAYING = 156609,
|
||||
NPC_AUSTIN_HUXWORTH_LAYING = 156610,
|
||||
NPC_KEE_LA_LAYING = 156612,
|
||||
NPC_KEE_LA_STANDING = 151088,
|
||||
NPC_BJORN_STOUTHANDS_STANDING = 151089,
|
||||
NPC_AUSTIN_HUXWORTH_STANDING = 154170,
|
||||
|
||||
SPELL_BANDAGING_QUEST = 297415
|
||||
};
|
||||
|
||||
// 156609 - Bjorn Stouthands
|
||||
// 156610 - Austin Huxworth
|
||||
// 156612 - Kee-La
|
||||
template<uint32 ConversationId>
|
||||
struct npc_alliance_survivors_beach_laying : public ScriptedAI
|
||||
{
|
||||
npc_alliance_survivors_beach_laying(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (spellInfo->Id != SPELL_BANDAGING_QUEST)
|
||||
return;
|
||||
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
player->UpdateObjectVisibility();
|
||||
|
||||
Conversation::CreateConversation(ConversationId, player, *player, player->GetGUID(), nullptr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
enum ExilesReachHordeSurvivorsBeachData
|
||||
{
|
||||
EVENT_SURVIVORS_HORDE_STAND_AND_TALK = 1,
|
||||
EVENT_SURVIVORS_HORDE_MOVE_TO_GRIMAXE,
|
||||
|
||||
NPC_BO_LAYING_LAYING = 166786,
|
||||
NPC_MITHDRAN_LAYING = 166791,
|
||||
NPC_LANA_JORDAN_LAYING = 166796,
|
||||
NPC_BO_STANDING = 166787,
|
||||
NPC_MITHDRAN_STANDING = 166792,
|
||||
NPC_LANA_JORDAN_STANDING = 166797,
|
||||
|
||||
PATH_BO_TO_GRIMAXE = 10520210,
|
||||
PATH_MITHDRAN_TO_GRIMAXE = 10520220,
|
||||
PATH_LANA_JORDAN_TO_GRIMAXE = 10520230,
|
||||
|
||||
TALK_HORDE_BEACH_THANK_PLAYER = 0
|
||||
};
|
||||
|
||||
// 166786 - Bo
|
||||
struct npc_bo_beach_laying : public ScriptedAI
|
||||
{
|
||||
npc_bo_beach_laying(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (spellInfo->Id != SPELL_BANDAGING_QUEST)
|
||||
return;
|
||||
|
||||
static const Position BoCloneSpawnPosition = { -448.731f, -2606.03f, 0.602435f, 6.17441f };
|
||||
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
|
||||
if (Creature* survivor = player->FindNearestCreatureWithOptions(50.0f, FindCreatureOptions().SetStringId("bo_beach").SetIgnorePhases(true)))
|
||||
survivor->SummonPersonalClone(BoCloneSpawnPosition, TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 166791 - Mithdran Dawntracker
|
||||
struct npc_mithran_dawntracker_beach_laying : public ScriptedAI
|
||||
{
|
||||
npc_mithran_dawntracker_beach_laying(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (spellInfo->Id != SPELL_BANDAGING_QUEST)
|
||||
return;
|
||||
|
||||
static Position const MithranCloneSpawnPosition = { -428.576f, -2593.93f, 0.152832f, 4.849576f };
|
||||
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
|
||||
if (Creature* survivor = player->FindNearestCreatureWithOptions(50.0f, FindCreatureOptions().SetStringId("mithran_beach").SetIgnorePhases(true)))
|
||||
survivor->SummonPersonalClone(MithranCloneSpawnPosition, TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 166796 - Lana Jordan
|
||||
struct npc_lana_jordan_beach_laying : public ScriptedAI
|
||||
{
|
||||
npc_lana_jordan_beach_laying(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (spellInfo->Id != SPELL_BANDAGING_QUEST)
|
||||
return;
|
||||
|
||||
static Position const LanaCloneSpawnPosition = { -420.656f, -2600.28f, 0.556646f, 4.046853f };
|
||||
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
|
||||
if (Creature* survivor = player->FindNearestCreatureWithOptions(50.0f, FindCreatureOptions().SetStringId("lana_jordan_beach").SetIgnorePhases(true)))
|
||||
survivor->SummonPersonalClone(LanaCloneSpawnPosition, TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 166787 - Bo
|
||||
// 166792 - Mithdran Dawntracker
|
||||
// 166797 - Lana Jordan
|
||||
template<uint32 PathId>
|
||||
struct npc_horde_survivors_beach_q59930_private : public ScriptedAI
|
||||
{
|
||||
npc_horde_survivors_beach_q59930_private(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_SLEEP);
|
||||
}
|
||||
|
||||
void JustAppeared() override
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_SURVIVORS_HORDE_STAND_AND_TALK, 1s);
|
||||
}
|
||||
|
||||
void WaypointPathEnded(uint32 /*nodeId*/, uint32 /*pathId*/) override
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SURVIVORS_HORDE_STAND_AND_TALK:
|
||||
Talk(TALK_HORDE_BEACH_THANK_PLAYER);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
_events.ScheduleEvent(EVENT_SURVIVORS_HORDE_MOVE_TO_GRIMAXE, 6s);
|
||||
break;
|
||||
case EVENT_SURVIVORS_HORDE_MOVE_TO_GRIMAXE:
|
||||
me->GetMotionMaster()->MovePath(PathId, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* BoBeachStandingAISelector(Creature* creature)
|
||||
{
|
||||
if (creature->IsPrivateObject())
|
||||
return new npc_horde_survivors_beach_q59930_private<PATH_BO_TO_GRIMAXE>(creature);
|
||||
|
||||
return new NullCreatureAI(creature);
|
||||
};
|
||||
|
||||
CreatureAI* MithdranBeachStandingAISelector(Creature* creature)
|
||||
{
|
||||
if (creature->IsPrivateObject())
|
||||
return new npc_horde_survivors_beach_q59930_private<PATH_MITHDRAN_TO_GRIMAXE>(creature);
|
||||
|
||||
return new NullCreatureAI(creature);
|
||||
};
|
||||
|
||||
CreatureAI* LanaJordanBeachStandingAISelector(Creature* creature)
|
||||
{
|
||||
if (creature->IsPrivateObject())
|
||||
return new npc_horde_survivors_beach_q59930_private<PATH_LANA_JORDAN_TO_GRIMAXE>(creature);
|
||||
|
||||
return new NullCreatureAI(creature);
|
||||
};
|
||||
|
||||
enum ExilesReachMurlocsData
|
||||
{
|
||||
ITEM_STITCHED_CLOTH_SHOES = 174791,
|
||||
ITEM_STITCHED_LEATHER_BOOTS = 174792,
|
||||
ITEM_LINKED_MAIL_BOOTS = 174793,
|
||||
ITEM_DENTED_PLATE_BOOTS = 174794,
|
||||
|
||||
QUEST_MURLOC_HIDEAWAY_BOOTS_DROPPED = 58883
|
||||
};
|
||||
|
||||
// 150228 - Murloc Spearhunter
|
||||
// 150229 - Murloc Watershaper
|
||||
struct npc_murloc_spearhunter_watershaper : public ScriptedAI
|
||||
{
|
||||
npc_murloc_spearhunter_watershaper(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
for (auto const& [playerGuid, loot] : me->m_personalLoot)
|
||||
{
|
||||
for (LootItem const& lootItem : loot->items)
|
||||
{
|
||||
if (lootItem.itemid == ITEM_STITCHED_CLOTH_SHOES || lootItem.itemid == ITEM_STITCHED_LEATHER_BOOTS || lootItem.itemid == ITEM_LINKED_MAIL_BOOTS || lootItem.itemid == ITEM_DENTED_PLATE_BOOTS)
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGuid))
|
||||
player->SetRewardedQuest(QUEST_MURLOC_HIDEAWAY_BOOTS_DROPPED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
// 150228 - Murloc Spearhunter
|
||||
// 150229 - Murloc Watershaper
|
||||
struct npc_murloc_spearhunter_watershaper_higher_ground : public npc_murloc_spearhunter_watershaper
|
||||
{
|
||||
npc_murloc_spearhunter_watershaper_higher_ground(Creature* creature) : npc_murloc_spearhunter_watershaper(creature) { }
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
me->GetMotionMaster()->MoveJump(who->GetPosition(), 16.0f, 6.2f);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_zone_exiles_reach()
|
||||
{
|
||||
// Ship
|
||||
@@ -1059,11 +1650,28 @@ void AddSC_zone_exiles_reach()
|
||||
RegisterPrivatePublicCreatureAIPair("npc_crew_ship", npc_crew_ship_private, NullCreatureAI);
|
||||
RegisterPrivatePublicCreatureAIPair("npc_pet_ship", npc_pet_ship_private, NullCreatureAI);
|
||||
new quest_brace_for_impact();
|
||||
|
||||
new player_exiles_reach_ship_crash();
|
||||
new scene_alliance_and_horde_ship();
|
||||
|
||||
// Beach
|
||||
RegisterSpellScript(spell_knocked_down_exiles_reach_beach);
|
||||
new scene_alliance_and_horde_crash();
|
||||
RegisterSpellScriptWithArgs(spell_crash_landed_generic<NPC_CAPTAIN_GARRICK_BEACH>, "spell_crash_landed_alliance");
|
||||
RegisterSpellScriptWithArgs(spell_crash_landed_generic<NPC_WARLORD_BREKA_GRIMAXE_BEACH>, "spell_crash_landed_horde");
|
||||
new FactoryCreatureScript<CreatureAI, &CaptainGarrickBeachAISelector>("npc_captain_garrick_beach");
|
||||
new FactoryCreatureScript<CreatureAI, &WarlordGrimaxeBeachAISelector>("npc_warlord_grimaxe_beach");
|
||||
new FactoryCreatureScript<CreatureAI, &HealedByLeaderAllianceAISelector>("npc_healed_by_leader_alliance_beach");
|
||||
new FactoryCreatureScript<CreatureAI, &HealedByLeaderHordeAISelector>("npc_healed_by_leader_horde_beach");
|
||||
new GenericCreatureScript<npc_alliance_survivors_beach_laying<CONVERSATION_STOUTHANDS_BEACH>>("npc_bjorn_stouthands_beach_laying");
|
||||
new GenericCreatureScript<npc_alliance_survivors_beach_laying<CONVERSATION_HUXWORTH_BEACH>>("npc_austin_huxworth_beach_laying");
|
||||
new GenericCreatureScript<npc_alliance_survivors_beach_laying<CONVERSATION_KEE_LA_BEACH>>("npc_kee_la_beach_laying");
|
||||
// Note: alliance survivor do not need a script for Emergency First Aid quest
|
||||
RegisterCreatureAI(npc_bo_beach_laying);
|
||||
RegisterCreatureAI(npc_mithran_dawntracker_beach_laying);
|
||||
RegisterCreatureAI(npc_lana_jordan_beach_laying);
|
||||
new FactoryCreatureScript<CreatureAI, &BoBeachStandingAISelector>("npc_bo_beach_standing");
|
||||
new FactoryCreatureScript<CreatureAI, &MithdranBeachStandingAISelector>("npc_mithdran_dawntracker_beach_standing");
|
||||
new FactoryCreatureScript<CreatureAI, &LanaJordanBeachStandingAISelector>("npc_lana_jordan_beach_standing");
|
||||
RegisterCreatureAI(npc_murloc_spearhunter_watershaper);
|
||||
RegisterCreatureAI(npc_murloc_spearhunter_watershaper_higher_ground);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user