Thread: Adding NPCs From Command? Will REP+

Results 1 to 8 of 8
  1. #1 Adding NPCs From Command? Will REP+ 
    Banned

    Join Date
    May 2013
    Posts
    458
    Thanks given
    145
    Thanks received
    59
    Rep Power
    0
    Does anybody have, or know how to write, a command that adds a given NPC to the NPC Spawns? I have a .xml spawn system, it looks like this:
    Code:
    	
             <npc>
    		<id>0</id>
    		<location>
    			<x>3222</x>
    			<y>3222</y>
    			<z>0</z>
    		</location>
    		<walkType>RANGE</walkType>
    		<minimumCoords>
    			<x>3218</x>
    			<y>3221</y>
    			<z>0</z>
    		</minimumCoords>
    		<maximumCoords>
    			<x>3226</x>
    			<y>3225</y>
    			<z>0</z>
    		</maximumCoords>
    	</npc>
    I need to add a ton of NPC spawns and this would be very helpful, any help is greatly appreciated. I am using this on a 530 source.

    Thanks;
    -Abexlry
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Nov 2013
    Posts
    815
    Thanks given
    111
    Thanks received
    109
    Rep Power
    14
    Code:
    if (cmd[0].equals("addspawn")) {
                int npcID = Integer.parseInt(cmd[1]);
                NPCSpawns.addNPCSpawn(npcID, player.getRegionId(), new WorldTile(player.getX(), player.getY(), 0), -1, false);
                World.spawnNPC(npcID, player, -1, true, true);
                return true;
            }
    You will have to stand in which you want the npc to be spawned
    EDIT: Just noticed you needed it for a 530 source, This will probably not work
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    May 2013
    Posts
    458
    Thanks given
    145
    Thanks received
    59
    Rep Power
    0
    Quote Originally Posted by TemptedLegend View Post
    Code:
    if (cmd[0].equals("addspawn")) {
                int npcID = Integer.parseInt(cmd[1]);
                NPCSpawns.addNPCSpawn(npcID, player.getRegionId(), new WorldTile(player.getX(), player.getY(), 0), -1, false);
                World.spawnNPC(npcID, player, -1, true, true);
                return true;
            }
    You will have to stand in which you want the npc to be spawned
    EDIT: Just noticed you needed it for a 530 source, This will probably not work
    Hey thanks but, whats in your World.spawnNPC method, and whats the .addNPCSpawn method have in it also.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    May 2013
    Posts
    458
    Thanks given
    145
    Thanks received
    59
    Rep Power
    0
    bump
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    May 2013
    Posts
    458
    Thanks given
    145
    Thanks received
    59
    Rep Power
    0
    I wrote this up myself, thanks anyways
    Reply With Quote  
     

  6. #6  
    0x2P | ~0x2P
    Google rapes bing's Avatar
    Join Date
    May 2013
    Posts
    595
    Thanks given
    120
    Thanks received
    62
    Rep Power
    0
    Quote Originally Posted by Abexlry View Post
    I wrote this up myself, thanks anyways
    Abexlry, why don't you just do a bufferwriter to write it in. Make a program to do it. lol
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    May 2013
    Posts
    458
    Thanks given
    145
    Thanks received
    59
    Rep Power
    0
    Quote Originally Posted by Google rapes bing View Post
    Abexlry, why don't you just do a bufferwriter to write it in. Make a program to do it. lol
    I wrote up a command today for it, used DOM to write .xml... works perfectly fine lol.
    Reply With Quote  
     

  8. #8  
    0x2P | ~0x2P
    Google rapes bing's Avatar
    Join Date
    May 2013
    Posts
    595
    Thanks given
    120
    Thanks received
    62
    Rep Power
    0
    Quote Originally Posted by Abexlry View Post
    I wrote up a command today for it, used DOM to write .xml... works perfectly fine lol.
    ok , nice.
    Reply With Quote  
     


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. Replies: 7
    Last Post: 09-13-2009, 07:53 PM
  2. xgive command will rep
    By defmenow in forum Help
    Replies: 0
    Last Post: 08-31-2009, 10:12 PM
  3. neeed help with commands will rep+++
    By Trock in forum Help
    Replies: 2
    Last Post: 08-01-2009, 10:52 PM
  4. Need master command! Will rep
    By walid in forum Help
    Replies: 9
    Last Post: 01-25-2009, 06:38 PM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •