Author Topic: Question about bonus attributes on weapons/armors.  (Read 1580 times)

Question about bonus attributes on weapons/armors.
« on: September 08, 2016, 11:46:55 am »
Hello everyone! I`ve been try to find some answers on forum through the search system, but i dont have any answer. I bring my apologize if im duplicate thread and this questions has been already answered before. So... Can somebody explain to me please,how to put some items in chest? I can`t do it...And... i wish that they will be spawned randomly - with some attribute stats. i mean superior/unique/advanced and etc. And i also want to understand how i can spawn some items in game with stats? how to do that? Thanks a lot for answering.

Re: Question about bonus attributes on weapons/armors.
« Reply #1 on: September 08, 2016, 12:28:30 pm »
To spawn items in some locker, you need to write script wich will take care of it, like this small example:

create file container_respawn.fos in scipts folder, put there code

Code: [Select]
#include "_defines.fos"
#include "_macros.fos"
#include "_itempid.fos"
#include "_time.fos"

void _ContainerRespawnInit(Item& container, bool firstTime)
{
    CreateTimeEvent(__FullSecond + REAL_MINUTE( 1 ), "e_LootSpawn", container.Id , false);
}

uint e_LootSpawn( uint[] @ values )
{
    Item@ container = GetItem( values[ 0 ] );
    if( not valid( container ) )
        return 0;
       
    container.AddItem( PID_BOTTLE_CAPS, 100, 0);   
    return REAL_HOUR( 1 );
}

Than enable your script by

opening scripts.cfg and under # Used modules
add line
@ server module container_respawn                  # My script to spawn items

Than you need to open map in mapper, select needed locker and in opened panel define
ScriptName           container_respawn
FuncName             _ContainerRespawnInit
Than just save map and start server, in choosen locker after 1 minute will spawn 100 caps and will spawn 100 caps more every hour.

Same with items with stats, you must write own scripts as there is no ready tools in SDK


Re: Question about bonus attributes on weapons/armors.
« Reply #2 on: September 08, 2016, 12:37:59 pm »
Thank you so much, you really help me. Im gonna try to do same with some other lockers. Thanks a lot.