laserboy
Active Member
- Joined
- Feb 3, 2007
- Sythe Gold
- 0
- Messages
- 182
Purpose: This is a simple tutorial that will explain how to edit a private server. Here are the chapters we will cover in this ultimate server guide:
Difficulty: 2
Assumed Knowledge: Know what a router is. Know what a computer is. Know what the internet is. Know how to read. Know what an IP address is. Know the difference between an internet IP address and a computer/gateway IP address. Know how to use a keyboard (possibly, not entirely required), and finally you need to know how to click with a mouse.
Server Base: I have not personally performed this tutorial, but it is compatible with ANY server source.
Classes Modified: Possibly client.java, item.java, item2.java, npchandler.java, shophandler.java, playerhandler.java, and server.java.
chapter 1 ~ Getting a server source and setting up your server for running to the public and editing.
chapter 2 ~ Thoroughly explaining the important .cfg files.
chapter 3 ~ Explaining variables, frames, and interfaces are and what they do in the .java 's.
chapter 4 ~ Explaining how to edit your .java 's and the purpose of each individual one.
chapter 5 ~ How to learn more and help other players/make your own tutorials!
chapter 6 ~ Setting up a no-ip for your server!
chapter 7 ~ Making a fourms and Website for your server as well as a pumping name!
----------------------------------------------------------------------------------------------------------------------------------------------------
CHAPTER 1:
First off we need a server source (Testscape personally recommended):
Moparscape Server Downloads
All of the top server sources + fast downloading
We may also need Moparscape v3.2:
Moparscape v3.2 w/ Aryan
Next, you will need to open ports in Windows Firewall and/or the firewalls offered by McAffee, Norton, or other full-system maintenance suites. For Windows Firewall, open its settings file in the control panel. Click on the "Exceptions Tab" and then click "Add Port." Add the following port: 43594. (If you'd rather not open a specific port or have to worry about Windows Firewall disabling access in any way, you can disable it entirely.)
Now we will need to make the rule for your router, by doing this you need to go into your router. You can do this by going into Internet Explorer (or whatever client you use for the Internet), and then type in the IP address of the router. Now log into the router and go into "advanced" (at top of screen on mine). Then on the sidebar to the left click the "gaming" button (is only left side for me...) Then you need to make a new rule and fill in the blanks with this information:
Name: 1
IP address: 2
TCP Ports to open: 43594
UDP Ports to open:
Inbound Filter: Allow All
Schedule: Always
KEY
1 = Any name you want the server to be (I.E.MyScape).[/glow]
2 = The IP adddress of your COMPUTER; not the Internet.
Then save it. Ok now you can save settings after the rule is saved. Every router is different. Check with the manuals for yours to fully understand how to open the ports. If you cannot find/have a manuel, go to this address:
Port Forwarding
Now your server rule is nice and good. Now we need Java to get your server's compiler and runserver to work. You can download the newest java at this link:
Java SE Downloads Page
Now, click JDK 6.0
After this, it will come up with a security warning:
Click yes to it. Now you want to agree to the terms and conditions:
You will now get another security box (shown above), just click yes to that again. Now, download the Windows Offline Installation for Multiple Languages (if you are not using Windows, then try downloading the offline installations for some other Operating Systems):
Now the download window will come up. Just click Run and wait for it to end downloading. Then install it and everything should work.
Ok before we can fix the compiler and runeserver, we need to set out variables. Ok go into start menu, then control panel, then system, then advanced, then enviromental variables.
start menu -> control panel -> system -> advanced -> enviromental variables
Ok now find the variable called "path" in the list in that new screen open. Rename it to "PATH" and then for it's variable value (erase old one):
C:Windows\System32\;"C:\Program Files\Java\jdk1.6.0\bin\"
You will also need to set a variables called "classpath". Make a new variable and give it the name classpath. No add this in for it's value:
"C:\Program Files\Java\Java\jdk1.6.0\bin\"
Ok now go into your server source (if you dont have a rar uncompressor you can download 7zip at this link: 7zip, or you can download rar uncompresser at this link: WinRar. Ok now you can right click the compressed source and click "extract here"),
and now when in your server srouce, right click compile.bat and click "edit". Then erase everything in it and put this in it's place:
Code:
@echo off
title Compiler
"%ProgramFiles%\Java\jdk1.6.0\bin\javac.exe" -cp . *.java
pause
Ok now save it and right click runserver.bat and erase all of that and add this:
Code:
@echo off
title Runserver
set java="C:\Program Files\Java\jdk1.6.0\bin\java.exe"
java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
pause
Ok now we have a working source!
----------------------------------------------------------------------------------------------------------------------------------------------------
CHAPTER 2:
Ok now we want to edit your cfg files. Ok first of right click your cfg files and click "open with", then search the list for notepad. High-light it and then click the box at the bottom of that window that says "use this to open all files of this type" (make sure it has a check mark in it), then click ok. Do this same thing with the .java 's. Ok now open up autospawn.cfg. This is the first few lines of my autospawn:
Code:
//------NpcID---CoordX--CoordY--Height--RangeX1-RangeY1-RangeX2-RangeY2-WalkType-Descrption
spawn = 1699 2816 3462 0 2817 3463 2815 3461 2 Ghost Shopkeeper
spawn = 23 2660 3304 0 2662 3306 2658 3302 2 Knight Of Adrougne
spawn = 23 2662 3309 0 2665 3311 2660 3308 2 Knight Of Adrougne
Ok the first is a Ghost Shopkeeper (hence the description). The "spawn = 1699" is saying that npc 1699 (1699 = code of that npc) will be spawned (we will get into other npc codes in the furture). Now the "2816" and "3462" are the X and Y cordinates of where the npc will be spawned on the map. This is just like Math in school, the X and Y are just like X and Y on a graph. You can find you X and Y cords inside the game by using the command ::mypos or by looking in the player settings button on the sidebar and your X and Y cords are usually next to your run energy. Ok now the "0" above is the height of the npc. Unless you are making in a multi-level house/building or are in a dungeon, keep this at 0 when making your own npc spawns. Now the "2817", "3463", "2815", and "3461" are the X X and Y Y cords of where the npc will be walking. This can get confusing (lol) so you can just keep these at 0 0 0 0 if you wish. Then next thing is "2". This represents the walk-type of the npc. You can keep this at 1 if you are making the npc stationary. Now the last thing is the "Ghost Shopkeeper". This is the title and you need one. It can be anything you want but I would advise to put the npc name here, then click enter to the next line, and then put the city/place where it is being spawned. This will save a lot of confusion.
Ok now lets look at npc.cfg. Here is another few lines of code from mine:
Code:
//Fixed by: Takajin++ a.k.a. Yetsuki
// NpcID NpcName combat health
npc = 0 Hans 0 0
npc = 1 Man 2 7
npc = 2 Man 2 7
npc = 3 Man 2 7
npc = 4 Woman 2 7
npc = 5 Woman 2 7
npc = 6 Woman
Ok the first thing "npc = 0" is the ID code for that npc (this ID code is what is used for autospawn.cfg and npc-spawning commands in-game). Then the "Hans" is the name of the npc (pretty much it's here for fast maneuvering through wanted npcs.) The "0" after the name is the comabt level of the npc (you can change this but it won't do anything. I think it is just a reminder so you dont have to look in-game for the npc's combat level.) Now the next number "0" in this case is the npc's health. If you want to spawn attackable npcs then you have to make sure they have hit-points; otherwise, the game will freeze upon seeing the npc (I.E. Kalphite Queen).
Here we will now go through item.cfg. Here are some lines of mine:
Code:
//-----ShopID---ShopName---------------------------------------------------------------------------------------------------------------------------------------------------
item = 1 Tool_kit These_could_be_handy. 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
item = 2 Cannonball Ammo_for_the_Dwarf_Cannon. 4.67264229473597 4.67264229473597 4.85427038587765 0 0 0 0 0 0 0 0 0 0 0 0
item = 3 Nulodion's_notes Construction_notes_for_Dwarf_cannon_ammo. 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
Ok this is similarly to npc.cfg. The "item = 1" says that the "Tool_kit" 's ID is 1. "Tool_kit" is the name of the Item. (all spaces in the the description and name for a regulart item would be turned into a _ [I.E. "abyssal whip" would be "abyssal_whip"].) The "These_could_be_handy." is the description of the item (no use of changing this). The "1", "1", and "1" are the values of the item. CHANGE THE SECOND NUMBER IN THIS SET OF 3 NUMBERS FOR ABSOULUTLY CHANGE THE OVERALL PRIZE OF THE ITEM. The next 12 numbers are the bonuses that you get when wearing/wielding this item (of course this is only for items that you can wear/wield).
Now we will be going through shops.cfg. Here is some lines from me, once again:
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 Varrock_General_Store 1 1 1931 5 1935 2 1735 2 1925 3 1923 2 1887 2 590 2 1755 2 2347 5 550 5 2552 20
shop = 2 Aubury's_Rune_Store 2 2 554 50000 555 50000 556 50000 557 50000 558 50000 559 50000 562 5000 560 25000 4278 25000 563 25000
Ok the "shop = 1" designates this shop as shop 1 (will learn more about this when we get to shophandler.java). Now the "Varrock_General_Store" is the name that will show up while seeing this shop in-game (always use underscores for spaces for names!) If you want it to show up colors, here are some nifty color symbols you put IN FRONT OF the name:
Code:
@gre@
@red@
@yel@
@cya@
@whi@
@bla@
@pur@
@blu@
Now the "1" "1" after the name designates the shop type. ("1" "1" is a general store type - you can sell any item to it. "2" "2" is a special store type - you can only sell back what it already has in stock.) Now the "1931" is the item type that you want in the first slot on that store. You can put any itm you want here. The "5" after the "1931" is the amount of that item you want sold at once/at beginning of server startup. ALWAYS PUT A TAB BETWEEN THE SHOP ID AND THE NAME, ALWAYS PUT A TAB BETWEEN SHOP NAME AND SHOP TYPE, ALWAYS PUT A TAB BETWEEN SHOP TYPE AND SHOP ITEMS, ALWAYS PUT A TAB BETWEEN ITEM SOLD IN SHOP AND ITS AMOUNT, and ALWAYS PUT A TAB BETWEEN THE PREVIOUS ITEM AMOUNT AND THE ITEM SOLD IN THE NEXT SLOT AFTER IT.
----------------------------------------------------------------------------------------------------------------------------------------------------
CHAPTER 3:
Ok in this chapter we will be explaining different variables, frames, cases, and interfaces inside the different java files. I will also explain what they are used for. By knowing this you will become a much better coder. First off we will tackle the different variables.
Ok there are several commonly-used variables:
Code:
boolean
void
int
There are about 20 other ones in java besides these that are used, but these are the main ones used in RS2 private servers and probably the only ones you will be editing (for now.) Ok the boolean variable is usually used for large actions that include smaller variables inside them (voids and ints.) So here is an example of a boolean:
Code:
public boolean process()
{ // is being called regularily every 500ms
NewObjects();
writePlayers();
This boolean is being used as a public boolean (which means it can be accessed by all other java files; you can also make it a private or just keep it boolean to make only that java file use it) and smaller-used variables inside it are "NewObjects();" and "writePlayers();". Ok so now you understand booleans.
Lets move onto voids. Here is an example of a public void:
Code:
public void Shinykey()
{
sendMessage("Your key shines up the room as the chest opens.");
deleteItem(85,getItemSlot(85),1);
addItem(1607,1);
addItem(Item2.randomshinykey(), 1);
}
Ok the void name is "Shinykey()" and it is invlolving code to send a message to the player, to delete the item (in this case the shinykey) and to add an item to the players inventory. But anyways, now this can be used for an action like in this sequence:
Code:
//shiny key
else if(useItemID == 85 && (atObjectID == 172))//crystal chest
{
Shinykey();
}
This is saying that if the item (85) is being used at the object (172) then it will use the public void "Shinykey()". Make sense? Good.
Ok now moving to int (intigers.) Ok this is a good exaomple of an int:
Code:
public static int shinykey[] = {1046,4566,5698,1623,4566,4566,5698,5698,5698,5698,5698,5698,5698,5698,5698,5698,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,5698,5698,5698,5698,5698,5698,5698,5698,5698,5698,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623};//chest of keys - shiny key
public static int randomshinykey()
{
return shinykey[(int)(Math.random()*shinykey.length)];
}
Ok this is giving a public static int (the static is allowing it to be used in a public void [look above at my shinykey void]) the matrix of all those item IDs. Now the next public static int makes a random of that matrix to be picked when being used in a void. In this sequence - "shinykey()".
*****
Let's move onto Frames now. Here are a few examples of Frames, sendQuests, and sendMessages being used:
Code:
sendQuest("@gre@Welcome to Freescape", 8145);
Code:
sendMessage("Oh dear you are dead!");
Code:
sendFrame126("TzHaar", 2484);
Ok the first one "showQuest" is tell to show "Welcome to Freescape" on an interface (in this case the interface is inside the void MainHelpMenu.) The "8145" is the programmed frame of where the "showQuest" will show up in the Interface. Now the "sendMessage" is easy. When you die (in this sequence), then it will send a message in the chat box saying "Oh dear you are dead!". This is simple enough. Now we will move onto the frame one. "sendFrame126" is saying that in that case (case 75 in this sequence) is sending frame126 to the amulet of glory saying in a frame "TzHaar". This is as simple as it can get, sorry. I hope you understand the different purposes of this section of chapter 3.
*****
Now the tough one - cases! First off, cases are used to set certain actions to specific items/interfaces/frames. here is an example of a case being used:
Code:
case 24: //KEY CRAFTING MADE 100% BY MOD TAHAROK
sendFrame164(4882);
stillgfx(199, absX, absY);
sendFrame126("Congratulations, you just advanced a Key Crafting level!", 4884);
sendFrame126("Congratulations, your Key Crafting is now "+playerLevel[24]+" .", 4885);
sendMessage("Congratulations, you just advanced a Key Crafting level!");
NpcDialogueSend = true;
break;
Now this is saying that "case 24" is setting my skill (lol.) This is setting "sendFrame126" 's to send a frame with those messages when I level up a new level. Also it will send a message to me ("sendMessage".) This also allows "NpcDialogue" 's to be used with this case. Besides that you can tell this case designates keycrafting a skill.
*****
Ok now we will move onto Interfaces. Interfaces are skins used to cover everything up that we usually use. Like menu backrounds (just the backround) are interfaces. Then the sidebar backround is the exact same Interface on each different tab. Here is an example of an Interface:
Code:
clearQuestInterface();
Code:
showInterface(8134);
Ok now this is saying to clear all quest interfaces (type of interface.) But it also says to "showInterface(8134)". Interface 8134 is the backround on menus. This is putting in the menu-backround-Interface after the "sendQuest" 's that I put into a void (MainHelpMenu). This is fairly easy to understand. I hope you enjoyed chapter 3 - I certainly did!
----------------------------------------------------------------------------------------------------------------------------------------------------
Difficulty: 2
Assumed Knowledge: Know what a router is. Know what a computer is. Know what the internet is. Know how to read. Know what an IP address is. Know the difference between an internet IP address and a computer/gateway IP address. Know how to use a keyboard (possibly, not entirely required), and finally you need to know how to click with a mouse.
Server Base: I have not personally performed this tutorial, but it is compatible with ANY server source.
Classes Modified: Possibly client.java, item.java, item2.java, npchandler.java, shophandler.java, playerhandler.java, and server.java.
chapter 1 ~ Getting a server source and setting up your server for running to the public and editing.
chapter 2 ~ Thoroughly explaining the important .cfg files.
chapter 3 ~ Explaining variables, frames, and interfaces are and what they do in the .java 's.
chapter 4 ~ Explaining how to edit your .java 's and the purpose of each individual one.
chapter 5 ~ How to learn more and help other players/make your own tutorials!
chapter 6 ~ Setting up a no-ip for your server!
chapter 7 ~ Making a fourms and Website for your server as well as a pumping name!
----------------------------------------------------------------------------------------------------------------------------------------------------
CHAPTER 1:
First off we need a server source (Testscape personally recommended):
Moparscape Server Downloads
All of the top server sources + fast downloading
We may also need Moparscape v3.2:
Moparscape v3.2 w/ Aryan
Next, you will need to open ports in Windows Firewall and/or the firewalls offered by McAffee, Norton, or other full-system maintenance suites. For Windows Firewall, open its settings file in the control panel. Click on the "Exceptions Tab" and then click "Add Port." Add the following port: 43594. (If you'd rather not open a specific port or have to worry about Windows Firewall disabling access in any way, you can disable it entirely.)
Now we will need to make the rule for your router, by doing this you need to go into your router. You can do this by going into Internet Explorer (or whatever client you use for the Internet), and then type in the IP address of the router. Now log into the router and go into "advanced" (at top of screen on mine). Then on the sidebar to the left click the "gaming" button (is only left side for me...) Then you need to make a new rule and fill in the blanks with this information:
Name: 1
IP address: 2
TCP Ports to open: 43594
UDP Ports to open:
Inbound Filter: Allow All
Schedule: Always
KEY
1 = Any name you want the server to be (I.E.MyScape).[/glow]
2 = The IP adddress of your COMPUTER; not the Internet.
Then save it. Ok now you can save settings after the rule is saved. Every router is different. Check with the manuals for yours to fully understand how to open the ports. If you cannot find/have a manuel, go to this address:
Port Forwarding
Now your server rule is nice and good. Now we need Java to get your server's compiler and runserver to work. You can download the newest java at this link:
Java SE Downloads Page
Now, click JDK 6.0
After this, it will come up with a security warning:
Click yes to it. Now you want to agree to the terms and conditions:
You will now get another security box (shown above), just click yes to that again. Now, download the Windows Offline Installation for Multiple Languages (if you are not using Windows, then try downloading the offline installations for some other Operating Systems):
Now the download window will come up. Just click Run and wait for it to end downloading. Then install it and everything should work.
Ok before we can fix the compiler and runeserver, we need to set out variables. Ok go into start menu, then control panel, then system, then advanced, then enviromental variables.
start menu -> control panel -> system -> advanced -> enviromental variables
Ok now find the variable called "path" in the list in that new screen open. Rename it to "PATH" and then for it's variable value (erase old one):
C:Windows\System32\;"C:\Program Files\Java\jdk1.6.0\bin\"
You will also need to set a variables called "classpath". Make a new variable and give it the name classpath. No add this in for it's value:
"C:\Program Files\Java\Java\jdk1.6.0\bin\"
Ok now go into your server source (if you dont have a rar uncompressor you can download 7zip at this link: 7zip, or you can download rar uncompresser at this link: WinRar. Ok now you can right click the compressed source and click "extract here"),
and now when in your server srouce, right click compile.bat and click "edit". Then erase everything in it and put this in it's place:
Code:
@echo off
title Compiler
"%ProgramFiles%\Java\jdk1.6.0\bin\javac.exe" -cp . *.java
pause
Ok now save it and right click runserver.bat and erase all of that and add this:
Code:
@echo off
title Runserver
set java="C:\Program Files\Java\jdk1.6.0\bin\java.exe"
java -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
pause
Ok now we have a working source!
----------------------------------------------------------------------------------------------------------------------------------------------------
CHAPTER 2:
Ok now we want to edit your cfg files. Ok first of right click your cfg files and click "open with", then search the list for notepad. High-light it and then click the box at the bottom of that window that says "use this to open all files of this type" (make sure it has a check mark in it), then click ok. Do this same thing with the .java 's. Ok now open up autospawn.cfg. This is the first few lines of my autospawn:
Code:
//------NpcID---CoordX--CoordY--Height--RangeX1-RangeY1-RangeX2-RangeY2-WalkType-Descrption
spawn = 1699 2816 3462 0 2817 3463 2815 3461 2 Ghost Shopkeeper
spawn = 23 2660 3304 0 2662 3306 2658 3302 2 Knight Of Adrougne
spawn = 23 2662 3309 0 2665 3311 2660 3308 2 Knight Of Adrougne
Ok the first is a Ghost Shopkeeper (hence the description). The "spawn = 1699" is saying that npc 1699 (1699 = code of that npc) will be spawned (we will get into other npc codes in the furture). Now the "2816" and "3462" are the X and Y cordinates of where the npc will be spawned on the map. This is just like Math in school, the X and Y are just like X and Y on a graph. You can find you X and Y cords inside the game by using the command ::mypos or by looking in the player settings button on the sidebar and your X and Y cords are usually next to your run energy. Ok now the "0" above is the height of the npc. Unless you are making in a multi-level house/building or are in a dungeon, keep this at 0 when making your own npc spawns. Now the "2817", "3463", "2815", and "3461" are the X X and Y Y cords of where the npc will be walking. This can get confusing (lol) so you can just keep these at 0 0 0 0 if you wish. Then next thing is "2". This represents the walk-type of the npc. You can keep this at 1 if you are making the npc stationary. Now the last thing is the "Ghost Shopkeeper". This is the title and you need one. It can be anything you want but I would advise to put the npc name here, then click enter to the next line, and then put the city/place where it is being spawned. This will save a lot of confusion.
Ok now lets look at npc.cfg. Here is another few lines of code from mine:
Code:
//Fixed by: Takajin++ a.k.a. Yetsuki
// NpcID NpcName combat health
npc = 0 Hans 0 0
npc = 1 Man 2 7
npc = 2 Man 2 7
npc = 3 Man 2 7
npc = 4 Woman 2 7
npc = 5 Woman 2 7
npc = 6 Woman
Ok the first thing "npc = 0" is the ID code for that npc (this ID code is what is used for autospawn.cfg and npc-spawning commands in-game). Then the "Hans" is the name of the npc (pretty much it's here for fast maneuvering through wanted npcs.) The "0" after the name is the comabt level of the npc (you can change this but it won't do anything. I think it is just a reminder so you dont have to look in-game for the npc's combat level.) Now the next number "0" in this case is the npc's health. If you want to spawn attackable npcs then you have to make sure they have hit-points; otherwise, the game will freeze upon seeing the npc (I.E. Kalphite Queen).
Here we will now go through item.cfg. Here are some lines of mine:
Code:
//-----ShopID---ShopName---------------------------------------------------------------------------------------------------------------------------------------------------
item = 1 Tool_kit These_could_be_handy. 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
item = 2 Cannonball Ammo_for_the_Dwarf_Cannon. 4.67264229473597 4.67264229473597 4.85427038587765 0 0 0 0 0 0 0 0 0 0 0 0
item = 3 Nulodion's_notes Construction_notes_for_Dwarf_cannon_ammo. 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
Ok this is similarly to npc.cfg. The "item = 1" says that the "Tool_kit" 's ID is 1. "Tool_kit" is the name of the Item. (all spaces in the the description and name for a regulart item would be turned into a _ [I.E. "abyssal whip" would be "abyssal_whip"].) The "These_could_be_handy." is the description of the item (no use of changing this). The "1", "1", and "1" are the values of the item. CHANGE THE SECOND NUMBER IN THIS SET OF 3 NUMBERS FOR ABSOULUTLY CHANGE THE OVERALL PRIZE OF THE ITEM. The next 12 numbers are the bonuses that you get when wearing/wielding this item (of course this is only for items that you can wear/wield).
Now we will be going through shops.cfg. Here is some lines from me, once again:
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 Varrock_General_Store 1 1 1931 5 1935 2 1735 2 1925 3 1923 2 1887 2 590 2 1755 2 2347 5 550 5 2552 20
shop = 2 Aubury's_Rune_Store 2 2 554 50000 555 50000 556 50000 557 50000 558 50000 559 50000 562 5000 560 25000 4278 25000 563 25000
Ok the "shop = 1" designates this shop as shop 1 (will learn more about this when we get to shophandler.java). Now the "Varrock_General_Store" is the name that will show up while seeing this shop in-game (always use underscores for spaces for names!) If you want it to show up colors, here are some nifty color symbols you put IN FRONT OF the name:
Code:
@gre@
@red@
@yel@
@cya@
@whi@
@bla@
@pur@
@blu@
Now the "1" "1" after the name designates the shop type. ("1" "1" is a general store type - you can sell any item to it. "2" "2" is a special store type - you can only sell back what it already has in stock.) Now the "1931" is the item type that you want in the first slot on that store. You can put any itm you want here. The "5" after the "1931" is the amount of that item you want sold at once/at beginning of server startup. ALWAYS PUT A TAB BETWEEN THE SHOP ID AND THE NAME, ALWAYS PUT A TAB BETWEEN SHOP NAME AND SHOP TYPE, ALWAYS PUT A TAB BETWEEN SHOP TYPE AND SHOP ITEMS, ALWAYS PUT A TAB BETWEEN ITEM SOLD IN SHOP AND ITS AMOUNT, and ALWAYS PUT A TAB BETWEEN THE PREVIOUS ITEM AMOUNT AND THE ITEM SOLD IN THE NEXT SLOT AFTER IT.
----------------------------------------------------------------------------------------------------------------------------------------------------
CHAPTER 3:
Ok in this chapter we will be explaining different variables, frames, cases, and interfaces inside the different java files. I will also explain what they are used for. By knowing this you will become a much better coder. First off we will tackle the different variables.
Ok there are several commonly-used variables:
Code:
boolean
void
int
There are about 20 other ones in java besides these that are used, but these are the main ones used in RS2 private servers and probably the only ones you will be editing (for now.) Ok the boolean variable is usually used for large actions that include smaller variables inside them (voids and ints.) So here is an example of a boolean:
Code:
public boolean process()
{ // is being called regularily every 500ms
NewObjects();
writePlayers();
This boolean is being used as a public boolean (which means it can be accessed by all other java files; you can also make it a private or just keep it boolean to make only that java file use it) and smaller-used variables inside it are "NewObjects();" and "writePlayers();". Ok so now you understand booleans.
Lets move onto voids. Here is an example of a public void:
Code:
public void Shinykey()
{
sendMessage("Your key shines up the room as the chest opens.");
deleteItem(85,getItemSlot(85),1);
addItem(1607,1);
addItem(Item2.randomshinykey(), 1);
}
Ok the void name is "Shinykey()" and it is invlolving code to send a message to the player, to delete the item (in this case the shinykey) and to add an item to the players inventory. But anyways, now this can be used for an action like in this sequence:
Code:
//shiny key
else if(useItemID == 85 && (atObjectID == 172))//crystal chest
{
Shinykey();
}
This is saying that if the item (85) is being used at the object (172) then it will use the public void "Shinykey()". Make sense? Good.
Ok now moving to int (intigers.) Ok this is a good exaomple of an int:
Code:
public static int shinykey[] = {1046,4566,5698,1623,4566,4566,5698,5698,5698,5698,5698,5698,5698,5698,5698,5698,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,5698,5698,5698,5698,5698,5698,5698,5698,5698,5698,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623,1623};//chest of keys - shiny key
public static int randomshinykey()
{
return shinykey[(int)(Math.random()*shinykey.length)];
}
Ok this is giving a public static int (the static is allowing it to be used in a public void [look above at my shinykey void]) the matrix of all those item IDs. Now the next public static int makes a random of that matrix to be picked when being used in a void. In this sequence - "shinykey()".
*****
Let's move onto Frames now. Here are a few examples of Frames, sendQuests, and sendMessages being used:
Code:
sendQuest("@gre@Welcome to Freescape", 8145);
Code:
sendMessage("Oh dear you are dead!");
Code:
sendFrame126("TzHaar", 2484);
Ok the first one "showQuest" is tell to show "Welcome to Freescape" on an interface (in this case the interface is inside the void MainHelpMenu.) The "8145" is the programmed frame of where the "showQuest" will show up in the Interface. Now the "sendMessage" is easy. When you die (in this sequence), then it will send a message in the chat box saying "Oh dear you are dead!". This is simple enough. Now we will move onto the frame one. "sendFrame126" is saying that in that case (case 75 in this sequence) is sending frame126 to the amulet of glory saying in a frame "TzHaar". This is as simple as it can get, sorry. I hope you understand the different purposes of this section of chapter 3.
*****
Now the tough one - cases! First off, cases are used to set certain actions to specific items/interfaces/frames. here is an example of a case being used:
Code:
case 24: //KEY CRAFTING MADE 100% BY MOD TAHAROK
sendFrame164(4882);
stillgfx(199, absX, absY);
sendFrame126("Congratulations, you just advanced a Key Crafting level!", 4884);
sendFrame126("Congratulations, your Key Crafting is now "+playerLevel[24]+" .", 4885);
sendMessage("Congratulations, you just advanced a Key Crafting level!");
NpcDialogueSend = true;
break;
Now this is saying that "case 24" is setting my skill (lol.) This is setting "sendFrame126" 's to send a frame with those messages when I level up a new level. Also it will send a message to me ("sendMessage".) This also allows "NpcDialogue" 's to be used with this case. Besides that you can tell this case designates keycrafting a skill.
*****
Ok now we will move onto Interfaces. Interfaces are skins used to cover everything up that we usually use. Like menu backrounds (just the backround) are interfaces. Then the sidebar backround is the exact same Interface on each different tab. Here is an example of an Interface:
Code:
clearQuestInterface();
Code:
showInterface(8134);
Ok now this is saying to clear all quest interfaces (type of interface.) But it also says to "showInterface(8134)". Interface 8134 is the backround on menus. This is putting in the menu-backround-Interface after the "sendQuest" 's that I put into a void (MainHelpMenu). This is fairly easy to understand. I hope you enjoyed chapter 3 - I certainly did!
----------------------------------------------------------------------------------------------------------------------------------------------------

