Core/Spells: Implemented SPELL_EFFECT_GIVE_EXPERIENCE and SPELL_EFFECT_GIVE_RESTED_EXPERIENCE_BONUS
Port From (https://github.com/TrinityCore/TrinityCore/commit/ade34a7f484dfcc7e41eddfd1014e7728c8dc2c1)
This commit is contained in:
@@ -49,25 +49,23 @@ namespace Game.Entities
|
||||
if (restBonus > rest_bonus_max)
|
||||
restBonus = rest_bonus_max;
|
||||
|
||||
uint oldBonus = (uint)(_restBonus[(int)restType]);
|
||||
_restBonus[(int)restType] = restBonus;
|
||||
|
||||
uint oldBonus = (uint)_restBonus[(int)restType];
|
||||
if (oldBonus == restBonus)
|
||||
PlayerRestState oldRestState = (PlayerRestState)(int)_player.m_activePlayerData.RestInfo[(int)restType].StateID;
|
||||
PlayerRestState newRestState = PlayerRestState.Normal;
|
||||
|
||||
if (affectedByRaF && _player.GetsRecruitAFriendBonus(true) && (_player.GetSession().IsARecruiter() || _player.GetSession().GetRecruiterId() != 0))
|
||||
newRestState = PlayerRestState.RAFLinked;
|
||||
else if (_restBonus[(int)restType] >= 1)
|
||||
newRestState = PlayerRestState.Rested;
|
||||
|
||||
if (oldBonus == restBonus && oldRestState == newRestState)
|
||||
return;
|
||||
|
||||
// update data for client
|
||||
if (affectedByRaF && _player.GetsRecruitAFriendBonus(true) && (_player.GetSession().IsARecruiter() || _player.GetSession().GetRecruiterId() != 0))
|
||||
_player.SetRestState(restType, PlayerRestState.RAFLinked);
|
||||
else
|
||||
{
|
||||
if (_restBonus[(int)restType] > 10)
|
||||
_player.SetRestState(restType, PlayerRestState.Rested);
|
||||
else if (_restBonus[(int)restType] <= 1)
|
||||
_player.SetRestState(restType, PlayerRestState.NotRAFLinked);
|
||||
}
|
||||
|
||||
// RestTickUpdate
|
||||
_player.SetRestThreshold(restType, (uint)_restBonus[(int)restType]);
|
||||
_player.SetRestState(restType, newRestState);
|
||||
}
|
||||
|
||||
public void AddRestBonus(RestTypes restType, float restBonus)
|
||||
|
||||
Reference in New Issue
Block a user