scenario_the_throughway

This commit is contained in:
luis
2026-03-03 23:13:24 -03:00
parent 39a6e8e626
commit 66c48685fa
3 changed files with 439 additions and 0 deletions
@@ -0,0 +1,332 @@
#include "CriteriaHandler.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "Scenario.h"
#include "scenario_the_throughway.h"
#include "Vehicle.h"
#include "TemporarySummon.h"
#include "Player.h"
#include "CombatAI.h"
#include "ConversationAI.h"
#include "Creature.h"
#include "CreatureGroups.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Scenario.h"
Position const wrathionpath[8] =
{
{ 131.60591f, -915.16144f, 839.13513f ,0 },
{ 131.17361f, -910.86804f, 841.0954f ,0 },
{ 130.4566f, -905.40625f, 842.89886f ,0 },
{ 129.34723f, -898.92706f, 844.72906f ,0 },
{ 128.0868f, -891.8559f, 846.507f ,0 },
{ 126.43924f, -884.5417f, 848.43097f ,0 },
{ 124.68229f, -876.9132f, 850.5709f ,0 },
{ 121.68924f, -864.9809f, 853.3789f ,0 },
};
class instance_scenario_the_throughway : public InstanceMapScript
{
public:
instance_scenario_the_throughway() : InstanceMapScript("instance_scenario_the_throughway", 2516) {}
struct instance_scenario_the_throughway_InstanceMapScript : public InstanceScript
{
instance_scenario_the_throughway_InstanceMapScript(InstanceMap* map) : InstanceScript(map)
{
}
void OnPlayerEnter(Player* player) override
{
// Prevent playing the scene multiple times per instance lifetime
if (!_firstIntroTriggered)
{
_firstIntroTriggered = true;
// Play intro cinematic / scene once when first player enters
player->GetSceneMgr().PlayScene(3175);
// Optional: broadcast to the whole group if it's a group scenario
// if (Group* group = player->GetGroup())
// for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
// if (Player* member = itr->GetSource())
// if (member->IsInWorld() && member->GetMap() == player->GetMap())
// member->GetSceneMgr().PlayScene(3175);
}
}
private:
bool _firstIntroTriggered = false;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
return new instance_scenario_the_throughway_InstanceMapScript(map);
}
};
//3175
class scene_intro_entrance_to_scenario : public SceneScript
{
public:
scene_intro_entrance_to_scenario() : SceneScript("scene_intro_entrance_to_scenario") { }
void StartIntroConvosabellian(Player* player)
{
player->CastSpell(player, SPELL_CONVERSATION_SABELLIAN_INTRO, true);
}
void OnSceneComplete(Player* player, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) override
{
StartIntroConvosabellian(player);
}
void OnSceneCancel(Player* player, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) override
{
StartIntroConvosabellian(player);
}
};
//21001
struct conversation_Sabellian_201411 : public ConversationAI
{
conversation_Sabellian_201411(Conversation* conversation) : ConversationAI(conversation) {}
void OnCreate(Unit* creator) override
{
if (Creature* Sabellian = creator->FindNearestCreature(201411, 50.0f, true))
conversation->AddActor(201411, 1, Sabellian->GetGUID());
}
};
//21000
struct conversation_Sabellian_and_Wrathion : public ConversationAI
{
conversation_Sabellian_and_Wrathion(Conversation* conversation) : ConversationAI(conversation) {}
void OnCreate(Unit* creator) override
{
if (Creature* wrathion = creator->FindNearestCreature(201412, 50.0f, true))
conversation->AddActor(201412, 1, wrathion->GetGUID());
if (Creature* Sabellian = creator->FindNearestCreature(201411, 50.0f, true))
conversation->AddActor(201411, 0, Sabellian->GetGUID());
}
};
//201411
struct npc_sabellian : public ScriptedAI
{
public:
npc_sabellian(Creature* creature) : ScriptedAI(creature) { Reset(); }
private:
bool SayHeroes;
void Reset() override
{
}
void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == 406669)
{
DoCastSelf(407131, true);
if (Creature* wrathion = me->FindNearestCreature(NPC_WARTHION_INTRO, 50.0f))
{
me->CastSpell(wrathion, 407131);
}
}
}
void UpdateAI(uint32 diff) override
{
_scheduler.Update(diff);
}
bool OnGossipSelect(Player* player, uint32 /*MenuID*/, uint32 gossipListId) override
{
if (gossipListId == 1) //Start Scenario Event
{
ClearGossipMenuFor(player);
_scheduler.Schedule(1s, [player, this](TaskContext /*context*/)
{
player->CastSpell(player, SPELL_CONVERSATION_DISCUSS_THE_PLAN);
me->CastSpell(player, SPELL_CAST_EARTH_WARDERS_PROTECTION);
});
_scheduler.Schedule(2s, [this](TaskContext /*context*/)
{
if (Creature* wrathion = me->FindNearestCreature(201412, 50.0f))
wrathion->AI()->DoAction(ACTION_START_WARTHION_MOVE);
});
_scheduler.Schedule(9s, [this, player](TaskContext /*context*/)
{
player->CastSpell(player, AURA_EARTH_WARDERS_PROTECTION);
});
_scheduler.Schedule(10s, [this](TaskContext /*context*/)
{
me->GetMotionMaster()->MovePoint(0, -13.923788f, 760.272888f, 93.151299f, true);
});
_scheduler.Schedule(21s, [this, player](TaskContext /*context*/)
{
if (Scenario* scenario = player->GetScenario())
{
if (scenario->GetStep() == sScenarioStepStore.LookupEntry(5418))
{
scenario->SetStepState(sScenarioStepStore.LookupEntry(5418), SCENARIO_STEP_IN_PROGRESS);
scenario->CompleteStep(sScenarioStepStore.LookupEntry(5418));
scenario->SetStep(sScenarioStepStore.LookupEntry(5464));
}
}
if (Creature* wrathion = me->FindNearestCreature(NPC_WARTHION_INTRO, 50.0f))
wrathion->AI()->DoAction(ACTION_IN_COMBAT);
if (Creature* monstrous = me->FindNearestCreature(NPC_MONSTROUS_MUD_INTRO, 150.0f))
monstrous->AI()->DoAction(ACTION_PREDATOR_PRESENCE);
});
_scheduler.Schedule(22s, [player](TaskContext /*context*/)
{
player->CastSpell(player, 406249); //Battle RP Starts, Boss Conversation
});
_scheduler.Schedule(23s, [this](TaskContext /*context*/)
{
me->CastSpell(me, 410723);
});
}
return true;
}
private:
TaskScheduler _scheduler;
};
//201412
struct npc_wrathion_201412 : public ScriptedAI
{
public:
npc_wrathion_201412(Creature* creature) : ScriptedAI(creature)
{
}
void Reset() override
{
}
void DoAction(int32 action) override
{
if (action == ACTION_START_WARTHION_MOVE)
{
me->SetWalk(true);
me->GetMotionMaster()->MovePoint(0, -7.203760f, 767.083252f, 95.777267f, true);
}
if (action == ACTION_IN_COMBAT)
{
me->SetEmoteState(EMOTE_STATE_READY1H);
}
if (action == ACTION_WARTHION_FLY)
{
me->SetWalk(false);
// me->GetMotionMaster()->MoveSmoothPath(0, wrathionpath, 2, false, true);
}
}
};
//202593
struct npc_monstrous_mud : public ScriptedAI
{
public:
npc_monstrous_mud(Creature* creature) : ScriptedAI(creature)
{
me->AddAura(412583, me); //(Predator Presence)
me->SetUnitFlag(UnitFlags(33088));
}
void Reset() override
{}
void DoAction(int32 action) override
{
if (action == ACTION_PREDATOR_PRESENCE)
{
me->CastSpell(me, 412416);
_scheduler.Schedule(1s, [this](TaskContext /*context*/)
{
if (Creature* Sabellian = me->FindNearestCreature(201411, 200.0f)) //Summitshaper Lorac
{
me->CastSpell(Sabellian, 406669);
}
});
_scheduler.Schedule(4s, [this](TaskContext /*context*/)
{
if (Creature* wrathion = me->FindNearestCreature(NPC_WARTHION_INTRO, 250.0f))
wrathion->AI()->DoAction(ACTION_WARTHION_FLY);
});
}
}
void UpdateAI(uint32 diff) override
{
_scheduler.Update(diff);
}
private:
TaskScheduler _scheduler;
};
//202591
struct npc_Summitshaper_Lorac : public ScriptedAI
{
public:
npc_Summitshaper_Lorac(Creature* creature) : ScriptedAI(creature)
{
}
void Reset() override
{}
void DoAction(int32 action) override
{
if (action == ACTION_START_EVENT_LORAC)
{
}
}
void UpdateAI(uint32 diff) override
{
_scheduler.Update(diff);
}
private:
TaskScheduler _scheduler;
};
void AddSC_instance_scenario_the_throughway()
{
new instance_scenario_the_throughway ();
//Conversation
RegisterConversationAI(conversation_Sabellian_201411);
RegisterConversationAI(conversation_Sabellian_and_Wrathion);
//scene
new scene_intro_entrance_to_scenario();
// Creatures
RegisterCreatureAI(npc_sabellian);
RegisterCreatureAI(npc_wrathion_201412);
RegisterCreatureAI(npc_monstrous_mud);
RegisterCreatureAI(npc_Summitshaper_Lorac);
}
@@ -0,0 +1,102 @@
enum StepScenario
{
STEP_1 = 5418,
STEP_2 = 5464,
//[2] PickedStep : 5420
//[3] PickedStep : 5542
};
enum ActionAndEvent
{
ACTION_START_WARTHION_MOVE = 1,
ACTION_IN_COMBAT = 2,
ACTION_PREDATOR_PRESENCE = 3,
ACTION_START_EVENT_LORAC = 4,
ACTION_WARTHION_FLY = 5,
};
enum SpellsScenario
{
SPELL_CAST_EARTH_WARDERS_PROTECTION = 410728,
AURA_EARTH_WARDERS_PROTECTION = 406600,
SPELL_CONVERSATION_DISCUSS_THE_PLAN = 404463,
SPELL_CONVERSATION_SABELLIAN_INTRO = 404410,
SPELL_WRATHION_INITIAL_TRANSFORM = 373400,
SPELL_SABELLIAN_INITIAL_TRANSFORM = 374008,
//(Cast) SpellID: 412583 (Predator Presence)
//(Cast) SpellID: 412418 (Throw Boulder)
//(Cast) SpellID: 412416 (Throw Boulder)
//(Cast) SpellID: 406669 (Throw Boulder) -- Este es el Spell que Castea el Mostruo a sabellian
// (Cast) SpellID: 407131 (Throw Boulder)
//[0] SpellID: 412582 (Predatory Fear)
//(Cast) SpellID: 404325 (S1 - Battle RP Starts, Companions Conversation)
//[0] SpellID: 412571 (Knockdown Stun)
//(Cast) SpellID: 373043 (Wrathion Transform)
//(Cast) SpellID: 372334 (Wrathion Transform)
//(Cast) SpellID: 373342 (Wrathion Transform)
//[0] SpellID: 373343 (Growth)
// (Cast)SpellID: 406706 (Strafe) Spell que castea de fuego Wrathion
//(Cast) SpellID: 406784 (Strafe)
//SpellID: 411850 ([DNT] Spell) Spell que mataa los npc cuando wrathio hecha fuego
// 201412 waypoint donde wrathion sale volando Flags: 2438990336 (Flying, Catmullrom, CanSwim, UncompressedPath, Unknown5, Steering, Unknown10)
//(MovementMonsterSpline)(MovementSpline)[0] Points: X: -40.37847 Y : 774.2118 Z : 83.34778
//(MovementMonsterSpline)(MovementSpline)[1] Points : X : -57.42882 Y : 802.4792 Z : 87.91718
//(MovementMonsterSpline)(MovementSpline)[2] Points : X : -86.31944 Y : 851.0764 Z : 77.22843
//(MovementMonsterSpline)(MovementSpline)[3] Points : X : -98.58854 Y : 882.2899 Z : 68.3041
};
enum CreaturesID
{
NPC_WARTHION_INTRO = 201412,
NPC_SABELLIAN_INTRO = 201411,
NPC_MONSTROUS_MUD_INTRO = 202593,
};
/*
Waypoint Moustro
[0] WayPoints: X: -64.50174 Y: 772.2908 Z: 79.13559
[1] WayPoints: X: -66.25174 Y: 774.5408 Z: 78.88559
[2] WayPoints: X: -66.50174 Y: 775.2908 Z: 78.88559
[3] WayPoints: X: -67.25174 Y: 777.0408 Z: 78.88559
[4] WayPoints: X: -67.50174 Y: 778.2908 Z: 79.63559
[5] WayPoints: X: -67.75174 Y: 778.7908 Z: 79.88559
[6] WayPoints: X: -67.50174 Y: 782.5408 Z: 78.88559
[7] WayPoints: X: -67.50174 Y: 783.5408 Z: 78.63559
[8] WayPoints: X: -68.00174 Y: 788.5408 Z: 78.38559
[9] WayPoints: X: -68.25174 Y: 790.5408 Z: 77.88559
[10] WayPoints: X: -68.50174 Y: 791.5408 Z: 77.63559
[11] WayPoints: X: -68.50174 Y: 792.0408 Z: 77.88559
[12] WayPoints: X: -68.50174 Y: 793.0408 Z: 77.63559
[13] WayPoints: X: -68.50174 Y: 794.7908 Z: 77.38559
[14] WayPoints: X: -68.50174 Y: 795.7908 Z: 76.63559
[15] WayPoints: X: -68.75174 Y: 796.7908 Z: 76.13559
[16] WayPoints: X: -69.00174 Y: 797.7908 Z: 75.88559
[17] WayPoints: X: -69.50174 Y: 799.7908 Z: 75.88559
[18] WayPoints: X: -69.50174 Y: 800.0408 Z: 76.38559
[19] WayPoints: X: -70.00174 Y: 802.0408 Z: 75.88559
[20] WayPoints: X: -70.00174 Y: 803.0408 Z: 75.63559
[21] WayPoints: X: -70.00174 Y: 804.0408 Z: 75.38559
[22] WayPoints: X: -69.50174 Y: 805.0408 Z: 75.13559
[23] WayPoints: X: -68.75174 Y: 805.7908 Z: 74.13559
[24] WayPoints: X: -68.50174 Y: 806.2908 Z: 74.13559
[25] WayPoints: X: -68.00174 Y: 807.0408 Z: 73.63559
[26] WayPoints: X: -67.50174 Y: 808.0408 Z: 73.88559
[27] WayPoints: X: -67.50174 Y: 808.2908 Z: 73.88559
[28] WayPoints: X: -68.00174 Y: 810.2908 Z: 73.63559
[29] WayPoints: X: -68.50174 Y: 812.5408 Z: 73.38559
[30] WayPoints: X: -68.50174 Y: 815.5408 Z: 73.13559
[31] WayPoints: X: -68.50174 Y: 816.7908 Z: 73.13559
*/
Position const wrathionmove[1] =
{
{-8.366320f, 755.195984f, 91.987503f, 0},
};
@@ -118,6 +118,9 @@ void AddSC_boss_sentinel_talondras();
void AddSC_boss_emberon();
void AddSC_boss_chrono_lord_deios_U();
//SCENARIOS
void AddSC_instance_scenario_the_throughway();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
void AddDragonIslesScripts()
@@ -224,4 +227,6 @@ void AddDragonIslesScripts()
AddSC_boss_emberon();
AddSC_boss_chrono_lord_deios_U();
//SCENARIOS
AddSC_instance_scenario_the_throughway();
}