Fixed Issue with players and Hiding.

Tasanar

Moderator
ServUO Developer
Oct 16, 2014
4,470
102
32
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
All players are being passively revealed. Make a character, player, give him hiding, go to a spawned Luna bank and hide. After a few seconds it will say "you have been revealed".
 

Tasanar

Moderator
ServUO Developer
Oct 16, 2014
4,470
102
32
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
Unless something is broken and the range at which pets can reveal is over 200 paces.
 

Tasanar

Moderator
ServUO Developer
Oct 16, 2014
4,470
102
32
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
I can not reproduce it on TC yet but on Heritage, in Luna and Britain, for some reason all players get auto revealed by something. I can not seem to figure out what. Even if I set myself to a player it happens.
 

Tasanar

Moderator
ServUO Developer
Oct 16, 2014
4,470
102
32
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
It could be, in certain spots I am not revealed however in almost all spots I am. There are no pets around though...which is weird.
 

Tasanar

Moderator
ServUO Developer
Oct 16, 2014
4,470
102
32
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
Possibly however it does not happen on a fresh ServUO svn.

Something strange I did notice was pet parrots in Luna all passively gained detect hidden and now all have 100 but I tested standing next to one and could not force it to detect me.
 

Tasanar

Moderator
ServUO Developer
Oct 16, 2014
4,470
102
32
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
BaseCreature.cs
Code:
 #region Detect Hidden
        private long _NextDetect;

        public virtual bool CanDetectHidden { get { return Skills[SkillName.DetectHidden].Value > 0; } }

        public virtual int FindPlayerDelayBase { get { return (15000 / Int); } }
        public virtual int FindPlayerDelayMax { get { return 60; } }
        public virtual int FindPlayerDelayMin { get { return 5; } }
        public virtual int FindPlayerDelayHigh { get { return 10; } }
        public virtual int FindPlayerDelayLow { get { return 9; } }

        // This does NOT actually use the skill. Just uses the skill values for a distinct ability.
        public virtual void TryFindPlayer()
        {
            if (Deleted || Map == null)
            {
                return;
            }

            double srcSkill = Skills[SkillName.DetectHidden].Value;

            if (srcSkill <= 0)
            {
                return;
            }

            DetectHidden.OnUse(this);

            if (Target is DetectHidden.InternalTarget)
            {
                Target.Invoke(this, this);
                DebugSay("Checking for hidden players");
            }
            else
            {
                DebugSay("Failed Checking for hidden players");
            }
        }
        #endregion
Code:
 if (CanDetectHidden && Core.TickCount >= _NextDetect)
            {
                TryFindPlayer();

                // Not exactly OSI style, approximation.
                int delay = FindPlayerDelayBase;

                if (delay > FindPlayerDelayMax)
                {
                    delay = FindPlayerDelayMax; // 60s max at 250 int
                }
                else if (delay < FindPlayerDelayMin)
                {
                    delay = FindPlayerDelayMin; // 5s min at 3000 int
                }

                int min = delay * (FindPlayerDelayLow / FindPlayerDelayHigh); // 13s at 1000 int, 33s at 400 int, 54s at <250 int
                int max = delay * (FindPlayerDelayHigh / FindPlayerDelayLow); // 16s at 1000 int, 41s at 400 int, 66s at <250 int

                _NextDetect = Core.TickCount +
                    (int)TimeSpan.FromSeconds(Utility.RandomMinMax(min, max)).TotalMilliseconds;
            }
        }
Seems to be something going on with pets. If I set my hiding really high (like 500 skill level) and my INT to 500 it takes much longer for me to be revealed. Is there a distance check in here? Should non tamed pets do this? Should tamed pets do this against non enemies?
 

Dexter_Lexia

Moderator
ServUO Developer
Jul 3, 2014
3,826
155
42
Shard Name
Alexandria
Donate
Donate money to this user
Yea, I have an idea. First of all, vendors should not be detecting. Also, there needs to be a noto check like passive detect hidden.