Scripts/Stormwind: Implement RP Event for quest "Ancient Curses" (#29780)

This commit is contained in:
Naddley
2024-03-25 23:19:05 +01:00
committed by GitHub
parent 28c9474337
commit ee0858d859
2 changed files with 272 additions and 0 deletions

View File

@@ -0,0 +1,100 @@
-- Creature
UPDATE `creature` SET `equipment_id` = 1 WHERE `guid` = 9004157;
DELETE FROM `creature_template_addon` WHERE `entry` = 207353;
INSERT INTO `creature_template_addon` (`entry`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
(207353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '416876'); -- Arko'narin Starshade
DELETE FROM `creature_addon` WHERE `guid` = 9004158;
INSERT INTO `creature_addon` (`guid`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
(9004158, 0, 0, 0, 0, 0, 0, 0, 743, 0, 0, 0, 0, '416876');
-- Template
UPDATE `creature_template` SET `ScriptName` = 'npc_arkonarin_starshade_ancient_curses' WHERE `entry` = 207353;
UPDATE `creature_template` SET `ScriptName` = 'npc_lysande_starshade_ancient_curses' WHERE `entry` = 202700;
-- Conditions
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=26 AND `SourceGroup` = 21386 AND `SourceEntry` = 0);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES
(26, 21386, 0, 0, 0, 47, 0, 75890, 2|8|64, 0, 0, 'Apply Phase 12881 if Quest 75890 is in Progress | complete | rewarded'),
(26, 21386, 0, 0, 0, 47, 0, 75891, 2|8|64, 0, 1, 'Apply Phase 12881 if Quest 75891 is not in Progress | complete | rewarded');
-- Conversation
DELETE FROM `conversation_template` WHERE `Id`=22025;
INSERT INTO `conversation_template` (`Id`, `FirstLineID`, `TextureKitId`, `VerifiedBuild`) VALUES
(22025, 58792, 0, 53441);
UPDATE `conversation_template` SET `ScriptName` = 'conversation_quest_ancient_curses_accept' WHERE `Id` = 22025;
DELETE FROM `conversation_actors` WHERE (`ConversationId`=22025 AND `Idx` IN (1,0,2));
INSERT INTO `conversation_actors` (`ConversationId`, `ConversationActorId`, `Idx`, `CreatureId`, `CreatureDisplayInfoId`, `NoActorObject`, `ActivePlayerObject`, `VerifiedBuild`) VALUES
(22025, 92501, 1, 0, 0, 0, 0, 53441), -- Full: 0x203CD80000CA7E400046850000635334 Creature/0 R3894/S18053 Map: 0 (Eastern Kingdoms) Entry: 207353 (Arko'narin Starshade) Low: 6509364
(22025, 0, 0, 0, 0, 0, 1, 53441), -- Full: 0x0800040000000000FFFFFFFFFFFFFFFF Player/0 R1/S16777215 Map: 0 (Eastern Kingdoms) Low: 1099511627775
(22025, 92502, 2, 0, 0, 0, 0, 53441); -- Full: 0x203CD80000C5F3000046850000635334 Creature/0 R3894/S18053 Map: 0 (Eastern Kingdoms) Entry: 202700 (Lysander Starshade) Low: 6509364
DELETE FROM `conversation_line_template` WHERE `Id` IN (58695, 59782, 58689, 60113, 58686, 58685, 58681, 58684, 58792);
INSERT INTO `conversation_line_template` (`Id`, `UiCameraID`, `ActorIdx`, `Flags`, `ChatType`, `VerifiedBuild`) VALUES
(58695, 0, 1, 0, 0, 53441),
(59782, 0, 0, 0, 0, 53441),
(58689, 0, 1, 0, 0, 53441),
(60113, 0, 2, 0, 0, 53441),
(58686, 0, 1, 0, 0, 53441),
(58685, 0, 1, 0, 0, 53441),
(58681, 0, 2, 0, 0, 53441),
(58684, 0, 1, 0, 0, 53441),
(58792, 0, 0, 0, 0, 53441);
-- Path for Arko'narin Starshade
SET @ENTRY := 207353;
SET @PATHOFFSET := 0;
SET @PATH := @ENTRY * 100 + @PATHOFFSET;
DELETE FROM `waypoint_path` WHERE `PathId`= @PATH;
INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Comment`) VALUES
(@PATH, 0, 0, 'Arkonarin Starshade - Ancient Curses - Walk to Mount up');
DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH;
INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES
(@PATH, 0, -8055.644, 811.8108, 67.04881, NULL, 0),
(@PATH, 1, -8059.302, 813.7813, 67.03999, NULL, 0),
(@PATH, 2, -8061.103, 816.2917, 67.12263, NULL, 0),
(@PATH, 3, -8063.181, 819.7986, 66.95995, NULL, 0),
(@PATH, 4, -8064.859, 822.7864, 67.23528, NULL, 0),
(@PATH, 5, -8067.783, 827.4531, 68.42369, NULL, 0);
SET @ENTRY := 207353;
SET @PATHOFFSET := 1;
SET @PATH := @ENTRY * 100 + @PATHOFFSET;
DELETE FROM `waypoint_path` WHERE `PathId`= @PATH;
INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Comment`) VALUES
(@PATH, 1, 0, 'Arkonarin Starshade - Ancient Curses - Fly with Mount');
DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH;
INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES
(@PATH, 0, -8062.76, 837.1875, 90.90665, NULL, 0);
-- Path for Lysander Starshade
SET @ENTRY := 202700;
SET @PATHOFFSET := 1;
SET @PATH := @ENTRY * 100 + @PATHOFFSET;
DELETE FROM `waypoint_path` WHERE `PathId`= @PATH;
INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Comment`) VALUES
(@PATH, 0, 0, 'Lysander Starshade - Ancient Curses - Walk to Mount up');
DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH;
INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES
(@PATH, 0, -8057.543, 816.6129, 67.32983, NULL, 0),
(@PATH, 1, -8059.802, 818.9965, 67.22331, NULL, 0),
(@PATH, 2, -8060.806, 821.8246, 67.04409, NULL, 0),
(@PATH, 3, -8061.877, 824.8906, 67.3605, NULL, 0),
(@PATH, 4, -8063.377, 828.0174, 68.87323, NULL, 0);
SET @ENTRY := 202700;
SET @PATHOFFSET := 2;
SET @PATH := @ENTRY * 100 + @PATHOFFSET;
DELETE FROM `waypoint_path` WHERE `PathId`= @PATH;
INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Comment`) VALUES
(@PATH, 1, 0, 'Lysander Starshade - Fly with Mount');
DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH;
INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES
(@PATH, 0, -8093.516, 861.3646, 86.87444, NULL, 0);

View File

@@ -325,14 +325,186 @@ class spell_kultiras_skip_intro : public SpellScript
}
};
enum AncientCursesData
{
QUEST_ANCIENT_CURSES = 75891,
NPC_ARKONARIN_STARSHADE = 207353,
NPC_LYSANDER_STARSHADE = 202700,
DISPLAY_ID_STARSHADE_MOUNT = 63626,
CONVERSATION_ANCIENT_CURSES = 22025,
POINT_LYSANDER_STEP_TO_DOOR = 1,
PATH_ARKONARIN_WALK_TO_MOUNT_UP = 20735300,
PATH_ARKONARIN_FLY_TO_FELWOOD = 20735301,
PATH_LYSANDER_WALK_TO_MOUNT_UP = 20270001,
PATH_LYSANDER_FLY_TO_FELWOOD = 20270002
};
Position const LysanderWalkToTheDoor = { -8051.493f, 820.21704f, 68.30904f };
// 207353 - Arko'narin Starshade
struct npc_arkonarin_starshade_ancient_curses : public ScriptedAI
{
npc_arkonarin_starshade_ancient_curses(Creature* creature) : ScriptedAI(creature) { }
void OnQuestAccept(Player* player, Quest const* quest) override
{
if (quest->GetQuestId() == QUEST_ANCIENT_CURSES)
{
PhasingHandler::OnConditionChange(player);
Conversation::CreateConversation(CONVERSATION_ANCIENT_CURSES, player, *player, player->GetGUID(), nullptr, false);
}
}
void WaypointPathEnded(uint32 /*nodeId*/, uint32 pathId) override
{
if (pathId == PATH_ARKONARIN_WALK_TO_MOUNT_UP)
{
me->SetDisableGravity(true, true);
me->SetMountDisplayId(DISPLAY_ID_STARSHADE_MOUNT);
_scheduler.Schedule(2s + 500ms, [this](TaskContext /*context*/)
{
me->GetMotionMaster()->MovePath(PATH_ARKONARIN_FLY_TO_FELWOOD, false);
me->DespawnOrUnsummon(5s);
});
}
}
void UpdateAI(uint32 diff) override
{
_scheduler.Update(diff);
}
private:
TaskScheduler _scheduler;
};
// 202700 - Lysander Starshade
struct npc_lysande_starshade_ancient_curses : public ScriptedAI
{
npc_lysande_starshade_ancient_curses(Creature* creature) : ScriptedAI(creature) { }
void WaypointPathEnded(uint32 /*nodeId*/, uint32 pathId) override
{
if (pathId == PATH_LYSANDER_WALK_TO_MOUNT_UP)
{
me->SetDisableGravity(true, true);
me->SetMountDisplayId(DISPLAY_ID_STARSHADE_MOUNT);
_scheduler.Schedule(2s + 500ms, [this](TaskContext /*context*/)
{
me->GetMotionMaster()->MovePath(PATH_LYSANDER_FLY_TO_FELWOOD, false);
me->DespawnOrUnsummon(5s);
});
}
}
void UpdateAI(uint32 diff) override
{
_scheduler.Update(diff);
}
private:
TaskScheduler _scheduler;
};
// 22025 - Conversation
class conversation_quest_ancient_curses_accept : public ConversationScript
{
public:
conversation_quest_ancient_curses_accept() : ConversationScript("conversation_quest_ancient_curses_accept") { }
enum AncientCursesConversationEvents
{
EVENT_ARKONARIN_START_PATH = 1,
EVENT_LYSANDER_START_PATH = 2
};
enum AncientCursesConversationData
{
CONVO_LINE_ARKONARIN_START_PATH = 58685,
CONVO_LINE_LYSANDER_START_PATH = 60113,
};
void OnConversationCreate(Conversation* conversation, Unit* creator) override
{
Creature* arkonarinObject = GetClosestCreatureWithOptions(creator, 20.0f, { .CreatureId = NPC_ARKONARIN_STARSHADE, .IgnorePhases = true });
Creature* lysanderObject = GetClosestCreatureWithOptions(creator, 20.0f, { .CreatureId = NPC_LYSANDER_STARSHADE, .IgnorePhases = true });
if (!arkonarinObject || !lysanderObject)
return;
TempSummon* arkonarinClone = arkonarinObject->SummonPersonalClone(arkonarinObject->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, creator->ToPlayer());
TempSummon* lysanderClone = lysanderObject->SummonPersonalClone(lysanderObject->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, creator->ToPlayer());
if (!arkonarinClone || !lysanderClone)
return;
arkonarinClone->RemoveNpcFlag(NPCFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER));
lysanderClone->RemoveNpcFlag(NPCFlags(UNIT_NPC_FLAG_GOSSIP));
lysanderClone->SetWalk(true);
lysanderClone->GetMotionMaster()->MovePoint(POINT_LYSANDER_STEP_TO_DOOR, LysanderWalkToTheDoor);
conversation->AddActor(CONVERSATION_ANCIENT_CURSES, 1, arkonarinClone->GetGUID());
conversation->AddActor(CONVERSATION_ANCIENT_CURSES, 2, lysanderClone->GetGUID());
conversation->Start();
}
void OnConversationStart(Conversation* conversation) override
{
LocaleConstant privateOwnerLocale = conversation->GetPrivateObjectOwnerLocale();
if (Milliseconds const* lysanderPathStartTime = conversation->GetLineStartTime(privateOwnerLocale, CONVO_LINE_ARKONARIN_START_PATH))
_events.ScheduleEvent(EVENT_ARKONARIN_START_PATH, *lysanderPathStartTime + 2s);
if (Milliseconds const* lysanderPathStartTime = conversation->GetLineStartTime(privateOwnerLocale, CONVO_LINE_LYSANDER_START_PATH))
_events.ScheduleEvent(EVENT_LYSANDER_START_PATH, *lysanderPathStartTime);
}
void OnConversationUpdate(Conversation* conversation, uint32 diff) override
{
_events.Update(diff);
switch (_events.ExecuteEvent())
{
case EVENT_ARKONARIN_START_PATH:
{
Creature* arkonarinClone = conversation->GetActorCreature(1);
if (!arkonarinClone)
break;
arkonarinClone->GetMotionMaster()->MovePath(PATH_ARKONARIN_WALK_TO_MOUNT_UP, false);
break;
}
case EVENT_LYSANDER_START_PATH:
{
Creature* lysanderClone = conversation->GetActorCreature(2);
if (!lysanderClone)
break;
lysanderClone->GetMotionMaster()->MovePath(PATH_LYSANDER_WALK_TO_MOUNT_UP, false);
break;
}
default:
break;
}
}
private:
EventMap _events;
};
void AddSC_stormwind_city()
{
// Creature
RegisterCreatureAI(npc_jaina_proudmoore_tides_of_war);
RegisterCreatureAI(npc_anduin_wrynn_nation_of_kultiras);
RegisterCreatureAI(npc_arkonarin_starshade_ancient_curses);
RegisterCreatureAI(npc_lysande_starshade_ancient_curses);
// Conversation
new conversation_start_council_tides_of_war();
new conversation_quest_ancient_curses_accept();
// PlayerScript
new player_conv_after_movie_tides_of_war();