RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SuperHeat.java
1package com.osroyale.content.skill.impl.magic.spell.impl;
2
3import com.osroyale.Config;
4import com.osroyale.content.skill.impl.magic.Spellbook;
5import com.osroyale.content.skill.impl.magic.spell.Spell;
6import com.osroyale.content.skill.impl.smithing.Smelting;
7import com.osroyale.content.skill.impl.smithing.SmeltingData;
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.SendForceTab;
13
14import java.util.Optional;
15
44
45public class SuperHeat implements Spell {
46
47 @Override
48 public String getName() {
49 return "Super heat";
50 }
51
52 @Override
53 public int getLevel() {
54 return 43;
55 }
56
57 @Override
58 public Item[] getRunes() {
59 return new Item[] { new Item(554, 1), new Item(561, 1) };
60 }
61
62 @Override
63 public void execute(Player player, Item item) {
64 if (player.spellbook != Spellbook.MODERN)
65 return;
66 if (!player.spellCasting.castingDelay.elapsed(599))
67 return;
68
69 Optional<SmeltingData> data = SmeltingData.getDefinitionByItem(item.getId());
70
71 if (!data.isPresent()) {
72 player.message("You can not super heat this item!");
73 return;
74 }
75
76 if (!player.inventory.containsAll(data.get().required)) {
77 player.message("You do not contain the required items to super heat!");
78 return;
79 }
80
81 if (player.skills.getMaxLevel(Skill.SMITHING) < data.get().requirement) {
82 player.message("You need a smithing level of " + data.get().requirement + " to do super heat this item!");
83 return;
84 }
85
86 player.animate(722);
87 player.graphic(new Graphic(148, false));
88 player.send(new SendForceTab(6));
89 player.inventory.removeAll(data.get().required);
90 player.inventory.addAll(data.get().produced);
92 player.skills.addExperience(Skill.SMITHING, data.get().experience * Config.SMITHING_MODIFICATION);
93 player.spellCasting.castingDelay.reset();
94 }
95}
static final double SMITHING_MODIFICATION
Definition Config.java:331
static final double MAGIC_MODIFICATION
Definition Config.java:310
void addExperience(int id, double experience)
boolean addAll(Collection<? extends Item > items)
boolean removeAll(Collection<? extends Item > items)
static Optional< SmeltingData > getDefinitionByItem(int itemId)