RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
MixHerb.java
1package com.osroyale.content.wintertodt.actions;
2
3import com.osroyale.Config;
4import com.osroyale.content.wintertodt.Wintertodt;
5import com.osroyale.game.action.Action;
6import com.osroyale.game.action.policy.WalkablePolicy;
7import com.osroyale.game.world.entity.mob.player.Player;
8import com.osroyale.game.world.entity.skill.Skill;
9import com.osroyale.game.world.items.Item;
10
11public class MixHerb extends Action<Player> {
12
13 int tick, amount;
14
15 public MixHerb(Player player, int amount) {
16 super(player, 1);
17 this.amount = amount;
18 }
19
20 @Override
21 public WalkablePolicy getWalkablePolicy() {
22 return WalkablePolicy.NON_WALKABLE;
23 }
24
25 @Override
26 public String getName() {
27 return "Mix herb";
28 }
29
30 @Override
31 protected void execute() {
32 if(!getMob().inventory.contains(Wintertodt.BRUMA_HERB) || !getMob().inventory.contains(Wintertodt.REJUV_POT_UNF)) {
33 getMob().animate(65535);
34 getMob().action.getCurrentAction().cancel();
35 return;
36 }
37
38 if(tick % 2 == 0) {
39
40 getMob().message("You combine the bruma herb into the unfinished potion.");
41 getMob().animate(363);
42 getMob().inventory.remove(new Item(Wintertodt.BRUMA_HERB));
43 getMob().inventory.remove(new Item(Wintertodt.REJUV_POT_UNF));
44 getMob().inventory.add(new Item(Wintertodt.REJUV_POT_4));
45 getMob().inventory.refresh();
46 double xp = Skill.getLevelForExperience(getMob().skills.get(Skill.HERBLORE).getExperience()) * 0.1;
47 if(xp > 0) getMob().skills.addExperience(Skill.HERBLORE, xp * Config.HERBLORE_MODIFICATION);
48
49 amount--;
50 if(amount <= 0) {
51 getMob().animate(65535);
52 getMob().action.getCurrentAction().cancel();
53 return;
54 }
55 }
56
57 tick++;
58 }
59}
abstract WalkablePolicy getWalkablePolicy()