Skip to content

Commit

Permalink
[Mods] Added Hastev3Cap (#1506)
Browse files Browse the repository at this point in the history
* Added Hastev3Cap

* Added Hastev3Cap rule
  • Loading branch information
xackery authored Sep 4, 2021
1 parent 59434e0 commit af6d344
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions common/ruletypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ RULE_INT(Character, ItemDSMitigationCap, 50, "Limit on damageshield mitigation g
RULE_INT(Character, ItemEnduranceRegenCap, 15, "Limit on endurance regeneration granted by items")
RULE_INT(Character, ItemExtraDmgCap, 150, "Cap for bonuses to melee skills like Bash, Frenzy, etc.")
RULE_INT(Character, HasteCap, 100, "Haste cap for non-v3(over haste) haste")
RULE_INT(Character, Hastev3Cap, 25, "Haste cap for v3(over haste) haste")
RULE_INT(Character, SkillUpModifier, 100, "The probability for a skill-up is multiplied by value/100")
RULE_BOOL(Character, SharedBankPlat, false, "Shared bank platinum. Off by default to prevent duplication")
RULE_BOOL(Character, BindAnywhere, false, "Allows players to bind their soul anywhere in the world")
Expand Down
7 changes: 6 additions & 1 deletion zone/client_mods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,12 @@ int Client::CalcHaste()
}
// 51+ 25 (despite there being higher spells...), 1-50 10
if (level > 50) { // 51+
h += spellbonuses.hastetype3 > 25 ? 25 : spellbonuses.hastetype3;
cap = RuleI(Character, Hastev3Cap);
if (spellbonuses.hastetype3 > cap) {
h += cap;
} else {
h += spellbonuses.hastetype3;
}
}
else { // 1-50
h += spellbonuses.hastetype3 > 10 ? 10 : spellbonuses.hastetype3;
Expand Down
13 changes: 9 additions & 4 deletions zone/mob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3235,11 +3235,16 @@ int Mob::GetHaste()
h = cap;

// 51+ 25 (despite there being higher spells...), 1-50 10
if (level > 50) // 51+
h += spellbonuses.hastetype3 > 25 ? 25 : spellbonuses.hastetype3;
else // 1-50
if (level > 50) { // 51+
cap = RuleI(Character, Hastev3Cap);
if (spellbonuses.hastetype3 > cap) {
h += cap;
} else {
h += spellbonuses.hastetype3;
}
} else { // 1-50
h += spellbonuses.hastetype3 > 10 ? 10 : spellbonuses.hastetype3;

}
h += ExtraHaste; //GM granted haste.

return 100 + h;
Expand Down

0 comments on commit af6d344

Please sign in to comment.