RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
NpcFaceAction.java
1
2package com.osroyale.game.action.impl;
3
4import com.osroyale.game.action.Action;
5import com.osroyale.game.action.policy.WalkablePolicy;
6import com.osroyale.game.world.entity.mob.npc.Npc;
7import com.osroyale.content.pet.PetData;
8import com.osroyale.game.world.position.Position;
9
10import java.util.Arrays;
11
19public final class NpcFaceAction extends Action<Npc> {
23 private int[] identification;
24
28 private final int[] FIRST_OPTION = {};
29
33 private final int[] SECOND_OPTION = {3080, 3010};
34
38 private final int[] THIRD_OPTION = {};
39
40 private final int[] FOURTH_OPTION = {};
41
49 public NpcFaceAction(Npc npc, Position face, int option) {
50 super(npc, 25);
51 if (option == 0) identification = FIRST_OPTION;
52 else if (option == 1) identification = SECOND_OPTION;
53 else if (option == 2) identification = THIRD_OPTION;
54 else if (option == 3) identification = FOURTH_OPTION;
55
56 if (Arrays.stream(PetData.values()).anyMatch(p -> npc.id == p.getNpc())) {
57 cancel();
58 return;
59 }
60
61 if (identification != null && Arrays.stream(identification).anyMatch($it -> npc.id == $it)) {
62 cancel();
63 return;
64 }
65
66 getMob().face(face);
67 }
68
69 @Override
70 public void execute() {
71 Npc npc = getMob().getNpc();
72
73 if (npc.walk) {
74 getMob().face(getMob().faceDirection);
75 }
76
77 cancel();
78 }
79
80 @Override
81 public String getName() {
82 return "Npc face";
83 }
84
85 @Override
86 public boolean prioritized() {
87 return false;
88 }
89
90 @Override
94
95}
Action(T mob, int delay, boolean instant)
Definition Action.java:24
NpcFaceAction(Npc npc, Position face, int option)
synchronized final void cancel()
Definition Task.java:147