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!

Fixed "Corpse Equipped Item Auto-Dress After Resurrection" !!

JEEG84

Sorceror
Hi guys i have found a little bug on RunUO Server : on Osi if i click my corpse after resurrection all Equipped Item (Before PG Death) return Auto-Dressed on PG, on this server this feature is missed.

Hi fix this Bug and i will share this modifiction with Community.



- Go in "RunUO/Server" Folder and open "Mobile.cs" file.

- Find "public virtual void Kill()" fuction and before this line "DeathMoveResult res = GetParentMoveResultFor( item );" add this part of Code :

Code:
if ( ( item.Insured || item.LootType == LootType.Blessed) && item.Parent == this && item.Layer != Layer.Mount )
       equip.Add( item );

- Open "Corpse.cs" File and Change "Self Looting Region" contained in "public virtual void Open( Mobile from, bool checkSelfLoot )" Function with this Fixed Code :

Code:
                #region Self Looting
                bool selfLoot = ( checkSelfLoot && ( from == m_Owner ) );
                 
                if ( selfLoot )
                {
                    List<Item> items = new List<Item>( this.Items );
                       
                    bool gathered = false;
                       
                    for ( int k = 0; k < EquipItems.Count; ++k )
                    {
                        Item item2 = EquipItems[k];
       
                        if ( !items.Contains( item2 ) && item2.IsChildOf( from.Backpack ) )
                        {
                            items.Add( item2 );
                            gathered = true;           
                        }                                           
                    }       
   
                    bool didntFit = false;
 
                    Container pack = from.Backpack;
 
                    bool checkRobe = true;
   
                    for ( int i = 0; !didntFit && i < items.Count; ++i )
                    {
                        Item item = items[i];       
                        Point3D loc = item.Location;       
       
                        if ( (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable )
                            continue;
 
                        if ( checkRobe )
                        {
                            DeathRobe robe = from.FindItemOnLayer( Layer.OuterTorso ) as DeathRobe;
 
                            if ( robe != null )
                            {
                                if ( Core.SA )
                                {
                                    robe.Delete();
                                }
                                else
                                {
                                    Map map = from.Map;
 
                                    if ( map != null && map != Map.Internal )
                                        robe.MoveToWorld( from.Location, map );
                                }
                            }
                        }
 
                        if ( m_EquipItems.Contains( item ) && from.EquipItem( item ) )
                        {
                            gathered = true;
                        }
                        else if ( pack != null && pack.CheckHold( from, item, false, true ) )
                        {
                            item.Location = loc;
                            pack.AddItem( item );
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }
 
                    if ( gathered && !didntFit )
                    {
                        SetFlag( CorpseFlag.Carved, true );
 
                        if ( ItemID == 0x2006 )
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random( 0xECA, 9 ); // bone graphic
                            Hue = 0;
                            ProcessDelta();
                        }
 
                        from.PlaySound( 0x3E3 );
                        from.SendLocalizedMessage( 1062471 ); // You quickly gather all of your belongings.
                        items.Clear();
                        m_EquipItems.Clear();
                        return;
                    }
 
                    if ( gathered && didntFit )
                        from.SendLocalizedMessage( 1062472 ); // You gather some of your belongings. The rest remain on the corpse.
                }
                #endregion

- Recompile Your Server and This Bug is Fixed and All Item "Equipped before PG Death" return Auto-Dressed after Corpse Retrived.
 

Dreamseeker

Sorceror
Had a small error when it calls up -> Item item = items;

Needed to be
Code:
for ( int i = 0; !didntFit && i < items.Count; ++i )
{
Item item = items[i];
Point3D loc = item.Location;
Ye must've left out the
Code:
[i]
after items accidently.. it'll need that to increment through the items correctly ;) (Had to put the (i) in code.. it wouldn't show up :confused:)

Apart from that minor error Good Work, I was wondering about how to fix this issue a couple of days ago, and seems as the World hasn't blown up.. was gonna take a look.

Awesome, now I can be lazier :p Thx Dude!
 

fwiffo

Sorceror
I think that the top is that when resurrected upon a corpse that is yours, you are already dressed, I have that function enabled here, but it requires quite other mods and isn't quite OSI standard.

PS: Anyway, I think that putting sponsor/link of your shard in signature isn't allowed here on runuo, I would check the rules ;)
 

JEEG84

Sorceror
This My Method is Like OSI not Equals, but is nearly Osi.

On Osi after Resurrection, when you Retrive your goods inside your corpse All Equipped Item Before Death return Equipped on PG, while other Item return on His position inside PG Backpack.
 

The_Man

Sorceror
I don't quite understand what is being said here... if I die and click my corpse after rez it auto equips already. What is the bug?
 

Dreamseeker

Sorceror
For insured & Blessed Items.. before they would just be placed in your backpack when you get rezzed (before you recover your corpse) Now they are auto equip to the correct slot.

No more embarrasing White death robe moments if you have a Reward robe :eek:
 

Xavier

Account Terminated
SVN 754, Sept 18 2011 had that feature added, with only scripts side code.

Is it not working for you guys ?
 

JEEG84

Sorceror
Emmhh i dont Understand....

I have last RunUO and when i doubleclick my corpse for retrivee item inside it, the equipped item before death dont autodress on my Player and i need to dress manually from backpack.
 

Xavier

Account Terminated
Two things come to mind. Are you using the latest SVN revision, or are you using the latest RunUO RC package? The packaged RC version is older and wont have the auto-dress stuff.

The other thing, there's an era check (Core.AoS) in Corpse.cs Line 495, so if you are running it without the AoS flag, that check would need to be removed or altered, to make it work.
 

Dreamseeker

Sorceror
Hmmm.. I was wrong when I said
For insured & Blessed Items.. before they would just be placed in your backpack when you get rezzed (before you recover your corpse) Now they are auto equip to the correct slot.
I thought it auto dressed blessed & insured Items on resurrection :confused: I don't know what's going on! What day of the week is it? AGHH!!
 

peepeetree

Sorceror
I am using the latest version and it is not working for me, when a player dies with blessed armor, they are found in their backpack and need to be reequipped upon Resurrection.
 
Top