Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.rs.game.player.actions;
- import com.rs.cache.loaders.ItemDefinitions;
- import com.rs.game.Animation;
- import com.rs.game.item.Item;
- import com.rs.game.player.Player;
- import com.rs.game.player.Skills;
- import com.rs.game.tasks.WorldTask;
- import com.rs.game.tasks.WorldTasksManager;
- import java.util.HashMap;
- import java.util.Map;
- public class Burying {
- public enum Bones {
- NORMAL(526, 4.5),
- NORMAL2(2530, 4.5),
- WOLF(2859, 4.5),
- BURNT(528, 4.5),
- MONKEY(3183, 5),
- BAT(530, 5.3),
- BIG(532, 15),
- JOGRE(3125, 15),
- ZOGRE(4812, 22.5),
- SHAIKAHAN(3123, 25),
- BABY_DRAGON(534, 30),
- WYVERN(6812, 50),
- DRAGON(536, 72),
- FAYRG(4830, 84),
- RAURG(4832, 96),
- DAGANNOTH(6729, 125),
- OURG(4834, 140),
- OURG_GRAARDOR(14793, 140),
- FROST_DRAGON(18830, 180),
- ANCIENT(15410, 200),
- SKELETAL_MONKEY(3187, 3),
- SMALL_ZOMBIE_MONKEY(3185, 5),
- LARGE_ZOMBIE_MONKEY(3186, 5),
- SMALL_NINJA_MONKEY(3179, 16),
- MEDIUM_NINJA_MONKEY(3180, 18),
- GORILLA(3181, 18),
- BEARDED_GORILLA(3182, 20),
- NORMAL_DUNGEONEERING(17670, 4.5),
- BAT_DUNGEONEERING(17672, 5.3),
- BIG_DUNGEONEERING(17674, 15),
- DRAGON_DUNGEONEERING(17676, 72),
- FROST_DRAGON_DUNGEONEERING(18832, 180);
- private final int id;
- private final double experience;
- private static final Map<Integer, Bones> bones = new HashMap<Integer, Bones>();
- static {
- for (Bones bone : Bones.values()) {
- bones.put(bone.getId(), bone);
- }
- }
- public static Bones forId(int id) {
- return bones.get(id);
- }
- private Bones(int id, double experience) {
- this.id = id;
- this.experience = experience;
- }
- public int getId() {
- return id;
- }
- public double getExperience() {
- return experience;
- }
- public static final Animation BURY_ANIMATION = new Animation(827);
- public static void bury(final Player player, int inventorySlot) {
- final Item item = player.getInventory().getItem(inventorySlot);
- if (item == null || Bones.forId(item.getId()) == null)
- return;
- final Bones bone = Bones.forId(item.getId());
- final ItemDefinitions itemDef = new ItemDefinitions(item.getId());
- player.stopAll();
- player.lock(2);
- player.getPackets().sendSound(2738, 0, 1);
- player.setNextAnimation(BURY_ANIMATION);
- player.getPackets().sendGameMessage("You dig a hole in the ground...");
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- player.getPackets().sendGameMessage("You bury the bones.");
- player.getInventory().getItems().remove(inventorySlot, item);
- player.getInventory().refresh(inventorySlot);
- double xp = bone.getExperience();
- player.getSkills().addXp(Skills.PRAYER, xp);
- stop();
- }
- });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment