RuneHive-Game
Loading...
Searching...
No Matches
LightBrazier.java
Go to the documentation of this file.
1package com.runehive.content.wintertodt.actions;
2
3import com.runehive.Config;
4import com.runehive.content.wintertodt.Brazier;
5import com.runehive.content.wintertodt.Wintertodt;
6import com.runehive.game.action.Action;
7import com.runehive.game.action.policy.WalkablePolicy;
8import com.runehive.game.world.entity.mob.player.Player;
9import com.runehive.game.world.entity.skill.Skill;
10
11public class LightBrazier extends Action<Player> {
12
14
16 super(player, 3);
17 this.brazier = brazier;
18 }
19
20 @Override
24
25 @Override
26 public String getName() {
27 return "Light brazier";
28 }
29
30 @Override
31 protected void execute() {
32 if(brazier.getBrazierState() != 2) {
33 //brazier.getObject().transform(Wintertodt.BURNING_BRAZIER_ID);
34 brazier.getObject().unregister();
36 brazier.getObject().register();
37 }
38
39 getMob().skills.addExperience(Skill.FIREMAKING, (Skill.getLevelForExperience(getMob().skills.get(Skill.FIREMAKING).getExperience()) * 6) * Config.FIREMAKING_MODIFICATION);
41 getMob().animate(65535);
42 getMob().action.getCurrentAction().cancel();
43 }
44}
The class that contains setting-related constants for the server.
Definition Config.java:24
static final double FIREMAKING_MODIFICATION
The experience modification for firemaking.
Definition Config.java:256
static void addPoints(Player player, int amount)
Handles adding wintertodt points to a player.
String getName()
Gets the name of this action.
WalkablePolicy getWalkablePolicy()
Gets the WalkablePolicy of this action.
void execute()
A function representing the unit of work that will be carried out.
T getMob()
Gets the player.
Definition Action.java:44
Action(T mob, int delay, boolean instant)
Creates a new Action randomevent.
Definition Action.java:24
This class represents a character controlled by a player.
Definition Player.java:125
Represents a trainable and usable skill.
Definition Skill.java:18
static final byte getLevelForExperience(double experience)
Gets the level for a given experience amount.
Definition Skill.java:446
static final int FIREMAKING
The firemaking skill id.
Definition Skill.java:54
A queue policy determines whether the action can occur while walking.
NON_WALKABLE
This indicates actions cannot occur while walking.