diff --git a/GameServer/ECS-Effects/StealthECSEffect.cs b/GameServer/ECS-Effects/StealthECSEffect.cs index f672972f6e..511d5153a6 100644 --- a/GameServer/ECS-Effects/StealthECSEffect.cs +++ b/GameServer/ECS-Effects/StealthECSEffect.cs @@ -42,16 +42,13 @@ public override void OnStartEffect() OwnerPlayer.Sprint(false); - if (OwnerPlayer.Client.Account.PrivLevel == 1 || OwnerPlayer.Client.Account.PrivLevel == 0) + foreach (GamePlayer player in OwnerPlayer.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { - //GameEventMgr.AddHandler(this, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(Unstealth)); - foreach (GamePlayer player in OwnerPlayer.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) - { - if (player == null || player == OwnerPlayer) continue; - if (!player.CanDetect(OwnerPlayer)) - player.Out.SendObjectDelete(OwnerPlayer); - } - OwnerPlayer.Out.SendUpdateMaxSpeed(); + if (player == OwnerPlayer) + continue; + + if (!player.CanDetect(OwnerPlayer)) + player.Out.SendObjectDelete(OwnerPlayer); } StealthStateChanged(); @@ -106,10 +103,7 @@ public override void OnStopEffect() private void StealthStateChanged() { OwnerPlayer.Notify(GamePlayerEvent.StealthStateChanged, OwnerPlayer, null); - if (OwnerPlayer.Client.Account.PrivLevel == 1 || OwnerPlayer.Client.Account.PrivLevel == 0) - { - OwnerPlayer.Out.SendUpdateMaxSpeed(); - } + OwnerPlayer.OnMaxSpeedChange(); } } -} \ No newline at end of file +} diff --git a/GameServer/propertycalc/MaxSpeedCalculator.cs b/GameServer/propertycalc/MaxSpeedCalculator.cs index ab5ba8c93e..17c77d8173 100644 --- a/GameServer/propertycalc/MaxSpeedCalculator.cs +++ b/GameServer/propertycalc/MaxSpeedCalculator.cs @@ -53,7 +53,7 @@ public override int CalcValue(GameLiving living, eProperty property) speed *= 1.25; // New run speed is 125% when no buff. } - if (player.IsOverencumbered && player.Client.Account.PrivLevel < 2 && ServerProperties.Properties.ENABLE_ENCUMBERANCE_SPEED_LOSS) + if (player.IsOverencumbered && player.Client.Account.PrivLevel == 1 && ServerProperties.Properties.ENABLE_ENCUMBERANCE_SPEED_LOSS) { double Enc = player.Encumberance; // Calculating player.Encumberance is a bit slow with all those locks, don't call it much. @@ -67,7 +67,8 @@ public override int CalcValue(GameLiving living, eProperty property) else player.IsOverencumbered = false; } - if (player.IsStealthed) + + if (player.IsStealthed && player.Client.Account.PrivLevel == 1) { AtlasOF_MasteryOfStealth mos = player.GetAbility(); //GameSpellEffect bloodrage = SpellHandler.FindEffectOnTarget(player, "BloodRage");