Mod Joe
June 17th, 2010, 18:51
Hi there, this tut will give you a basic idea of a 562[Rs2hd] server and getting around the Source, just how to keep it alive...Etc.
Okay, firstly, when you have it setup etc..to change the name of your server(If using Rs2hd) simply go to - Data>Scripts>Authentication. When you open the file...Open it is as a notepad from your selected browsers. Then you should see something like this :
player.getActionSender().sendMessage("Welcome to Bla Bla Bla");
Just edit that to make it so what you wish, then compile..
Okay, Secondly, now we go onto adding Npc's, First off when you open your Source, go into Data>Npcs.Xml,(there are a couple of ways of adding these) you will "hopefully" see something like:
<npc><id>320</id><location><x>2840</x><y>3431</y><z>0</z></location></npc>
To find the X and Y coords of your disired posistion simply stand on the spot you would like and type "coords" in your Commands Screen.
Just copy and paste that two or one line undearneath and where you see "<id>320</id>" just simply change the id to your npc id you have chosen. Where you see the "<x>2840</x>" Is the first coords, the "x" simply change that and same with the "y" and the 0 in "<z>0</z>" Is the height of ground where your placing your npc.
The second way of adding it is the "Down" method. Scroll down when you open your Npcs.xml and you will see something like...:
<npc>
<id>115</id>
<location>
<x>2495</x>
<y>3089</y>
<z>0</z>
</location>
<walkType>RANGE</walkType>
<minimumCoords>
<x>2602</x>
<y>3096</y>
<z>0</z>
</minimumCoords>
<maximumCoords>
<x>2606</x>
<y>3099</y>
<z>0</z>
</maximumCoords>
</npc>
Same method again. Where you see the Npc id change to your desired one and where you see your x and y coords change to what you wish.
Thirdly, Changing your home, simply go into Src>Com>Rs2hd>Model>Entity.java. Once your in there you will see something like:
public static final Location DEFAULT_LOCATION = Location.location(3163, 3482, 0)
And....
public static final Location CLAN_DEATH = Location.location(3163, 3482, 0);
On the first one where you see "(3163, 3482, 0)" that is the coords of where you login...so like you have learned earlier in this tutorial about getting your coords, simply do the same, and with the second one, that is where you die. Simply change your coords again.
And, Fourthly, adding objects. Go to Src>Com>Rs2hd>PacketHandler>Object1PackHandler.Java, you will need the id of your Object...to start with. Once you have that it will be something like:
case 0000://hi
player.WalkTo().WalkTo(player, 3417, 3540);
if(player.getLocation().getX() == 3417 && player.getLocation().getY() == 3540) {
World.getInstance().registerEvent(new Event(100) {
public void execute() {
player.tele(3412, 3540, 1);
this.stop();
}
});
}
break;
Where you see "case 0000" change it to your Object id. and where you see "player.WalkTo().WalkTo(player, 3417, 3540);" They are the coords to right infront of your object, so it walks to it instead of making it tele you way furthur back, and the same with: "if(player.getLocation().getX() == 3417 && player.getLocation().getY() == 3540) {" They are the coords to right infornt of your object also.. and the "player.tele(3412, 3540, 1);" Is simply the "outcome" coords to where your player ends up on clicking the object. If you would like to make your player have some sort of... Gfx? or Emote? to when clicking the object, the code for having a emote would be something like....:
player.animate(0000, 0);
and change the "0000" to what your emote id is.
Also for adding gfx to when clickin on your object will be something like.....:
player.graphics(0000, 0);
Same again... Change your "0000" to what your gfx id is.
Thank you, i hope this guide helps new commers to 562's. :)
Okay, firstly, when you have it setup etc..to change the name of your server(If using Rs2hd) simply go to - Data>Scripts>Authentication. When you open the file...Open it is as a notepad from your selected browsers. Then you should see something like this :
player.getActionSender().sendMessage("Welcome to Bla Bla Bla");
Just edit that to make it so what you wish, then compile..
Okay, Secondly, now we go onto adding Npc's, First off when you open your Source, go into Data>Npcs.Xml,(there are a couple of ways of adding these) you will "hopefully" see something like:
<npc><id>320</id><location><x>2840</x><y>3431</y><z>0</z></location></npc>
To find the X and Y coords of your disired posistion simply stand on the spot you would like and type "coords" in your Commands Screen.
Just copy and paste that two or one line undearneath and where you see "<id>320</id>" just simply change the id to your npc id you have chosen. Where you see the "<x>2840</x>" Is the first coords, the "x" simply change that and same with the "y" and the 0 in "<z>0</z>" Is the height of ground where your placing your npc.
The second way of adding it is the "Down" method. Scroll down when you open your Npcs.xml and you will see something like...:
<npc>
<id>115</id>
<location>
<x>2495</x>
<y>3089</y>
<z>0</z>
</location>
<walkType>RANGE</walkType>
<minimumCoords>
<x>2602</x>
<y>3096</y>
<z>0</z>
</minimumCoords>
<maximumCoords>
<x>2606</x>
<y>3099</y>
<z>0</z>
</maximumCoords>
</npc>
Same method again. Where you see the Npc id change to your desired one and where you see your x and y coords change to what you wish.
Thirdly, Changing your home, simply go into Src>Com>Rs2hd>Model>Entity.java. Once your in there you will see something like:
public static final Location DEFAULT_LOCATION = Location.location(3163, 3482, 0)
And....
public static final Location CLAN_DEATH = Location.location(3163, 3482, 0);
On the first one where you see "(3163, 3482, 0)" that is the coords of where you login...so like you have learned earlier in this tutorial about getting your coords, simply do the same, and with the second one, that is where you die. Simply change your coords again.
And, Fourthly, adding objects. Go to Src>Com>Rs2hd>PacketHandler>Object1PackHandler.Java, you will need the id of your Object...to start with. Once you have that it will be something like:
case 0000://hi
player.WalkTo().WalkTo(player, 3417, 3540);
if(player.getLocation().getX() == 3417 && player.getLocation().getY() == 3540) {
World.getInstance().registerEvent(new Event(100) {
public void execute() {
player.tele(3412, 3540, 1);
this.stop();
}
});
}
break;
Where you see "case 0000" change it to your Object id. and where you see "player.WalkTo().WalkTo(player, 3417, 3540);" They are the coords to right infront of your object, so it walks to it instead of making it tele you way furthur back, and the same with: "if(player.getLocation().getX() == 3417 && player.getLocation().getY() == 3540) {" They are the coords to right infornt of your object also.. and the "player.tele(3412, 3540, 1);" Is simply the "outcome" coords to where your player ends up on clicking the object. If you would like to make your player have some sort of... Gfx? or Emote? to when clicking the object, the code for having a emote would be something like....:
player.animate(0000, 0);
and change the "0000" to what your emote id is.
Also for adding gfx to when clickin on your object will be something like.....:
player.graphics(0000, 0);
Same again... Change your "0000" to what your gfx id is.
Thank you, i hope this guide helps new commers to 562's. :)