mirror of
https://github.com/mangosfour/server.git
synced 2025-12-28 13:37:13 +00:00
[12697] Improve alcohol handling
Fixes client crash when using Barbershop Chair while drunk Also allow .mod drunk to modify the drunk state of the targeted player (original author @Shauren)
This commit is contained in:
parent
4cebb3880c
commit
7ae2fd2a6e
8 changed files with 60 additions and 55 deletions
|
|
@ -9346,13 +9346,12 @@ void Spell::EffectInebriate(SpellEffectEntry const* /*effect*/)
|
|||
return;
|
||||
|
||||
Player* player = (Player*)unitTarget;
|
||||
uint16 currentDrunk = player->GetDrunkValue();
|
||||
uint16 drunkMod = damage * 256;
|
||||
if (currentDrunk + drunkMod > 0xFFFF)
|
||||
currentDrunk = 0xFFFF;
|
||||
else
|
||||
currentDrunk += drunkMod;
|
||||
player->SetDrunkValue(currentDrunk, m_CastItem ? m_CastItem->GetEntry() : 0);
|
||||
|
||||
uint8 drunkValue = player->GetDrunkValue() + (uint8)damage;
|
||||
if (drunkValue > 100)
|
||||
drunkValue = 100;
|
||||
|
||||
player->SetDrunkValue(drunkValue, m_CastItem ? m_CastItem->GetEntry() : 0);
|
||||
}
|
||||
|
||||
void Spell::EffectFeedPet(SpellEffectEntry const* effect)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue