RuneScape 2 Development > Snippets

[PI/wL] NPC Spawns from json [v1.3]

<<< (6/10) >>>

jackfrost890:
so is this all rs spawns in correct cords?

sk8rdude461:

--- Quote from: jackfrost890 on January 15, 2015, 11:18:12 PM ---so is this all rs spawns in correct cords?

--- End quote ---

Hahahahahahaha funny.
No.

It's literally just loading from json. You get to do the fun part of adding the spawns.

Freesunfury:
My spawns aren't loading?

sk8rdude461:

--- Quote from: Freesunfury on January 24, 2015, 11:22:03 AM ---My spawns aren't loading?

--- End quote ---
Did you put any in the file? Did you make sure to LOAD the file when the server starts up?

Freesunfury:
Yes.. Can you add me on Skype if you have I really would like to use this. SunnyPlusPlus
In server.java I have under    public static void main(java.lang.String args[])
         throws NullPointerException, IOException {

--- Code: --- NPCSpawns.loadNPCSpawns();

--- End code ---

NPCHandler


--- Code: --- public NPCHandler() {
for (int i = 0; i < maxNPCs; i++) {
npcs[i] = null;
NPCDefinitions.getDefinitions()[i] = null;
}

loadNPCList("./Data/CFG/npc.cfg");
loadAutoSpawn();
}

--- End code ---


--- Code: ---    public boolean loadAutoSpawn() {
        try {
                for(int i = 0; i < NPCSpawns.getNPCSpawns().length; i++) {
                        newNPC(NPCSpawns.getNPCSpawns()[i].getNpcId(), NPCSpawns.getNPCSpawns()[i].getXPos(),
                                        NPCSpawns.getNPCSpawns()[i].getYPos(),NPCSpawns.getNPCSpawns()[i].getHeight(),
                                        NPCSpawns.getNPCSpawns()[i].getWalkType(), NPCSpawns.getNPCSpawns()[i].getHealth(),
                                        NPCSpawns.getNPCSpawns()[i].getMaxHit(), NPCSpawns.getNPCSpawns()[i].getAttack(),
                                        NPCSpawns.getNPCSpawns()[i].getDefence());
                }
                return true;
        } catch(Exception e) {
                return false;
        }
}

--- End code ---

Oh also when you use the spawn editor you can't hit new npc, it will just overwrite the one you are on.....




Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version
Powered by SMFPacks SEO Pro Mod |