RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
FletchKindling.java
1package com.osroyale.content.wintertodt.actions;
2
3import com.osroyale.Config;
4import com.osroyale.content.wintertodt.Wintertodt;
5import com.osroyale.content.wintertodt.WintertodtAction;
6import com.osroyale.game.world.entity.mob.player.Player;
7import com.osroyale.game.world.entity.skill.Skill;
8import com.osroyale.game.world.items.Item;
9
28
29public class FletchKindling extends WintertodtAction {
30
31 int tick, amount;
32
33 public FletchKindling(Player player, int amount) {
34 super(player);
35 this.amount = amount;
36 }
37
38 @Override
39 protected void execute() {
40
41 if(!getMob().inventory.contains(Wintertodt.BRUMA_ROOT)) {
42 getMob().animate(65535);
43 getMob().action.getCurrentAction().cancel();
44 return;
45 }
46
47 if(tick % 3 == 0) {
48 getMob().animate(1248);
49
50 getMob().inventory.remove(new Item(Wintertodt.BRUMA_ROOT));
51 getMob().inventory.add(new Item(Wintertodt.BRUMA_KINDLING));
52 getMob().inventory.refresh();
53 double xp = Skill.getLevelForExperience(getMob().skills.get(Skill.FLETCHING).getExperience()) * 0.6;
54 if(xp > 0) getMob().skills.addExperience(Skill.FLETCHING, xp * Config.FLETCHING_MODIFICATION);
55
56 amount--;
57 if(amount <= 0) {
58 getMob().animate(65535);
59 getMob().action.getCurrentAction().cancel();
60 return;
61 }
62 }
63 tick++;
64 }
65
66}
static final double FLETCHING_MODIFICATION
Definition Config.java:301
static final byte getLevelForExperience(double experience)
Definition Skill.java:483