From 67e695468101e497e359d44449275b87bbe31695 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Sun, 26 Jun 2022 04:47:29 -0300 Subject: [PATCH] fix(Scripts/ZulGurub): Priestess Jeklik intro (#12109) * fix(Core/ZulGurub): Priestess Jeklik intro * ? * sniffed values --- .../rev_1655630549319690700.sql | 9 ++++++ .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 32 ++++++++++++++----- 2 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1655630549319690700.sql diff --git a/data/sql/updates/pending_db_world/rev_1655630549319690700.sql b/data/sql/updates/pending_db_world/rev_1655630549319690700.sql new file mode 100644 index 000000000..b838dc712 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1655630549319690700.sql @@ -0,0 +1,9 @@ +-- +SET @ENTRY := 14517; +SET @PATH := @ENTRY*10; +UPDATE `creature_template_movement` SET `Flight` = 2 WHERE `CreatureId` = @ENTRY; + +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, -12291.88, -1380.0778, 144.90173, 2.286381244659423828, 0, 2, 0, 100, 0), +(@PATH, 2, -12273.857, -1407.774, 132.22281, 0, 0, 2, 0, 100, 0); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index ebb69ebee..5b35f0ba4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -97,6 +97,13 @@ Position const SpawnBat[6] = { -12293.6220f, -1380.2640f, 144.8304f, 5.483f } }; +enum Misc +{ + PATH_JEKLIK_INTRO = 145170 +}; + +Position const homePosition = { -12291.9f, -1380.08f, 144.902f, 2.28638f }; + struct boss_jeklik : public BossAI { boss_jeklik(Creature* creature) : BossAI(creature, DATA_JEKLIK) { } @@ -106,7 +113,9 @@ struct boss_jeklik : public BossAI DoCastSelf(SPELL_GREEN_CHANNELING); me->SetHover(false); me->SetDisableGravity(false); + me->SetReactState(REACT_PASSIVE); _Reset(); + SetCombatMovement(false); } void JustDied(Unit* /*killer*/) override @@ -117,22 +126,31 @@ struct boss_jeklik : public BossAI void EnterEvadeMode(EvadeReason why) override { - const Position homePos = me->GetHomePosition(); - me->NearTeleportTo(homePos.GetPositionX(), homePos.GetPositionY(), homePos.GetPositionZ(), homePos.GetOrientation()); + me->GetMotionMaster()->Clear(); + me->SetHomePosition(homePosition); + me->NearTeleportTo(homePosition.GetPositionX(), homePosition.GetPositionY(), homePosition.GetPositionZ(), homePosition.GetOrientation()); BossAI::EnterEvadeMode(why); } void EnterCombat(Unit* /*who*/) override { - _EnterCombat(); Talk(SAY_AGGRO); me->RemoveAurasDueToSpell(SPELL_GREEN_CHANNELING); me->SetHover(true); me->SetDisableGravity(true); - me->AddUnitState(UNIT_STATE_IGNORE_PATHFINDING); - DoCastSelf(SPELL_BAT_FORM); - events.SetPhase(PHASE_ONE); + DoCastSelf(SPELL_BAT_FORM, true); + me->GetMotionMaster()->MovePath(PATH_JEKLIK_INTRO, false); + } + + void PathEndReached(uint32 /*pathId*/) override + { + me->SetHover(false); + me->SetDisableGravity(false); + _EnterCombat(); + SetCombatMovement(true); + me->SetReactState(REACT_AGGRESSIVE); + events.SetPhase(PHASE_ONE); events.ScheduleEvent(EVENT_CHARGE_JEKLIK, urand(10000, 20000), PHASE_ONE); events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(5000, 15000), PHASE_ONE); events.ScheduleEvent(EVENT_BLOOD_LEECH, urand(5000, 15000), PHASE_ONE); @@ -146,8 +164,6 @@ struct boss_jeklik : public BossAI if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(50)) { me->RemoveAurasDueToSpell(SPELL_BAT_FORM); - me->SetHover(false); - me->SetDisableGravity(false); DoResetThreat(); events.SetPhase(PHASE_TWO); events.CancelEventGroup(PHASE_ONE);