refactor(CS-P3): siege defenses = 6 castle gates only (removed 4 statues per user - kept clean gate mechanic)
Some checks failed
.NET Core / build (push) Has been cancelled

This commit is contained in:
Acentech Dev
2026-07-15 11:18:28 +03:00
parent 8114930855
commit b890e82a88

View File

@@ -27,28 +27,18 @@ public sealed class CastleSiegeEventPlugIn : IPeriodicTaskPlugIn, ISupportCustom
private const ushort ValleyOfLorenMapNumber = 30;
private const short CastleGateNumber = 277; // client MONSTER_CASTLE_GATE1 -> renders a real gate + blocks terrain until broken
private const short GateTemplateNumber = 131; // BloodCastle "Castle Gate" destructible (has HP) — HP template for 277
private const short GuardianStatueNumber = 283; // "Guardian Statue" — inner castle defense
private const short StatueTemplateNumber = 132; // BloodCastle "Statue of Saint" destructible (has HP) — HP template for 283
private const int SwitchHoldRange = 3;
// Castle defenses spawned at siege start — destructibles the attackers must break: (number, x, y).
// Gates are at the 6 REAL castle gate positions (client g_byGateLocation) so the client renders them
// closed and blocks the terrain until broken. Guardian statues stand inside near the throne.
// Castle defenses spawned at siege start — the 6 REAL castle gates (client g_byGateLocation).
// The client renders them closed and blocks the terrain until each is broken. All must fall before the throne.
private static readonly (short Number, byte X, byte Y)[] DefenseSpawns =
{
// 6 real castle gates (client g_byGateLocation) — close + block terrain until broken.
(CastleGateNumber, 67, 114),
(CastleGateNumber, 93, 114),
(CastleGateNumber, 119, 114),
(CastleGateNumber, 81, 161),
(CastleGateNumber, 107, 161),
(CastleGateNumber, 93, 204),
// 4 guardian statues inside the castle (real map positions) — must all be destroyed for the throne.
(GuardianStatueNumber, 82, 129),
(GuardianStatueNumber, 107, 129),
(GuardianStatueNumber, 94, 131),
(GuardianStatueNumber, 94, 126),
};
// Crown Switch positions on Valley of Loren (from the map init) — held by standing on them: (number, x, y).
@@ -182,10 +172,9 @@ public sealed class CastleSiegeEventPlugIn : IPeriodicTaskPlugIn, ISupportCustom
continue;
}
// The stock CS gate (277) / statue (283) definitions have no HP and aren't destructible;
// make them breakable by borrowing the HP/attributes of a working destructible (131/132).
var template = gameContext.Configuration.Monsters.FirstOrDefault(
m => m.Number == (spawn.Number == CastleGateNumber ? GateTemplateNumber : StatueTemplateNumber));
// The stock CS gate (277) definition has no HP and isn't destructible; make it breakable
// by borrowing the HP/attributes of a working destructible (BloodCastle gate 131).
var template = gameContext.Configuration.Monsters.FirstOrDefault(m => m.Number == GateTemplateNumber);
EnsureDestructible(definition, template);
var spawnArea = new MonsterSpawnArea