[Rules] Added rule to extend max race id (#1630)

* Added rule to extend max race id

* Cleaned fmt of MaxRaceID

* Added format command

* Updated MaxRaceID default to be 732
This commit is contained in:
Logan 2021-10-24 13:53:49 -07:00 committed by GitHub
parent da01156673
commit 5eb95a95d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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;