28 lines
1.5 KiB
JavaScript
28 lines
1.5 KiB
JavaScript
const HEALER_SPECIALIZATIONS = new Set([
|
|
"paladin:holy", "priest:discipline", "priest:holy", "shaman:restoration", "druid:restoration",
|
|
"witch-doctor:brewing", "bloodmage:fleshweaver", "chronomancer:time", "cultist:heretic",
|
|
"starcaller:moon-priest", "sun-cleric:blessings", "tinker:invention", "venomancer:vizier",
|
|
"primalist:life",
|
|
]);
|
|
|
|
const TANK_SPECIALIZATIONS = new Set([
|
|
"warrior:protection", "paladin:protection", "death-knight:blood", "druid:feral-bear",
|
|
"felsworn:infernal", "witch-hunter:black-knight", "knight-of-xoroth:defiance", "guardian:vanguard",
|
|
"templar:oathkeeper", "bloodmage:eternal", "cultist:dreadnought", "starcaller:moon-guard",
|
|
"sun-cleric:valkyrie", "venomancer:fortitude", "reaper:domination", "primalist:mountain-king",
|
|
"runemaster:riftblade",
|
|
]);
|
|
|
|
export function arenaRoleForSpecialization(classId, specializationId, ruleset) {
|
|
const normalizedClass = String(classId ?? "").trim().toLowerCase();
|
|
const normalizedSpec = String(specializationId ?? "").trim().toLowerCase();
|
|
if (!normalizedClass || !normalizedSpec || !normalizedSpec.startsWith(`${normalizedClass}:`)) return null;
|
|
if (ruleset === "rom") {
|
|
if (normalizedSpec === `${normalizedClass}:role-healer`) return "healer";
|
|
if (normalizedSpec === `${normalizedClass}:role-damage`) return "damage";
|
|
return normalizedSpec.endsWith(":role-tank") ? "tank" : null;
|
|
}
|
|
if (TANK_SPECIALIZATIONS.has(normalizedSpec)) return "tank";
|
|
return HEALER_SPECIALIZATIONS.has(normalizedSpec) ? "healer" : "damage";
|
|
}
|