rhasce

Member
Hi all I hope you all find yourselves well,

So if I want to reduce the time in which the pets leave there owners, I already had many users report that they just leave, can anyone guide me or give me a clue on where do I need to look?
 
So on my shard, under BaseCreature.cs

I added this bit of code

Code:
Expand Collapse Copy
else if (Controlled && Commandable)
            {
                if (IsBonded) //Intentional difference (showing ONLY bonded when bonded instead of bonded & tame)
                {
                    list.Add(1049608); // (bonded)
                    list.Add(1060662, String.Format("Loyalty Rating\t{0}%", Loyalty.ToString())); // ADD THIS
                }
                else
                {
                    list.Add(502006); // (tame)
                    list.Add(1060662, String.Format("Loyalty Rating\t{0}%", Loyalty.ToString())); // ADD THIS
                }
            }

the bonded and tame are already there, below that I simply added:

list.Add(1060662, String.Format("Loyalty Rating\t{0}%", Loyalty.ToString())); // ADD THIS

This allows my players to better keep track. Search for Loyalty in BaseCreature and you will find the code that controls this.
 
In BaseCreature.cs this is the code you would want to edit:

Code:
Expand Collapse Copy
public class LoyaltyTimer : Timer
    {
        private static readonly TimeSpan InternalDelay = TimeSpan.FromMinutes(5.0);

        public static void Initialize()
        {
            new LoyaltyTimer().Start();
        }

        public LoyaltyTimer()
            : base(InternalDelay, InternalDelay)
        {
            m_NextHourlyCheck = DateTime.UtcNow + TimeSpan.FromHours(1.0);
            Priority = TimerPriority.FiveSeconds;
        }

        private DateTime m_NextHourlyCheck;

        protected override void OnTick()
        {
            if (DateTime.UtcNow >= m_NextHourlyCheck)
            {
                m_NextHourlyCheck = DateTime.UtcNow + TimeSpan.FromHours(1.0);
            }
            else
            {
                return;
            }

I am assuming you are using ServUO. If using RunUO it should be similar but I do not really know.
 
Tasanar you could also do it like this 😉 then in case you want to change the string (for example) you dont need to do it twice 😛

Code:
Expand Collapse Copy
            else if (Controlled && Commandable)
            {
                if (IsBonded) //Intentional difference (showing ONLY bonded when bonded instead of bonded & tame)
                {
                    list.Add(1049608); // (bonded)
                }
                else
                {
                    list.Add(502006); // (tame)
                }
                list.Add(1060662, String.Format("Loyalty Rating\t{0}%", Loyalty.ToString())); // ADD THIS
            }
 
what exactly does this do? I'm having an issue where followers are going un-tame on random world saves. I have my loyalty ratings modified to lose 1 every hour but these are pretty fresh tames that they are losing.
Tasanar you could also do it like this 😉 then in case you want to change the string (for example) you dont need to do it twice 😛

Code:
Expand Collapse Copy
            else if (Controlled && Commandable)
            {
                if (IsBonded) //Intentional difference (showing ONLY bonded when bonded instead of bonded & tame)
                {
                    list.Add(1049608); // (bonded)
                }
                else
                {
                    list.Add(502006); // (tame)
                }
                list.Add(1060662, String.Format("Loyalty Rating\t{0}%", Loyalty.ToString())); // ADD THIS
            }
 

Donations

Total amount
$50.00
Goal
$500.00

Shards

Back