HowToAddMapsServerStendhal: Difference between revisions

Content deleted Content added
imported>Chad3f
imported>Chad3f
Line 238:
<implementation class-name="games.stendhal.server.maps.athor.holiday_area.SwimmerNPC">
<parameter name="name">Enrique</parameter>
<parameter name="class">swimmer3npc</parameter>▼
<parameter name="node0">67,68</parameter>
<parameter name="node1">67,63</parameter>
</implementation>
 
▲ <parameterattribute name="class">swimmer3npc</parameterattribute>
</entity>
 
Line 247 ⟶ 248:
* The second line tells the server where we stored our Java file with the dialog.
* The third line says that our NPC should be called Enrique.
* The fifthfourth and sixthfifth lines define the path along which Enrique should walk/swim. He will first visit the point (67, 68), then return to his start position (67, 63), and continue like this infinitely. You can of course create NPCs with more than 2 nodes, but:▼
* The fourth line defines how the NPC should look like. In this case, the graphics from the file <code>data/sprites/npc/swimmer3npc.png</code> will be used.▼
▲* The fifth and sixth lines define the path along which Enrique should walk/swim. He will first visit the point (67, 68), then return to his start position (67, 63), and continue like this infinitely. You can of course create NPCs with more than 2 nodes, but:
** keep in mind that counting starts with 0
** make sure that you don't forget a node number, e.g. if you have node6, you must also have node5, node4 etc.
 
▲* The fourth'class' lineattribute defines how the NPC should look like. In this case, the graphics from the file <code>data/sprites/npc/swimmer3npc.png</code> will be used.
 
If you don't want your NPC to walk around, just leave out the node parameters. Instead, you should add a parameter that defines in which direction the NPC should look on server startup (left, right, up, down), e.g.:
Line 256 ⟶ 258:
<parameter name="direction">down</parameter>
 
Other parametersattributes you can use:
 
<parameterattribute name="hp">50</parameterattribute>
 
This will make the NPC look wounded (the health bar will be at the middle). Note that, as NPCs cannot be killed, this is only for decoration. If you leave this parameter out, the hitpoints will be set to 100, which means full health.
 
<parameterattribute name="level">10</parameterattribute>
 
This sets the NPC's level of experience. Again, this is only for decoration, as NPCs don't fight or die.