From 221d173c5975a460b493d9e7708cabfb386c230d Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 2 Jul 2022 22:53:15 -0400 Subject: [PATCH] [Feature] Bind Wound and Forage while mounted. (#2257) During some point in the eras you were not able to Bind Wound or Forage when mounted. I am not sure if Live is still like this, so I added a rule with it disabled by default. --- common/ruletypes.h | 1 + zone/client_packet.cpp | 17 +++++++++++++++-- zone/string_ids.h | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 7c4273161..ea9e36773 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -158,6 +158,7 @@ RULE_BOOL(Character, OPClientUpdateVisualDebug, false, "Shows a pulse and forwar RULE_BOOL(Character, AllowCrossClassTrainers, false, "If the value is true, a player can also train with other class Guildmasters.") RULE_BOOL(Character, PetsUseReagents, true, "Conjuring pets consumes reagents") RULE_BOOL(Character, DismountWater, true, "Dismount horses when entering water") +RULE_BOOL(Character, NoSkillsOnHorse, false, "Enabling this will prevent Bind Wound and Foraging while on a mount") RULE_BOOL(Character, UseNoJunkFishing, false, "Disregards junk items when fishing") RULE_BOOL(Character, SoftDeletes, true, "When characters are deleted in character select, they are only soft deleted") RULE_INT(Character, DefaultGuild, 0, "If not 0, new characters placed into the guild # indicated") diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 87bcd8da8..9e62987fd 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3672,12 +3672,18 @@ void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) LogError("Size mismatch for Bind wound packet"); DumpPacket(app); } + + // Not allowed to forage while mounted + if (RuleB(Character, NoSkillsOnHorse) && GetHorseId()) { + MessageString(Chat::Skills, NO_SKILL_WHILE_MOUNTED); + return; + } + BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer; Mob* bindmob = entity_list.GetMob(bind_in->to); if (!bindmob) { LogError("Bindwound on non-exsistant mob from [{}]", GetName()); - } - else { + } else { LogDebug("BindWound in: to:\'[{}]\' from=\'[{}]\'", bindmob->GetName(), GetName()); BindWound(bindmob, true); } @@ -6055,6 +6061,13 @@ void Client::Handle_OP_Forage(const EQApplicationPacket *app) Message(Chat::Red, "Ability recovery time not yet met."); return; } + + // Not allowed to forage while mounted + if (RuleB(Character, NoSkillsOnHorse) && GetHorseId()) { + MessageString(Chat::Skills, NO_SKILL_WHILE_MOUNTED); + return; + } + p_timers.Start(pTimerForaging, ForagingReuseTime - 1); ForageItem(); diff --git a/zone/string_ids.h b/zone/string_ids.h index 7c94bd8b6..d64a36f51 100644 --- a/zone/string_ids.h +++ b/zone/string_ids.h @@ -478,6 +478,7 @@ #define NO_LONGER_HIDDEN 12337 //You are no longer hidden. #define STOP_SNEAKING 12338 //You stop sneaking #define NOT_IN_CONTROL 12368 //You do not have control of yourself right now. +#define NO_SKILL_WHILE_MOUNTED 12393 //You can not use this skill while on a mount. #define STAND_TO_CAST 12441 //You must be standing to cast a spell. #define ALREADY_CASTING 12442 //You are already casting a spell! #define SHIMMERS_BRIEFLY 12444 //Your %1 shimmers briefly.