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.
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.