diff --git a/doc/OptionalServerOptions.md b/doc/OptionalServerOptions.md index cfb06d3717..5d3919a610 100644 --- a/doc/OptionalServerOptions.md +++ b/doc/OptionalServerOptions.md @@ -9,6 +9,7 @@ Every option below is OFF in the shipped `worldserver.conf.dist`, which gives th | `Instance.IgnoreAttunement` | No attunement item or quest is needed to enter an instance (Molten Core, Onyxia, Blackwing Lair, Naxxramas and so on). Level limits are separate: `Instance.IgnoreLevel`. | 0 | | `Instance.AhnQirajGatesOpen` | The Gate of Ahn'Qiraj stands open, so the war effort and the Scarab Gong are not needed to reach Ruins and Temple of Ahn'Qiraj. | 0 | | `Instance.PersistRaidTrash` | Raid trash that was killed stays dead until the lockout resets, including after you leave the instance, the instance unloads or the server restarts. Needs `Instance.BindOnEntry = 1` for players without a lockout yet. | 0 | +| `Instance.NefarianCapAdds` | Nefarian phase 1: Victor Nefarius stops calling drakonids after 42 have come (spawn timing unchanged). Off (1.12): they keep coming until 42 are killed. | 0 | | `Instance.MoltenCoreHoundsLinked` | Core Hounds as in 1.12 (feign death and rise again unless the whole pack dies together). Off (standard): hound packs are unlinked and can be killed one by one. | 0 | Note: the first five switch off Blizzlike rules; `MoltenCoreHoundsLinked` is the reverse, its off state is the shared default for this project (packs unlinked). diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index ebf18aa5e9..434aa07309 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -632,6 +632,7 @@ void World::LoadConfigSettings(bool reload) { .Name = "Instance.PersistRaidTrash"sv, .DefaultValue = false, .Index = CONFIG_INSTANCE_PERSIST_RAID_TRASH }, { .Name = "Instance.MoltenCoreHoundsLinked"sv, .DefaultValue = false, .Index = CONFIG_MC_CORE_HOUNDS_LINKED }, { .Name = "Instance.MoltenCoreSkipRunes"sv, .DefaultValue = false, .Index = CONFIG_MC_SKIP_RUNES }, + { .Name = "Instance.NefarianCapAdds"sv, .DefaultValue = false, .Index = CONFIG_BWL_NEFARIAN_CAP_ADDS }, { .Name = "Instance.IgnoreRaid"sv, .DefaultValue = false, .Index = CONFIG_INSTANCE_IGNORE_RAID }, { .Name = "Instance.CombatResurrectionLimit"sv, .DefaultValue = false, .Index = CONFIG_INSTANCE_COMBAT_RES_LIMIT }, { .Name = "CastUnstuck"sv, .DefaultValue = true, .Index = CONFIG_CAST_UNSTUCK }, diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index dbd6c248f9..1c5d9b94ef 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -123,6 +123,7 @@ enum WorldBoolConfigs : uint32 CONFIG_INSTANCE_PERSIST_RAID_TRASH, CONFIG_MC_CORE_HOUNDS_LINKED, CONFIG_MC_SKIP_RUNES, + CONFIG_BWL_NEFARIAN_CAP_ADDS, CONFIG_INSTANCE_COMBAT_RES_LIMIT, CONFIG_CAST_UNSTUCK, CONFIG_ALLOW_GM_GROUP, diff --git a/src/server/scripts/Custom/Classic/instances/blackwing_lair/classic_boss_victor_nefarius.cpp b/src/server/scripts/Custom/Classic/instances/blackwing_lair/classic_boss_victor_nefarius.cpp index 3c900d06e3..56ad93a82e 100644 --- a/src/server/scripts/Custom/Classic/instances/blackwing_lair/classic_boss_victor_nefarius.cpp +++ b/src/server/scripts/Custom/Classic/instances/blackwing_lair/classic_boss_victor_nefarius.cpp @@ -31,6 +31,7 @@ #include "ScriptedGossip.h" #include "SpellInfo.h" #include "TemporarySummon.h" +#include "World.h" #include "ThreatManager.h" #include "classic_blackwing_lair.h" #include "classic_script_text.h" @@ -139,6 +140,8 @@ struct classic_boss_victor_nefarius : public ScriptedAI bool m_bInert; uint32 m_uiKilledAdds = 0; + uint32 m_uiSpawnedAdds = 0; // Instance.NefarianCapAdds: drakonids called this phase 1 + uint32 m_uiLostAdds = 0; // drakonids that went away alive (out of combat for 10 s): never killed uint32 m_uiAddSpawnTimer = 6000; uint32 m_uiAddChromaSpawnTimer = 8000; uint32 m_uiShadowBoltTimer = 5000; @@ -172,6 +175,8 @@ struct classic_boss_victor_nefarius : public ScriptedAI return; m_uiKilledAdds = 0; + m_uiSpawnedAdds = 0; + m_uiLostAdds = 0; m_uiAddSpawnTimer = 6000; m_uiAddChromaSpawnTimer = urand(7000, 9000); m_uiShadowBoltTimer = 5000; @@ -319,6 +324,12 @@ struct classic_boss_victor_nefarius : public ScriptedAI ++m_uiKilledAdds; } + void SummonedCreatureDespawn(Creature* pSummoned) override + { + if (pSummoned->GetEntry() != CLASSIC_BWL_NPC_NEFARIAN && pSummoned->IsAlive()) + ++m_uiLostAdds; + } + // VMaNGOS gossip_scripts 604500 (gossip option "Attack them, minions!"): // the instance forwards SetData(CLASSIC_BWL_GOSSIP_OPTION_NEFARIUS) here. void DoAction(int32 action) override @@ -417,19 +428,21 @@ struct classic_boss_victor_nefarius : public ScriptedAI return; } + // Instance.NefarianCapAdds (the TrinityCore way): no drakonid after the 42nd has come. Off: they come until 42 are killed (1.12). + bool const capAdds = sWorld->getBoolConfig(CONFIG_BWL_NEFARIAN_CAP_ADDS); + auto callAdd = [&](uint32 entry, Position const& at) + { + if (capAdds && m_uiSpawnedAdds >= CLASSIC_BWL_MAX_DRAKE_KILLED) + return; + if (me->SummonCreature(entry, at.GetPositionX(), at.GetPositionY(), at.GetPositionZ(), 5.000f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10s)) + ++m_uiSpawnedAdds; + }; + // Add spawning mechanism if (m_uiAddSpawnTimer < uiDiff) { - me->SummonCreature(m_uiDrakeTypeOne, - ClassicBwlNefarianLocs[0].GetPositionX(), - ClassicBwlNefarianLocs[0].GetPositionY(), - ClassicBwlNefarianLocs[0].GetPositionZ(), - 5.000f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10s); - me->SummonCreature(m_uiDrakeTypeTwo, - ClassicBwlNefarianLocs[1].GetPositionX(), - ClassicBwlNefarianLocs[1].GetPositionY(), - ClassicBwlNefarianLocs[1].GetPositionZ(), - 5.000f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10s); + callAdd(m_uiDrakeTypeOne, ClassicBwlNefarianLocs[0]); + callAdd(m_uiDrakeTypeTwo, ClassicBwlNefarianLocs[1]); m_uiAddSpawnTimer = urand(6000, 7000); } @@ -438,16 +451,8 @@ struct classic_boss_victor_nefarius : public ScriptedAI if (m_uiAddChromaSpawnTimer < uiDiff) { - me->SummonCreature(CLASSIC_BWL_NPC_CHROMATIC_DRAKANOID, - ClassicBwlNefarianLocs[0].GetPositionX(), - ClassicBwlNefarianLocs[0].GetPositionY(), - ClassicBwlNefarianLocs[0].GetPositionZ(), - 5.000f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10s); - me->SummonCreature(CLASSIC_BWL_NPC_CHROMATIC_DRAKANOID, - ClassicBwlNefarianLocs[1].GetPositionX(), - ClassicBwlNefarianLocs[1].GetPositionY(), - ClassicBwlNefarianLocs[1].GetPositionZ(), - 5.000f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10s); + callAdd(CLASSIC_BWL_NPC_CHROMATIC_DRAKANOID, ClassicBwlNefarianLocs[0]); + callAdd(CLASSIC_BWL_NPC_CHROMATIC_DRAKANOID, ClassicBwlNefarianLocs[1]); m_uiAddChromaSpawnTimer = 35000; } else @@ -457,7 +462,11 @@ struct classic_boss_victor_nefarius : public ScriptedAI return; // Begin phase 2 by spawning Nefarian - if (m_uiKilledAdds >= (CLASSIC_BWL_MAX_DRAKE_KILLED - 2)) // 40 drakes killed + // Instance.NefarianCapAdds: with no more drakonids to come, one that went away alive must not leave the raid short of 40 kills + // for good. He lands once all 42 are gone. + bool const allGone = capAdds && m_uiSpawnedAdds >= CLASSIC_BWL_MAX_DRAKE_KILLED && + m_uiKilledAdds + m_uiLostAdds >= CLASSIC_BWL_MAX_DRAKE_KILLED; + if (m_uiKilledAdds >= (CLASSIC_BWL_MAX_DRAKE_KILLED - 2) || allGone) // 40 drakes killed { // Inturrupt any spell casting me->InterruptNonMeleeSpells(false); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 9cc05b3dea..3aff2b567f 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1280,6 +1280,16 @@ Instance.MoltenCoreSkipRunes = 0 Instance.MoltenCoreRagnarosReady = 0 +# +# Instance.NefarianCapAdds +# Description: Blackwing Lair, Nefarian phase 1: Lord Victor Nefarius stops calling drakonids once +# 42 have come (the TrinityCore way). The spawn timing stays as in 1.12 (two every +# 6-7 seconds, two Chromatic every 35 seconds); Nefarian still lands at 40 kills. +# Default: 0 - (Disabled, the 1.12 way: drakonids keep coming until 42 are killed) +# 1 - (Enabled, at most 42 drakonids in phase 1) + +Instance.NefarianCapAdds = 0 + # # Instance.CombatResurrectionLimit # Description: Limit resurrections during a boss encounter to the encounter's combat