PDA

View Full Version : 562 rs2hd adding objects



Divine-X
June 19th, 2010, 02:25
Step 1:
Open your source folder

Step 2:
Go here: src\com\rs2hd\net\ActionSender.java

Step 3:
Search

player.getActionSender().sendCreateObject

You will see this void:
public void sendMapRegion() {
try {
if(!validateMapRegion()) {
player.getActionSender().sendMessage("This area of the world is unavailable, teleporting to spawn point...");
player.setLocation(Entity.DEFAULT_LOCATION);
}
StaticPacketBuilder spb = new StaticPacketBuilder().setId(76).setSize(Packet.Siz e.VariableShort);
boolean forceSend = true;
spb.addLEShortA(player.getLocation().getRegionX()) ;
spb.addShort(player.getLocation().getLocalY());
spb.addByte((byte) 0);
spb.addByteA(0);
if ((((player.getLocation().getRegionX() / 8) == 48) || ((player.getLocation().getRegionX() / 8) == 49)) && ((player.getLocation().getRegionY() / 8) == 48)) {
forceSend = false;
}
if (((player.getLocation().getRegionX() / 8) == 48) && ((player.getLocation().getRegionY() / 8) == 148)) {
forceSend = false;
}
for (int xCalc = (player.getLocation().getRegionX() - 6) / 8; xCalc <= ((player.getLocation().getRegionX() + 6) / 8); xCalc++) {
for (int yCalc = (player.getLocation().getRegionY() - 6) / 8; yCalc <= ((player.getLocation().getRegionY() + 6) / 8); yCalc++) {
int region = yCalc + (xCalc << 8); // 1786653352
if (forceSend || ((yCalc != 49) && (yCalc != 149) && (yCalc != 147) && (xCalc != 50) && ((xCalc != 49) || (yCalc != 47)))) {
int[] mapData = World.getInstance().getMapData(region);
if(mapData == null) {
mapData = new int[4];
}
spb.addInt(mapData[0]);
spb.addInt(mapData[1]);
spb.addInt(mapData[2]);
spb.addInt(mapData[3]);
}
}
}
spb.addByteA(player.getLocation().getZ());
spb.addShort(player.getLocation().getLocalX());
spb.addShort(player.getLocation().getRegionY());
player.getSession().write(spb.toPacket());
player.getUpdateFlags().setLastRegion(player.getLo cation());
World.getInstance().getItemManager().refresh(playe r);
World.getInstance().getObjectManager().refresh(pla yer);
if (player.getLocation().getZ() == 0) {
player.getActionSender().sendCreateObject(409, 0, 3223, 3223, -2, 10);
player.getActionSender().sendCreateObject(17010, 0, 2141, 3943, -1, 10);
player.getActionSender().sendCreateObject(2560, 0, 3226, 3215, -1, 10);
player.getActionSender().sendCreateObject(2562, 0, 3226, 3225, -1, 10);
player.getActionSender().sendCreateObject(2213, 0, 3227, 3218, -1, 10);
player.getActionSender().sendCreateObject(409, 0, 2902, 4410, -2, 10);
GameEngine.TreeLive.treesCheck(player);
GameEngine.RockLive.rocksCheck(player);
GameEngine.StallLive.stallsCheck(player);
//player.RouteFinder().loadMap();
}
} catch(Exception e) {
}
}


Ok well pretty simpile?
(These are not all of my objects removed the good ones from leechers.)

Now i'm going to explain real quickly because i'm getting bored o.O
(OBJECT ID, 0, X COORD, Y COORD, Way it face, 10);

Example:


player.getActionSender().sendCreateObject(409, 0, 2902, 4410, -2, 10);

Alright

-2 means it going to face South
-1 means it going to face West
0 means it is going to face North [I believe]
1 Means it going for face East [I BELIEVE]

I have not tested 0 and 1 yet.

Save compile, Restart server and boom. Your object is created.

Thank you.

jamie
June 19th, 2010, 05:14
Thanks helpful for the 562 lovers and wannabe makers.

Divine-X
June 20th, 2010, 17:46
Mhm, I guess and are you Jamie who dated Sarah?

finalpk
June 28th, 2010, 18:38
nice tut for beginners...

Demonzscape owner
July 1st, 2010, 10:38
nice tut ill use this

AdmiII
August 2nd, 2010, 14:49
Ok, I added an object, it's a dummy, but if I click on it it says, object not added 823= 2604 5702 the x and y, how can I make it attack the dummy?

riches321
August 2nd, 2010, 15:32
ffs... its an npc....

Discardedx2
August 3rd, 2010, 04:11
Ok, I added an object, it's a dummy, but if I click on it it says, object not added 823= 2604 5702 the x and y, how can I make it attack the dummy?
Lol the dummy is an npc id for it is 7891 i think.

crowd1
October 26th, 2010, 02:14
will this spawn the same object like 500 time randomly on the map ??

battlezone
October 26th, 2010, 06:57
people need a tutoiral for this? its to hard to serch the dam bank code at least 8+ months ago when there were no tuts people were smart enough to use the serch box. now people are so dumb they need tutorials to do the simple things

Karbon
November 7th, 2010, 01:32
people need a tutoiral for this? its to hard to serch the dam bank code at least 8+ months ago when there were no tuts people were smart enough to use the serch box. now people are so dumb they need tutorials to do the simple things

Or maybe they are begginer coders, which i am sure you understand, after all, i believe this is for begginer coders like me.

Coolguy77
December 12th, 2010, 23:50
where do we put the code? do we just dump it in their somewhere? lol and i am in my actionsender.java and searched player.getActionSender().sendCreateObject but mine doesnt seem to have it.... i have a 562 server btw

Tyler930
December 15th, 2010, 03:46
@ coolguy77 then add it in thier? all the code you need is here..

energy-scape
May 16th, 2011, 17:26
i need a portel at 2973 9515 1 how can i setup high???