summaryrefslogtreecommitdiffstats
path: root/example/serverdata/scripts/crafting.lua
Commit message (Collapse)AuthorAgeFilesLines
* Merged the example client and server dataThorbjørn Lindeijer2012-02-251-99/+0
| | | | | | | | | It's easier to just talk about world data and to modify it as a whole. If there is really a need to separate it, a project can still choose to do that (and in whatever suitable way). There is no need to enforce this separation or to do it in our example. Reviewed-by: Erik Schilling
* Unified the lua.cpp documentation.Yohann Ferreira2011-08-031-5/+5
| | | | | I also changed the chatmessage function to chat_message to follow the coding standard.
* fixed a bug in the example crafting scriptsPhilipp Sehmisch2011-04-271-2/+2
| | | | (trivial change)
* Added a simple crafting systemPhilipp Sehmisch2011-04-271-0/+99
A client can craft something using the @craft command. The command needs a list of item names and amounts. The gameserver checks if the character has these items in the inventory and then passes the list together with the character handle to the lua script function on_craft in the script file scripts/crafting.lua. This function can then be used to evaluate if the list is a valid crafting combination and when this is the case take or give items. Implemented two example crafting scripts there, one which enforces exact item order and amount and one which doesn't. Both are disabled per default and one needs to be enabled by uncommenting a line. Also gave the player group permission to use the @craft command in permissions.xml and added two new items (wood and iron) required for the example crafting combination. Resolves: #333 Reviewed-by: bcs86, Bertram