/**
* Creates a Object.
* @param Objectid The Id of the Object to spawn.
* @param Heigh The Height to spawn the Object on.
* @param ObjectX The AbsX to spawn the Object on.
* @param ObjectY The AbsY to spawn the Object on.
* @param Face The Position for the OBject to face
* @param Type Object Type
* */
public void createObject(Player p, int objectId, int height, int objectX, int objectY, int face, int type) {
sendCoords(p, (objectX - ((p.mapRegionX - 6) * 8)), (objectY - ((p.mapRegionY - 6) * 8)));
int ot = ((type << 2) + (face & 3));
p.stream.createFrame(30);
p.stream.writeWordBigEndian(objectId);
p.stream.writeByteA(0);
p.stream.writeByteC(ot);
}
/**
* Creates a GlobalObject.
* @param Objectid The Id of the Object to spawn.
* @param Heigh The Height to spawn the Object on.
* @param ObjectX The AbsX to spawn the Object on.
* @param ObjectY The AbsY to spawn the Object on.
* @param Face The Position for the OBject to face
* @param Type Object Type
* */
public void createGlobalObject(int objectId, int height, int objectX, int objectY, int face, int type) {
for (Player p : Engine.players) {
if (p == null) {
continue;
}
createObject(p, objectId, height, objectX, objectY, face, type);
}
}