RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
BonesToPeaches.java
1package com.osroyale.content.skill.impl.magic.spell.impl;
2
3import com.osroyale.Config;
4import com.osroyale.content.skill.impl.magic.Magic;
5import com.osroyale.content.skill.impl.magic.Spellbook;
6import com.osroyale.content.skill.impl.magic.spell.Spell;
7import com.osroyale.game.Animation;
8import com.osroyale.game.Graphic;
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.net.packet.out.SendMessage;
13
37
38public class BonesToPeaches implements Spell {
39
40 @Override
41 public String getName() {
42 return "Bones to peaches";
43 }
44
45 @Override
46 public Item[] getRunes() {
47 return new Item[]{new Item(557, 4), new Item(555, 4), new Item(561, 2)};
48 }
49
50 @Override
51 public int getLevel() {
52 return 60;
53 }
54
55 @Override
56 public void execute(Player player, Item item) {
57 if (player.spellbook != Spellbook.MODERN)
58 return;
59 int bone = 0;
60 for (final int bones : Magic.BONES) {
61 if (player.inventory.contains(bones)) {
62 bone = bones;
63 break;
64 }
65
66 }
67 if (bone == 0) {
68 player.send(new SendMessage("You have no bones to do this!"));
69 return;
70 }
71 final int amount = player.inventory.computeAmountForId(bone);
72 player.inventory.remove(bone, amount);
73 player.inventory.add(new Item(6883, amount), -1, true);
74 player.inventory.removeAll(getRunes());
75 player.animate(new Animation(722));
76 player.graphic(new Graphic(141, true));
77 player.skills.addExperience(Skill.MAGIC, 35.5 * Config.MAGIC_MODIFICATION);
78 player.send(new SendMessage("You have converted " + amount + " bones to peaches."));
79 }
80}
static final double MAGIC_MODIFICATION
Definition Config.java:310
void addExperience(int id, double experience)
boolean removeAll(Collection<? extends Item > items)