Thread: Adding npc teleports to Matrix.

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Adding npc teleports to Matrix. 
    Registered Member
    Join Date
    Oct 2012
    Posts
    66
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Tutorial if you want to add npc to teleport you somewhere.


    Step one: Get an npc Id (15331,big ben)

    Go into data\npcs\unpackedspawnslist.java
    -At the bottom add
    Code:
    //Big Ben
    15331- XCOORDS YCOORDS 0
    Replace the coords with your own. Once done delete the "Packedspawns" folder.

    Step two.
    -Go into com\rs\game\player\dialogues and make a new java file called "BigBen". Place this inside it.

    Code:
    package com.rs.game.player.dialogues;
    
    import com.rs.Settings;
    import com.rs.cache.loaders.NPCDefinitions;
    import com.rs.game.WorldTile;
    import com.rs.game.minigames.CastleWars;
    import com.rs.game.player.Skills;
    import com.rs.game.player.content.Magic;
    import com.rs.game.player.controlers.FightCaves;
    import com.rs.game.player.controlers.FightKiln;
    
    public class BigBen extends Dialogue {
    
    	private int npcId;
    
    	@Override
    	public void start() {
    		npcId = (Integer) parameters[0];
    		sendEntityDialogue(SEND_2_TEXT_CHAT, new String[] { NPCDefinitions.getNPCDefinitions(npcId).name, "Hello adventurer, would you like me to teleport you somewhere?" }, IS_NPC, npcId, 9827);
    	}
    
    	@Override
    	public void run(int interfaceId, int componentId) {
    		if (stage == -1) {
    			sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { player.getDisplayName(), "Yes please. Where can you teleport me to?" }, IS_PLAYER, player.getIndex(), 9827);
    			stage = 1;
    		} else if (stage == 1) {
    			sendOptionsDialogue("Teleports", "Armadyl Chamber", "Bandos Chamber", "Saradomin Chamber", "Zamorak Chamber");
    			stage = 2;
    		} else if (stage == 2) {
    			if (componentId == OPTION_1)
    				teleportPlayer(2838, 5297, 2);
    			else if (componentId == OPTION_2)
    				teleportPlayer(2870, 5363, 2);
    			else if (componentId == OPTION_3)
    				teleportPlayer(2901, 5264, 0);
    			else if (componentId == OPTION_4)
    				teleportPlayer(2925, 5330, 2);
    			else if (componentId == OPTION_5) {
    
    				}
    			}
    		}
    	}
    
    	private void teleportPlayer(int x, int y, int z) {
    		player.setNextWorldTile(new WorldTile(x, y, z));
    		player.stopAll();
    		player.getControlerManager().startControler("GodWars");
    	}
    
    	@Override
    	public void finish() {
    
    	}
    }
    I made the coords and names color coded, so if you want to change the red coords change the red name aswell.

    Step 3
    -Go into dialogue and search for
    Code:
    			handledDialogues.put("MakeOverMage", value39);
    under that add this
    Code:
    			Class<Dialogue> value43 = (Class<Dialogue>) Class
    					.forName(BigBen.class.getCanonicalName());
    			handledDialogues.put("BigBen", value43);
    Reply With Quote  
     

  2. #2  
    Registered Member Lord's Avatar
    Join Date
    Jul 2012
    Posts
    603
    Thanks given
    5
    Thanks received
    20
    Rep Power
    10
    Nice tut mate, but its pretty obvious though.
    Reply With Quote  
     

  3. #3  
    New Project
    Ben_U's Avatar
    Join Date
    Dec 2011
    Age
    28
    Posts
    1,715
    Thanks given
    109
    Thanks received
    359
    Rep Power
    66
    pretty simple. great work though!
    Reply With Quote  
     

  4. #4  
    Registered Member Coookie's Avatar
    Join Date
    May 2012
    Posts
    543
    Thanks given
    21
    Thanks received
    38
    Rep Power
    14
    doesn't work. :\ get 5 errors
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Sep 2012
    Posts
    182
    Thanks given
    16
    Thanks received
    10
    Rep Power
    0
    Did you create the file Big Ben?
    Show me the Compiler Error.
    Reply With Quote  
     

  6. #6  
    Sexy User
    User's Avatar
    Join Date
    Apr 2013
    Posts
    603
    Thanks given
    97
    Thanks received
    218
    Rep Power
    346
    Are you sure your not missing something? I'm trying out your method because it's alot easier than what I was doing... and when I compile and restart there are no errors in eclipse but it wont work when I talk to the guy, I have a mage of zammy as the teleporter should I change NPC's?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jun 2013
    Posts
    372
    Thanks given
    8
    Thanks received
    8
    Rep Power
    11
    good job nice tutorial
    Reply With Quote  
     

  8. #8  
    Registered Member Blackout's Avatar
    Join Date
    Jun 2013
    Posts
    23
    Thanks given
    2
    Thanks received
    0
    Rep Power
    11
    it all works for me except i cant talk to big ben, nothing pops up when i try to talk for teleports

    help please?
    Reply With Quote  
     

  9. #9  
    Officially Retired


    Join Date
    Oct 2007
    Age
    27
    Posts
    5,456
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    This is not work. You need to make the npc clicking.
    Reply With Quote  
     

  10. #10  
    Banned

    Join Date
    Jan 2012
    Age
    22
    Posts
    2,705
    Thanks given
    907
    Thanks received
    628
    Rep Power
    0
    Quote Originally Posted by Norhaqim Ruslan View Post
    This is not work. You need to make the npc clicking.
    Handle it then?
    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. Adding Teleports
    By kiestarbabyx in forum Help
    Replies: 3
    Last Post: 09-20-2012, 02:21 AM
  2. Adding Npc Teleports
    By nathanrr44 in forum Help
    Replies: 5
    Last Post: 04-07-2012, 03:05 AM
  3. [PI] Adding Teleports Through NPC's?
    By timebroken in forum Help
    Replies: 1
    Last Post: 05-15-2011, 01:55 AM
  4. Adding teleports [pi]
    By Mickt3 in forum Help
    Replies: 12
    Last Post: 04-24-2011, 02:49 AM
  5. Adding Objects + teleports
    By fazed in forum Help
    Replies: 8
    Last Post: 07-04-2009, 07:44 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
  •