HowToAddItemsStendhal: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
imported>Kymara
Add to game: split up options and add details
Line 145: Line 145:


= Add to game=
= Add to game=
==Dropped by creature==
Creatures can drop items, see [[HowToAddCreaturesStendhal]]. Perhaps you will want your NPC to equip the player with an item as part of a quest, see [[HowToCreateQuests]] and [[How to test NPC Parser]] or an NPC to sell the item. For the latter you will need to understand NPC seller behaviour which should be covered separately. Until that is done, look at Seller examples such as Margaret in Semos Tavern in your source code.
Creatures can drop items, see [[HowToAddCreaturesStendhal]].


==Add to map or grower==
You may wish to add items to a map (for player to pick up or harvest). You can either add to zone by creating a java file (good for one - off items like the poison and scroll of Haizen's table in his hut) or add using tiled which is more work initially but allows you to add to the objects layer in tiled again and again in future. (Good for iron ore to collect from the ground, herbs etc). This needs a whole tutorial on spawners (also knows as growers), please see [[HowToAddGrowers]].
You may wish to add items to a map (for player to pick up or harvest). You can either add to zone by creating a java file (good for one - off items like the poison and scroll of Haizen's table in his hut) or add using tiled which is more work initially but allows you to add to the objects layer in tiled again and again in future. (Good for iron ore to collect from the ground, herbs etc). This needs a whole tutorial on spawners (also knows as growers), please see [[HowToAddGrowers]].

==Sold by NPC==
You will need to understand NPC seller behaviour which should be covered separately. Until that is done, look at Seller examples such as Margaret in Semos Tavern in your source code. The file is [http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/maps/semos/tavern/BarMaidNPC.java?view=markup src/games/stendhal/server/maps/semos/tavern/BarMaidNPC.java]. If you have any problems with the NPC understanding the item name, you might like to check [[How to test NPC Parser]].

==Produced by NPC==
You will need to understand NPC seller behaviour which should be covered separately. Until that is done, look at Producer examples such as Arlindo in Ados Bakery in your source code. The file is [http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/maps/ados/bakery/BakerNPC.java?view=markup src/games/stendhal/server/maps/ados/bakery/BakerNPC.java]. If you have any problems with the NPC understanding the item name, you might like to check [[How to test NPC Parser]].

==Quest Reward==
Perhaps you will want your NPC to equip the player with an item as part of a quest, see [[HowToCreateQuests]].