diff --git a/common/ruletypes.h b/common/ruletypes.h index c432455e3..956ac43d3 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -510,6 +510,7 @@ RULE_BOOL(NPC, NPCHealOnGate, true, "Will the NPC Heal on Gate") RULE_BOOL(NPC, UseMeditateBasedManaRegen, false, "Based NPC ooc regen on Meditate skill") RULE_REAL(NPC, NPCHealOnGateAmount, 25, "How much the NPC will heal on gate if enabled") RULE_BOOL(NPC, AnimalsOpenDoors, true, "Determines or not whether animals open doors or not when they approach them") +RULE_INT(NPC, MaxRaceID, 732, "Maximum Race ID, RoF2 by default supports up to 732") RULE_CATEGORY_END() RULE_CATEGORY(Aggro) diff --git a/zone/command.cpp b/zone/command.cpp index 3cad3be78..be06bd9b6 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -3123,18 +3123,18 @@ void command_race(Client *c, const Seperator *sep) if (sep->IsNumber(1)) { auto race = atoi(sep->arg[1]); - if ((race >= 0 && race <= 732) || (race >= 2253 && race <= 2259)) { + if ((race >= 0 && race <= RuleI(NPC, MaxRaceID)) || (race >= 2253 && race <= 2259)) { if ((c->GetTarget()) && c->Admin() >= commandRaceOthers) { target = c->GetTarget(); } target->SendIllusionPacket(race); } else { - c->Message(Chat::White, "Usage: #race [0-732, 2253-2259] (0 for back to normal)"); + c->Message(Chat::White, fmt::format("Usage: #race [0-{}, 2253-2259] (0 for back to normal)", RuleI(NPC, MaxRaceID)).c_str()); } } else { - c->Message(Chat::White, "Usage: #race [0-732, 2253-2259] (0 for back to normal)"); + c->Message(Chat::White, fmt::format("Usage: #race [0-{}, 2253-2259] (0 for back to normal)", RuleI(NPC, MaxRaceID)).c_str()); } } @@ -5223,8 +5223,8 @@ void command_fixmob(Client *c, const Seperator *sep) if (strcasecmp(command, "race") == 0) { if (Race == 1 && codeMove == 'p') - Race = 724; - else if (Race >= 724 && codeMove != 'p') + Race = RuleI(NPC, MaxRaceID); + else if (Race >= RuleI(NPC, MaxRaceID) && codeMove != 'p') Race = 1; else Race += Adjustment;