Skip to content

Commit 67ac5e4

Browse files
committed
Core/Misc: Port some cherry-pick refactors
1 parent f908dbf commit 67ac5e4

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎src/server/game/Entities/Player/Player.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,6 +1858,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
18581858

18591859
void SetDrunkValue(uint8 newDrunkValue, uint32 itemId = 0);
18601860
uint8 GetDrunkValue() const { return GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_INEBRIATION); }
1861+
void ApplyModFakeDrunkValue(int32 mod, bool apply) { ApplyModInt32Value(PLAYER_FAKE_INEBRIATION, mod, apply); }
18611862
int32 GetFakeDrunkValue() const { return GetInt32Value(PLAYER_FAKE_INEBRIATION); }
18621863
void UpdateInvisibilityDrunkDetect();
18631864
static DrunkenState GetDrunkenstateByValue(uint8 value);

‎src/server/game/Entities/Unit/Unit.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "Object.h"
2222
#include "CombatManager.h"
2323
#include "SpellAuraDefines.h"
24-
#include "PetDefines.h"
2524
#include "ThreatManager.h"
2625
#include "Timer.h"
2726
#include "UnitDefines.h"
@@ -94,6 +93,8 @@ class UnitAura;
9493
class Vehicle;
9594
class VehicleJoinEvent;
9695

96+
enum PetAction : int32;
97+
enum class PetActionFeedback : uint8;
9798
enum MovementGeneratorType : uint8;
9899
enum ZLiquidStatus : uint32;
99100

‎src/server/game/Spells/Auras/SpellAuraEffects.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4911,7 +4911,7 @@ void AuraEffect::HandleAuraModFakeInebriation(AuraApplication const* aurApp, uin
49114911
if (!target)
49124912
return;
49134913

4914-
target->ApplyModInt32Value(PLAYER_FAKE_INEBRIATION, GetAmount(), apply);
4914+
target->ApplyModFakeDrunkValue(GetAmount(), apply);
49154915
target->UpdateInvisibilityDrunkDetect();
49164916
}
49174917

‎src/server/game/Spells/SpellEffects.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3886,7 +3886,7 @@ void Spell::EffectInebriate()
38863886
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
38873887
return;
38883888

3889-
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
3889+
if (!unitTarget || !unitTarget->IsPlayer())
38903890
return;
38913891

38923892
Player* player = unitTarget->ToPlayer();
@@ -3908,7 +3908,7 @@ void Spell::EffectInebriate()
39083908

39093909
player->SetDrunkValue(currentDrunk, m_CastItem ? m_CastItem->GetEntry() : 0);
39103910

3911-
if (currentDrunk == 100 && roll_chance_i(25))
3911+
if (currentDrunk == 100 && drunkMod > 0 && roll_chance_i(25))
39123912
player->CastSpell(player, 67468, false); // Drunken Vomit
39133913
}
39143914

0 commit comments

Comments
 (0)