1package com.osroyale.content.skill.impl.thieving;
3import com.osroyale.Config;
4import com.osroyale.content.activity.randomevent.RandomEventHandler;
5import com.osroyale.content.clanchannel.content.ClanTaskKey;
6import com.osroyale.content.dialogue.Expression;
7import com.osroyale.content.event.impl.NpcInteractionEvent;
8import com.osroyale.content.event.impl.ObjectInteractionEvent;
9import com.osroyale.content.pet.PetData;
10import com.osroyale.content.pet.Pets;
11import com.osroyale.content.skillcape.SkillCape;
12import com.osroyale.game.Animation;
13import com.osroyale.game.world.World;
14import com.osroyale.game.world.entity.combat.hit.Hit;
15import com.osroyale.game.world.entity.mob.data.LockType;
16import com.osroyale.game.world.entity.mob.npc.Npc;
17import com.osroyale.game.world.entity.mob.player.Player;
18import com.osroyale.game.world.entity.mob.player.PlayerRight;
19import com.osroyale.game.world.entity.skill.Skill;
20import com.osroyale.game.world.items.Item;
21import com.osroyale.game.world.object.GameObject;
22import com.osroyale.game.world.position.Area;
23import com.osroyale.net.packet.out.SendMessage;
24import com.osroyale.util.Utility;
57public class Thieving
extends Skill {
59 public Thieving(
int level,
double experience) {
60 super(
Skill.THIEVING, level, experience);
67 double f1 = (double) pickpocket.
getLevel() / 10;
69 return (
int) Math.floor((f2 + f1) / 2);
73 protected double modifier() {
79 if (event.getOpcode() != 1) {
83 Npc npc =
event.getNpc();
86 if (pickpocket ==
null) {
95 player.send(
new SendMessage(
"You need a thieving level of " + pickpocket.
getLevel() +
" to do this!"));
99 boolean failed =
Utility.random(100) < failureRate(pickpocket, player);
102 player.locking.lock(1,
LockType.MASTER);
104 player.send(
new SendMessage(
"You attempt to pickpocket the " + npc.
getName() +
"..."));
109 npc.
speak(
"What do you think you're doing?");
112 player.send(
new SendMessage(
"You failed to pickpocketing the " + npc.
getName() +
"."));
120 player.send(
new SendMessage(
"You have successfully pickpocket the " + npc.
getName() +
"."));
124 player.playerAssistant.activateSkilling(1);
131 if (event.getOpcode() == 0 && event.getObject().getId() == 7236) {
136 if (event.getOpcode() != 1) {
149 player.send(
new SendMessage(
"You need at least 1 free inventory space to do this!"));
154 player.send(
new SendMessage(
"You need a thieving level of " + stall.
getLevel() +
" to steal from this stall."));
162 int base_chance = 50;
165 boolean failed =
Utility.random(modified_chance) == 0;
168 player.locking.lock(1,
LockType.MASTER);
173 double newExperience =
Area.inSuperDonatorZone(player) ||
Area.inRegularDonatorZone(player)? experience * 2 : experience;
177 player.
speak(
"Ouch!");
178 player.send(
new SendMessage(
"You failed to thieve from the stall and were instead inflicted pain!"));
190 player.forClan(channel -> channel.activateTask(
ClanTaskKey.THIEVING_STALL, player.
getName()));
193 player.playerAssistant.activateSkilling(1);
198 public static void exchange(
Player player) {
199 int amount = 0, count = 0;
201 for (Item item : player.inventory.
toArray()) {
209 player.dialogueFactory.
sendNpcChat(3439,
Expression.ANGRY,
"You do not have any items of which I am interested",
"in purchasing.").
execute();
219 player.send(
new SendMessage(
"You have no items which the merchant would like to purchase."));
static final double THIEVING_MODIFICATION
static final int CURRENCY
final DialogueFactory sendNpcChat(int id, String... lines)
final DialogueFactory execute()
static void onReward(Player player, int item, int chance)
static void schedule(Task task)
void speak(String forceChat)
Skill(int skill, int level, double experience)
static final int THIEVING
void addExperience(int id, double experience)
boolean remove(Item item)
final boolean hasCapacityFor(Item... item)
void addOrDrop(List< Item > items)
static String formatDigits(final int amount)
static< T > T randomElement(Collection< T > collection)
static PickpocketData forId(int npc)
static boolean isReward(Item item)
static Optional< StallData > forId(int id)
static boolean isDonator(Player player)
static boolean isSuper(Player player)