RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Vengeance.java
1package com.osroyale.content.skill.impl.magic.spell.impl;
2
3import com.osroyale.content.skill.impl.magic.Spellbook;
4import com.osroyale.content.skill.impl.magic.spell.Spell;
5import com.osroyale.game.Animation;
6import com.osroyale.game.Graphic;
7import com.osroyale.game.UpdatePriority;
8import com.osroyale.game.world.entity.combat.attack.listener.other.VengeanceListener;
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;
13import com.osroyale.net.packet.out.SendWidget;
14
15import java.util.concurrent.TimeUnit;
16
43
44public class Vengeance implements Spell {
45 @Override
46 public String getName() {
47 return "Vengeance";
48 }
49
50 @Override
51 public Item[] getRunes() {
52 return new Item[]{new Item(9075, 4), new Item(557, 10), new Item(560, 2)};
53 }
54
55 @Override
56 public int getLevel() {
57 return 94;
58 }
59
60 @Override
61 public void execute(Player player, Item item) {
62 if (player.spellbook != Spellbook.LUNAR)
63 return;
64 if (player.skills.getMaxLevel(Skill.DEFENCE) < 45) {
65 player.send(new SendMessage("You need a defence level of 45 to cast this spell!"));
66 return;
67 }
68 if (player.venged) {
69 player.send(new SendMessage("You already have vengeance casted!"));
70 return;
71 }
72 if (player.spellCasting.vengeanceDelay.elapsedTime(TimeUnit.SECONDS) < 30) {
73 player.send(new SendMessage("You can only cast vengeance once every 30 seconds."));
74 return;
75 }
76 player.animate(new Animation(8317, UpdatePriority.HIGH), true);
77 player.graphic(new Graphic(726, true));
78 player.spellCasting.vengeanceDelay.reset();
79 player.send(new SendWidget(SendWidget.WidgetType.VENGEANCE, 30));
80 player.venged = true;
81 player.getCombat().addListener(VengeanceListener.get());
82 }
83}