
Originally Posted by
mauler320
How do I spawn in a NPC?
How can I make doors/ladders work?
I know these are some of the simplest things, but for some reason I can't figure it out myself.
Code:
/*
* Command changes player into a NPC
*/
case "pnpc":
short npc = parser.nextShort();
NpcDefinition npcDef = GameDefinitionLoader.getNpcDefinition(npc);
if (npcDef == null && npc != -1) {
player.send(new SendMessage("The npc id (" + npc + ") does not exist."));
return true;
}
player.setNpcAppearanceId(npc);
player.setAppearanceUpdateRequired(true);
if (npc == -1) {
player.getAnimations().setWalkEmote(819);
player.getAnimations().setRunEmote(824);
player.getAnimations().setStandEmote(808);
player.getAnimations().setTurn180Emote(820);
player.getAnimations().setTurn90CCWEmote(822);
player.getAnimations().setTurn90CWEmote(821);
player.send(new SendMessage("You reset your appearance."));
} else {
player.getAnimations().setWalkEmote(npcDef.getWalkAnimation());
player.getAnimations().setRunEmote(npcDef.getWalkAnimation());
player.getAnimations().setStandEmote(npcDef.getStandAnimation());
player.getAnimations().setTurn180Emote(npcDef.getTurn180Animation());
player.getAnimations().setTurn90CCWEmote(npcDef.getTurn90CCWAnimation());
player.getAnimations().setTurn90CWEmote(npcDef.getTurn90CWAnimation());
player.send(new SendMessage("You have turned into: \'" + npcDef.getName() + "\' (Id: " + npc + ", Size: " + npcDef.getSize() + ")."));
}
return true;
If you start leeching then atleast read the base before making these help topics.