diff options
| -rw-r--r-- | sql/updates/world/3.3.5/2025_10_15_03_world.sql | 73 | ||||
| -rw-r--r-- | src/server/scripts/Kalimdor/zone_azshara.cpp | 387 |
2 files changed, 169 insertions, 291 deletions
diff --git a/sql/updates/world/3.3.5/2025_10_15_03_world.sql b/sql/updates/world/3.3.5/2025_10_15_03_world.sql new file mode 100644 index 00000000000..8046662d695 --- /dev/null +++ b/sql/updates/world/3.3.5/2025_10_15_03_world.sql @@ -0,0 +1,73 @@ +-- +SET @PATH=2300200; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, 3691.97, -3962.41, 35.9118, 3.67, 0, 1, 0, 100, 0), +(@PATH, 2, 3675.02, -3960.49, 35.9118, 3.67, 0, 1, 0, 100, 0), +(@PATH, 3, 3653.19, -3958.33, 33.9118, 3.59, 0, 1, 0, 100, 0), +(@PATH, 4, 3621.12, -3958.51, 29.9118, 3.48, 0, 1, 0, 100, 0), +(@PATH, 5, 3604.86, -3963, 29.9118, 3.48, 0, 1, 0, 100, 0), +(@PATH, 6, 3569.94, -3970.25, 29.9118, 3.44, 0, 1, 0, 100, 0), +(@PATH, 7, 3541.03, -3975.64, 29.9118, 3.41, 0, 1, 0, 100, 0), +(@PATH, 8, 3510.84, -3978.71, 29.9118, 3.41, 0, 1, 0, 100, 0), +(@PATH, 9, 3472.7, -3997.07, 29.9118, 3.35, 0, 1, 0, 100, 0), +(@PATH, 10, 3439.15, -4014.55, 29.9118, 3.29, 0, 1, 0, 100, 0), +(@PATH, 11, 3412.8, -4025.87, 29.9118, 3.25, 0, 1, 0, 100, 0), +(@PATH, 12, 3384.95, -4038.04, 29.9118, 3.24, 0, 1, 0, 100, 0), +(@PATH, 13, 3346.77, -4052.93, 29.9118, 3.22, 0, 1, 0, 100, 0), +(@PATH, 14, 3299.56, -4071.59, 29.9118, 3.20, 0, 1, 0, 100, 0), +(@PATH, 15, 3261.22, -4080.38, 30.9118, 3.19, 0, 1, 0, 100, 0), +(@PATH, 16, 3220.68, -4083.09, 31.9118, 3.18, 0, 1, 0, 100, 0), +(@PATH, 17, 3187.11, -4070.45, 33.9118, 3.16, 0, 1, 0, 100, 0), +(@PATH, 18, 3162.78, -4062.75, 33.9118, 3.15, 0, 1, 0, 100, 0), +(@PATH, 19, 3136.09, -4050.32, 33.9118, 3.07, 0, 1, 0, 100, 0), +(@PATH, 20, 3119.47, -4044.51, 36.0363, 3.07, 0, 1, 0, 100, 0), +(@PATH, 21, 3098.95, -4019.8, 33.9118, 3.07, 0, 1, 0, 100, 0), +(@PATH, 22, 3073.07, -4011.42, 33.9118, 3.07, 0, 1, 0, 100, 0), +(@PATH, 23, 3051.71, -3993.37, 33.9118, 3.02, 0, 1, 0, 100, 0), +(@PATH, 24, 3027.52, -3978.6, 33.9118, 3.00, 0, 1, 0, 100, 0), +(@PATH, 25, 3003.78, -3960.14, 33.9118, 2.98, 0, 1, 0, 100, 0), +(@PATH, 26, 2977.99, -3941.98, 31.9118, 2.96, 0, 1, 0, 100, 0), +(@PATH, 27, 2964.57, -3932.07, 30.9118, 2.96, 0, 1, 0, 100, 0), +(@PATH, 28, 2947.9, -3921.31, 29.9118, 2.96, 0, 1, 0, 100, 0), +(@PATH, 29, 2924.91, -3910.8, 29.9118, 2.94, 0, 1, 0, 100, 0), +(@PATH, 30, 2903.04, -3896.42, 29.9118, 2.93, 0, 1, 0, 100, 0), +(@PATH, 31, 2884.75, -3874.03, 29.9118, 2.90, 0, 1, 0, 100, 0), +(@PATH, 32, 2868.19, -3851.48, 29.9118, 2.82, 0, 1, 0, 100, 0), +(@PATH, 33, 2854.62, -3819.72, 29.9118, 2.80, 0, 1, 0, 100, 0), +(@PATH, 34, 2825.53, -3790.4, 29.9118, 2.744, 0, 1, 0, 100, 0), +(@PATH, 35, 2804.31, -3773.05, 29.9118, 2.71, 0, 1, 0, 100, 0), +(@PATH, 36, 2769.78, -3763.57, 29.9118, 2.70, 0, 1, 0, 100, 0), +(@PATH, 37, 2727.23, -3745.92, 30.9118, 2.69, 0, 1, 0, 100, 0), +(@PATH, 38, 2680.12, -3737.49, 30.9118, 2.67, 0, 1, 0, 100, 0), +(@PATH, 39, 2647.62, -3739.94, 30.9118, 2.66, 0, 1, 0, 100, 0), +(@PATH, 40, 2616.6, -3745.75, 30.9118, 2.64, 0, 1, 0, 100, 0), +(@PATH, 41, 2589.38, -3731.97, 30.9118, 2.61, 0, 1, 0, 100, 0), +(@PATH, 42, 2562.94, -3722.35, 31.9118, 2.56, 0, 1, 0, 100, 0), +(@PATH, 43, 2521.05, -3716.6, 31.9118, 2.55, 0, 1, 0, 100, 0), +(@PATH, 44, 2485.26, -3706.67, 31.9118, 2.51, 0, 1, 0, 100, 0), +(@PATH, 45, 2458.93, -3696.67, 31.9118, 2.51, 0, 1, 0, 100, 0), +(@PATH, 46, 2432, -3692.03, 31.9118, 2.46, 0, 1, 0, 100, 0), +(@PATH, 47, 2399.59, -3681.97, 31.9118, 2.45, 0, 1, 0, 100, 0), +(@PATH, 48, 2357.75, -3666.6, 31.9118, 2.44, 0, 1, 0, 100, 0), +(@PATH, 49, 2311.99, -3656.88, 31.9118, 2.94, 0, 1, 0, 100, 0), +(@PATH, 50, 2263.41, -3649.55, 31.9118, 3.02, 0, 1, 0, 100, 0), +(@PATH, 51, 2209.05, -3641.76, 31.9118, 2.99, 0, 1, 0, 100, 0), +(@PATH, 52, 2164.83, -3637.64, 31.9118, 3.15, 0, 1, 0, 100, 0), +(@PATH, 53, 2122.42, -3639, 31.9118, 3.21, 0, 1, 0, 100, 0), +(@PATH, 54, 2075.73, -3643.59, 31.9118, 3.22, 0, 1, 0, 100, 0), +(@PATH, 55, 2033.59, -3649.52, 31.9118, 3.42, 0, 1, 0, 100, 0), +(@PATH, 56, 1985.22, -3662.99, 31.9118, 3.42, 0, 1, 0, 100, 0), +(@PATH, 57, 1927.09, -3679.56, 33.9118, 3.42, 0, 1, 0, 100, 0), +(@PATH, 58, 1873.57, -3695.32, 33.9118, 3.44, 0, 1, 0, 100, 0); + +DELETE FROM `gossip_menu` WHERE `MenuID` =57025; +INSERT INTO `gossip_menu` (`MenuID`, `TextID`, `VerifiedBuild`) VALUES +(57025, 1, 0); + +DELETE FROM `creature_template_movement` WHERE `CreatureId` IN(23002,23025); +INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES +(23002, 1, 1, 0, 0, 0, 0, 0), +(23025, 1, 1, 0, 0, 0, 0, 0); + +UPDATE `creature_template` SET `unit_flags` = 32768 WHERE `entry` IN(23002,23025); diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index 41497207d6e..8d00863ac70 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -18,6 +18,7 @@ #include "ScriptMgr.h" #include "ObjectAccessor.h" #include "MotionMaster.h" +#include "PassiveAI.h" #include "Player.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" @@ -44,342 +45,146 @@ enum RizzleSprysprocketData SAY_RIZZLE_GRENADE = 1, SAY_RIZZLE_FINAL = 2, MSG_ESCAPE_NOTICE = 3, + GOSSIP_MENU_GET_MOONSTONE = 57025, - GOSSIP_OPTION_GET_MOONSTONE = 0 -}; + GOSSIP_OPTION_GET_MOONSTONE = 0, -Position const WPs[58] = -{ - {3691.97f, -3962.41f, 35.9118f, 3.67f}, - {3675.02f, -3960.49f, 35.9118f, 3.67f}, - {3653.19f, -3958.33f, 33.9118f, 3.59f}, - {3621.12f, -3958.51f, 29.9118f, 3.48f}, - {3604.86f, -3963, 29.9118f, 3.48f}, - {3569.94f, -3970.25f, 29.9118f, 3.44f}, - {3541.03f, -3975.64f, 29.9118f, 3.41f}, - {3510.84f, -3978.71f, 29.9118f, 3.41f}, - {3472.7f, -3997.07f, 29.9118f, 3.35f}, - {3439.15f, -4014.55f, 29.9118f, 3.29f}, - {3412.8f, -4025.87f, 29.9118f, 3.25f}, - {3384.95f, -4038.04f, 29.9118f, 3.24f}, - {3346.77f, -4052.93f, 29.9118f, 3.22f}, - {3299.56f, -4071.59f, 29.9118f, 3.20f}, - {3261.22f, -4080.38f, 30.9118f, 3.19f}, - {3220.68f, -4083.09f, 31.9118f, 3.18f}, - {3187.11f, -4070.45f, 33.9118f, 3.16f}, - {3162.78f, -4062.75f, 33.9118f, 3.15f}, - {3136.09f, -4050.32f, 33.9118f, 3.07f}, - {3119.47f, -4044.51f, 36.0363f, 3.07f}, - {3098.95f, -4019.8f, 33.9118f, 3.07f}, - {3073.07f, -4011.42f, 33.9118f, 3.07f}, - {3051.71f, -3993.37f, 33.9118f, 3.02f}, - {3027.52f, -3978.6f, 33.9118f, 3.00f}, - {3003.78f, -3960.14f, 33.9118f, 2.98f}, - {2977.99f, -3941.98f, 31.9118f, 2.96f}, - {2964.57f, -3932.07f, 30.9118f, 2.96f}, - {2947.9f, -3921.31f, 29.9118f, 2.96f}, - {2924.91f, -3910.8f, 29.9118f, 2.94f}, - {2903.04f, -3896.42f, 29.9118f, 2.93f}, - {2884.75f, -3874.03f, 29.9118f, 2.90f}, - {2868.19f, -3851.48f, 29.9118f, 2.82f}, - {2854.62f, -3819.72f, 29.9118f, 2.80f}, - {2825.53f, -3790.4f, 29.9118f, 2.744f}, - {2804.31f, -3773.05f, 29.9118f, 2.71f}, - {2769.78f, -3763.57f, 29.9118f, 2.70f}, - {2727.23f, -3745.92f, 30.9118f, 2.69f}, - {2680.12f, -3737.49f, 30.9118f, 2.67f}, - {2647.62f, -3739.94f, 30.9118f, 2.66f}, - {2616.6f, -3745.75f, 30.9118f, 2.64f}, - {2589.38f, -3731.97f, 30.9118f, 2.61f}, - {2562.94f, -3722.35f, 31.9118f, 2.56f}, - {2521.05f, -3716.6f, 31.9118f, 2.55f}, - {2485.26f, -3706.67f, 31.9118f, 2.51f}, - {2458.93f, -3696.67f, 31.9118f, 2.51f}, - {2432, -3692.03f, 31.9118f, 2.46f}, - {2399.59f, -3681.97f, 31.9118f, 2.45f}, - {2357.75f, -3666.6f, 31.9118f, 2.44f}, - {2311.99f, -3656.88f, 31.9118f, 2.94f}, - {2263.41f, -3649.55f, 31.9118f, 3.02f}, - {2209.05f, -3641.76f, 31.9118f, 2.99f}, - {2164.83f, -3637.64f, 31.9118f, 3.15f}, - {2122.42f, -3639, 31.9118f, 3.21f}, - {2075.73f, -3643.59f, 31.9118f, 3.22f}, - {2033.59f, -3649.52f, 31.9118f, 3.42f}, - {1985.22f, -3662.99f, 31.9118f, 3.42f}, - {1927.09f, -3679.56f, 33.9118f, 3.42f}, - {1873.57f, -3695.32f, 33.9118f, 3.44f} + PATH_RIZZLE = 2300200 }; -class npc_rizzle_sprysprocket : public CreatureScript +struct npc_rizzle_sprysprocket : public ScriptedAI { -public: - npc_rizzle_sprysprocket() : CreatureScript("npc_rizzle_sprysprocket") { } + npc_rizzle_sprysprocket(Creature* creature) : ScriptedAI(creature) { } - struct npc_rizzle_sprysprocketAI : public ScriptedAI + void Reset() override { - npc_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - SpellEscapeTimer = 1300; - TeleportTimer = 3500; - CheckTimer = 10000; - GrenadeTimer = 30000; - MustDieTimer = 3000; - CurrWP = 0; - - PlayerGUID.Clear(); - - MustDie = false; - Escape = false; - ContinueWP = false; - Reached = false; - } - - void Reset() override - { - Initialize(); - } - - void JustEngagedWith(Unit* /*who*/) override { } + _playerGUID.Clear(); + me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP); + } - void AttackStart(Unit* who) override + void IsSummonedBy(WorldObject* summoner) override + { + if (Player* player = summoner->ToPlayer()) { - if (!who || !PlayerGUID.IsEmpty()) - return; - - Player* player = who->ToPlayer(); - - if (player && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) + _playerGUID = player->GetGUID(); + Talk(SAY_RIZZLE_START); + DoCast(player, SPELL_RIZZLE_BLACKJACK, true); + _scheduler.Schedule(1s, [this](TaskContext teleportContext) { - PlayerGUID = who->GetGUID(); - Talk(SAY_RIZZLE_START); - DoCast(who, SPELL_RIZZLE_BLACKJACK, false); - return; - } + if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID)) + Talk(MSG_ESCAPE_NOTICE, player); + DoCastSelf(SPELL_RIZZLE_ESCAPE); + teleportContext.Schedule(1ms, [this](TaskContext/* startPathContext*/) + { + me->SetSpeedRate(MOVE_SWIM, 0.85f); + DoCastSelf(SPELL_PERIODIC_DEPTH_CHARGE, true); + me->GetMotionMaster()->MovePath(PATH_RIZZLE, false); + }); + }); } + } - bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override - { - CloseGossipMenuFor(player); - me->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); - MustDieTimer = 3000; - MustDie = true; - return false; - } + void WaypointStarted(uint32 waypointId, uint32 pathId) override + { + if (pathId != PATH_RIZZLE || waypointId != 1) + return; - void MovementInform(uint32 type, uint32 id) override + _scheduler.Schedule(1s, [this](TaskContext checkDistanceContext) { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 57) + Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID); + if (!player) { me->DespawnOrUnsummon(); return; } - - ++CurrWP; - ContinueWP = true; - } - - void UpdateAI(uint32 diff) override - { - if (MustDie) - { - if (MustDieTimer <= diff) - { - me->DespawnOrUnsummon(); - return; - } - else - MustDieTimer -= diff; - } - - if (!Escape) - { - if (!PlayerGUID) - return; - - if (SpellEscapeTimer <= diff) - { - DoCast(me, SPELL_RIZZLE_ESCAPE, false); - SpellEscapeTimer = 10000; - } - else - SpellEscapeTimer -= diff; - - if (TeleportTimer <= diff) - { - // temp solution - unit can't be teleported by core using spelleffect 5, only players - DoTeleportTo(3706.39f, -3969.15f, 35.9118f); - - //begin swimming and summon depth charges - Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID); - if (!player) - return; - - Talk(MSG_ESCAPE_NOTICE, player); - DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE); - me->SetHover(true); - me->SetSwim(true); - me->SetSpeedRate(MOVE_RUN, 0.85f); - me->GetMotionMaster()->Clear(MOTION_PRIORITY_NORMAL); - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); - Escape = true; - } - else - TeleportTimer -= diff; - - return; - } - - if (ContinueWP) + if (me->IsWithinDist(player, 5.0f)) { - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); - ContinueWP = false; + checkDistanceContext.CancelAll(); + Talk(SAY_RIZZLE_FINAL); + me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); + me->GetMotionMaster()->MoveIdle(); + me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); } - - if (GrenadeTimer <= diff) + else + checkDistanceContext.Repeat(1s); + }).Schedule(20s, [this](TaskContext granadeContext) + { + if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID)) { - if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) - { - Talk(SAY_RIZZLE_GRENADE, player); - DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); - } - GrenadeTimer = 30000; + Talk(SAY_RIZZLE_GRENADE, player); + DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); } - else - GrenadeTimer -= diff; + granadeContext.Repeat(20s, 30s); + }); + } - if (CheckTimer <= diff) - { - Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID); - if (!player) - { - me->DespawnOrUnsummon(); - return; - } + void WaypointPathEnded(uint32/* waypointId*/, uint32 pathId) override + { + if (pathId != PATH_RIZZLE) + return; - if (me->IsWithinDist(player, 10) && me->GetPositionX() > player->GetPositionX() && !Reached) - { - Talk(SAY_RIZZLE_FINAL); - me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); - me->SetFaction(FACTION_FRIENDLY); - me->GetMotionMaster()->MoveIdle(); - me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); - Reached = true; - } + me->DespawnOrUnsummon(); + } - CheckTimer = 1000; - } - else - CheckTimer -= diff; - } + void UpdateAI(uint32 diff) override + { + _scheduler.Update(diff); + } - bool OnGossipHello(Player* player) override - { - InitGossipMenuFor(player, GOSSIP_MENU_GET_MOONSTONE); - if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE) - return true; - AddGossipItemFor(player, GOSSIP_MENU_GET_MOONSTONE, GOSSIP_OPTION_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - SendGossipMenuFor(player, 10811, me->GetGUID()); - return true; - } + bool OnGossipHello(Player* player) override + { + if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE) + return false; - private: - ObjectGuid PlayerGUID; - uint32 SpellEscapeTimer; - uint32 TeleportTimer; - uint32 CheckTimer; - uint32 GrenadeTimer; - uint32 MustDieTimer; - uint32 CurrWP; - bool MustDie; - bool Escape; - bool ContinueWP; - bool Reached; - }; + InitGossipMenuFor(player, GOSSIP_MENU_GET_MOONSTONE); + AddGossipItemFor(player, GOSSIP_MENU_GET_MOONSTONE, GOSSIP_OPTION_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + SendGossipMenuFor(player, player->GetGossipTextId(GOSSIP_MENU_GET_MOONSTONE, me), me->GetGUID()); + return true; + } - CreatureAI* GetAI(Creature* creature) const override + bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { - return new npc_rizzle_sprysprocketAI(creature); + CloseGossipMenuFor(player); + if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) + DoCast(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); + me->DespawnOrUnsummon(3s); + return true; } + +private: + ObjectGuid _playerGUID; + TaskScheduler _scheduler; }; /*#### # npc_depth_charge ####*/ -class npc_depth_charge : public CreatureScript + +struct npc_depth_charge : public NullCreatureAI { -public: - npc_depth_charge() : CreatureScript("npc_depth_charge") { } + npc_depth_charge(Creature * creature) : NullCreatureAI(creature) { } - struct npc_depth_chargeAI : public ScriptedAI + void Reset() override { - npc_depth_chargeAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - WeMustDie = false; - WeMustDieTimer = 1000; - } - - bool WeMustDie; - uint32 WeMustDieTimer; - - void Reset() override - { - me->SetHover(true); - me->SetSwim(true); - me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE); - Initialize(); - } - - void JustEngagedWith(Unit* /*who*/) override { } - - void AttackStart(Unit* /*who*/) override { } - - void MoveInLineOfSight(Unit* who) override - { - if (!who) - return; + me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE); + me->SetFacingTo(me->GetOrientation() + float(M_PI)); + } - if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5)) - { - DoCast(who, SPELL_DEPTH_CHARGE_TRAP); - WeMustDie = true; - return; - } - } + void MoveInLineOfSight(Unit* who) override + { + if (!who) + return; - void UpdateAI(uint32 diff) override + if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5.f)) { - if (WeMustDie) - { - if (WeMustDieTimer <= diff) - me->DespawnOrUnsummon(); - else - WeMustDieTimer -= diff; - } - return; + DoCast(who, SPELL_DEPTH_CHARGE_TRAP); + me->DespawnOrUnsummon(1s); } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_depth_chargeAI(creature); } }; void AddSC_azshara() { - new npc_rizzle_sprysprocket(); - new npc_depth_charge(); + RegisterCreatureAI(npc_rizzle_sprysprocket); + RegisterCreatureAI(npc_depth_charge); } |
