RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Blessed items in pack issue.

I recently upgraded to the latest osi patch. several problems arose from that. The biggest annoyance is that upon a players death, all blessed items in his/her possession are removed from the blessed holding bag and strewn threw his/her pack. I can not for life of me figure out how to fix this issue. Any help would be greatly appreciated.
 

haazen

Sorceror
I've been chasing this same issue for several days. Found it this morning. Here is what was added to PlayerMobile.cs

Code:
      private bool FindItems_Callback(Item item)
        {
/*  Take this code out
            if (!item.Deleted && (item.LootType == LootType.Blessed || item.Insured))
            {
                if (this.Backpack != item.ParentEntity)
                {
                    return true;
                }
            }  */  down to here
            return false;
        }
 
        public override bool OnBeforeDeath()
        {
            NetState state = NetState;
 
            if ( state != null )
                state.CancelAllTrades();
 
            DropHolding();
/*  Take this code out
            if (Core.AOS && Backpack != null && !Backpack.Deleted)
            {
                List<Item> ilist = Backpack.FindItemsByType<Item>(FindItems_Callback);
 
                for (int i = 0; i < ilist.Count; i++)
                {
                    Backpack.AddItem(ilist[i]);
                }
            }  */   to here

I did not take the FindItems_Callback out totally because I am not sure if it is called elsewhere. Regardless it now returns false always.
 

Vorspire

Knight
Just be warned that if you put blessed items in a non-blessed container, they will be lootable (I think that's OSI-accurate anyway)

This is the only place where FindItems_Callback is called, just below its definition in OnBeforeDeath()

C#:
			if (Backpack != null && !Backpack.Deleted)
			{
				foreach (Item t in Backpack.FindItemsByType<Item>(FindItems_Callback))
				{
					Backpack.AddItem(t);
				}
			}

FindItems_Callback should be more appropriately named MoveBlessedItemsToPack_Predicate IMO

It would be safer to exclude blessed items with a blessed parent than to remove or disable the code; although it does feel like it's vestigial because all of the moving items on death is handled by the DeathMoveResult returned by other methods.

I changed my FindItems_Calback to this, to check if the parent containers are blessed;
C#:
			if (item == null || item.Deleted || item.ParentEntity == Backpack || !item.CheckBlessed(this))
			{
				return false;
			}

			if (item.ParentEntity is Container)
			{
				return !((Container)item.ParentEntity).CheckBlessed(this);
			}

			return true;
 
Top