mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Players: Improved alcohol handling, weeeeeeeeeeeeeeeee
Closes #7293
This commit is contained in:
@@ -4772,16 +4772,18 @@ void Spell::EffectInebriate(SpellEffIndex /*effIndex*/)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
Player* player = (Player*)unitTarget;
|
||||
uint16 currentDrunk = player->GetDrunkValue();
|
||||
uint16 drunkMod = damage * 256;
|
||||
if (currentDrunk + drunkMod > 0xFFFF)
|
||||
Player* player = unitTarget->ToPlayer();
|
||||
uint8 currentDrunk = player->GetDrunkValue();
|
||||
uint8 drunkMod = damage;
|
||||
if (currentDrunk + drunkMod > 100)
|
||||
{
|
||||
currentDrunk = 0xFFFF;
|
||||
player->CastSpell(player, 67468, false);
|
||||
currentDrunk = 100;
|
||||
if (rand_chance() < 25.0f)
|
||||
player->CastSpell(player, 67468, false); // Drunken Vomit
|
||||
}
|
||||
else
|
||||
currentDrunk += drunkMod;
|
||||
|
||||
player->SetDrunkValue(currentDrunk, m_CastItem ? m_CastItem->GetEntry() : 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user