|
----
<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 Extenders}}
The file contains all the description of the items in game.
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.
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:
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
<<pre>>
<<implementation class-name=""games.stendhal.server.entity.item.scroll.SummonScroll""/>>
<</pre>>
takes care of this, so you do not set it.
= Add GFX=
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]]
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(""item"",null,Item.class);
register(""item"",""book"",Book.class);
register(""item"",""food"",StackableItem.class);
register(""item"",""drink"",StackableItem.class);
register(""item"",""money"",StackableItem.class);
register(""item"",""projectiles"",StackableItem.class);
|