|
Hello everyone,
Recently I've discovered a bug in my server.
So firemakings works, but there's one annoying thing wich is:
If you use a log you do not have the FM requirment for it glitches the whole skill, then you wont be able to use any log on the tinderbox not even the ones to do have the requirment for nothing happends.
But if you relog you're able to light te logs again (the ones you have the requirment for)
Thanks,
[SPOIL]package server.model.players.skills;
import server.cycle.*;
import server.clip.region.Region;
import server.model.players.Client;
import server.model.objects.Objects;
import server.model.items.GroundItem;
import server.world.ItemHandler;
import server.world.ObjectHandler;
import server.model.players.Experience;
public class Firemaking {
private static int[][] data = {
{1511, 1, 250, 2732}, // LOG
{7406, 1, 175, 11406}, // RED LOG
{7405, 1, 175, 11405}, // BLUE LOG
{7404, 1, 175, 11404}, // RED LOG
{2862, 1, 250, 2732}, // ACHEY
{1521, 15, 400, 2732}, // OAK
{1519, 30, 700, 2732}, // WILLOW
{6333, 35, 1300, 2732}, // TEAK
{1517, 45, 2050, 2732}, // MAPLE
{10810, 45, 2930, 2732}, // ARTIC PINE
{6332, 50, 3320, 2732}, // MAHOGANY
{1515, 60, 3800, 2732}, // YEW
{1513, 75, 4090, 2732}, // MAGIC
};
public static boolean playerLogs(Client c, int i, int l) {
boolean flag = false;
for (int kl = 0; kl < data.length; kl++) {
if ((i == data[kl][0] && l == 590) || (i == 590 && l == data[kl][0])) {
flag = true;
}
}
return flag;
}
public static void grabData(final Client c, final int useWith, final int withUse, int slot) {
if (c == null || c.disconnected || c.duelStatus >= 5 || c.playerIsFiremaking || System.currentTimeMillis() - c.lastFire < 1200)
return;
final int[] coords = new int[3];
coords[0] = c.absX;
coords[1] = c.absY;
coords[2] = c.heightLevel;
Objects o = ObjectHandler.objectExists(coords[0], coords[1], coords[2]);
if (o != null) {
c.sendMessage("You can't light a fire here.");
return;
}
if (c.woodcut[0] > 0)
c.woodcut[0] = 0;
c.playerIsFiremaking = true;
for (int i = 0; i < data.length; i++) {
if (useWith == 590 || withUse == 590) {
if ((useWith == 590 ? withUse : useWith) != data[i][0])
continue;
}
if (c.playerLevel[11] < data[i][1]) {
c.sendMessage("You need a firemaking level of at least " + data[i][1] + " to light this log.");
return;
}
final int log = data[i][0];
final int fire = data[i][3];
final int xpAmount = data[i][2];
c.startAnimation(733);
c.lastFire = System.currentTimeMillis();
c.resetWalkingQueue();
c.getItems().deleteItem(log, 1);
ItemHandler.createGroundItem(c, log, coords[0], coords[1], 1, c.getId());
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
public void execute(CycleEventContainer container) {
if (c == null || c.disconnected) {
container.stop();
return;
}
ItemHandler.removeGroundItem(c, log, coords[0], coords[1], false);
Objects o = new Objects(fire, coords[0], coords[1], coords[2], 0, 10, 0);
ObjectHandler.placeObject(o);
Experience.addExperience(c, xpAmount, 11);
c.playerIsFiremaking = false;
container.stop();
}
public void stop() {
}
}, 2);
if (Region.getClipping(c.getX(), c.getY(), c.heightLevel, -1, 0, false)) {
c.getPA().walkTo(-1, 0);
} else if (Region.getClipping(c.getX(), c.getY(), c.heightLevel, 1, 0, false)) {
c.getPA().walkTo(1, 0);
} else if (Region.getClipping(c.getX(), c.getY(), c.heightLevel, 0, -1, false)) {
c.getPA().walkTo(0, -1);
} else if (Region.getClipping(c.getX(), c.getY(), c.heightLevel, 0, 1, false)) {
c.getPA().walkTo(0, 1);
}
c.sendMessage("You light the logs.");
c.sendMessage("<col=1532693>830 Coins have been added to your Money Pouch!</col>");
c.MoneyCash += 830;
if(c.MoneyCash > 99999 && c.MoneyCash <= 999999) {
c.getPA().sendFrame126(""+c.MoneyCash/1000+"K", 8134);
} else if(c.MoneyCash > 999999 && c.MoneyCash <= 2147483647) {
c.getPA().sendFrame126(""+c.MoneyCash/1000000+"M", 8134);
} else {
c.getPA().sendFrame126(""+c.MoneyCash+"", 8134);
}
c.getPA().sendFrame126(""+c.MoneyCash+"", 8135);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
public void execute(CycleEventContainer container) {
if (c == null || c.disconnected) {
container.stop();
return;
}
c.startAnimation(65535);
container.stop();
}
public void stop() {
}
}, 2);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
public void execute(CycleEventContainer container) {
container.stop();
}
public void stop() {
Objects removeFire = ObjectHandler.objectExists(coords[0], coords[1], coords[2]);
ObjectHandler.globalRemoveObject(removeFire);
GroundItem item = new GroundItem(592, coords[0], coords[1], coords[2], 1, 0, 0, "");
item.removeTicks = 25;
ItemHandler.createGlobalItem(item);
ItemHandler.addItem(item);
}
}, 30);
c.turnPlayerTo(c.absX + 1, c.absY);
break;
}
}
}[/SPOIL]
This is very old lol, i suggest you rewrite or use my release.
https://www.rune-server.ee/runescape...g-release.html
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |