mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +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:
+7
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user