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:
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 ^-^