From 8e697633b820ec8bd50c8a1763f8c46bd7d9c146 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 29 Mar 2023 01:16:37 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/IcecrownCitadel):=20Fix=20Nerubar?= =?UTF-8?q?=20Broodkeeper=20flickering=20anim=E2=80=A6=20(#15642)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/IcecrownCitadel): Fix Nerubar Broodkeeper flickering animation partial cherry-pick of https://github.com/TrinityCore/TrinityCore/commit/f8db738e8da008ccb48f79f5dd10ebbd81750f5f Co-Authored-By: Ovahlord <18347559+Ovahlord@users.noreply.github.com> Co-Authored-By: Houston <69751143+HoustonCore@users.noreply.github.com> Co-Authored-By: Lucas Nascimento * Update icecrown_citadel.cpp * fix the spiders before sindragosa as well * Update icecrown_citadel.cpp --------- Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com> Co-authored-by: Houston <69751143+HoustonCore@users.noreply.github.com> Co-authored-by: Lucas Nascimento --- .../rev_1680057777548192700.sql | 6 +++++ .../IcecrownCitadel/icecrown_citadel.cpp | 22 ++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1680057777548192700.sql diff --git a/data/sql/updates/pending_db_world/rev_1680057777548192700.sql b/data/sql/updates/pending_db_world/rev_1680057777548192700.sql new file mode 100644 index 000000000..f6854f75c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1680057777548192700.sql @@ -0,0 +1,6 @@ +-- +UPDATE `creature_template` SET `flags_extra`=512 WHERE `entry` IN (36725,38058); +UPDATE `creature_template_addon` SET `bytes1`=0 WHERE `entry` IN (36725,38058); +UPDATE `creature_template_movement` SET `Flight`=0, `Ground`=1 WHERE `CreatureId` IN (36725,38058); +UPDATE `creature_template` SET `flags_extra` = `flags_extra` | 512 WHERE `entry` IN (37501, 37502, 38197, 38198); +UPDATE `smart_scripts` SET `event_param1` = 16 WHERE `entryorguid` IN (37501, 37502) AND `source_type` = 0 AND `event_type` = 34; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index b9110e2e3..0029019b2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -3347,13 +3347,19 @@ public: EventMap events; bool _didWebBeam; + void InitializeAI() override + { + me->SetDisableGravity(true); + me->SetImmuneToAll(true); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_03); + } + void Reset() override { events.Reset(); events.ScheduleEvent(1, 3s, 10s); // Crypt Scarabs events.ScheduleEvent(2, 15s, 25s); // Dark Mending events.ScheduleEvent(3, 8s, 15s); // Web Wrap - me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); } void MoveInLineOfSight(Unit* who) override @@ -3364,9 +3370,10 @@ public: float nx = me->GetPositionX(); float ny = me->GetPositionY(); float nz = me->GetFloorZ(); + DoCastSelf(SPELL_WEB_BEAM); me->SetHomePosition(nx, ny, nz, me->GetOrientation()); - me->CastSpell(me, SPELL_WEB_BEAM, false); - me->GetMotionMaster()->MovePoint(1, nx, ny, nz, false); + me->GetMotionMaster()->MoveLand(1, nx, ny, nz, false); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); return; } @@ -3386,20 +3393,19 @@ public: if (me->IsLevitating()) { me->SetDisableGravity(false); + me->SetImmuneToAll(false); me->NearTeleportTo(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); } } - void MovementInform(uint32 type, uint32 id) override + void MovementInform(uint32 /*type*/, uint32 id) override { - if (type == POINT_MOTION_TYPE && id == 1) + if (id == 1) { if (me->IsLevitating()) { me->SetDisableGravity(false); me->SetOrientation(0.0f); - me->NearTeleportTo(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->ClearUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); } } } @@ -3516,7 +3522,7 @@ public: if (spider->GetPositionZ() > 220.0f) { spider->CastSpell(spider, SPELL_WEB_BEAM2, false); - spider->GetMotionMaster()->MovePoint(POINT_ENTER_COMBAT, spider->GetPositionX(), spider->GetPositionY(), 213.03f, false); + spider->GetMotionMaster()->MoveLand(POINT_ENTER_COMBAT, spider->GetPositionX(), spider->GetPositionY(), 213.03f, false); } }