How to add spawn command for NPCs

Newbie Spellweaver
Joined
Feb 19, 2009
Messages
16
Reaction score
1
Hey,
I just started my private server with Bubbles dev 111 and I found out that NPC could not spawn monsters so I added the command!

Here is how to do it:

1. Open Netbeans
2. Open NPCConversationManager.java (in scripting.npc source package!)
3.Add import server.life.MapleLifeFactory; where all the other imports are.
4.At the end, add
Code:
public void spawnmonster(int mobid){
                getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(mobid), getPlayer().getPosition());
    }
right before the last }
5 The end of the script should look like that :
Code:
public void saveGetFlorina(int a) {
        if (a == 0)
            getPlayer().saveLocation(SavedLocationType.FLORINA);
        else
            getPlayer().getSavedLocation(SavedLocationType.FLORINA);
    }
    public void spawnmonster(int mobid){
                getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(mobid), getPlayer().getPosition());
    }
}
6.Compile and there you go XD

You now have the the NPCcommand cm.spawnmonster(mobID) EDIT: unless you used another name for spawnmonster

Sorry if my tut is bad, It's my first one so....
Hope I helped
 
Last edited:
I didn't find it so I re-made it XD
Maybe its there and I don't know...because I can't find the warp command and it works so....
 
Well I'm a beginner, I looked how the other commands were made and made this one XD
I'm starting C++ too so I understand a lot of things XD XD

Right now I'm trying to make the PlyerNPCs work and everything I made crashed MS XD
 
Last edited:
This isn't the way to add commands for the NPC's. I honestly don't even think this works.
 
I see, well the right place to add NPC commands is NPCConversationManager.java.
 
u said that the npc didnt worked...

i got that to :P

But some 1 said to me.. that u need to add summonmob somewhere (dont got the name atm) but i dont know what to add
 
u said that the npc didnt worked...

i got that to :P

But some 1 said to me.. that u need to add summonmob somewhere (dont got the name atm) but i dont know what to add

Well me I didn't find a command to spawn a monster, so I did this and it seems to work. So if you did what I told earlier, you have to use cm.spawnmonster(monsID) and not cm.summonmob

---------- Post added at 05:53 PM ---------- Previous post was at 05:43 PM ----------

Well, XiuzSu you confused

So, if someone could tell me if I'm right would be nice XD
 
What a bump. (And it's not even *that* related to the thread)

It's called a command. Look up guides on compiling server sources, then go to the command file and code your command.
 
Back