Gothic Online Forums
[0.1.3] [server] ItemGroundSpawner - Printable Version

+- Gothic Online Forums (https://archive.gothic-online.com)
+-- Forum: Scripting (English) (https://archive.gothic-online.com/forum-11.html)
+--- Forum: Resources (https://archive.gothic-online.com/forum-14.html)
+---- Forum: Scripts (https://archive.gothic-online.com/forum-17.html)
+---- Thread: [0.1.3] [server] ItemGroundSpawner (/thread-2302.html)



[0.1.3] [server] ItemGroundSpawner - HammelGammel - 28.12.2017

Description:

Allows respawning grounditems after a while when picked up. For example: Sticks/rocks on the ground that, when picked up, respawn after 10 minutes.

Please report any problems you find here: Issue Tracker



Installation:

  1. Install my utility scripts: download
  2. Extract G2O_Module_ItemGroundSpawner.7z
  3. Move resulting folder in the root folder of your server
  4. Add the following to your config.xml:
Code:
<!-- Module ItemGroundSpawner -->
<import src="G2O_Module_ItemGroundSpawner/scripts.xml" />




Usage:

Create your itemspawners in the event "onInitItemSpawners" like this.

Code:
temGroundSpawner.add(itemId, amount, x, y, z, world, intervalInMS)

examples:

Code:
addEventHandler("onInitItemSpawners", function()
{
    // -- Items in newworld harbor (0|0|0) -- //
    ItemGroundSpawner.add(Items.id("ITFO_APPLE"), 1, 0, 0, 0, "NEWWORLD\\NEWWORLD.ZEN", TIMESPAN_SHORTEST);
    ItemGroundSpawner.add(Items.id("ITFO_BREAD"), 2, 100, 0, 0, "NEWWORLD\\NEWWORLD.ZEN", TIMESPAN_SHORT);
    ItemGroundSpawner.add(Items.id("ITFO_BEER"), 3, 200, 0, 0, "NEWWORLD\\NEWWORLD.ZEN", TIMESPAN_DEFAULT);
    ItemGroundSpawner.add(Items.id("ITFO_HONEY"), 4, 300, 0, 0, "NEWWORLD\\NEWWORLD.ZEN", 10000);
});



Constants:

Code:
TIMESPAN_SHORTEST     // -- 100ms
TIMESPAN_SHORTER      // -- 1s
TIMESPAN_SHORT        // -- 10s
TIMESPAN_DEFAULT      // -- 1m
TIMESPAN_LONG         // -- 10m
TIMESPAN_LONGER       // -- 1h
TIMESPAN_LONGEST      // -- 10h




Download

Repository


RE: [0.1.3] [server] ItemGroundSpawner - demor140202 - 05.02.2020

hello. Why doesn't it work?

ItemGroundSpawner.add(Items.id("ITMW_2H_AXE_L_01"), 1, -12751, -1124, -3200, "OLDWORLD\\OLDWORLD.ZEN", TIMESPAN_DEFAULT);

I want the weapon to spawn)