Cannot make NpcSpawn

Joined
Nov 9, 2012
Messages
608
Reaction score
164
Well I tried to make npcs spawn for some tutorials, no matter what I do they do not spawn.
I have used c.getPlayer().getMap().spawnNPC() but nothing, I even tried my players coordinates. The npcs I am trying to spawn is from the cannon shooter tutorials, skeeper and rating. Anyone has a clue to why it will not spawn?
 
Experienced Elementalist
Joined
Apr 18, 2009
Messages
211
Reaction score
38
This only spawns temporary NPCs so when you restart the server they disappear.
PHP:
} else if (sub[0].equalsIgnoreCase("npc")) {
            MapleNPC npc = MapleLifeFactory.getNPC(Integer.parseInt(sub[1]));
            if (npc != null) {
                npc.setPosition(player.getPosition());
                npc.setCy(player.getPosition().y);
                npc.setRx0(player.getPosition().x + 50);
                npc.setRx1(player.getPosition().x - 50);
                npc.setFh(player.getMap().getFootholds().findBelow(c.getPlayer().getPosition()).getId());
                player.getMap().addMapObject(npc);
                player.getMap().broadcastMessage(MaplePacketCreator.spawnNPC(npc));
            }
If you want to add permanent NPCs, either try looking up how !pnpc works or mess with the map XML files.
 
Upvote 0
Back
Top