RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
RandomEventHandler.java
1package com.osroyale.content.activity.randomevent;
2
3
4import com.osroyale.game.world.entity.mob.player.Player;
5import com.osroyale.content.activity.randomevent.impl.DrillDemonEvent;
6import com.osroyale.content.activity.randomevent.impl.GenieEvent;
7import com.osroyale.content.activity.randomevent.impl.MimeEvent;
8import com.osroyale.game.world.position.Area;
9import com.osroyale.util.RandomUtils;
10import com.osroyale.util.Utility;
11
30
31public class RandomEventHandler {
32
33 public static void trigger(Player player) {
34 if (Area.inWilderness(player))
35 return;
36 if (player.playerAssistant.busy())
37 return;
38 if (player.inActivity())
39 return;
40 if (!player.isVisible())
41 return;
42
43 int base = 200;
44
45 if (Utility.random(base) != 0)
46 return;
47
48 int events = RandomUtils.inclusive(1, 3);
49
50 switch (events) {
51 case 1: GenieEvent.create(player); break;
52 case 2: MimeEvent.create(player); break;
53 case 3: DrillDemonEvent.create(player); break;
54 }
55 }
56}