HowToAddMapsServerStendhal: Difference between revisions
Content deleted Content added
imported>Chad3f |
imported>Chad3f |
||
Line 143:
This is how NPCs used to be added to the world. The downside of this is that you need a lot of Java code. If you're adding new NPCs, consider using the new way of doing it, as described in the next section.
''SpeakerNPC npc = new SpeakerNPC() { ... }'' creates a new NPC.
<pre>
SpeakerNPC npc = new SpeakerNPC("name") {
Line 161:
SpeakerNPC npc = new SpeakerNPC("Ilisa") {
protected void createPath() {
List<
nodes.add(new Path.Node(9,5));
nodes.add(new Path.Node(14,5));
Line 181:
}
});
zone.assignRPObjectID(npc);
// This determines how the NPC will look like.
npc.
npc.
npc.initHP(100);
zone.add(npc);
</pre>
Because
Just after that it is a good idea to create a path that the NPC will follow on that area.
| |||