Thread: [5$-10$] Soul Split NPCs

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [5$-10$] Soul Split NPCs 
    Banned

    Join Date
    Feb 2012
    Posts
    616
    Thanks given
    300
    Thanks received
    120
    Rep Power
    0
    Paying up to 10 dollars for someone to fix my soul splits spawnconfig lmfao..
    Basicly my spawn-config.cfg npcs aren't spawned..

    Code:
       	public NPCHandler() {
    		for(int i = 0; i < maxNPCs; i++) {
    			npcs[i] = null;
    		}
    		for(int i = 0; i < maxListedNPCs; i++) {
    			 npcDef[i] = null;
    		}
          (new NPCDrops()).loadDrops();
          loadAutoSpawn();
    	}
    Code:
       public void loadAutoSpawn() {
          try {
             Scanner s = new Scanner(new File("./data/cfg/spawn-config.cfg"));
    
             while(s.hasNextLine()) {
                String str = s.nextLine();
    			if(str.startsWith("//")) {
    			System.out.println("returned tr0ll.");
    			return;
    			}
                if(!str.startsWith("#")) {
                   String[] args = str.split("\t");
                   int id = Integer.parseInt(args[0]);
                   int x = Integer.parseInt(args[1]);
                   int y = Integer.parseInt(args[2]);
                   int z = Integer.parseInt(args[3]);
                   if(npcDef[id] != null) {
    			   System.out.println("spawned npc tr0ll.");
                      this.newNPC(id, x, y, z, 1, npcDef[id].npcHealth, npcDef[id].maxHit, 0, 0);
                   } else {
                      System.out.println("Couldn\'t spawn npc: " + id + " because the definition is empty.");
                   }
                }
             }
    
             s.close();
          } catch (IOException var8) {
             ;
          }
    
       }
    As you can see it should be printing but it doesn't.
    PM me msn
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,760
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    is there a npcHandler process?
    Reply With Quote  
     

  3. #3  
    arrowzftw
    Guest
    Code:
    public boolean loadAutoSpawn(String FileName) {
    		String line = "";
    		String token = "";
    		String token2 = "";
    		String token2_2 = "";
    		String[] token3 = new String[10];
    		boolean EndOfFile = false;
    		int ReadMode = 0;
    		BufferedReader characterfile = null;
    		try {
    			characterfile = new BufferedReader(new FileReader("./"+FileName));
    		} catch(FileNotFoundException fileex) {
    			Misc.println(FileName+": file not found.");
    			return false;
    		}
    		try {
    			line = characterfile.readLine();
    		} catch(IOException ioexception) {
    			Misc.println(FileName+": error loading file.");
    			return false;
    		}
    		while(EndOfFile == false && line != null) {
    			line = line.trim();
    			int spot = line.indexOf("=");
    			if (spot > -1) {
    				token = line.substring(0, spot);
    				token = token.trim();
    				token2 = line.substring(spot + 1);
    				token2 = token2.trim();
    				token2_2 = token2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token3 = token2_2.split("\t");
    				if (token.equals("spawn")) {
    					newNPC(Integer.parseInt(token3[0]), Integer.parseInt(token3[1]), Integer.parseInt(token3[2]), Integer.parseInt(token3[3]), Integer.parseInt(token3[4]), getNpcListHP(Integer.parseInt(token3[0])), Integer.parseInt(token3[5]), Integer.parseInt(token3[6]), Integer.parseInt(token3[7]));
    				
    				}
    			} else {
    				if (line.equals("[ENDOFSPAWNLIST]")) {
    					try { characterfile.close(); } catch(IOException ioexception) { }
    					return true;
    				}
    			}
    			try {
    				line = characterfile.readLine();
    			} catch(IOException ioexception1) { EndOfFile = true; }
    		}
    		try { characterfile.close(); } catch(IOException ioexception) { }
    		return false;
    	}
    Code:
    loadAutoSpawn("./data/cfg/spawnConfig2.cfg");
    Erm make new file called spawnConfig2.cfg

    Code:
    // npc                 spawnX    spawnY   height      walk      maxhit      attack     defence      description
    spawn = 6970	3080	3505	0	1	0	0
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Feb 2012
    Posts
    616
    Thanks given
    300
    Thanks received
    120
    Rep Power
    0
    Quote Originally Posted by arrowzftw View Post
    Code:
    public boolean loadAutoSpawn(String FileName) {
    		String line = "";
    		String token = "";
    		String token2 = "";
    		String token2_2 = "";
    		String[] token3 = new String[10];
    		boolean EndOfFile = false;
    		int ReadMode = 0;
    		BufferedReader characterfile = null;
    		try {
    			characterfile = new BufferedReader(new FileReader("./"+FileName));
    		} catch(FileNotFoundException fileex) {
    			Misc.println(FileName+": file not found.");
    			return false;
    		}
    		try {
    			line = characterfile.readLine();
    		} catch(IOException ioexception) {
    			Misc.println(FileName+": error loading file.");
    			return false;
    		}
    		while(EndOfFile == false && line != null) {
    			line = line.trim();
    			int spot = line.indexOf("=");
    			if (spot > -1) {
    				token = line.substring(0, spot);
    				token = token.trim();
    				token2 = line.substring(spot + 1);
    				token2 = token2.trim();
    				token2_2 = token2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token3 = token2_2.split("\t");
    				if (token.equals("spawn")) {
    					newNPC(Integer.parseInt(token3[0]), Integer.parseInt(token3[1]), Integer.parseInt(token3[2]), Integer.parseInt(token3[3]), Integer.parseInt(token3[4]), getNpcListHP(Integer.parseInt(token3[0])), Integer.parseInt(token3[5]), Integer.parseInt(token3[6]), Integer.parseInt(token3[7]));
    				
    				}
    			} else {
    				if (line.equals("[ENDOFSPAWNLIST]")) {
    					try { characterfile.close(); } catch(IOException ioexception) { }
    					return true;
    				}
    			}
    			try {
    				line = characterfile.readLine();
    			} catch(IOException ioexception1) { EndOfFile = true; }
    		}
    		try { characterfile.close(); } catch(IOException ioexception) { }
    		return false;
    	}
    Code:
    loadAutoSpawn("./data/cfg/spawnConfig2.cfg");
    Erm make new file called spawnConfig2.cfg

    Code:
    // npc                 spawnX    spawnY   height      walk      maxhit      attack     defence      description
    spawn = 6970	3080	3505	0	1	0	0
    Omg so close..
    Code:
    src\server\model\npcs\NPCHandler.java:1030: cannot find symbol
    symbol  : class BufferedReader
    location: class server.model.npcs.NPCHandler
                    BufferedReader characterfile = null;
                    ^
    src\server\model\npcs\NPCHandler.java:1032: cannot find symbol
    symbol  : class BufferedReader
    location: class server.model.npcs.NPCHandler
                            characterfile = new BufferedReader(new FileReader("./"+F
    ileName));
                                                ^
    src\server\model\npcs\NPCHandler.java:1032: cannot find symbol
    symbol  : class FileReader
    location: class server.model.npcs.NPCHandler
                            characterfile = new BufferedReader(new FileReader("./"+F
    ileName));
                                                                   ^
    Note: src\server\net\StaticPacketBuilder.java uses or overrides a deprecated API
    .
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    3 errors
    And is it any way to keep my current spawnConfig
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Feb 2012
    Posts
    616
    Thanks given
    300
    Thanks received
    120
    Rep Power
    0
    Quote Originally Posted by 'Spike View Post
    is there a npcHandler process?
    yes

    EDIT: Omg soz doublepost
    Reply With Quote  
     

  6. #6  
    arrowzftw
    Guest
    Please do learn java and learn to import

    Code:
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.FileWriter;
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Feb 2012
    Posts
    616
    Thanks given
    300
    Thanks received
    120
    Rep Power
    0
    Quote Originally Posted by arrowzftw View Post
    Please do learn java and learn to import

    Code:
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.FileWriter;
    Lmfao sorry.
    Also, i thought it wasn't cause of that since i thought soul split has dif npc loading lol
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Feb 2012
    Posts
    616
    Thanks given
    300
    Thanks received
    120
    Rep Power
    0
    Quote Originally Posted by arrowzftw View Post
    Please do learn java and learn to import

    Code:
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.FileWriter;
    Code:
    Exception in thread "main" java.lang.ExceptionInInitializerError
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 7
            at server.model.npcs.NPCHandler.loadAutoSpawn(NPCHandler.java:1060)
            at server.model.npcs.NPCHandler.<init>(NPCHandler.java:96)
            at server.Server.<clinit>(Server.java:49)
    Could not find the main class: server.Server.  Program will exit.
    Press any key to continue . . .
    Shit it crashes when i run it..
    And yeh i added ENDOFSPAWNLIST or w.e in spawnConfig2 aswell.
    Any suggestions?
    Red crashes it
    Code:
     public boolean loadAutoSpawn(String FileName) {
    		String line = "";
    		String token = "";
    		String token2 = "";
    		String token2_2 = "";
    		String[] token3 = new String[10];
    		boolean EndOfFile = false;
    		int ReadMode = 0;
    		BufferedReader characterfile = null;
    		try {
    			characterfile = new BufferedReader(new FileReader("./"+FileName));
    		} catch(FileNotFoundException fileex) {
    			Misc.println(FileName+": file not found.");
    			return false;
    		}
    		try {
    			line = characterfile.readLine();
    		} catch(IOException ioexception) {
    			Misc.println(FileName+": error loading file.");
    			return false;
    		}
    		while(EndOfFile == false && line != null) {
    			line = line.trim();
    			int spot = line.indexOf("=");
    			if (spot > -1) {
    				token = line.substring(0, spot);
    				token = token.trim();
    				token2 = line.substring(spot + 1);
    				token2 = token2.trim();
    				token2_2 = token2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token2_2 = token2_2.replaceAll("\t\t", "\t");
    				token3 = token2_2.split("\t");
    				if (token.equals("spawn")) {
    					newNPC(Integer.parseInt(token3[0]), Integer.parseInt(token3[1]), Integer.parseInt(token3[2]), Integer.parseInt(token3[3]), Integer.parseInt(token3[4]), getNpcListHP(Integer.parseInt(token3[0])), Integer.parseInt(token3[5]), Integer.parseInt(token3[6]), Integer.parseInt(token3[7]));
    				
    				}
    			} else {
    				if (line.equals("[ENDOFSPAWNLIST]")) {
    					try { characterfile.close(); } catch(IOException ioexception) { }
    					return true;
    				}
    			}
    			try {
    				line = characterfile.readLine();
    			} catch(IOException ioexception1) { EndOfFile = true; }
    		}
    		try { characterfile.close(); } catch(IOException ioexception) { }
    		return false;
    	}
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Feb 2012
    Posts
    616
    Thanks given
    300
    Thanks received
    120
    Rep Power
    0
    bump need asap!
    Reply With Quote  
     

  10. #10  
    Banned

    Join Date
    Nov 2010
    Age
    29
    Posts
    2,682
    Thanks given
    824
    Thanks received
    404
    Rep Power
    0
    Had same problem, but fixed 100% soulsplit release by iRamie worked.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI] Soul-Split 5$
    By HiImRusty in forum Help
    Replies: 2
    Last Post: 01-01-2015, 02:06 PM
  2. Soul split HELP
    By Kissy in forum Help
    Replies: 4
    Last Post: 11-20-2011, 06:37 PM
  3. Soul Split [PI]
    By Kickyamom in forum Help
    Replies: 3
    Last Post: 07-19-2011, 10:40 PM
  4. soul split ;-;
    By Im JDK in forum Requests
    Replies: 2
    Last Post: 04-04-2010, 03:48 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •