Thread: 317 PI tutorials

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1 317 PI tutorials 
    Registered Member chains424's Avatar
    Join Date
    May 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11


    I believe everyone needs to start somewhere in coding. That's what tutorials are for, to help the new comers in coding. So if you say, "You are helping leachers", then oh well, get over it. Kaythx



    I DO NOT TAKE CREDIT FOR THIS!!! This came from Arhams Pack!
    ----------------------------------------------------------------------------------------------------------------------------------

    Let's get started!
    1. Adding Teletabs


    Go into ClickItem.java

    Then under:


    Code:
    public void processPacket(Client c, int packetType, int packetSize) {
    		int junk = c.getInStream().readSignedWordBigEndianA();
    		int itemSlot = c.getInStream().readUnsignedWordA();
    		int itemId = c.getInStream().readUnsignedWordBigEndian();
    		if (itemId != c.playerItems[itemSlot] - 1) {
    			return;
    		}


    Add this:


    Code:
    if (itemId == 8007) { //Varrock Tele-tab
    			if(System.currentTimeMillis() - c.buryDelay > 1500) {
    				c.getItems().deleteItem(8007, 1); //Deletes item after used.
    				c.sendMessage("You break the teleport tab."); //Sends a message after using te item
    				c.startAnimation(4731); //starts the teletab animation
    				c.gfx0(678); //starts the teletab gfx
    				c.getPA().movePlayer(3213, 3424, 0); //moves the player by activating the teletab
    				c.buryDelay = System.currentTimeMillis();
    			}
    
    if (itemId == 8008) { //Lumbridge tab
    			if(System.currentTimeMillis() - c.buryDelay > 1500) {
    				c.getItems().deleteItem(8008, 1);
    				c.sendMessage("You break the teleport tab.");
    				c.startAnimation(4731);
    				c.gfx0(678);
    				c.getPA().movePlayer(3222, 3218, 0);
    				c.buryDelay = System.currentTimeMillis();
    			}
    		}
    
    if (itemId == 8009) { //Falador Tele-tab
    			if(System.currentTimeMillis() - c.buryDelay > 1500) {
    				c.getItems().deleteItem(8009, 1);
    				c.sendMessage("You break the teleport tab.");
    				c.startAnimation(4731);
    				c.gfx0(678);
    				c.getPA().movePlayer(2965, 3379, 0);
    				c.buryDelay = System.currentTimeMillis();
    			}
    		}
    
    if (itemId == 8010) { //Camelot Tele-tab
    			if(System.currentTimeMillis() - c.buryDelay > 1500) {
    				c.getItems().deleteItem(8010, 1);
    				c.sendMessage("You break the teleport tab.");
    				c.startAnimation(4731);
    				c.gfx0(678);
    				c.getPA().movePlayer(2757, 3477, 0);
    				c.buryDelay = System.currentTimeMillis();
    			}
    		}
    
    if (itemId == 8011) { // Ardougne tele-tab
    			if(System.currentTimeMillis() - c.buryDelay > 1500) {
    				c.getItems().deleteItem(8011, 1);
    				c.sendMessage("You break the teleport tab.");
    				c.startAnimation(4731);
    				c.gfx0(678);
    				c.getPA().movePlayer(2661, 3305, 0);
    				c.buryDelay = System.currentTimeMillis();
    			}
    		}
    
    if (itemId == 8012) { //Watchtower Tele-tab
    			if(System.currentTimeMillis() - c.buryDelay > 1500) {
    				c.getItems().deleteItem(8012, 1);
    				c.sendMessage("You break the teleport tab.");
    				c.startAnimation(4731);
    				c.gfx0(678);
    				c.getPA().movePlayer(2549, 3112, 0);
    				c.buryDelay = System.currentTimeMillis();
    			}
    		}
    ------------------------------------------------------------------------------------------------------------------------------------

    2. Adding and Changing Global Objects.

    Open your server folder and search for ObjectManager.java, and open.
    There you will need to search for:


    Code:
    public void loadCustomSpawns(Client client)
    Under that line, add

    Code:
    client.getPA().checkObjectSpawn(#, ##, ###, ####, 10);
    Change the #'s to what it says in the below sentence...
    # = Object ID
    ## = Object co-ord X
    ### = Object co-ord Y
    #### = Object Face/Direction


    ------------------------------------------------------------------------------------------------------------------------------------

    3. Adding items!

    Now first, get your model and extract it the the RAW folder in your client. Now add this:

    Code:
    case ####:
    itemDef.name = "##";
    itemDef.itemActions = new String[5];
    itemDef.modelID = ###;
    itemDef.modelZoom = 848;
    itemDef.modelRotationY = 267;
    itemDef.modelRotationX = 138;
    itemDef.modelOffset1 = 5;
    itemDef.modelOffset2 = 0;
    itemDef.anInt165 = -1;
    itemDef.anInt200 = -1;
    itemDef.anInt188 = -1;
    itemDef.description = "#####".getBytes();
    break;
    Now, replace the:

    #### = Your model ID you want it to have
    ## = The name of your model
    ### = The number your model had. Like the .dat file that you extracted to your RAW Folder,
    it's title.
    ##### = The description of the item when they press examine.


    ------------------------------------------------------------------------------------------------------------------------------------

    4. Adding Shops!

    Open up your server folder and search for ActionHandler.java, and open it.
    Press cotrol+F and search for:


    Code:
    case 683:
    Under it, add

    Code:
    case ##:
                c.getShops().openShop(####);
    Explanation:

    ## = The NPC ID of the Shopkeeper
    #### = The Shop ID that will be used in shops.cfg (make sure that this number is unique
    or you will get some errors!)

    Now, Open up your server folder and search for Shops.cfg, and open it.
    You will see lines of code similar to this:


    Code:
    //-----ShopID---ShopName----------------------------------------Sell----Buy-----Item----
    Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--
    Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----
    Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--
    Item----Amount
    
    shop = 1	General_Store					2	2	590	
    100	1755	100	2347	100	952	100	946	100	228	100000	
    1540	30	1523	100	7946	1000	314	100000	2368	3	8007	
    1000	8008	1000	8009	1000	8010	1000	8011	1000
    
    shop = 2	Magic_Supplies			2	2	9075	10000	554	
    2500	555	2500	556	2500	557	2500	558	2500	562	2500	
    566	2500	561	100000	563	100000	564	100000	8013	100000	8007	
    100000	6107	100000	6108	100000	6106	100000	6109	100000	6110	100000	
    6111	100000	1011	100000	4089	100000	4091	100000	4093	100000	4095	
    100000	4097	100000	3387	100000	3389	100000	3755	100000	6137	100000	
    6139	100000	6141	100000	1727	1000	1381	100000	1383	1000	1385	
    1000000	1387	1000
    Explanation:

    Code:
    //-----ShopID-----------ShopName------------------------Sell----Buy-----Item------------Amount
    shop = Your shop ID   SHOP_Name         ##   ##   Item ID      amount of that item
    and so on...
    ## = Change to 1 to only buy and sell what the shop has stocked - Change to 2 to buy and
    sell anything!


    ------------------------------------------------------------------------------------------------------------------------------------

    5. Changing the Starter Package

    First you are going to want to open up your server folder and search for your
    PlayerAssistant.java, and open it.
    2. Press Control+F and search for:


    Code:
    public void addStarter() {
    You will see something like this underneath it:
    It should look similar to this!


    Code:
    c.getItems().addItem(995, 2500000);
    			c.getItems().addItem(8007, 20);
    			c.getItems().addItem(8008, 20);
    			c.getItems().addItem(8009, 20);
    			c.getItems().addItem(1713, 10);
    			c.getPA().showInterface(3559);
    			c.canChangeAppearance = true;
    		}
    This is basically what it means:

    c.getItems().addItem(995, 2500000) is 2.5M of gold coins.
    ^ ^
    Money The amount
    ID This is 2.5M

    So add/edit 1 of them and make them to yours.


    ------------------------------------------------------------------------------------------------------------------------------------

    6. Changing the location of were players spawn if they die.

    Open up your server folder and look for config.java, and open it.
    Search for:


    Code:
    public static final int RESPAWN_X =
    There you will see two lines of code like this:

    Code:
    public static final int RESPAWN_X = ####
    public static final int RESPAWN_Y = ####
    Change #### with the co-ordinates of your death spawn location

    ------------------------------------------------------------------------------------------------------------------------------------
    7. Changing the starting location!

    This is the location of were new players log-in for the first time.

    To get started, you will want to open up your server folder and look for config.java, and open it.
    Press Control+F and search for:


    Code:
    public static final int START_LOCATION_X = #### //Defult Starting Location
    public static final int START_LOCATION_Y = ####
    Change #### with the co-ordinates of your death spawn location.

    ------------------------------------------------------------------------------------------------------------------------------------
    8. Changing XP rate!

    Combat

    Open up your server folder and search for config.java, and open.
    There, you will need to search for:


    Code:
    public static final int MELEE_EXP_RATE =

    You will see these Three lines


    Code:
    public static final int MELEE_EXP_RATE = ####; // damage * exp rate
    public static final int RANGE_EXP_RATE = ####;
    public static final int MAGIC_EXP_RATE = ####;
    Change #### to the rate you wish to gain XP at (I hit damage = XP that you set)

    Skills

    Open up your server folder and search for config.java, and open it.
    Press control+F and search for:


    Code:
    public static final int WOODCUTTING_EXPERIENCE =

    You will see some lines of code like this:


    Code:
    public static final int WOODCUTTING_EXPERIENCE = ####;
    public static final int MINING_EXPERIENCE = ####;
    public static final int SMITHING_EXPERIENCE = ####;
    public static final int FARMING_EXPERIENCE = ####;
    public static final int FIREMAKING_EXPERIENCE = ####;
    public static final int HERBLORE_EXPERIENCE = ####;
    public static final int FISHING_EXPERIENCE = ####;
    public static final int AGILITY_EXPERIENCE = ####;
    public static final int PRAYER_EXPERIENCE = ####;
    public static final int RUNECRAFTING_EXPERIENCE = ####;
    public static final int CRAFTING_EXPERIENCE = ####;
    public static final int THIEVING_EXPERIENCE = ####;
    public static final int SLAYER_EXPERIENCE = ####;
    public static final int COOKING_EXPERIENCE = ####;
    public static final int FLETCHING_EXPERIENCE = ####;
    3. Change #### to the rate you wish to gain XP at (Decrease to make harder, Increase to
    make easier)


    ------------------------------------------------------------------------------------------------------------------------------------
    9. How to change prices

    Open your server folder and search for prices.txt, and open.
    You will see lines and lines of numbers like this:


    Code:
    0 1
    1 1
    2 5
    3 1
    4 5
    15050 32400000
    5 10
    6 187500
    7 187500
    8 187500
    9 187500
    Explanation:

    The numbers on the left column correspond to the item ID while the numbers on the right
    column correspond to the price of that item.

    So as explained above, search for your item ID then change the price of that item via
    the right hand column.


    -------------------------------------------------------------------------------------------------------------------------------------

    10. How to change you're Home teleport

    Open up your server folder and look for config.java, and open it.
    Search for this line:


    Code:
    public static final int LUMBY_X =
    There you will see two lines that look like this:

    Code:
    public static final int LUMBY_X = ####
    public static final int LUMBY_Y = ####
    Change #### with the X & Y co-ordinates of your home location


    ------------------------------------------------------------------------------------------------------------------------------------

    11. How to make Various Commands!

    *Teleportation commands

    Open up your server folder and search for commands.java, and open it.
    It shouldn't be too long to find it, but you should be looking for lines similar to this:


    Code:
    if (playerCommand.startsWith
    Possibly a few lines under you should see a bracket like this }
    And under the } press enter to make a new line, then add this line: (making sure you are
    keeping to the format)


    Code:
    if (playerCommand.equals("####")) {
                c.getPA().startTeleport(##, ##, 0, "modern");   
             }
    Changed these values as so.
    #### = The name of your command (DO NOT put :: at the beginning, it will load it automatically)
    ##= The X & Y co-ordinate of your teleport destination


    *Give item commands (e.g Starter Packs, barrage runes etc...)


    Open up your server folder and search for commands.java, and open it.
    It shouldn't be too long to find it, but you should be looking for lines similar to this:


    Code:
    if (playerCommand.startsWith
    Possibly a few lines under you should see a bracket like this }
    And under the } press enter to make a new line, then add this line: (making sure you are
    keeping to the format)


    Code:
             if (playerCommand.startsWith("####")
                c.getItems().addItem(###, ##);
                c.getItems().addItem(555, 2000);
                c.getItems().addItem(556, 2000);
                c.getItems().addItem(557, 2000);
    Change these values as so.
    #### = The name of your command (DO NOT put :: at the beginning, it will load it
    automatically)
    ### = Item ID
    ## = Amount of the item you wish to have (remember to input the ID as noted if it is a
    large amount of unstackerble items!)


    *How to add player rights to commands

    Open up your server folder and search for commands.java, and open it.
    Search for the command you wish to add a players right to like:


    Code:
    if (playerCommand.startsWith("RANDOM")
                c.getItems().addItem(995, 1000)
    Add this line:

    Code:
    && c.playerRights >= ####) {
    infront of the first line.
    It will look like this:


    Code:
     if (playerCommand.startsWith("RANDOM") && c.playerRights >= ####) {
                c.getItems().addItem(995, 1000)
    4. Replace #### with the player right, like 0 (player), 1 (Mod), 2 (Admin), 3 (Owner), 4 (Donator)

    That's all for now! Enjoy coding your own server and making it the best ^-^

    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Banned

    Join Date
    Jul 2012
    Posts
    130
    Thanks given
    76
    Thanks received
    16
    Rep Power
    0
    This would only be useful if you didn't have any common sense what-so-ever.
    Reply With Quote  
     

  4. #3  
    Registered Member chains424's Avatar
    Join Date
    May 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11
    Quote Originally Posted by Expert View Post
    This would only be useful if you didn't have any common sense what-so-ever.
    New players need them most.

    I needed them when I began my coding.

    Instead of having to google search every single tutorial they need, here a few, combined.

    Reply With Quote  
     

  5. #4  
    Banned

    Join Date
    Jul 2012
    Posts
    130
    Thanks given
    76
    Thanks received
    16
    Rep Power
    0
    Quote Originally Posted by chains424 View Post
    New players need them most.

    I needed them when I began my coding.

    Instead of having to google search every single tutorial they need, here a few, combined.
    You began with pi?
    Reply With Quote  
     

  6. #5  
    Registered Member chains424's Avatar
    Join Date
    May 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11
    Quote Originally Posted by Expert View Post
    You began with pi?

    Yes.
    lol

    I don't like delta.
    It's crap to me o. e

    Reply With Quote  
     

  7. #6  
    Contaminated

    Radiated's Avatar
    Join Date
    Mar 2011
    Age
    27
    Posts
    928
    Thanks given
    255
    Thanks received
    164
    Rep Power
    240
    Good job i think, But starting on PI is lil messy.. It's like you will FIX MORE instead of coding.. <_< Anyways, Thanks for the release!
    fuckoff
    Reply With Quote  
     

  8. #7  
    Registered Member chains424's Avatar
    Join Date
    May 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11
    Quote Originally Posted by A7mad View Post
    Good job i think, But starting on PI is lil messy.. It's like you will FIX MORE instead of coding.. <_< Anyways, Thanks for the release!

    Haha!
    Trust me! I learned that as well. PI's can be glitchy.

    And you're welcome.

    Reply With Quote  
     

  9. #8  
    Motivation is your best friend
    geordie's Avatar
    Join Date
    Nov 2008
    Posts
    750
    Thanks given
    3
    Thanks received
    19
    Rep Power
    0
    I see you got bored.
    Reply With Quote  
     

  10. #9  
    Registered Member

    Join Date
    Jan 2012
    Posts
    236
    Thanks given
    18
    Thanks received
    32
    Rep Power
    79
    Good job man.
    Reply With Quote  
     

  11. #10  
    lurkin about

    Haywire's Avatar
    Join Date
    Apr 2012
    Posts
    1,277
    Thanks given
    610
    Thanks received
    230
    Rep Power
    383
    This is great for new guys

    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. All 317 Tutorials
    By Rusko in forum Tutorials
    Replies: 15
    Last Post: 09-14-2018, 08:05 AM
  2. Tutorials
    By Charlie in forum RS2 Server
    Replies: 21
    Last Post: 01-05-2012, 09:39 PM
  3. Coding Tutorials Only 5$ An Hour! (317)
    By Stapler in forum Advertise
    Replies: 23
    Last Post: 10-20-2010, 10:54 PM
  4. [TUT] Beginner 317 Java Tutorials [TUT]
    By dragon kk in forum Tutorials
    Replies: 9
    Last Post: 10-20-2009, 07:42 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
  •