[Rule] Classic Tradeskill Skill Clamp (#3914)

Legacy Tradeskills had a 252 clamp regardless of modifier and skill.

Default to 0 to bypass clamp
This commit is contained in:
Fryguy 2024-01-08 02:48:40 -05:00 committed by GitHub
parent b30fbc70a3
commit c731f3f560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -254,6 +254,7 @@ RULE_BOOL(Skills, TrainSenseHeading, false, "Switch whether SenseHeading is trai
RULE_INT(Skills, SenseHeadingStartValue, 200, "Start value of sense heading skill") RULE_INT(Skills, SenseHeadingStartValue, 200, "Start value of sense heading skill")
RULE_BOOL(Skills, SelfLanguageLearning, true, "Enabling self-learning of languages") RULE_BOOL(Skills, SelfLanguageLearning, true, "Enabling self-learning of languages")
RULE_BOOL(Skills, RequireTomeHandin, false, "Disable click-to-learn and force hand in to Guild Master") RULE_BOOL(Skills, RequireTomeHandin, false, "Disable click-to-learn and force hand in to Guild Master")
RULE_INT(Skills, TradeSkillClamp, 0, "Legacy tradeskills would clamp at 252 regardless of item modifiers and skill combination. DEFAULT: 0 will bypass clamp. Legacy value 252")
RULE_CATEGORY_END() RULE_CATEGORY_END()
RULE_CATEGORY(Pets) RULE_CATEGORY(Pets)

View File

@ -952,10 +952,16 @@ void Client::SendTradeskillDetails(uint32 recipe_id) {
//returns true on success //returns true on success
bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
if(spec == nullptr) if (!spec) {
return(false); return false;
}
uint16 user_skill = GetSkill(spec->tradeskill); uint16 user_skill = GetSkill(spec->tradeskill);
if (RuleI(Skills, TradeSkillClamp) != 0 && user_skill > RuleI(Skills, TradeSkillClamp)) {
user_skill = RuleI(Skills, TradeSkillClamp);
}
float chance = 0.0; float chance = 0.0;
float skillup_modifier = 0.0; float skillup_modifier = 0.0;
int16 thirdstat = 0; int16 thirdstat = 0;