mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-17 18:41:29 +00:00
[Feature] Add Character:TradeskillUpMinChance rule (#4867)
This commit is contained in:
parent
20da490bda
commit
4a9779635d
@ -156,6 +156,7 @@ RULE_REAL(Character, TradeskillUpPottery, 4.0, "Pottery skillup rate adjustment.
|
|||||||
RULE_REAL(Character, TradeskillUpResearch, 1.0, "Research skillup rate adjustment. Lower is faster")
|
RULE_REAL(Character, TradeskillUpResearch, 1.0, "Research skillup rate adjustment. Lower is faster")
|
||||||
RULE_REAL(Character, TradeskillUpTinkering, 2.0, "Tinkering skillup rate adjustment. Lower is faster")
|
RULE_REAL(Character, TradeskillUpTinkering, 2.0, "Tinkering skillup rate adjustment. Lower is faster")
|
||||||
RULE_REAL(Character, TradeskillUpTailoring, 2.0, "Tailoring skillup rate adjustment. Lower is faster")
|
RULE_REAL(Character, TradeskillUpTailoring, 2.0, "Tailoring skillup rate adjustment. Lower is faster")
|
||||||
|
RULE_REAL(Character, TradeskillUpMinChance, 2.5, "Determines the minimum percentage chance to gain a skill increase from a tradeskill. Cannot go below 2.5")
|
||||||
RULE_BOOL(Character, MarqueeHPUpdates, false, "Will show health percentage in center of screen if health lesser than 100%")
|
RULE_BOOL(Character, MarqueeHPUpdates, false, "Will show health percentage in center of screen if health lesser than 100%")
|
||||||
RULE_INT(Character, IksarCommonTongue, 95, "Starting value for Common Tongue for Iksars")
|
RULE_INT(Character, IksarCommonTongue, 95, "Starting value for Common Tongue for Iksars")
|
||||||
RULE_INT(Character, OgreCommonTongue, 95, "Starting value for Common Tongue for Ogres")
|
RULE_INT(Character, OgreCommonTongue, 95, "Starting value for Common Tongue for Ogres")
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@ -1234,15 +1235,18 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float
|
|||||||
return; //not allowed to go higher.
|
return; //not allowed to go higher.
|
||||||
uint16 maxskill = MaxSkill(tradeskill);
|
uint16 maxskill = MaxSkill(tradeskill);
|
||||||
|
|
||||||
|
float min_skill_up_chance = RuleR(Character, TradeskillUpMinChance);
|
||||||
|
min_skill_up_chance = std::max(min_skill_up_chance, 2.5f);
|
||||||
|
|
||||||
float chance_stage2 = 0;
|
float chance_stage2 = 0;
|
||||||
|
|
||||||
//A successfull combine doubles the stage1 chance for an skillup
|
//A successfull combine doubles the stage1 chance for an skillup
|
||||||
//Some tradeskill are harder than others. See above for more.
|
//Some tradeskill are harder than others. See above for more.
|
||||||
float chance_stage1 = (bonusstat - stat_modifier) / (skillup_modifier * success_modifier);
|
float chance_stage1 = (bonusstat - stat_modifier) / (skillup_modifier * success_modifier);
|
||||||
|
chance_stage1 = std::max(min_skill_up_chance, chance_stage1);
|
||||||
|
|
||||||
//In stage2 the only thing that matters is your current unmodified skill.
|
//In stage2 the only thing that matters is your current unmodified skill
|
||||||
//If you want to customize here you probbably need to implement your own
|
//and the Character:TradeskillUpMinChance rule.
|
||||||
//formula instead of tweaking the below one.
|
|
||||||
if (chance_stage1 > zone->random.Real(0, 99)) {
|
if (chance_stage1 > zone->random.Real(0, 99)) {
|
||||||
if (current_raw_skill < 15) {
|
if (current_raw_skill < 15) {
|
||||||
//Always succeed
|
//Always succeed
|
||||||
@ -1254,6 +1258,7 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float
|
|||||||
//At skill 175, your chance of success falls linearly from 12.5% to 2.5% at skill 300.
|
//At skill 175, your chance of success falls linearly from 12.5% to 2.5% at skill 300.
|
||||||
chance_stage2 = 12.5 - (.08 * (current_raw_skill - 175));
|
chance_stage2 = 12.5 - (.08 * (current_raw_skill - 175));
|
||||||
}
|
}
|
||||||
|
chance_stage2 = std::max(min_skill_up_chance, chance_stage2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chance_stage2 > zone->random.Real(0, 99)) {
|
if (chance_stage2 > zone->random.Real(0, 99)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user