From 67dd96e502e0b2b815e4e3ad4acdc275e663d3c0 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:36:18 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/IcecrownCitadel):=20Fix=20Sindragos?= =?UTF-8?q?a's=20icewall=20poping=20up=20prem=E2=80=A6=20(#15836)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/IcecrownCitadel): Fix Sindragosa's icewall poping up prematurely --- .../IcecrownCitadel/boss_sindragosa.cpp | 7 +++-- .../instance_icecrown_citadel.cpp | 29 ++++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index e65cb5391..968fcba47 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -282,6 +282,7 @@ public: _didFirstFlyPhase = false; _isBelow20Pct = false; _isThirdPhase = false; + _isLanding = false; _bombCount = 0; _mysticBuffetStack = 0; _Reset(); @@ -365,15 +366,16 @@ public: void DoAction(int32 action) override { - if (action == ACTION_START_FROSTWYRM) + if (action == ACTION_START_FROSTWYRM && !_isLanding) { + _isLanding = true; + if (TempSummon* summon = me->ToTempSummon()) summon->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN); if (me->isDead()) return; - instance->SetBossState(DATA_SINDRAGOSA, IN_PROGRESS); me->setActive(true); me->SetDisableGravity(true); me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); @@ -673,6 +675,7 @@ public: bool _isBelow20Pct; bool _isThirdPhase; bool _isInAirPhase; + bool _isLanding; }; CreatureAI* GetAI(Creature* creature) const override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 546fbb5f3..177d56cbb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -116,6 +116,11 @@ DoorData const doorData[] = {0, 0, DOOR_TYPE_ROOM } }; +ObjectData const creatureData[] = +{ + { NPC_SINDRAGOSA, DATA_SINDRAGOSA } +}; + // this doesnt have to only store questgivers, also can be used for related quest spawns struct WeeklyQuest { @@ -203,6 +208,7 @@ public: SetBossNumber(MAX_ENCOUNTERS); SetPersistentDataCount(MAX_DATA_INDEXES); LoadBossBoundaries(boundaries); + LoadObjectData(creatureData, nullptr); LoadDoorData(doorData); TeamIdInInstance = TEAM_NEUTRAL; HeroicAttempts = MaxHeroicAttempts; @@ -257,7 +263,7 @@ public: if (GetBossState(DATA_LADY_DEATHWHISPER) == DONE && GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) != DONE) SpawnGunship(); - if (GetBossState(DATA_SINDRAGOSA) != DONE && IsSindragosaIntroDone && SindragosaGUID.IsEmpty() && Events.GetTimeUntilEvent(EVENT_RESPAWN_SINDRAGOSA) == Milliseconds::max()) + if (GetBossState(DATA_SINDRAGOSA) != DONE && IsSindragosaIntroDone && !GetCreature(DATA_SINDRAGOSA) && Events.GetTimeUntilEvent(EVENT_RESPAWN_SINDRAGOSA) == Milliseconds::max()) { Events.ScheduleEvent(EVENT_RESPAWN_SINDRAGOSA, 30s); } @@ -518,12 +524,16 @@ public: default: break; } + + InstanceScript::OnCreatureCreate(creature); } void OnCreatureRemove(Creature* creature) override { if (creature->GetEntry() == NPC_SINDRAGOSA) SindragosaGUID.Clear(); + + InstanceScript::OnCreatureRemove(creature); } uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override @@ -1764,15 +1774,18 @@ public: SpawnGunship(); break; case EVENT_RESPAWN_SINDRAGOSA: - if (Creature* sindragosa = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) + if (!GetCreature(DATA_SINDRAGOSA)) { - sindragosa->setActive(true); - sindragosa->SetDisableGravity(true); - sindragosa->GetMotionMaster()->MovePath(NPC_SINDRAGOSA * 10, true); - - if (TempSummon* summon = sindragosa->ToTempSummon()) + if (Creature* sindragosa = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) { - summon->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN); + sindragosa->setActive(true); + sindragosa->SetDisableGravity(true); + sindragosa->GetMotionMaster()->MovePath(NPC_SINDRAGOSA * 10, true); + + if (TempSummon* summon = sindragosa->ToTempSummon()) + { + summon->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN); + } } } // Could happen more than once if more than one player enters before she respawns.