RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.skill.SkillRepository Class Reference
Collaboration diagram for com.runehive.content.skill.SkillRepository:

Static Public Member Functions

static boolean isBones (int item)
static boolean isHerbloreItem (int item)
static boolean isSkillingItem (int item)
static boolean isSuccess (int skill, int levelRequired)
static boolean isSuccess (Player p, int skill, int levelRequired, int toolLevelRequired)
static boolean isSuccess (Player p, int skillId, int levelRequired, boolean usingDragonHarpoon)
static void load ()
 Loads all the skilling data.
static void spawn ()
 Spawns all the skilling npcs.

Static Public Attributes

static final int[][] IMPLINGS

Static Private Member Functions

static void declareItems ()

Static Private Attributes

static final List< Integer > BONE_ITEMS = new ArrayList<>()
static final List< Integer > ESSENCE_ITEMS = new ArrayList<>()
static final List< Integer > HERBLORE_ITEMS = new ArrayList<>()
static final Position[] HUNTER_SPAWN_POSITION
 Holds all the impling onSpawn locations.
static final List< Integer > SKILLING_ITEMS = new ArrayList<>()

Detailed Description

Definition at line 28 of file SkillRepository.java.

Member Function Documentation

◆ declareItems()

void com.runehive.content.skill.SkillRepository.declareItems ( )
staticprivate

Definition at line 88 of file SkillRepository.java.

88 {
89 for (TreeData tree : TreeData.values()) {
90 SKILLING_ITEMS.add(tree.item);
91 }
92 for (OreData ore : OreData.values()) {
93 SKILLING_ITEMS.add(ore.ore);
94 }
95 for (Fishable fish : Fishable.values()) {
96 SKILLING_ITEMS.add(fish.getRawFishId());
97 }
98 for (GrimyHerb herb : GrimyHerb.values()) {
99 HERBLORE_ITEMS.add(herb.getCleanID());
100 }
101 for (GrimyHerb herb : GrimyHerb.values()) {
102 HERBLORE_ITEMS.add(herb.getGrimyID());
103 }
104 for (BoneData bones : BoneData.values()) {
105 BONE_ITEMS.add(bones.getId2());
106 }
107 }

References BONE_ITEMS, HERBLORE_ITEMS, and SKILLING_ITEMS.

Referenced by load().

Here is the caller graph for this function:

◆ isBones()

boolean com.runehive.content.skill.SkillRepository.isBones ( int item)
static

Definition at line 124 of file SkillRepository.java.

124 {
125 for (int id : BONE_ITEMS) {
126 if (item == id)
127 return true;
128 }
129 return false;
130 }

References BONE_ITEMS.

◆ isHerbloreItem()

boolean com.runehive.content.skill.SkillRepository.isHerbloreItem ( int item)
static

Definition at line 116 of file SkillRepository.java.

116 {
117 for (int id : SKILLING_ITEMS) {
118 if (item == id)
119 return true;
120 }
121 return false;
122 }

References SKILLING_ITEMS.

◆ isSkillingItem()

boolean com.runehive.content.skill.SkillRepository.isSkillingItem ( int item)
static

Definition at line 109 of file SkillRepository.java.

109 {
110 for (int id : SKILLING_ITEMS) {
111 if (item == id)
112 return true;
113 }
114 return false;
115 }

References SKILLING_ITEMS.

◆ isSuccess() [1/3]

boolean com.runehive.content.skill.SkillRepository.isSuccess ( int skill,
int levelRequired )
static

Definition at line 133 of file SkillRepository.java.

133 {
134 double successChance = Math.ceil(((double) skill * 50.0D - (double) levelRequired * 15.0D) / (double) levelRequired / 3.0D * 4.0D);
135 int roll = Utility.random(99);
136 return successChance >= roll;
137 }

References com.runehive.util.Utility.random().

Referenced by com.runehive.content.skill.impl.fishing.Fishing.success(), com.runehive.content.skill.impl.mining.Mining.success(), and com.runehive.content.skill.impl.woodcutting.Woodcutting.success().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSuccess() [2/3]

boolean com.runehive.content.skill.SkillRepository.isSuccess ( Player p,
int skill,
int levelRequired,
int toolLevelRequired )
static

Definition at line 146 of file SkillRepository.java.

146 {
147 double level = (p.skills.getMaxLevel(skill) + toolLevelRequired) / 2.0D;
148 double successChance = Math.ceil((((level * 50.0D) - ((double) levelRequired * 15.0D)) / (double) levelRequired / 3.0D) * 4.0D);
149 int roll = Utility.random(99);
150 return successChance >= roll;
151 }

References com.runehive.game.world.entity.skill.SkillManager.getMaxLevel(), com.runehive.util.Utility.random(), and com.runehive.game.world.entity.mob.Mob.skills.

Here is the call graph for this function:

◆ isSuccess() [3/3]

boolean com.runehive.content.skill.SkillRepository.isSuccess ( Player p,
int skillId,
int levelRequired,
boolean usingDragonHarpoon )
static

Definition at line 139 of file SkillRepository.java.

139 {
140 double level = p.skills.getMaxLevel(skillId);
141 double successChance = Math.ceil((((level * 50.0D) - ((double) levelRequired * 15.0D)) / (double) levelRequired / 3.0D) * 4.0D);
142 int roll = usingDragonHarpoon ? Utility.random(79) : Utility.random(99);
143 return successChance >= roll;
144 }

References com.runehive.game.world.entity.skill.SkillManager.getMaxLevel(), com.runehive.util.Utility.random(), and com.runehive.game.world.entity.mob.Mob.skills.

Here is the call graph for this function:

◆ load()

void com.runehive.content.skill.SkillRepository.load ( )
static

Loads all the skilling data.

Definition at line 70 of file SkillRepository.java.

70 {
71 Gem.load();
72 Hide.load();
73 Arrow.load();
74 Carvable.load();
75 Bolt.load();
76 Crossbow.load();
77 Featherable.load();
78 Stringable.load();
79 Agility.declare();
80 FishingTool.declare();
81 Battlestaff.load();
82 Fishable.declare();
83 FishingSpot.declare();
84 spawn();
85 declareItems();
86 }

References com.runehive.content.skill.impl.agility.Agility.declare(), com.runehive.content.skill.impl.fishing.Fishable.declare(), com.runehive.content.skill.impl.fishing.FishingSpot.declare(), com.runehive.content.skill.impl.fishing.FishingTool.declare(), declareItems(), com.runehive.content.skill.impl.crafting.impl.Gem.load(), com.runehive.content.skill.impl.crafting.impl.Hide.load(), com.runehive.content.skill.impl.fletching.impl.Arrow.load(), com.runehive.content.skill.impl.fletching.impl.Battlestaff.load(), com.runehive.content.skill.impl.fletching.impl.Bolt.load(), com.runehive.content.skill.impl.fletching.impl.Carvable.load(), com.runehive.content.skill.impl.fletching.impl.Crossbow.load(), com.runehive.content.skill.impl.fletching.impl.Featherable.load(), com.runehive.content.skill.impl.fletching.impl.Stringable.load(), and spawn().

Referenced by com.runehive.RuneHive.processParallelStartupTasks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spawn()

void com.runehive.content.skill.SkillRepository.spawn ( )
static

Spawns all the skilling npcs.

Definition at line 49 of file SkillRepository.java.

49 {
50 for (Position position : HUNTER_SPAWN_POSITION) {
51 int npc;
52
53 if (RandomUtils.success(.50)) {
54 npc = Utility.randomElement(Butterfly.values()).butterfly;
55 } else {
56 npc = Utility.randomElement(Impling.values()).impling;
57 }
58
59 new Npc(npc, position, Config.NPC_WALKING_RADIUS, Mob.DEFAULT_INSTANCE, Direction.NORTH).register();
60 }
61
62 for (int[] IMPLING : IMPLINGS) {
63 new Npc(IMPLING[0], new Position(IMPLING[1], IMPLING[2]), Config.NPC_WALKING_RADIUS, Mob.DEFAULT_INSTANCE, Direction.NORTH).register();
64
65 }
66
67 }

References com.runehive.game.world.entity.Entity.DEFAULT_INSTANCE, HUNTER_SPAWN_POSITION, IMPLINGS, com.runehive.game.world.entity.mob.Direction.NORTH, com.runehive.Config.NPC_WALKING_RADIUS, com.runehive.util.Utility.randomElement(), com.runehive.game.world.entity.mob.npc.Npc.register(), and com.runehive.util.RandomUtils.success().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ BONE_ITEMS

final List<Integer> com.runehive.content.skill.SkillRepository.BONE_ITEMS = new ArrayList<>()
staticprivate

Definition at line 32 of file SkillRepository.java.

Referenced by declareItems(), and isBones().

◆ ESSENCE_ITEMS

final List<Integer> com.runehive.content.skill.SkillRepository.ESSENCE_ITEMS = new ArrayList<>()
staticprivate

Definition at line 34 of file SkillRepository.java.

◆ HERBLORE_ITEMS

final List<Integer> com.runehive.content.skill.SkillRepository.HERBLORE_ITEMS = new ArrayList<>()
staticprivate

Definition at line 31 of file SkillRepository.java.

Referenced by declareItems().

◆ HUNTER_SPAWN_POSITION

final Position [] com.runehive.content.skill.SkillRepository.HUNTER_SPAWN_POSITION
staticprivate
Initial value:
= {
new Position(3081, 3484), new Position(3101, 3484), new Position(3115, 3506),
new Position(3094, 3453), new Position(3134, 3511), new Position(3180, 3422),
new Position(3240, 3440), new Position(3287, 3351), new Position(3257, 3247),
new Position(3221, 3213), new Position(2803, 3445), new Position(2721, 3472),
new Position(3349, 3271), new Position(3283, 3196), new Position(3574, 3322),
new Position(2659, 2660), new Position(3377, 3168), new Position(2660, 3706),
new Position(2318, 3813), new Position(3054, 3514)
}
Represents a single tile on the game world.
Definition Position.java:14

Holds all the impling onSpawn locations.

Definition at line 38 of file SkillRepository.java.

38 {
39 new Position(3081, 3484), new Position(3101, 3484), new Position(3115, 3506),
40 new Position(3094, 3453), new Position(3134, 3511), new Position(3180, 3422),
41 new Position(3240, 3440), new Position(3287, 3351), new Position(3257, 3247),
42 new Position(3221, 3213), new Position(2803, 3445), new Position(2721, 3472),
43 new Position(3349, 3271), new Position(3283, 3196), new Position(3574, 3322),
44 new Position(2659, 2660), new Position(3377, 3168), new Position(2660, 3706),
45 new Position(2318, 3813), new Position(3054, 3514)
46 };

Referenced by spawn().

◆ IMPLINGS

final int [][] com.runehive.content.skill.SkillRepository.IMPLINGS
static

Definition at line 153 of file SkillRepository.java.

153 {
154 /**
155 * Baby imps
156 */
157 {1635, 2612, 4318},
158 {1635, 2602, 4314},
159 {1635, 2610, 4338},
160 {1635, 2582, 4344},
161 {1635, 2578, 4344},
162 {1635, 2568, 4311},
163 {1635, 2583, 4295},
164 {1635, 2582, 4330},
165 {1635, 2600, 4303},
166 {1635, 2611, 4301},
167 {1635, 2618, 4329},
168
169 /**
170 * Young imps
171 */
172 {1636, 2591, 4332},
173 {1636, 2600, 4338},
174 {1636, 2595, 4345},
175 {1636, 2610, 4327},
176 {1636, 2617, 4314},
177 {1636, 2619, 4294},
178 {1636, 2599, 4294},
179 {1636, 2575, 4303},
180 {1636, 2570, 4299},
181
182 /**
183 * Gourment imps
184 */
185 {1637, 2573, 4339},
186 {1637, 2567, 4328},
187 {1637, 2593, 4297},
188 {1637, 2618, 4305},
189 {1637, 2605, 4316},
190 {1637, 2596, 4333},
191
192 /**
193 * Earth imps
194 */
195 {1638, 2592, 4338},
196 {1638, 2611, 4345},
197 {1638, 2617, 4339},
198 {1638, 2614, 4301},
199 {1638, 2606, 4295},
200 {1638, 2581, 4299},
201
202 /**
203 * Essence imps
204 */
205 {1639, 2602, 4328},
206 {1639, 2608, 4333},
207 {1639, 2609, 4296},
208 {1639, 2581, 4304},
209 {1639, 2570, 4318},
210
211 /**
212 * Eclectic imps
213 */
214 {1640, 2611, 4310},
215 {1640, 2617, 4319},
216 {1640, 2600, 4347},
217 {1640, 2570, 4326},
218 {1640, 2579, 4310},
219
220 /**
221 * Spirit imps
222 */
223
224 /**
225 * Nature imps
226 */
227 {1641, 2581, 4310},
228 {1641, 2581, 4310},
229 {1641, 2603, 4333},
230 {1641, 2576, 4335},
231 {1641, 2588, 4345},
232
233 /**
234 * Magpie imps
235 */
236 {1642, 2612, 4324},
237 {1642, 2602, 4323},
238 {1642, 2587, 4348},
239 {1642, 2564, 4320},
240 {1642, 2566, 4295},
241
242 /**
243 * Ninja imps
244 */
245 {1643, 2570, 4347},
246 {1643, 2572, 4327},
247 {1643, 2578, 4318},
248 {1643, 2610, 4312},
249 {1643, 2594, 4341},
250
251 /**
252 * Dragon imps
253 */
254 {1654, 2613, 4341},
255 {1654, 2585, 4337},
256 {1654, 2576, 4319},
257 {1654, 2576, 4294},
258 {1654, 2592, 4305},
259 };

Referenced by spawn().

◆ SKILLING_ITEMS

final List<Integer> com.runehive.content.skill.SkillRepository.SKILLING_ITEMS = new ArrayList<>()
staticprivate

Definition at line 30 of file SkillRepository.java.

Referenced by declareItems(), isHerbloreItem(), and isSkillingItem().


The documentation for this class was generated from the following file: