RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
DrillDemonEvent.java
1package com.osroyale.content.activity.randomevent.impl;
2
3import com.osroyale.net.packet.out.SendMessage;
4import com.osroyale.game.Animation;
5import com.osroyale.game.world.entity.mob.player.Player;
6import com.osroyale.content.activity.randomevent.RandomEvent;
7import com.osroyale.content.event.impl.NpcInteractionEvent;
8import com.osroyale.game.world.items.Item;
9
46
47public class DrillDemonEvent extends RandomEvent {
48
50 private DrillDemonEvent(Player player) {
51 super(player, 20);
52 }
53
55 public static DrillDemonEvent create(Player player) {
56 DrillDemonEvent event = new DrillDemonEvent(player);
57 event.add(player);
58 return event;
59 }
60
61 @Override
62 protected boolean clickNpc(Player player, NpcInteractionEvent event) {
63 if (event.getNpc().id != eventNpcIdentification())
64 return false;
65 if (!event.getNpc().owner.equals(player))
66 return false;
67 if (angered) {
68 player.dialogueFactory.sendNpcChat(eventNpcIdentification(), "You will suffer for ignoring me!").execute();
69 return true;
70 }
71 if (event.getOpcode() == 0) {
72 player.dialogueFactory.sendStatement("You have been given a reward from the Drill Demon.").onAction(() -> {
73 player.dialogueFactory.clear();
74 player.inventory.addOrDrop(new Item(6832, 1));
76 }).execute();
77 } else if (event.getOpcode() == 1) {
78 angered = true;
79 player.send(new SendMessage("You have dismissed the drill demon random event."));
80 player.animate(new Animation(863));
83 }
84 return true;
85 }
86
87 @Override
88 protected int eventNpcIdentification() {
89 return 337;
90 }
91
92 @Override
93 protected String[] eventNpcShout() {
94 return new String[]{
95 "Attention, %name! I have something for you.",
96 "%name! I said I have something for you!",
97 "You are starting to really get my angry %name!",
98 "I hope you burn in hell, %name!"
99 };
100 }
101}
final DialogueFactory sendStatement(String... lines)
final DialogueFactory onAction(Runnable action)
final DialogueFactory sendNpcChat(int id, String... lines)