1package com.osroyale.content.skill.impl.thieving;
3import com.osroyale.Config;
4import com.osroyale.net.packet.out.SendMessage;
5import com.osroyale.game.Animation;
6import com.osroyale.game.action.Action;
7import com.osroyale.game.action.policy.WalkablePolicy;
8import com.osroyale.game.world.entity.combat.hit.Hit;
9import com.osroyale.game.world.entity.mob.player.Player;
10import com.osroyale.game.world.entity.skill.Skill;
11import com.osroyale.game.world.items.Item;
12import com.osroyale.util.Utility;
57 private static final Item REWARD[] = {
58 new Item(1617),
new Item(1619),
new Item(1621),
new Item(1623),
59 new Item(1623),
new Item(995, 20),
new Item(995, 40)
63 static void thieve(
Player player) {
75 player.action.execute(crack(player),
true);
79 private static int rate(
Player player) {
80 boolean stethoscope = player.inventory.
contains(
new Item(5560));
81 int calculation = stethoscope ?
Utility.random(5) : (
Utility.random(11) + 20);
83 return calculated <= 0 ? 1 : (calculated > 10 ? 10 : calculated);
94 int rate = rate(player);
98 public void execute() {
104 if (
chance(player) == 0) {
106 player.send(
new SendMessage(
"You slip and trigger a trap!"));
107 player.damage(
new Hit(
Utility.random(1, 5)));
112 player.send(
new SendMessage(
"You get some loot."));
119 protected void onSchedule() {
121 player.send(
new SendMessage(
"You attempt to crack the safe... "));
125 protected void onCancel(
boolean logout) {
126 player.skills.
get(Skill.THIEVING).setDoingSkill(
false);
130 public String getName() {
131 return "Wallsafe crack";
135 public boolean prioritized() {
140 public WalkablePolicy getWalkablePolicy() {
141 return WalkablePolicy.NON_WALKABLE;
static final double THIEVING_MODIFICATION
final DialogueFactory sendStatement(String... lines)
final DialogueFactory execute()
static int chance(Player player)
static final int THIEVING
void addExperience(int id, double experience)
static< T > T randomElement(Collection< T > collection)