[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:
Jasdac authored and GitHub committed 2023-05-03 16:19:53 -04:00
1 parent c64a2aec94
commit 9f4d60ec36
10 files changed
+36 -18

No files matched your search

+2 -2
View File
@@ -160,7 +160,7 @@ int Mob::compute_tohit(EQ::skills::SkillType skillinuse)
if (IsNPC())
tohit += CastToNPC()->GetAccuracyRating();
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);
@@ -256,7 +256,7 @@ int Mob::compute_defense()
defense += CastToNPC()->GetAvoidanceRating();
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);