diff options
-rw-r--r-- | sql/updates/world/master/2024_02_05_00_world.sql | 182 | ||||
-rw-r--r-- | src/server/scripts/ExilesReach/zone_exiles_reach.cpp | 602 |
2 files changed, 783 insertions, 1 deletions
diff --git a/sql/updates/world/master/2024_02_05_00_world.sql b/sql/updates/world/master/2024_02_05_00_world.sql new file mode 100644 index 00000000000..18dd9f88a18 --- /dev/null +++ b/sql/updates/world/master/2024_02_05_00_world.sql @@ -0,0 +1,182 @@ +-- Re-sizing the Situation + +-- Set by TC Devs +-- One new creature spawn +SET @GUID := 8000040; + +-- Add missing Re-sized Boar +DELETE FROM `creature` WHERE `guid`=@GUID; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `phaseUseFlags`, `PhaseId`, `PhaseGroup`, `terrainSwapMap`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `unit_flags2`, `unit_flags3`, `ScriptName`, `StringId`, `VerifiedBuild`) VALUES +(@GUID,156595,2175,10424,10588,'0',0,13775,0,-1,0,0,116.44965,-2430.3699,90.571266,0.8442242,7200,0,0,1,0,0,NULL,NULL,NULL,NULL,'',NULL,52649); + +UPDATE `creature_template` SET `ScriptName`="npc_lindie_springstock_q56034" WHERE `entry`=156749; +UPDATE `creature_template` SET `ScriptName`="npc_cork_fizzlepop_q59941" WHERE `entry`=167915; +UPDATE `creature_template` SET `ScriptName`="npc_re_sized_boar_q56034" WHERE `entry`=156736; + +-- Henry Garrick & Shuja Grimaxe fix +UPDATE `creature_template_movement` SET `Ground`=1, `Swim`=1 WHERE `CreatureId` IN (156799,167126); + +-- Quest data +DELETE FROM `creature_queststarter` WHERE `id`=149899 AND `quest`=56034; +DELETE FROM `creature_queststarter` WHERE `id`=167019 AND `quest`=59941; +INSERT INTO `creature_queststarter` (`id`, `quest`, `VerifiedBuild`) VALUES +(149899, 56034, 52649), -- Re-sizing the Situation accept from Lindie Springstock +(167019, 59941, 52649); -- Re-sizing the Situation accept from Cork Fizzlepop + +DELETE FROM `creature_questender` WHERE `id`=156280 AND `quest`=56034; +DELETE FROM `creature_questender` WHERE `id`=167021 AND `quest`=59941; +INSERT INTO `creature_questender` (`id`, `quest`, `VerifiedBuild`) VALUES +(156280, 56034, 52649), -- Re-sizing the Situation turn in to Captain Garrick +(167021, 59941, 52649); -- Re-sizing the Situation turn in to Warlord Breka Grimaxe + +DELETE FROM `quest_template_addon` WHERE `ID` IN (56034,59941); +INSERT INTO `quest_template_addon` (`ID`,`AllowableClasses`,`PrevQuestID`,`NextQuestID`,`ScriptName`) VALUES +(56034,0,55193,0,'quest_resizing_the_situation_alliance'), -- Re-sizing the Situation Alliance +(59941,0,59940,0,'quest_resizing_the_situation_horde'); -- Re-sizing the Situation Horde + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (305749,326635,305716,305724,305721,305742,325346,325345); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(305749,'spell_summon_guardian_q56034_q59941'), +(326635,'spell_summon_guardian_q56034_q59941'), +(305716,'spell_re_sizing_q56034'), +(305724,'spell_resizer_hit_one_two_q56034_q59941'), +(305721,'spell_resizer_hit_one_two_q56034_q59941'), +(305742,'spell_resizer_hit_three_q56034'), +(325346,'spell_re_sizing_q59941'), +(325345,'spell_re_sizing_aura_q59941'); + +-- Conversation +DELETE FROM `conversation_template` WHERE `Id` IN (12086); +INSERT INTO `conversation_template` (`Id`,`FirstLineId`,`TextureKitId`,`ScriptName`,`VerifiedBuild`) VALUES +(12086,29430,0,'',52649); + +DELETE FROM `conversation_actors` WHERE `ConversationId` IN (12086); +INSERT INTO `conversation_actors` (`ConversationId`,`ConversationActorId`,`ConversationActorGuid`,`Idx`,`CreatureId`,`CreatureDisplayInfoId`,`NoActorObject`,`ActivePlayerObject`,`VerifiedBuild`) VALUES +(12086,0,0,0,0,0,0,1,52649), -- Player +(12086,71366,0,1,0,0,0,0,52649), -- Lindie Springstock +(12086,76343,0,2,0,0,0,0,52649); -- Cork Fizzlepop + +DELETE FROM `conversation_line_template` WHERE `Id` IN (29430,29431,36373); +INSERT INTO `conversation_line_template` (`Id`,`UiCameraID`,`ActorIdx`,`Flags`,`VerifiedBuild`) VALUES +(29430,0,0,0,52649), +(29431,0,1,0,52649), +(36373,0,2,0,52649); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=29 AND `SourceEntry` IN (29431,36373); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(29,0,29431,0,0,6,0,469,0,0,0,0,0,'','Allow conversation line 29431 if team is Alliance'), +(29,0,36373,0,0,6,0,67,0,0,0,0,0,'','Allow conversation line 36373 if team is horde'); + +-- Conversation +DELETE FROM `conversation_template` WHERE `Id` IN (12087); +INSERT INTO `conversation_template` (`Id`,`FirstLineId`,`TextureKitId`,`ScriptName`,`VerifiedBuild`) VALUES +(12087,29435,0,'',52649); + +DELETE FROM `conversation_actors` WHERE `ConversationId` IN (12087); +INSERT INTO `conversation_actors` (`ConversationId`,`ConversationActorId`,`ConversationActorGuid`,`Idx`,`CreatureId`,`CreatureDisplayInfoId`,`NoActorObject`,`ActivePlayerObject`,`VerifiedBuild`) VALUES +(12087,0,0,0,0,0,0,1,52649), -- Player +(12087,71366,0,1,0,0,0,0,52649), -- Lindie Springstock +(12087,76343,0,2,0,0,0,0,52649); -- Cork Fizzlepop + +DELETE FROM `conversation_line_template` WHERE `Id` IN (29435,29432,36374); +INSERT INTO `conversation_line_template` (`Id`,`UiCameraID`,`ActorIdx`,`Flags`,`VerifiedBuild`) VALUES +(29435,0,0,0,52649), +(29432,0,1,0,52649), +(36374,0,2,0,52649); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=29 AND `SourceEntry` IN (29432,36374); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(29,0,29432,0,0,6,0,469,0,0,0,0,0,'','Allow conversation line 29432 if team is Alliance'), +(29,0,36374,0,0,6,0,67,0,0,0,0,0,'','Allow conversation line 36374 if team is horde'); + +-- Conversation +DELETE FROM `conversation_template` WHERE `Id` IN (12088); +INSERT INTO `conversation_template` (`Id`,`FirstLineId`,`TextureKitId`,`ScriptName`,`VerifiedBuild`) VALUES +(12088,29437,0,'',52649); + +DELETE FROM `conversation_actors` WHERE `ConversationId` IN (12088); +INSERT INTO `conversation_actors` (`ConversationId`,`ConversationActorId`,`ConversationActorGuid`,`Idx`,`CreatureId`,`CreatureDisplayInfoId`,`NoActorObject`,`ActivePlayerObject`,`VerifiedBuild`) VALUES +(12088,0,0,0,0,0,0,1,52649), -- Player +(12088,71366,0,1,0,0,0,0,52649), -- Lindie Springstock +(12088,76343,0,2,0,0,0,0,52649); -- Cork Fizzlepop + +DELETE FROM `conversation_line_template` WHERE `Id` IN (29437,29438,36398); +INSERT INTO `conversation_line_template` (`Id`,`UiCameraID`,`ActorIdx`,`Flags`,`VerifiedBuild`) VALUES +(29437,0,0,0,52649), +(29438,0,1,0,52649), +(36398,0,2,0,52649); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=29 AND `SourceEntry` IN (29438,36398); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(29,0,29438,0,0,6,0,469,0,0,0,0,0,'','Allow conversation line 29438 if team is Alliance'), +(29,0,36398,0,0,6,0,67,0,0,0,0,0,'','Allow conversation line 36398 if team is horde'); + +-- Conversation +DELETE FROM `conversation_template` WHERE `Id` IN (12089); +INSERT INTO `conversation_template` (`Id`,`FirstLineId`,`TextureKitId`,`ScriptName`,`VerifiedBuild`) VALUES +(12089,29439,0,'',52649); + +DELETE FROM `conversation_actors` WHERE `ConversationId` IN (12089); +INSERT INTO `conversation_actors` (`ConversationId`,`ConversationActorId`,`ConversationActorGuid`,`Idx`,`CreatureId`,`CreatureDisplayInfoId`,`NoActorObject`,`ActivePlayerObject`,`VerifiedBuild`) VALUES +(12089,0,0,0,0,0,0,1,52649), -- Player +(12089,71366,0,1,0,0,0,0,52649), -- Lindie Springstock +(12089,76343,0,2,0,0,0,0,52649); -- Cork Fizzlepop + +DELETE FROM `conversation_line_template` WHERE `Id` IN (29439,29440,36399); +INSERT INTO `conversation_line_template` (`Id`,`UiCameraID`,`ActorIdx`,`Flags`,`VerifiedBuild`) VALUES +(29439,0,0,0,52649), +(29440,0,1,0,52649), +(36399,0,2,0,52649); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=29 AND `SourceEntry` IN (29440,36399); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(29,0,29440,0,0,6,0,469,0,0,0,0,0,'','Allow conversation line 29440 if team is Alliance'), +(29,0,36399,0,0,6,0,67,0,0,0,0,0,'','Allow conversation line 36399 if team is Horde'); + +-- Phase Area +DELETE FROM `phase_area` WHERE `AreaId`=10588 AND `PhaseId` IN (13775); +INSERT INTO `phase_area` (`AreaId`,`PhaseId`,`Comment`) VALUES +(10588,13775, 'Cosmetic - NPE - See Re-sized Boar at Plains'); + +-- Phase Names +DELETE FROM `phase_name` WHERE `ID` IN (13775); +INSERT INTO `phase_name` (`ID`,`Name`) VALUES +(13775,'Cosmetic - NPE - See Re-sized Boar at Plains'); + +-- Phase Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup` IN (13775) AND `SourceEntry`=10588; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(26,13775,10588, 0, 0, 47, 0, 56034, 66, 0, 0, 0, 0, '', 'See Re-sized Boar at Plains if quest Re-sizing the Situation is completed | rewarded Alliance.'), +(26,13775,10588, 0, 0, 1, 0, 305742, 0, 0, 1, 0, 0, '', 'See Re-sized Boar at Plains if player does not have aura Resizer Hit'), +(26,13775,10588, 0, 0, 1, 0, 173426, 1, 0, 1, 0, 0, '', 'See Re-sized Boar at Plains if player does not have aura Riding Giant Boar'); + +-- Phasing Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup`=13776 AND `ConditionValue1`=56034; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup`=15318 AND `ConditionValue1`=59941; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(26,13776,0, 0, 0, 47, 0, 56034, 8, 0, 1, 0, 0, '', 'See Lindie Springstock at Plains if quest Re-sizing the Situation is not in progress Alliance.'), +(26,15318,0, 0, 0, 47, 0, 59941, 8, 0, 1, 0, 0, '', 'See Cork Fizzlepop at Plains if quest Re-sizing the Situation is not in progress Horde.'); + +-- Fix phasing +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup`=15316 AND `SourceEntry` IN (10424,10588) AND `ConditionValue1` IN (59938,59939); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup` IN (15315,15318) AND `SourceEntry` IN (10424,10588) AND `ConditionValue1` IN (59939); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup`=13780 AND `SourceEntry` IN (10424,10588) AND `ConditionValue1` IN (55184,55186); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup` IN (13779,13776) AND `SourceEntry` IN (10424,10588) AND `ConditionValue1` IN (55184); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(26,15316,10588,0,0,47,0,59939,66,0,0,0,0,'','Apply Phase 15316 if Quest 59939 (Forbidden Quilboar Necromancy) is completed or rewarded'), +(26,15316,10588,0,1,47,0,59938,66,0,0,0,0,'','Apply Phase 15316 if Quest 59938 (Down with the Quilboar) is completed or rewarded'), +(26,15315,10588,0,0,47,0,59939,66,0,0,0,0,'','Apply Phase 15315 if Quest 59939 (Forbidden Quilboar Necromancy) is completed or rewarded'), +(26,15318,10588,0,0,47,0,59939,66,0,0,0,0,'','Apply Phase 15318 if Quest 59939 (Forbidden Quilboar Necromancy) is completed or rewarded'), +(26,13780,10588,0,0,47,0,55184,66,0,0,0,0,'','Apply Phase 13780 if Quest 55184 (Forbidden Quilboar Necromancy) is completed or rewarded'), +(26,13780,10588,0,1,47,0,55186,66,0,0,0,0,'','Apply Phase 13780 if Quest 55186 (Down with the Quilboar) is completed or rewarded'), +(26,13779,10588,0,0,47,0,55184,66,0,0,0,0,'','Apply Phase 13779 if Quest 55184 (Forbidden Quilboar Necromancy) is completed or rewarded'), +(26,13776,10588,0,0,47,0,55184,66,0,0,0,0,'','Apply Phase 13776 if Quest 55184 (Forbidden Quilboar Necromancy) is completed or rewarded'); + +DELETE FROM `phase_area` WHERE `AreaId` IN (10424,10588) AND `PhaseId` IN (15316,15315,15318,13780,13779,13776); +INSERT INTO `phase_area` (`AreaId`,`PhaseId`,`Comment`) VALUES +(10588,15316, 'Cosmetic - NPE - Mithdran Dawntracker at Darkmaul Plains'), +(10588,15315, 'Cosmetic - NPE - Warlord Breka Grimaxe at Darkmaul Plains'), +(10588,15318, 'Cosmetic - NPE - Cork Fizzlepop at Darkmaul Plains'), +(10588,13780, 'Cosmetic - NPE - Austin Huxworth at Darkmaul Plains'), +(10588,13779, 'Cosmetic - NPE - Captain Garrick at Darkmaul Plains'), +(10588,13776, 'Cosmetic - NPE - Lindie Springstock at Darkmaul Plains'); diff --git a/src/server/scripts/ExilesReach/zone_exiles_reach.cpp b/src/server/scripts/ExilesReach/zone_exiles_reach.cpp index ad0c8f10561..bc4d31c4a2f 100644 --- a/src/server/scripts/ExilesReach/zone_exiles_reach.cpp +++ b/src/server/scripts/ExilesReach/zone_exiles_reach.cpp @@ -5332,6 +5332,594 @@ public: } }; +// Quest 56034 - Re-sizing the Situation "Alliance" +// Quest 59941 - Re-sizing the Situation "Horde" +enum ResizingQuestData +{ + ACTOR_LINDIE_RESIZING_QUEST = 71366, + ACTOR_CORK_RESIZING_QUEST = 76343, + + CONVERSATION_RESIZING_QUEST_ACCEPT = 12086, + CONVERSATION_RESIZING_REPORT_BACK = 12089, + + EVENT_RESIZING_FOLLOW_PLAYER = 1, + EVENT_RESIZING_RUN_HOME = 2, + + POINT_HOME_POSITION = 0, + + SPELL_SUMMON_LINDIE_SPRINGSTOCK_GUARDIAN_Q56034 = 305750, + SPELL_SUMMON_CORK_FIZZLEPOP_GUARDIAN_Q59941 = 326634, + SPELL_LINDIE_DESUMMON_Q56034 = 305756, + SPELL_PING_LINDIE_Q56034_Q59941 = 305754, +}; + +Position ResizingGuardianPosition = { 100.56077f, -2418.0713f, 90.34765f }; + +// 156749 - Lindie Springstock +struct npc_lindie_springstock_q56034 : public ScriptedAI +{ + npc_lindie_springstock_q56034(Creature* creature) : ScriptedAI(creature) { } + + void JustAppeared() override + { + Unit* owner = me->GetOwner(); + + Player* player = owner->ToPlayer(); + if (!player) + return; + + Conversation* conversation = Conversation::CreateConversation(CONVERSATION_RESIZING_QUEST_ACCEPT, player, *player, player->GetGUID(), nullptr, false); + if (!conversation) + return; + + conversation->AddActor(0, 0, player->GetGUID()); + conversation->AddActor(ACTOR_LINDIE_RESIZING_QUEST, 1, me->GetGUID()); + conversation->AddActor(ACTOR_CORK_RESIZING_QUEST, 2, ObjectGuid::Empty); + conversation->Start(); + + _events.ScheduleEvent(EVENT_RESIZING_FOLLOW_PLAYER, 2s); + } + + void MovementInform(uint32 uiType, uint32 uiId) override + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (uiId != 0) + return; + + if (Unit* owner = me->GetOwner()) + owner->CastSpell(owner, SPELL_LINDIE_DESUMMON_Q56034); + } + + void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override + { + if (spellInfo->Id != SPELL_PING_LINDIE_Q56034_Q59941) + return; + + _events.ScheduleEvent(EVENT_RESIZING_RUN_HOME, 2s); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_RESIZING_FOLLOW_PLAYER: + { + if (Unit* owner = me->GetOwner()) + me->GetMotionMaster()->MoveFollow(owner, 0.0f, float(M_PI / 4.0f)); + break; + } + case EVENT_RESIZING_RUN_HOME: + { + me->GetMotionMaster()->MovePoint(POINT_HOME_POSITION, ResizingGuardianPosition); + break; + } + default: + break; + } + } + } + +private: + EventMap _events; +}; + +// 167915 - Cork Fizzlepop +struct npc_cork_fizzlepop_q59941 : public ScriptedAI +{ + npc_cork_fizzlepop_q59941(Creature* creature) : ScriptedAI(creature) { } + + void JustAppeared() override + { + Unit* owner = me->GetOwner(); + if (!owner) + return; + + Conversation* conversation = Conversation::CreateConversation(CONVERSATION_RESIZING_QUEST_ACCEPT, owner, *owner, owner->GetGUID(), nullptr, false); + if (!conversation) + return; + + conversation->AddActor(0, 0, owner->GetGUID()); + conversation->AddActor(ACTOR_LINDIE_RESIZING_QUEST, 1, ObjectGuid::Empty); + conversation->AddActor(ACTOR_CORK_RESIZING_QUEST, 2, me->GetGUID()); + conversation->Start(); + + _events.ScheduleEvent(EVENT_RESIZING_FOLLOW_PLAYER, 2s); + } + + void MovementInform(uint32 uiType, uint32 uiId) override + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (uiId != 0) + return; + + if (Unit* owner = me->GetOwner()) + { + owner->CastSpell(owner, SPELL_UPDATE_PHASE_SHIFT); + owner->RemoveAura(SPELL_SUMMON_CORK_FIZZLEPOP_GUARDIAN_Q59941); + } + } + + void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override + { + if (spellInfo->Id != SPELL_PING_LINDIE_Q56034_Q59941) + return; + + Unit* owner = me->GetOwner(); + if (!owner) + return; + + Conversation* conversation = Conversation::CreateConversation(CONVERSATION_RESIZING_REPORT_BACK, owner, *owner, owner->GetGUID(), nullptr, false); + if (!conversation) + return; + + conversation->AddActor(0, 0, owner->GetGUID()); + conversation->AddActor(ACTOR_LINDIE_RESIZING_QUEST, 1, ObjectGuid::Empty); + conversation->AddActor(ACTOR_CORK_RESIZING_QUEST, 2, me->GetGUID()); + conversation->Start(); + + _events.ScheduleEvent(EVENT_RESIZING_RUN_HOME, 2s); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_RESIZING_FOLLOW_PLAYER: + { + if (Unit* owner = me->GetOwner()) + me->GetMotionMaster()->MoveFollow(owner, 0.0f, float(M_PI / 4.0f)); + break; + } + case EVENT_RESIZING_RUN_HOME: + { + me->GetMotionMaster()->MovePoint(POINT_HOME_POSITION, ResizingGuardianPosition); + break; + } + default: + break; + } + } + } + +private: + EventMap _events; +}; + +enum ReSizedBoarData +{ + EVENT_BOAR_GROW = 1, + EVENT_BOAR_MOVE = 2, + + SPELL_GROW_Q56034 = 129310, + + SOUND_GROW_Q56034 = 157469 +}; + +Position GiantBoarPosition = { 116.146f, -2430.48f, 90.508415f }; + +// 156736 - Wandering Boar +struct npc_re_sized_boar_q56034 : public ScriptedAI +{ + npc_re_sized_boar_q56034(Creature* creature) : ScriptedAI(creature) { } + + void JustAppeared() override + { + _events.ScheduleEvent(EVENT_BOAR_GROW, 1s); + } + + void MovementInform(uint32 uiType, uint32 uiId) override + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (uiId != 0) + return; + + me->SetFacingTo(0.785398f); + + if (Unit* owner = me->GetOwner()) + owner->CastSpell(owner, SPELL_UPDATE_PHASE_SHIFT); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_BOAR_GROW: + me->CastSpell(me, SPELL_GROW_Q56034); + me->PlayDirectSound(SOUND_GROW_Q56034); + _events.ScheduleEvent(EVENT_BOAR_MOVE, 1s); + break; + case EVENT_BOAR_MOVE: + me->SetWalk(false); + me->GetMotionMaster()->MovePoint(POINT_HOME_POSITION, GiantBoarPosition); + break; + default: + break; + } + } + } + +private: + EventMap _events; +}; + +// Spell 305749 - Summon Admiral Garrick Guardian +// Spell 326635 - Summon Cork (DNT) +class spell_summon_guardian_q56034_q59941 : public SpellScript +{ + // @TODO: drop after TARGET_UNK_142 impl + + void SelectTarget(WorldObject*& target) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + Player* player = caster->ToPlayer(); + if (!player) + return; + + Creature* survivor = FindCreatureIgnorePhase(player, player->GetTeam() == ALLIANCE ? "lindie_springstock_plains" : "cork_fizzlepop_plains", 5.0f); + if (!survivor) + return; + + target = survivor; + } + + void Register() override + { + OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_summon_guardian_q56034_q59941::SelectTarget, EFFECT_0, TARGET_DEST_NEARBY_ENTRY_OR_DB); + } +}; + +enum ReSizingData +{ + NPC_WANDERING_BOAR = 156716, + NPC_LINDIE_SPRINGSTOCK_GUARDIAN = 156749, + NPC_CORK_FIZZLEPOP_GUARDIAN = 167915, + + QUEST_RE_SIZING_THE_SITUATION_ALLIANCE = 56034, + QUEST_RE_SIZING_THE_SITUATION_HORDE = 59941, + + QUEST_OBJECTIVE_RE_SIZING_THE_SITUATION_ALLIANCE = 390101, + QUEST_OBJECTIVE_RE_SIZING_THE_SITUATION_HORDE = 397274, + + SPELL_RESIZER_HIT_ONE_Q56034_Q59941 = 305724, + SPELL_RESIZER_HIT_TWO_Q56034_Q59941 = 305721, + SPELL_RESIZER_HIT_THREE_Q56034 = 305742, + SPELL_RESIZING_Q59941 = 325345, + SPELL_RE_SIZER_OVERCHARGED_Q56034 = 325347 +}; + +// 305716 - Re-Sizing +class spell_re_sizing_q56034 : public SpellScript +{ + SpellCastResult CheckCast() + { + if (!GetExplTargetUnit()) + return SPELL_FAILED_BAD_TARGETS; + + Creature* target = GetExplTargetUnit()->ToCreature(); + if (!target) + return SPELL_FAILED_BAD_TARGETS; + + if (target->GetEntry() != NPC_WANDERING_BOAR) + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_re_sizing_q56034::CheckCast); + } +}; + +// 305716 - Re-Sizing +class spell_re_sizing_aura_q56034 : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_RESIZER_HIT_ONE_Q56034_Q59941, + SPELL_RESIZER_HIT_TWO_Q56034_Q59941, + SPELL_PING_LINDIE_Q56034_Q59941, + }); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Player* player = Object::ToPlayer(GetCaster()); + Creature* creature = Object::ToCreature(GetTarget()); + if (!player || !creature) + return; + + switch (player->GetQuestObjectiveData(QUEST_RE_SIZING_THE_SITUATION_ALLIANCE, QUEST_OBJECTIVE_RE_SIZING_THE_SITUATION_ALLIANCE)) + { + case 0: + player->CastSpell(creature, SPELL_RESIZER_HIT_ONE_Q56034_Q59941, true); + creature->DespawnOrUnsummon(2s); + break; + case 1: + player->CastSpell(creature, SPELL_RESIZER_HIT_TWO_Q56034_Q59941, true); + creature->DespawnOrUnsummon(); + break; + case 2: + player->CastSpell(creature, SPELL_RESIZER_HIT_THREE_Q56034, true); + player->CastSpell(player, SPELL_PING_LINDIE_Q56034_Q59941, true); + creature->DespawnOrUnsummon(); + break; + default: + break; + } + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_re_sizing_aura_q56034::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 305724 - Resizer Hit +// 305721 - Resizer Hit +class spell_resizer_hit_one_two_q56034_q59941 : public SpellScript +{ + void HandleLaunch(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + } + + void HandleEffect(SpellEffIndex effIndex) + { + Player* player = Object::ToPlayer(GetCaster()); + if (!player) + return; + + uint32 guardianID = player->GetTeam() == ALLIANCE ? NPC_LINDIE_SPRINGSTOCK_GUARDIAN : NPC_CORK_FIZZLEPOP_GUARDIAN; + + Creature* guardian = player->FindNearestCreatureWithOptions(10.0f, { .CreatureId = guardianID, .OwnerGuid = player->GetGUID() }); + if (!guardian) + return; + + Conversation* conversation = Conversation::CreateConversation(GetSpellInfo()->GetEffect(effIndex).MiscValue, player, *player, player->GetGUID(), nullptr, false); + if (!conversation) + return; + + conversation->AddActor(0, 0, player->GetGUID()); + conversation->AddActor(ACTOR_LINDIE_RESIZING_QUEST, 1, player->GetTeam() == ALLIANCE ? guardian->GetGUID() : ObjectGuid::Empty); + conversation->AddActor(ACTOR_CORK_RESIZING_QUEST, 2, player->GetTeam() == ALLIANCE ? ObjectGuid::Empty : guardian->GetGUID()); + conversation->Start(); + } + + void Register() override + { + OnEffectLaunchTarget += SpellEffectFn(spell_resizer_hit_one_two_q56034_q59941::HandleLaunch, EFFECT_3, SPELL_EFFECT_CREATE_PRIVATE_CONVERSATION); + OnEffectHitTarget += SpellEffectFn(spell_resizer_hit_one_two_q56034_q59941::HandleEffect, EFFECT_3, SPELL_EFFECT_CREATE_PRIVATE_CONVERSATION); + } +}; + +// 305742 - Resizer Hit +class spell_resizer_hit_three_q56034 : public SpellScript +{ + void HandleLaunch(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + } + + void HandleEffect(SpellEffIndex effIndex) + { + Player* player = Object::ToPlayer(GetCaster()); + if (!player) + return; + + uint32 guardianID = player->GetTeam() == ALLIANCE ? NPC_LINDIE_SPRINGSTOCK_GUARDIAN : NPC_CORK_FIZZLEPOP_GUARDIAN; + + Creature* guardian = player->FindNearestCreatureWithOptions(10.0f, { .CreatureId = guardianID, .OwnerGuid = player->GetGUID() }); + if (!guardian) + return; + + Conversation* conversation = Conversation::CreateConversation(GetSpellInfo()->GetEffect(effIndex).MiscValue, player, *player, player->GetGUID(), nullptr, false); + if (!conversation) + return; + + conversation->AddActor(0, 0, player->GetGUID()); + conversation->AddActor(ACTOR_LINDIE_RESIZING_QUEST, 1, player->GetTeam() == ALLIANCE ? guardian->GetGUID() : ObjectGuid::Empty); + conversation->AddActor(ACTOR_CORK_RESIZING_QUEST, 2, player->GetTeam() == ALLIANCE ? ObjectGuid::Empty : guardian->GetGUID()); + conversation->Start(); + } + + void Register() override + { + OnEffectLaunchTarget += SpellEffectFn(spell_resizer_hit_three_q56034::HandleLaunch, EFFECT_4, SPELL_EFFECT_CREATE_PRIVATE_CONVERSATION); + OnEffectHitTarget += SpellEffectFn(spell_resizer_hit_three_q56034::HandleEffect, EFFECT_4, SPELL_EFFECT_CREATE_PRIVATE_CONVERSATION); + } +}; + +// 325346 - Re-Sizing +class spell_re_sizing_q59941 : public SpellScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_RESIZING_Q59941, + SPELL_RE_SIZER_OVERCHARGED_Q56034, + SPELL_PING_LINDIE_Q56034_Q59941, + }); + } + + SpellCastResult CheckCast() + { + if (!GetExplTargetUnit()) + return SPELL_FAILED_BAD_TARGETS; + + Creature* target = GetExplTargetUnit()->ToCreature(); + if (!target) + return SPELL_FAILED_BAD_TARGETS; + + if (target->GetEntry() != NPC_WANDERING_BOAR) + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Player* player = Object::ToPlayer(GetCaster()); + Creature* creature = Object::ToCreature(GetHitUnit()); + if (!player || !creature) + return; + + switch (player->GetQuestObjectiveData(QUEST_RE_SIZING_THE_SITUATION_HORDE, QUEST_OBJECTIVE_RE_SIZING_THE_SITUATION_HORDE)) + { + case 0: + case 1: + player->CastSpell(creature, SPELL_RESIZING_Q59941, true); + break; + case 2: + player->CastSpell(creature, SPELL_RE_SIZER_OVERCHARGED_Q56034, true); + player->CastSpell(player, SPELL_PING_LINDIE_Q56034_Q59941, true); + creature->DespawnOrUnsummon(3s); + break; + default: + break; + } + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_re_sizing_q59941::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_re_sizing_q59941::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 325345 - Re-Sizing +class spell_re_sizing_aura_q59941 : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_RESIZER_HIT_ONE_Q56034_Q59941, + SPELL_RESIZER_HIT_TWO_Q56034_Q59941 + }); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Player* player = Object::ToPlayer(GetCaster()); + Creature* creature = Object::ToCreature(GetTarget()); + if (!player || !creature) + return; + + switch (player->GetQuestObjectiveData(QUEST_RE_SIZING_THE_SITUATION_HORDE, QUEST_OBJECTIVE_RE_SIZING_THE_SITUATION_HORDE)) + { + case 0: + player->CastSpell(creature, SPELL_RESIZER_HIT_ONE_Q56034_Q59941, true); + creature->DespawnOrUnsummon(2s); + break; + case 1: + player->CastSpell(creature, SPELL_RESIZER_HIT_TWO_Q56034_Q59941, true); + creature->DespawnOrUnsummon(); + break; + default: + break; + } + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_re_sizing_aura_q59941::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 56034 - Re-sizing the Situation "Alliance" +// 59941 - Re-sizing the Situation "Horde" +class quest_resizing_the_situation : public QuestScript +{ +public: + quest_resizing_the_situation(char const* script) : QuestScript(script) { } + + void HandleQuestStatusChange(Player* player, QuestStatus newStatus, uint32 SummonSpell) + { + switch (newStatus) + { + case QUEST_STATUS_INCOMPLETE: + player->CastSpell(player, SPELL_UPDATE_PHASE_SHIFT); + player->CastSpell(player, SummonSpell); + break; + case QUEST_STATUS_NONE: + player->RemoveAura(SummonSpell); + player->CastSpell(player, SPELL_UPDATE_PHASE_SHIFT); + break; + default: + break; + } + } +}; + +// 56034 - Re-sizing the Situation "Alliance" +class quest_resizing_the_situation_alliance : public quest_resizing_the_situation +{ +public: + quest_resizing_the_situation_alliance() : quest_resizing_the_situation("quest_resizing_the_situation_alliance") { } + + void OnQuestStatusChange(Player* player, Quest const* /*quest*/, QuestStatus /*oldStatus*/, QuestStatus newStatus) override + { + HandleQuestStatusChange(player, newStatus, SPELL_SUMMON_LINDIE_SPRINGSTOCK_GUARDIAN_Q56034); + } +}; + +// 59941 - Re-sizing the Situation "Horde" +class quest_resizing_the_situation_horde : public quest_resizing_the_situation +{ +public: + quest_resizing_the_situation_horde() : quest_resizing_the_situation("quest_resizing_the_situation_horde") { } + + void OnQuestStatusChange(Player* player, Quest const* /*quest*/, QuestStatus /*oldStatus*/, QuestStatus newStatus) override + { + HandleQuestStatusChange(player, newStatus, SPELL_SUMMON_CORK_FIZZLEPOP_GUARDIAN_Q59941); + } +}; + void AddSC_zone_exiles_reach() { // Ship @@ -5420,7 +6008,7 @@ void AddSC_zone_exiles_reach() RegisterCreatureAI(npc_ogre_overseer); RegisterAreaTriggerAI(at_briarpatch_to_plains); RegisterSpellScript(spell_quilboar_sleep_dnt); - // Plains + // Plains scouting quest new quest_scout_o_matic_5000(); new quest_choppy_booster_mk5(); new FactoryCreatureScript<CreatureAI, &LindieSpringstockSelector>("npc_lindie_springstock_plains"); @@ -5428,4 +6016,16 @@ void AddSC_zone_exiles_reach() RegisterCreatureAI(npc_scoutomatic_5000); new FactoryCreatureScript<CreatureAI, &ChoppyBoosterSelector>("npc_choppy_booster"); new FactoryCreatureScript<CreatureAI, &HordeCrewPlainsSelector>("npc_horde_crew_plains"); + // Plains Resizing the situation + new quest_resizing_the_situation_alliance(); + new quest_resizing_the_situation_horde(); + RegisterCreatureAI(npc_lindie_springstock_q56034); + RegisterCreatureAI(npc_cork_fizzlepop_q59941); + RegisterCreatureAI(npc_re_sized_boar_q56034); + RegisterSpellScript(spell_summon_guardian_q56034_q59941); + RegisterSpellAndAuraScriptPair(spell_re_sizing_q56034, spell_re_sizing_aura_q56034); + RegisterSpellScript(spell_resizer_hit_one_two_q56034_q59941); + RegisterSpellScript(spell_resizer_hit_three_q56034); + RegisterSpellScript(spell_re_sizing_q59941); + RegisterSpellScript(spell_re_sizing_aura_q59941); }; |