Update Healer Man server

This commit is contained in:
phenom committed 2026-09-28 22:46:45 -04:00
1 parent 9d7e0e2f9e
commit 35dfdaed61
94 files changed
+17034 -418

No files matched your search

+142
View File
@@ -0,0 +1,142 @@
import type { AbilityDefinition, AbilityEffect } from "./abilityCatalog";
export const ROM_WARDEN_WILL_ATTACK_TAG = "rom-will-attack";
export const ROM_WARDEN_DAMAGE_TRANSFER_TAG = "rom-warden-damage-transfer";
export const ROM_WARDEN_DAMAGE_TRANSFER_FRACTION = 0.3;
const classPair = (ability: AbilityDefinition, primary: string, secondary: string): boolean => (
ability.classId === primary && ability.secondaryClassId === secondary
);
function casterAura(
ability: AbilityDefinition,
id: string,
name: string,
durationMs: number | null,
options: Pick<Extract<AbilityEffect, { kind: "apply-aura" }>["aura"], "controlImmunities" | "utilityTags">,
): Extract<AbilityEffect, { kind: "apply-aura" }> {
return {
kind: "apply-aura",
recipient: "caster",
aura: {
id,
name,
disposition: "buff",
durationMs,
...options,
},
sourceEffectType: -1,
sourceAuraType: -1,
miscValue: 0,
triggerSpellId: ability.dbcSpellId,
};
}
/** Select source-described Warden and Warden-linked class payloads. */
export function romWardenCastEffects(
ability: AbilityDefinition,
effects: readonly AbilityEffect[],
naturePower: number,
passiveTags: readonly string[] = [],
): readonly AbilityEffect[] {
if (ability.source !== "runewaker") return effects;
if (ability.dbcSpellId === 493391 && ability.classId === "rom-warden") {
// The source row includes Will Attack's component, but it belongs on the
// target only when the Warden has learned that passive.
const reduction = effects.find((effect) => effect.kind === "apply-aura" && effect.sourceAuraType === 173);
const baseEffects = effects.filter((effect) => !(effect.kind === "apply-aura" && effect.sourceAuraType === 173));
if (!passiveTags.includes(ROM_WARDEN_WILL_ATTACK_TAG) || !reduction || reduction.kind !== "apply-aura") {
return baseEffects;
}
return [...baseEffects, {
...reduction,
recipient: "ability-target",
aura: {
...reduction.aura,
id: "rom-warden-will-attack",
name: "Will Attack",
disposition: "debuff",
utilityTags: [...(reduction.aura.utilityTags ?? []), ROM_WARDEN_WILL_ATTACK_TAG],
},
}];
}
if (ability.dbcSpellId === 493399 && ability.classId === "rom-warden") {
return effects.map((effect) => effect.kind === "apply-aura"
&& effect.aura.modifiers?.some((modifier) => modifier.kind === "damage"
&& modifier.direction === "taken"
&& modifier.operation === "percent"
&& modifier.value === -ROM_WARDEN_DAMAGE_TRANSFER_FRACTION)
? {
...effect,
aura: {
...effect.aura,
utilityTags: [...(effect.aura.utilityTags ?? []), ROM_WARDEN_DAMAGE_TRANSFER_TAG],
},
}
: effect);
}
if (ability.dbcSpellId === 494043 && classPair(ability, "rom-rogue", "rom-warden")) {
// The source describes a chance on the second hit but contains no proc rate.
// Keep the guaranteed base strike and do not turn an unknown chance into 100%.
let keptBaseHit = false;
return effects.filter((effect) => {
if (effect.kind !== "damage") return true;
if (keptBaseHit) return false;
keptBaseHit = true;
return true;
});
}
if (ability.dbcSpellId === 499495 && classPair(ability, "rom-warrior", "rom-warden")) {
return [
casterAura(ability, "rom-warden-awakening-root-slow-immunity", ability.name, 10_000, {
controlImmunities: ["root", "slow"],
utilityTags: ["rom-awakening-of-the-wild-immunity"],
}),
casterAura(ability, "rom-warden-awakening-next-critical", ability.name, null, {
utilityTags: ["next-offensive-critical", "rom-awakening-of-the-wild-next-critical"],
}),
];
}
if (ability.dbcSpellId === 494323 && classPair(ability, "rom-druid", "rom-warden")) {
const heals = effects.filter((effect): effect is Extract<AbilityEffect, { kind: "heal" }> => effect.kind === "heal");
if (!heals.length) return effects;
if (naturePower < 1) return [heals[0]!];
return [
...heals.slice(0, 2),
{ kind: "resource-drain", amount: 1, burn: false, resource: "nature-power" },
];
}
if (ability.dbcSpellId === 499936 && classPair(ability, "rom-druid", "rom-warden")) {
const points = Math.max(0, Math.floor(naturePower));
if (points < 1) return [];
const heal = effects.find((effect): effect is Extract<AbilityEffect, { kind: "heal" }> => effect.kind === "heal");
if (!heal) return effects;
return [
{
...heal,
coefficient: 0,
percentMaxHealth: Math.min(1, points * 0.1),
basePoints: 0,
dieSides: 0,
pointsPerLevel: 0,
coefficientPerLevel: 0,
bonusPowerCoefficient: 0,
},
{ kind: "resource-drain", amount: points, burn: false, resource: "nature-power" },
];
}
if (ability.dbcSpellId === 494372 && classPair(ability, "rom-druid", "rom-warden")) {
return effects.map((effect) => effect.kind === "apply-aura" && effect.aura.modifiers?.length
? { ...effect, scope: "party" }
: effect);
}
return effects;
}