Author Topic: Hello, i am curious about some stuff.  (Read 2330 times)

Hello, i am curious about some stuff.
« 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.
« Last Edit: May 21, 2014, 10:08:27 pm by Voiddweller »

Re: Hello, i am curious about some stuff.
« Reply #1 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.

Re: Hello, i am curious about some stuff.
« Reply #2 on: May 27, 2014, 07:16:49 am »
Thanks  ;) I thought i can't just remove that XD
« Last Edit: May 27, 2014, 07:19:18 am by Voiddweller »