RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
RunecraftPouch.java
1
package
com.osroyale.content.skill.impl.runecrafting;
2
3
import
com.osroyale.game.world.entity.mob.player.Player;
4
import
com.osroyale.game.world.entity.skill.Skill;
5
import
com.osroyale.game.world.items.Item;
6
40
41
public
class
RunecraftPouch
{
43
private
final
Player
player;
44
46
public
RunecraftPouch
(
Player
player) {
47
this.player = player;
48
}
49
51
public
void
deposit
(
RunecraftPouchData
pouch) {
52
if
(player.skills.getMaxLevel(
Skill
.
RUNECRAFTING
) < pouch.
level
) {
53
player.message(
"You need a runecrafting level of "
+ pouch.
level
+
" to use this pouch!"
);
54
return
;
55
}
56
57
int
inventory = player.inventory.computeAmountForId(7936);
58
59
if
(inventory == 0) {
60
player.message(
"You have no rune essences in your inventory to fill this pouch!"
);
61
return
;
62
}
63
64
int
essence = pouch.
deposit
(player, pouch.
capacity
);
65
66
System.out.println(essence);
67
68
69
if
(essence != 0) {
70
player.inventory.remove(7936, essence);
71
player.message(
"You have filled your pouch with "
+ essence +
" rune essences!"
);
72
}
73
}
74
76
public
void
withdraw
(
RunecraftPouchData
pouch) {
77
int
essence = pouch.
withdraw
(player);
78
79
if
(essence != 0) {
80
player.inventory.add(7936, essence);
81
player.message(
"You have emptied your pouch."
);
82
}
83
}
84
86
public
boolean
death
(Item item) {
87
RunecraftPouchData
pouch =
RunecraftPouchData
.
forItem
(item.getId());
88
89
if
(pouch ==
null
)
90
return
false
;
91
92
pouch.
empty
(player);
93
return
true
;
94
}
95
}
com.osroyale.content.skill.impl.runecrafting.RunecraftPouch.deposit
void deposit(RunecraftPouchData pouch)
Definition
RunecraftPouch.java:51
com.osroyale.content.skill.impl.runecrafting.RunecraftPouch.withdraw
void withdraw(RunecraftPouchData pouch)
Definition
RunecraftPouch.java:76
com.osroyale.content.skill.impl.runecrafting.RunecraftPouch.death
boolean death(Item item)
Definition
RunecraftPouch.java:86
com.osroyale.content.skill.impl.runecrafting.RunecraftPouch.RunecraftPouch
RunecraftPouch(Player player)
Definition
RunecraftPouch.java:46
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.RUNECRAFTING
static final int RUNECRAFTING
Definition
Skill.java:118
com.osroyale.content.skill.impl.runecrafting.RunecraftPouchData
Definition
RunecraftPouchData.java:31
com.osroyale.content.skill.impl.runecrafting.RunecraftPouchData.withdraw
abstract int withdraw(Player player)
com.osroyale.content.skill.impl.runecrafting.RunecraftPouchData.capacity
final int capacity
Definition
RunecraftPouchData.java:193
com.osroyale.content.skill.impl.runecrafting.RunecraftPouchData.deposit
abstract int deposit(Player player, int amount)
com.osroyale.content.skill.impl.runecrafting.RunecraftPouchData.empty
abstract void empty(Player player)
com.osroyale.content.skill.impl.runecrafting.RunecraftPouchData.forItem
static RunecraftPouchData forItem(int item)
Definition
RunecraftPouchData.java:216
com.osroyale.content.skill.impl.runecrafting.RunecraftPouchData.level
final int level
Definition
RunecraftPouchData.java:190