From 58b1d214683023dd6379cd4a372eeb1437e38091 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 28 Jul 2018 12:37:14 +0200 Subject: [PATCH] Scripts/BoT: fixed respawn mechanics for Halfus Wyrmbreaker and Ascendant Council that has been broken due to dynamic spawn --- .../custom/custom_2018_07_28_00_world.sql | 47 +++++++++++++++++++ .../BastionOfTwilight/bastion_of_twilight.h | 8 ++++ .../boss_ascendant_council.cpp | 23 +++++---- .../instance_bastion_of_twilight.cpp | 22 ++++----- 4 files changed, 78 insertions(+), 22 deletions(-) create mode 100644 sql/updates/world/custom/custom_2018_07_28_00_world.sql diff --git a/sql/updates/world/custom/custom_2018_07_28_00_world.sql b/sql/updates/world/custom/custom_2018_07_28_00_world.sql new file mode 100644 index 0000000000..f23c2fa4b2 --- /dev/null +++ b/sql/updates/world/custom/custom_2018_07_28_00_world.sql @@ -0,0 +1,47 @@ +DELETE FROM `spawn_group_template` WHERE `groupId` IN (52, 53); +INSERT INTO `spawn_group_template` (`groupId`, `groupName`, `groupFlags`) VALUES +(52, 'Bastion of Twilight - Halfus Wyrmbreaker', 4), +(53, 'Bastion of Twilight - Ascendant Council', 4); + +DELETE FROM `spawn_group` WHERE `groupId` IN (52, 53); +INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) VALUES +-- Halfus Wyrmbreaker +(52, 0, 253860), +(52, 0, 253877), +(52, 0, 253862), +(52, 0, 253880), +(52, 0, 253850), +(52, 0, 253851), +(52, 0, 253852), +(52, 0, 253853), +(52, 0, 253854), +(52, 0, 253855), +(52, 0, 253856), +(52, 0, 253857), +(52, 0, 253858), +(52, 0, 253859), +(52, 0, 253875), +(52, 0, 253879), +(52, 0, 253882), +(52, 0, 253883), +(52, 0, 253884), +(52, 0, 253885), +(52, 0, 253886), +(52, 0, 253887), +(52, 0, 253888), +(52, 0, 253889), +(52, 0, 253890), +(52, 0, 253891), +(52, 0, 253870), +(52, 1, 211098), +(52, 1, 211085), +-- Ascendant Council +(53, 0, 254144), +(53, 0, 254133), +(53, 0, 254134), +(53, 0, 254148); + +DELETE FROM `instance_spawn_groups` WHERE `spawnGroupId` IN (52, 53); +INSERT INTO `instance_spawn_groups` (`instanceMapId`, `bossStateId`, `bossStates`, `spawnGroupId`, `flags`) VALUES +(671, 0, 23, 52, 1), +(671, 2, 23, 53, 1); diff --git a/src/server/scripts/EasternKingdoms/BastionOfTwilight/bastion_of_twilight.h b/src/server/scripts/EasternKingdoms/BastionOfTwilight/bastion_of_twilight.h index c94720f899..b8d58d588c 100644 --- a/src/server/scripts/EasternKingdoms/BastionOfTwilight/bastion_of_twilight.h +++ b/src/server/scripts/EasternKingdoms/BastionOfTwilight/bastion_of_twilight.h @@ -69,6 +69,9 @@ enum BoTDataTypes DATA_COLLAPSING_TWILIGHT_PORTAL_COUNT, DATA_VALIONA_AURA_DUMMY, + /*Ascendant Council*/ + DATA_RESPAWN_ASCENDANT_COUNCIL, + /*Cho'Gall*/ DATA_FULL_HEROIC_ID }; @@ -196,6 +199,11 @@ enum BoTSpells SPELL_DANCING_FLAMES_VISUAL = 83962 }; +enum BoTSpawnGroups +{ + SPAWN_GROUP_ASCENDANT_COUNCIL = 53 +}; + template AI* GetBastionOfTwilightAI(Creature* creature) { diff --git a/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_ascendant_council.cpp b/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_ascendant_council.cpp index 969248f319..bea62940c6 100644 --- a/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_ascendant_council.cpp +++ b/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_ascendant_council.cpp @@ -23,6 +23,7 @@ #include "SpellAuraEffects.h" #include "SpellMgr.h" #include "Player.h" +#include "DataStores\DBCStores.h" #include "bastion_of_twilight.h" enum Texts @@ -285,6 +286,11 @@ enum AchievementData DATA_ELEMENTARY = 1 }; +enum SummonProperties +{ + PROPERTY_DEFAULT = 64 +}; + Position const arionMiddlePosition = { -1007.961f, -582.0203f, 831.9003f }; Position const terrastraMiddlePosition = { -1009.37f, -583.4302f, 831.901f }; Position const feludiusMiddlePosition = { -1007.965f, -583.4254f, 831.901f }; @@ -301,9 +307,8 @@ class boss_ascendant_council_controller : public CreatureScript void Reset() override { - if (instance->GetBossState(DATA_ASCENDANT_COUNCIL) != DONE) - instance->SetData(DATA_ASCENDANT_COUNCIL, NOT_STARTED); - + _Reset(); + instance->SetData(DATA_RESPAWN_ASCENDANT_COUNCIL, IN_PROGRESS); events.SetPhase(PHASE_FELUDIUS_IGNACIOUS); } @@ -441,6 +446,7 @@ class boss_ascendant_council_controller : public CreatureScript { case EVENT_RESET_BOSS_STATE: instance->SetBossState(DATA_ASCENDANT_COUNCIL, NOT_STARTED); + instance->SetData(DATA_RESPAWN_ASCENDANT_COUNCIL, IN_PROGRESS); break; case EVENT_SUMMON_ELEMENTIUM_MONSTROSITY: if (Creature* feludius = instance->GetCreature(DATA_FELUDIUS)) @@ -455,7 +461,8 @@ class boss_ascendant_council_controller : public CreatureScript if (Creature* terrastra = instance->GetCreature(DATA_TERRASTRA)) instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, terrastra); - me->GetMap()->SummonCreature(BOSS_ELEMENTIUM_MONSTROSITY, me->GetPosition()); + if (SummonPropertiesEntry const* entry = sSummonPropertiesStore.LookupEntry(PROPERTY_DEFAULT)) + me->GetMap()->SummonCreature(BOSS_ELEMENTIUM_MONSTROSITY, me->GetPosition(), entry, 0, me); break; default: break; @@ -520,7 +527,7 @@ class npc_feludius : public CreatureScript { _EnterEvadeMode(); _summons.DespawnAll(); - me->DespawnOrUnsummon(0, Seconds(30)); + me->DespawnOrUnsummon(); } } @@ -711,7 +718,7 @@ class npc_ignacious : public CreatureScript { _EnterEvadeMode(); _summons.DespawnAll(); - me->DespawnOrUnsummon(0, Seconds(30)); + me->DespawnOrUnsummon(); } void KilledUnit(Unit* who) override @@ -933,7 +940,7 @@ class npc_arion : public CreatureScript { _EnterEvadeMode(); _summons.DespawnAll(); - me->DespawnOrUnsummon(0, Seconds(30)); + me->DespawnOrUnsummon(); } void KilledUnit(Unit* who) override @@ -1125,7 +1132,7 @@ class npc_terrastra : public CreatureScript { _EnterEvadeMode(); _summons.DespawnAll(); - me->DespawnOrUnsummon(0, Seconds(30)); + me->DespawnOrUnsummon(); } void KilledUnit(Unit* who) override diff --git a/src/server/scripts/EasternKingdoms/BastionOfTwilight/instance_bastion_of_twilight.cpp b/src/server/scripts/EasternKingdoms/BastionOfTwilight/instance_bastion_of_twilight.cpp index 07c32123c9..d25cad94c2 100644 --- a/src/server/scripts/EasternKingdoms/BastionOfTwilight/instance_bastion_of_twilight.cpp +++ b/src/server/scripts/EasternKingdoms/BastionOfTwilight/instance_bastion_of_twilight.cpp @@ -237,23 +237,12 @@ class instance_bastion_of_twilight : public InstanceMapScript for (ObjectGuid guid : _halfusEncounterGUIDs) if (Creature* creature = instance->GetCreature(guid)) - { - if (creature->GetEntry() != NPC_ORPHANED_EMERALD_WELP) - { - creature->SendSetPlayHoverAnim(false); - creature->SetDisableGravity(false); - creature->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); - } - creature->DespawnOrUnsummon(Milliseconds(0), Seconds(30)); - } if (GameObject* cage = GetGameObject(DATA_WHELP_CAGE)) - { - cage->ResetDoorOrButton(); - cage->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - } + cage->DespawnOrUnsummon(Milliseconds(0), Seconds(30)); + _halfusEncounterGUIDs.clear(); _deadOrphanedEmeraldWhelps = 0; events.CancelEvent(EVENT_CAST_DANCING_FLAMES); } @@ -267,7 +256,7 @@ class instance_bastion_of_twilight : public InstanceMapScript creature->DespawnOrUnsummon(Milliseconds(0)); if (GameObject* cage = GetGameObject(DATA_WHELP_CAGE)) - cage->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + cage->DespawnOrUnsummon(Milliseconds(0)); events.CancelEvent(EVENT_CAST_DANCING_FLAMES); } @@ -424,6 +413,11 @@ class instance_bastion_of_twilight : public InstanceMapScript SaveToDB(); } break; + case DATA_RESPAWN_ASCENDANT_COUNCIL: + if (!GetCreature(DATA_FELUDIUS)) + if (instance->IsSpawnGroupActive(SPAWN_GROUP_ASCENDANT_COUNCIL)) + instance->SpawnGroupSpawn(SPAWN_GROUP_ASCENDANT_COUNCIL, true, true); + break; default: break; }