[Rules] Add Skills:TrivialTradeskillCombinesNoFail Rule (#3481)

* Add TrivialNoFail rule

* feedback fixes

* Update tradeskills.cpp

* Update 1392_recipe_learning.sql

* Update ruletypes.h

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
Jasdac 2023-07-05 04:47:56 +02:00 committed by GitHub
parent 5c1be3643e
commit 98e56bdfe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -241,6 +241,7 @@ RULE_CATEGORY_END()
RULE_CATEGORY(Skills)
RULE_INT(Skills, MaxTrainTradeskills, 21, "Highest level for trading skills that can be learnt by the trainer")
RULE_BOOL(Skills, UseLimitTradeskillSearchSkillDiff, true, "Enables the limit for the maximum difference between trivial and skill for recipe searches and favorites")
RULE_BOOL(Skills, TrivialTradeskillCombinesNoFail, false, "Enable to make all trivial tradeskill combines unable to fail")
RULE_INT(Skills, MaxTradeskillSearchSkillDiff, 50, "The maximum difference in skill between the trivial of an item and the skill of the player if the trivial is higher than the skill. Recipes that have not been learnt or made at least once via the Experiment mode will be removed from searches based on this criteria.")
RULE_INT(Skills, MaxTrainSpecializations, 50, "Maximum level a GM trainer will train casting specializations")
RULE_INT(Skills, SwimmingStartValue, 100, "Start value of swimming skill")

View File

@ -1050,6 +1050,11 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
// above critical still stands.
// Mastery modifier is: 10%/25%/50% for rank one/two/three
chance = 95.0f + (float(user_skill - spec->trivial) / 40.0f);
if (RuleB(Skills, TrivialTradeskillCombinesNoFail)) {
chance = 100;
}
MessageString(Chat::Emote, TRADESKILL_TRIVIAL);
} else if(chance < 5) {
// Minimum chance is always 5