[Rules] Add Toggle for Warrior Shielding (#2496)

This adds a toggle to disable the Warrior shielding ability. This will not stop the client-side message from sending when you do not have a target, but it will keep the ability from doing anything.
This commit is contained in:
Kinglykrab 2022-10-22 15:59:52 -04:00 committed by GitHub
parent cb08c02537
commit 7abb02655d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -491,6 +491,7 @@ RULE_INT(Combat, FrontalStunImmunityRaces, 512, "Bitmask for Races than have fro
RULE_BOOL(Combat, NPCsUseFrontalStunImmunityRaces, true, "Enable or disable NPCs using frontal stun immunity Races from Combat:FrontalStunImmunityRaces, true by default.")
RULE_BOOL(Combat, AssassinateOnlyHumanoids, true, "Enable or disable Assassinate only being allowed on Humanoids, true by default.")
RULE_BOOL(Combat, HeadshotOnlyHumanoids, true, "Enable or disable Headshot only being allowed on Humanoids, true by default.")
RULE_BOOL(Combat, EnableWarriorShielding, true, "Enable or disable Warrior Shielding Ability (/shield), true by default.")
RULE_CATEGORY_END()
RULE_CATEGORY(NPC)

View File

@ -12978,10 +12978,14 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
return;
}
pTimerType timer = pTimerShieldAbility;
if (!RuleB(Combat, EnableWarriorShielding)) {
Message(Chat::White, "/shield is disabled.");
return;
}
pTimerType timer = pTimerShieldAbility;
if (!p_timers.Expired(&database, timer, false)) {
uint32 remaining_time = p_timers.GetRemainingTime(timer);
auto remaining_time = p_timers.GetRemainingTime(timer);
Message(
Chat::White,
fmt::format(
@ -12992,8 +12996,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
return;
}
Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer;
auto shield = (Shielding_Struct*) app->pBuffer;
if (ShieldAbility(shield->target_id, 15, 12000, 50, 25, true, false)) {
p_timers.Start(timer, SHIELD_ABILITY_RECAST_TIME);
}