RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
DuelNotificationTask.java
1package com.osroyale.game.task.impl;
2
3import com.osroyale.game.task.Task;
4import com.osroyale.game.world.entity.mob.player.Player;
5import com.osroyale.game.world.entity.mob.player.exchange.ExchangeSession;
6import com.osroyale.game.world.entity.mob.player.exchange.ExchangeSessionType;
7import com.osroyale.net.packet.out.SendConfig;
8
31
32public class DuelNotificationTask extends Task {
33
34 private final Player player;
35 private int time = 20;
36
37 public DuelNotificationTask(Player player) {
38 super(true, 0);
39 this.player = player;
40 }
41
42 @Override
43 public void execute() {
45 cancel();
46 return;
47 }
48
49 if (time <= 0) {
50 cancel();
51 return;
52 }
53
54 time--;
55
56 if (time % 2 == 0) {
57 player.send(new SendConfig(655, 1));
58 } else {
59 player.send(new SendConfig(655, 0));
60 }
61
62 }
63
64 @Override
65 protected void onCancel(boolean logout) {
66 player.send(new SendConfig(655, 0));
67 }
68
69}
synchronized final void cancel()
Definition Task.java:147
Task(boolean instant, int delay)
Definition Task.java:75
static boolean inSession(Player player, Player other, ExchangeSessionType type)