HowToAddItemsStendhal: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Ufizavipupu No edit summary |
imported>Blacklads Undo revision 11672 by Ufizavipupu (Talk) |
||
| Line 1: | Line 1: | ||
---- |
|||
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> |
|||
---- |
|||
=[http://ezemitekywe.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]= |
|||
---- |
|||
=[http://ezemitekywe.co.cc CLICK HERE]= |
|||
---- |
|||
</div> |
|||
{{Navigation for Stendhal Top}} |
{{Navigation for Stendhal Top}} |
||
{{Navigation for Stendhal Extenders}} |
{{Navigation for Stendhal Extenders}} |
||
| Line 15: | Line 7: | ||
The file contains all the description of the items in game. |
The file contains all the description of the items in game. |
||
Lets start with how to do weapons, for example in swords.xml: |
Lets start with how to do weapons, for example in swords.xml: |
||
<pre> |
|||
<item name="dagger"> |
|||
<type class="sword" subclass="dagger" tileid="-1"/> |
|||
<description>You see a dagger, it is little more than decorative but you can jab pretty fast with it.</description> |
|||
<implementation class-name="games.stendhal.server.entity.item.Item"/> <attributes> |
|||
<atk value="8"/> |
|||
<rate value="3"/> |
|||
</attributes> |
|||
<weight value="0.2"/> |
|||
<value value="8533"/> |
|||
<equipable> |
|||
<slot name="bag"/> |
|||
<slot name="lhand"/> |
|||
<slot name="rhand"/> |
|||
</equipable> |
|||
</item> |
|||
</pre> |
|||
It is important to understand how it works. |
It is important to understand how it works. |
||
| Line 48: | Line 40: | ||
The implementation tag should be copied from above, unless the item is stackable, in which case use: |
The implementation tag should be copied from above, unless the item is stackable, in which case use: |
||
<pre> |
|||
<implementation class-name="games.stendhal.server.entity.item.StackableItem"/> |
|||
</pre> |
|||
Inside the ''attributes'' tag you can specify the attributes the weapon has: |
Inside the ''attributes'' tag you can specify the attributes the weapon has: |
||
| Line 82: | Line 74: | ||
For scrolls, most of which are teleport scrolls, follow the examples in scrolls.xml for what implementation to use. The attribute INFOSTRING for marked scrolls is the destination of the scroll, e.g. |
For scrolls, most of which are teleport scrolls, follow the examples in scrolls.xml for what implementation to use. The attribute INFOSTRING for marked scrolls is the destination of the scroll, e.g. |
||
<pre> |
|||
<infostring value="0_nalwor_city 40 60"/> |
|||
</pre> |
|||
For summon scrolls the INFOSTRING is the creature name, but the implementation |
For summon scrolls the INFOSTRING is the creature name, but the implementation |
||
<pre> |
|||
<implementation class-name="games.stendhal.server.entity.item.scroll.SummonScroll"/> |
|||
</pre> |
|||
takes care of this, so you do not set it. |
takes care of this, so you do not set it. |
||
| Line 109: | Line 101: | ||
= Add GFX= |
= Add GFX= |
||
Now place the 32x32 sprite in the folder '''data/sprites/items/ |
Now place the 32x32 sprite in the folder '''data/sprites/items/<class>/<subclass>.png''' |
||
See also [[StendhalRefactoringGraphics#Items| How to know graphics specifications for items]] |
See also [[StendhalRefactoringGraphics#Items| How to know graphics specifications for items]] |
||
| Line 118: | Line 110: | ||
Usually you need to register your item class unless it really does nothing. If you're adding an item which is like what we already have (i.e. just a new shield) it's done for you, the shield class is registered. Add your item to the rest in ''src/games/stendhal/client/entity/EntityMap.java'' |
Usually you need to register your item class unless it really does nothing. If you're adding an item which is like what we already have (i.e. just a new shield) it's done for you, the shield class is registered. Add your item to the rest in ''src/games/stendhal/client/entity/EntityMap.java'' |
||
register( |
register("item",null,Item.class); |
||
register( |
register("item","book",Book.class); |
||
register( |
register("item","food",StackableItem.class); |
||
register( |
register("item","drink",StackableItem.class); |
||
register( |
register("item","money",StackableItem.class); |
||
register( |
register("item","projectiles",StackableItem.class); |
||