[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
2023-05-03 22:19:53 +02:00
committed by GitHub
parent c64a2aec94
commit 9f4d60ec36
10 changed files with 36 additions and 18 deletions
+7 -2
View File
@@ -908,8 +908,8 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
}
// Garble the message based on drunkness
if (m_pp.intoxication > 0 && !(RuleB(Chat, ServerWideOOC) && chan_num == ChatChannel_OOC) && !GetGM()) {
GarbleMessage(message, (int)(m_pp.intoxication / 3));
if (GetIntoxication() > 0 && !(RuleB(Chat, ServerWideOOC) && chan_num == ChatChannel_OOC) && !GetGM()) {
GarbleMessage(message, (int)(GetIntoxication() / 3));
language = 0; // No need for language when drunk
lang_skill = 100;
}
@@ -8340,6 +8340,11 @@ void Client::SetThirst(int32 in_thirst)
safe_delete(outapp);
}
void Client::SetIntoxication(int32 in_intoxication)
{
m_pp.intoxication = EQ::Clamp(in_intoxication, 0, 200);
}
void Client::SetConsumption(int32 in_hunger, int32 in_thirst)
{
EQApplicationPacket *outapp = nullptr;