fodev.net

FOnline Development => Questions and Answers => Topic started by: Voiddweller on May 20, 2014, 08:47:12 am

Title: Hello, i am curious about some stuff.
Post by: Voiddweller on May 20, 2014, 08:47:12 am
How to make player characters keep their equipment after death?
How to make npc weapons generate bonus stats?
Come on, i do not asking for a solution, just a hint where to look.
Thanks.
Title: Re: Hello, i am curious about some stuff.
Post by: Dagnir on May 25, 2014, 10:56:42 pm
How to make player characters keep their equipment after death?
replication.fos, ReplicateCritter function.
Remove:

Code: [Select]
if( _CritCanDropItemsOnDead( cr ) )
        {
            Map@ dropMap = cr.GetMap();
            Item@[] items;
            cr.GetItems( -1, items );

            // Disable drop of hidden items and delete gag items (sandbags)
            for( uint i = 0, j = items.length(); i < j; i++ )
            {
                if( FLAG( items[ i ].Flags, ITEM_GAG ) )
                {
                    DeleteItem( items[ i ] );
                    @items[ i ] = null;
                }
                else if( FLAG( items[ i ].Flags, ITEM_HIDDEN ) )
                {
                    @items[ i ] = null;
                }
            }

            // Drop
            if( valid( dropMap ) )
                MoveItems( items, dropMap, cr.HexX, cr.HexY );
            else
                DeleteItems( items );
        }

This will keep items on a character when he replicates. You also need to make players non-lootable.
For this add MODE_NO_LOOT attribute to all players in main.fos, critter_init function.
Title: Re: Hello, i am curious about some stuff.
Post by: Voiddweller on May 27, 2014, 07:16:49 am
Thanks  ;) I thought i can't just remove that XD