mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Stormwind: Implement Quest "Nation Of KulTiras" (#29547)
This commit is contained in:
68
sql/updates/world/master/2024_01_02_00_world.sql
Normal file
68
sql/updates/world/master/2024_01_02_00_world.sql
Normal file
@@ -0,0 +1,68 @@
|
||||
-- Update Template
|
||||
UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'npc_anduin_wrynn_nation_of_kultiras' WHERE `entry` = 120756;
|
||||
|
||||
UPDATE `creature` SET `npcflag` = 3 WHERE `guid` = 850697;
|
||||
|
||||
-- Conversation
|
||||
DELETE FROM `conversation_template` WHERE `Id`=4896;
|
||||
INSERT INTO `conversation_template` (`Id`, `FirstLineID`, `TextureKitId`, `VerifiedBuild`) VALUES
|
||||
(4896, 17624, 0, 52607);
|
||||
|
||||
DELETE FROM `conversation_actors` WHERE (`ConversationId`=4896 AND `Idx` IN (2,1,0));
|
||||
INSERT INTO `conversation_actors` (`ConversationId`, `ConversationActorId`, `ConversationActorGuid`, `Idx`, `CreatureId`, `CreatureDisplayInfoId`, `NoActorObject`, `ActivePlayerObject`, `VerifiedBuild`) VALUES
|
||||
(4896, 64275, 850675, 2, 0, 0, 0, 0, 52607), -- Full: 0x203CC8000075F50000187100000163C1 Creature/0 R3890/S6257 Map: 0 (Eastern Kingdoms) Entry: 120788 (Genn Greymane) Low: 91073
|
||||
(4896, 53220, 850679, 1, 0, 0, 0, 0, 52607), -- Full: 0x203CC8000075ED0000187100000163C2 Creature/0 R3890/S6257 Map: 0 (Eastern Kingdoms) Entry: 120756 (Anduin Wrynn) Low: 91074
|
||||
(4896, 0, 0, 0, 0, 0, 0, 1, 52607); -- Full: 0x0800040000000000FFFFFFFFFFFFFFFF Player/0 R1/S16777215 Map: 0 (Eastern Kingdoms) Low: 1099511627775
|
||||
|
||||
DELETE FROM `conversation_line_template` WHERE `Id` IN (17623, 17622, 17621, 17620, 17619, 17618, 17624);
|
||||
INSERT INTO `conversation_line_template` (`Id`, `UiCameraID`, `ActorIdx`, `Flags`, `ChatType`, `VerifiedBuild`) VALUES
|
||||
(17623, 0, 2, 0, 0, 52607),
|
||||
(17622, 0, 1, 0, 0, 52607),
|
||||
(17621, 0, 1, 0, 0, 52607),
|
||||
(17620, 0, 1, 0, 0, 52607),
|
||||
(17619, 0, 2, 0, 0, 52607),
|
||||
(17618, 0, 1, 0, 0, 52607),
|
||||
(17624, 0, 0, 0, 0, 52607);
|
||||
|
||||
-- ScriptNames
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` = 279998;
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(279998, 'spell_kultiras_skip_intro');
|
||||
|
||||
-- Serverside spell
|
||||
DELETE FROM `serverside_spell` WHERE `Id` = 247285;
|
||||
INSERT INTO `serverside_spell` (`Id`, `DifficultyID`, `CategoryId`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `AttributesEx8`, `AttributesEx9`, `AttributesEx10`, `AttributesEx11`, `AttributesEx12`, `AttributesEx13`, `AttributesEx14`, `Stances`, `StancesNot`, `Targets`, `TargetCreatureType`, `RequiresSpellFocus`, `FacingCasterFlags`, `CasterAuraState`, `TargetAuraState`, `ExcludeCasterAuraState`, `ExcludeTargetAuraState`, `CasterAuraSpell`, `TargetAuraSpell`, `ExcludeCasterAuraSpell`, `ExcludeTargetAuraSpell`, `CasterAuraType`, `TargetAuraType`, `ExcludeCasterAuraType`, `ExcludeTargetAuraType`, `CastingTimeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `StartRecoveryCategory`, `StartRecoveryTime`, `InterruptFlags`, `AuraInterruptFlags1`, `AuraInterruptFlags2`, `ChannelInterruptFlags1`, `ChannelInterruptFlags2`, `ProcFlags`, `ProcFlags2`, `ProcChance`, `ProcCharges`, `ProcCooldown`, `ProcBasePPM`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `Speed`, `LaunchDelay`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `ContentTuningId`, `SpellName`, `ConeAngle`, `ConeWidth`, `MaxTargetLevel`, `MaxAffectedTargets`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `SpellFamilyFlags4`, `DmgClass`, `PreventionType`, `AreaGroupId`, `SchoolMask`, `ChargeCategoryId`) VALUES
|
||||
(247285, 0, 0, 0, 0, 0, 0, 0, 0, 0x00000080, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 'KulTiras Skip Intro - Teleport Unit', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
DELETE FROM `serverside_spell_effect` WHERE `SpellID` = 247285 AND `EffectIndex` = 0;
|
||||
INSERT INTO `serverside_spell_effect` (`SpellID`, `EffectIndex`, `DifficultyID`, `Effect`, `EffectAura`, `EffectAmplitude`, `EffectAttributes`, `EffectAuraPeriod`, `EffectBonusCoefficient`, `EffectChainAmplitude`, `EffectChainTargets`, `EffectItemType`, `EffectMechanic`, `EffectPointsPerResource`, `EffectPosFacing`, `EffectRealPointsPerLevel`, `EffectTriggerSpell`, `BonusCoefficientFromAP`, `PvpMultiplier`, `Coefficient`, `Variance`, `ResourceCoefficient`, `GroupSizeBasePointsCoefficient`, `EffectBasePoints`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectSpellClassMask1`, `EffectSpellClassMask2`, `EffectSpellClassMask3`, `EffectSpellClassMask4`, `ImplicitTarget1`, `ImplicitTarget2`) VALUES
|
||||
(247285, 0, 0, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.52375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17);
|
||||
|
||||
-- Spell target pos.
|
||||
DELETE FROM `spell_target_position` WHERE `ID` = 247285;
|
||||
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `VerifiedBuild`) VALUES
|
||||
(247285, 0, 1643, 1053.48, -627.64, 0.54, 0);
|
||||
|
||||
-- Creature Text
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` = 120590;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `SoundPlayType`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||
(120590, 0, 0, 'I must prepare my ship. Champion, meet me in the harbor when you are ready to depart.', 12, 0, 100, 1, 0, 112107, 1, 129944, 0, 'Lady Jaina Proudmoore to Player');
|
||||
|
||||
-- Gossip
|
||||
DELETE FROM `creature_template_gossip` WHERE (`CreatureID`=120590 AND `MenuID`=22328);
|
||||
INSERT INTO `creature_template_gossip` (`CreatureID`, `MenuID`, `VerifiedBuild`) VALUES
|
||||
(120590, 22328, 52607); -- Lady Jaina Proudmoore
|
||||
|
||||
UPDATE `gossip_menu` SET `VerifiedBuild`=52607 WHERE (`MenuID`=22328 AND `TextID`=34271);
|
||||
|
||||
UPDATE `gossip_menu_option` SET `GossipOptionID`=47616, `BoxText`='Are you sure you want to skip the Kul Tiras introductory quests?', `BoxBroadcastTextID`=161817, `VerifiedBuild`=52607 WHERE (`MenuID`=22328 AND `OptionID`=1);
|
||||
UPDATE `gossip_menu_option` SET `GossipOptionID`=47615, `VerifiedBuild`=52607 WHERE (`MenuID`=22328 AND `OptionID`=0);
|
||||
|
||||
-- Quest stuff
|
||||
DELETE FROM `creature_queststarter` WHERE (`id`=120756 AND `quest`=46728);
|
||||
INSERT INTO `creature_queststarter` (`id`, `quest`, `VerifiedBuild`) VALUES
|
||||
(120756, 46728, 52607); -- The Nation of Kul Tiras offered Anduin Wrynn
|
||||
|
||||
DELETE FROM `quest_template_addon` WHERE `ID` = 46728;
|
||||
INSERT INTO `quest_template_addon` (`ID`, `MaxLevel`, `AllowableClasses`, `SourceSpellID`, `PrevQuestID`, `NextQuestID`, `ExclusiveGroup`, `BreadcrumbForQuestId`, `RewardMailTemplateID`, `RewardMailDelay`, `RequiredSkillID`, `RequiredSkillPoints`, `RequiredMinRepFaction`, `RequiredMaxRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepValue`, `ProvidedItemCount`, `SpecialFlags`, `ScriptName`) VALUES
|
||||
(46728, 0, 0, 0, 46727, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
|
||||
@@ -51,6 +51,29 @@ enum TidesOfWarData
|
||||
PATH_JAINA_VISION_FINISH = 12059001
|
||||
};
|
||||
|
||||
enum NationOfKulTirasData
|
||||
{
|
||||
QUEST_NATION_OF_KULTIRAS = 46728,
|
||||
QUEST_NATION_OF_KULTIRAS_NPE = 59641,
|
||||
QUEST_OUT_LIKE_FLYNN = 47098,
|
||||
QUEST_DAUGHTER_OF_THE_SEA = 51341,
|
||||
|
||||
SAY_JAINA_LEAVE_COUNCIL = 0,
|
||||
|
||||
SPELL_JAINA_TELEPORT = 40163,
|
||||
SPELL_SKIP_KULTIRAS_INTRO = 279998,
|
||||
SPELL_SKIP_TOLDAGOR_TELEPORT = 247285,
|
||||
|
||||
CONVERSATION_JAINA_LEAVE_COUNCIL = 4896,
|
||||
|
||||
ACTION_JAINA_LEAVE_COUNCIL = 1,
|
||||
|
||||
GOSSIP_MENU_NATION_OF_KULTIRAS = 22328,
|
||||
|
||||
GOSSIP_OPTION_START_KULTIRAS_INTRO = 0,
|
||||
GOSSIP_OPTION_SKIP_KULTIRAS_INTRO = 1
|
||||
};
|
||||
|
||||
// 55 - Stormwind Keep - Tides of War
|
||||
struct at_stormwind_keep_tides_of_war : AreaTriggerAI
|
||||
{
|
||||
@@ -157,6 +180,24 @@ struct npc_jaina_proudmoore_tides_of_war : public ScriptedAI
|
||||
{
|
||||
npc_jaina_proudmoore_tides_of_war(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool OnGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_NATION_OF_KULTIRAS)
|
||||
{
|
||||
if (gossipListId == GOSSIP_OPTION_START_KULTIRAS_INTRO)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
// @TODO: script start of TolDagor intro
|
||||
}
|
||||
else if (gossipListId == GOSSIP_OPTION_SKIP_KULTIRAS_INTRO)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
player->CastSpell(nullptr, SPELL_SKIP_KULTIRAS_INTRO, false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WaypointPathEnded(uint32 /*nodeId*/, uint32 pathId) override
|
||||
{
|
||||
if (pathId == PATH_JAINA_VISION_START)
|
||||
@@ -174,6 +215,30 @@ struct npc_jaina_proudmoore_tides_of_war : public ScriptedAI
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_JAINA_LEAVE_COUNCIL)
|
||||
{
|
||||
_scheduler.Schedule(1s, [this](TaskContext task)
|
||||
{
|
||||
Talk(SAY_JAINA_LEAVE_COUNCIL, me);
|
||||
task.Schedule(4s, [this](TaskContext task)
|
||||
{
|
||||
DoCastSelf(SPELL_JAINA_TELEPORT);
|
||||
task.Schedule(2s, [this](TaskContext /*task*/)
|
||||
{
|
||||
Unit* privateObjectOwner = ObjectAccessor::GetUnit(*me, me->GetPrivateObjectOwner());
|
||||
if (!privateObjectOwner)
|
||||
return;
|
||||
|
||||
Conversation::CreateConversation(CONVERSATION_JAINA_LEAVE_COUNCIL, privateObjectOwner, *privateObjectOwner, privateObjectOwner->GetGUID(), nullptr, true);
|
||||
me->DespawnOrUnsummon();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
@@ -218,10 +283,53 @@ class spell_despawn_sailor_memory : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 120756 - Anduin Wrynn
|
||||
struct npc_anduin_wrynn_nation_of_kultiras : public ScriptedAI
|
||||
{
|
||||
npc_anduin_wrynn_nation_of_kultiras(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void OnQuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_NATION_OF_KULTIRAS)
|
||||
{
|
||||
PhasingHandler::OnConditionChange(player);
|
||||
|
||||
Creature* jainaObject = GetClosestCreatureWithOptions(player, 15.0f, { .CreatureId = NPC_JAINA_TIDES_OF_WAR, .IgnorePhases = true });
|
||||
if (!jainaObject)
|
||||
return;
|
||||
|
||||
TempSummon* jainaClone = jainaObject->SummonPersonalClone(jainaObject->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player->ToPlayer());
|
||||
if (!jainaClone)
|
||||
return;
|
||||
|
||||
jainaClone->AI()->DoAction(ACTION_JAINA_LEAVE_COUNCIL);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 279998 - Kul Tiras: Skip Intro
|
||||
class spell_kultiras_skip_intro : public SpellScript
|
||||
{
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* player = GetCaster()->ToPlayer())
|
||||
{
|
||||
player->CastSpell(nullptr, SPELL_SKIP_TOLDAGOR_TELEPORT, false);
|
||||
player->SkipQuests({ QUEST_NATION_OF_KULTIRAS, QUEST_NATION_OF_KULTIRAS_NPE, QUEST_OUT_LIKE_FLYNN, QUEST_DAUGHTER_OF_THE_SEA });
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_kultiras_skip_intro::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_stormwind_city()
|
||||
{
|
||||
// Creature
|
||||
RegisterCreatureAI(npc_jaina_proudmoore_tides_of_war);
|
||||
RegisterCreatureAI(npc_anduin_wrynn_nation_of_kultiras);
|
||||
|
||||
// Conversation
|
||||
new conversation_start_council_tides_of_war();
|
||||
@@ -234,4 +342,5 @@ void AddSC_stormwind_city()
|
||||
|
||||
// Spells
|
||||
RegisterSpellScript(spell_despawn_sailor_memory);
|
||||
RegisterSpellScript(spell_kultiras_skip_intro);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user