FOnline Development > General Discussion
[ How to ] Script - Respawn item, inventory(barter npc)
muhoooool:
How do i use this script ?
(from respawn_item.fos)
Do i add it to scripts and function in mapper?
Or do i make a new script file and add that script in mapper ?
void SetItemRespawn (Item & item, uint mode, uint respTime)
{
item.Val5 = mode;
item.Val4 = respTime;
item.SetEvent (ITEM_EVENT_SKILL, "e_ItemOnSkill");
item.SetScript ("_RespItemInit");
item.Update ();
}
Dont use respawn_item script for barter npc-
that script is on the bottom
JovankaB:
There is a function there _RespItemInit that inits item respawning. That's what you are supposed to use in the Crapper, I mean Mapper. To check out an example, open map sf_tanker2 and click the knife on hex 136,94. Check out ScriptName, FuncName and Value4 in the item properties window. Value4 is respawn time.
To do this from a script for existing item object I guess you would have to simply call SetItemRespawn.
For cases other than stuff on ground like respawning in containers you have to set Val5/Value5 of the item. Translate ruski comment on top of the module for details.
muhoooool:
hello!
Thaks for your solution and tips. ( also thanks for taking the time to transfer my posts here !! )
I tried _RespawnItemInit, it didnt seem to work.
I will test this out and get back on this post!
Thanks again!
muhoooool:
_RespItemInit Works great!!
value is the number of in-game minutes.. for 100 will respawn about 3 seconds..
One more thing,
Where do i set VAL5/VALUE5 ?
-thanks
JovankaB:
--- Quote from: muhoooool on June 17, 2012, 06:05:55 pm ---_RespItemInit Works great!!
value is the number of in-game minutes.. for 100 will respawn about 3 seconds..
One more thing,
Where do i set VAL5/VALUE5 ?
--- End quote ---
I'm afraid val5 and higher you have to add manually in a text editor. But map files are just text, so it shouldn't be a big problem.
Navigation
[0] Message Index
[#] Next page
Go to full version