mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
[Feature] Intoxication setter/getter for source, getter for Perl/Lua (#3330)
* Add setter and getter methods for intoxication Add GetIntoxication functions for perl and Lua * Remove trailing tab * Use clamp instead of min/max
This commit is contained in:
+2
-2
@@ -1237,7 +1237,7 @@ int64 Mob::Tunecompute_tohit(EQ::skills::SkillType skillinuse, int accuracy_over
|
||||
tohit += add_accuracy;
|
||||
}
|
||||
if (IsClient()) {
|
||||
double reduction = CastToClient()->m_pp.intoxication / 2.0;
|
||||
double reduction = CastToClient()->GetIntoxication() / 2.0;
|
||||
if (reduction > 20.0) {
|
||||
reduction = std::min((110 - reduction) / 100.0, 1.0);
|
||||
tohit = reduction * static_cast<double>(tohit);
|
||||
@@ -1366,7 +1366,7 @@ int64 Mob::Tunecompute_defense(int avoidance_override, int add_avoidance)
|
||||
}
|
||||
|
||||
if (IsClient()) {
|
||||
double reduction = CastToClient()->m_pp.intoxication / 2.0;
|
||||
double reduction = CastToClient()->GetIntoxication() / 2.0;
|
||||
if (reduction > 20.0) {
|
||||
reduction = std::min((110 - reduction) / 100.0, 1.0);
|
||||
defense = reduction * static_cast<double>(defense);
|
||||
|
||||
Reference in New Issue
Block a user