1package com.osroyale.net.packet.in;
3import com.osroyale.content.gambling.GambleStage;
4import com.osroyale.content.itemaction.ItemActionRepository;
5import com.osroyale.game.event.impl.DropItemEvent;
6import com.osroyale.game.plugin.PluginManager;
7import com.osroyale.game.world.entity.mob.data.PacketType;
8import com.osroyale.game.world.entity.mob.player.Player;
9import com.osroyale.game.world.entity.mob.player.PlayerRight;
10import com.osroyale.game.world.items.Item;
11import com.osroyale.game.world.items.ItemDefinition;
12import com.osroyale.game.world.items.containers.pricechecker.PriceType;
13import com.osroyale.game.world.items.ground.GroundItem;
14import com.osroyale.game.world.position.Area;
15import com.osroyale.net.codec.ByteModification;
16import com.osroyale.net.packet.ClientPackets;
17import com.osroyale.net.packet.GamePacket;
18import com.osroyale.net.packet.PacketListener;
19import com.osroyale.net.packet.PacketListenerMeta;
20import com.osroyale.net.packet.out.SendMessage;
55 if (player.isDead() || player.locking.
locked(
PacketType.DROP_ITEM) || player.getGambling().getStage().equals(
GambleStage.PLACING_BET) || player.getGambling().getStage().equals(
GambleStage.IN_PROGRESS)) {
60 packet.readByte(
false);
61 packet.readByte(
false);
63 final Item item = player.inventory.
get(slot);
70 if (!player.interfaceManager.
isClear())
71 player.interfaceManager.close(
false);
79 if (item.getId() != itemId)
87 player.send(
new SendMessage(String.format(
"[%s]: item=%d amount=%d slot=%d",
ItemActionRepository.class.getSimpleName(), item.getId(), item.getAmount(), slot)));
92 boolean inWilderness =
Area.inWilderness(player);
94 player.dialogueFactory.
sendStatement(
"This is a valuable item, are you sure you want to",
"drop it? In a PvP area, this item will be seen",
"by everyone when dropped.");
95 player.dialogueFactory.
sendOption(
"Yes, drop it.", () -> {
96 player.inventory.
remove(item, slot,
true);
98 },
"Nevermind", () -> player.dialogueFactory.
clear());
99 player.dialogueFactory.
execute();
101 }
else if (inWilderness) {
102 player.inventory.
remove(item, slot,
true);
107 player.inventory.
remove(item, slot,
true);
final DialogueFactory sendStatement(String... lines)
final DialogueFactory sendOption(String option1, Runnable action1, String option2, Runnable action2)
final DialogueFactory execute()
Combat< Player > getCombat()
static ItemDefinition get(int id)
final Item get(int index)
boolean remove(Item item)
static void createGlobal(Player player, Item item)
static GroundItem create(Player player, Item item)
void handlePacket(Player player, GamePacket packet)
static boolean isDeveloper(Player player)