}
private void handleFireMaking(int tries) {
final int retries = --tries;
final FiremakingDef def = EntityHandler
.getFiremakingDef(item.getID());
if (!itemId(new int[] { 166 }) || def == null) {
owner.getActionSender().sendMessage(
"Nothing interesting happens.");
return;
}
if (owner.getCurStat(11) < def.getRequiredLevel()) {
owner.getActionSender()
.sendMessage(
"You need at least "
+ def.getRequiredLevel()
+ " firemaking to light these logs.");
return;
}
owner.setBusy(true);
Bubble bubble = new Bubble(owner, 166);
for (Player p : owner.getViewArea()
.getPlayersInView()) {
p.informOfBubble(bubble);
}
owner.getActionSender().sendMessage(
"You attempt to light the logs...");
Instance.getDelayedEventHandler().add(
new ShortEvent(owner) {
public void action() {
if (Formulae.lightLogs(def,
owner.getCurStat(11))) {
owner.getActionSender()
.sendMessage(
"They catch fire and start to burn.");
world.unregisterItem(item);
final GameObject fire = new GameObject(
item.getLocation(), 97,
0, 0);
world.registerGameObject(fire);
world.getDelayedEventHandler()
.add(new DelayedEvent(
null,
def.getLength()) {
public void run() {
if (tile.hasGameObject()
&& tile.getGameObject()
.equals(fire)) {
world.unregisterGameObject(fire);
world.registerItem(new Item(
181,
tile.getX(),
tile.getY(),
1,
null));
}
matchRunning = false;
}
});
owner.incExp(
11,
Formulae.firemakingExp(
owner.getMaxStat(11),
def.getExp()),
true);
owner.getActionSender()
.sendStat(11);
owner.setBusy(false);
} else {