FOnline Development > Questions and Answers

Question about bonus attributes on weapons/armors.

(1/1)

kelter:
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.

Skycast:
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: ---#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 );
}

--- End code ---

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

kelter:
Thank you so much, you really help me. Im gonna try to do same with some other lockers. Thanks a lot.

Navigation

[0] Message Index

Go to full version