RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
FeedBrazier.java
1
package
com.osroyale.content.wintertodt.actions;
2
3
import
com.osroyale.Config;
4
import
com.osroyale.content.wintertodt.Brazier;
5
import
com.osroyale.content.wintertodt.Wintertodt;
6
import
com.osroyale.content.wintertodt.WintertodtAction;
7
import
com.osroyale.game.world.entity.mob.player.Player;
8
import
com.osroyale.game.world.entity.skill.Skill;
9
import
com.osroyale.game.world.items.Item;
10
29
30
public
class
FeedBrazier
extends
WintertodtAction {
31
32
Brazier
brazier;
33
int
tick;
34
35
public
FeedBrazier(
Player
player,
Brazier
brazier) {
36
super(player);
37
this.brazier = brazier;
38
}
39
40
@Override
41
protected
void
execute
() {
42
if
(brazier.getObject().getId() !=
Wintertodt
.BURNING_BRAZIER_ID) {
43
getMob
().message(
"The brazier has gone out."
);
44
getMob
().animate(65535);
45
getMob
().action.getCurrentAction().cancel();
46
return
;
47
}
48
49
if
(!
getMob
().inventory.contains(
Wintertodt
.
BRUMA_ROOT
) && !
getMob
().inventory.contains(
Wintertodt
.BRUMA_KINDLING)) {
50
getMob
().animate(65535);
51
getMob
().action.getCurrentAction().cancel();
52
return
;
53
}
54
55
if
(tick % 2 == 0) {
56
getMob
().animate(832);
57
if
(
getMob
().inventory.remove(
new
Item(
Wintertodt
.BRUMA_KINDLING))) {
58
double
xp =
Skill
.
getLevelForExperience
(
getMob
().skills.get(
Skill
.
FIREMAKING
).getExperience()) * 3.8;
59
if
(xp > 0)
getMob
().skills.addExperience(
Skill
.
FIREMAKING
, xp *
Config
.
FIREMAKING_MODIFICATION
);
60
Wintertodt
.
addPoints
(
getMob
(), 25);
61
}
else
{
62
getMob
().inventory.remove(
new
Item(
Wintertodt
.
BRUMA_ROOT
));
63
double
xp =
Skill
.
getLevelForExperience
(
getMob
().skills.get(
Skill
.
FIREMAKING
).getExperience()) * 3;
64
if
(xp > 0)
getMob
().skills.addExperience(
Skill
.
FIREMAKING
, xp *
Config
.
FIREMAKING_MODIFICATION
);
65
Wintertodt
.
addPoints
(
getMob
(), 10);
66
}
67
getMob
().inventory.refresh();
68
}
69
70
tick++;
71
}
72
}
com.osroyale.Config
Definition
Config.java:61
com.osroyale.Config.FIREMAKING_MODIFICATION
static final double FIREMAKING_MODIFICATION
Definition
Config.java:298
com.osroyale.content.wintertodt.Brazier
Definition
Brazier.java:41
com.osroyale.content.wintertodt.Wintertodt
Definition
Wintertodt.java:68
com.osroyale.content.wintertodt.Wintertodt.BRUMA_ROOT
static final int BRUMA_ROOT
Definition
Wintertodt.java:90
com.osroyale.content.wintertodt.Wintertodt.addPoints
static void addPoints(Player player, int amount)
Definition
Wintertodt.java:851
com.osroyale.content.wintertodt.actions.FeedBrazier.execute
void execute()
Definition
FeedBrazier.java:41
com.osroyale.game.action.Action.getMob
T getMob()
Definition
Action.java:44
com.osroyale.game.world.entity.mob.player.Player
Definition
Player.java:162
com.osroyale.game.world.entity.skill.Skill
Definition
Skill.java:55
com.osroyale.game.world.entity.skill.Skill.FIREMAKING
static final int FIREMAKING
Definition
Skill.java:91
com.osroyale.game.world.entity.skill.Skill.getLevelForExperience
static final byte getLevelForExperience(double experience)
Definition
Skill.java:483