RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.skill.impl.fletching.Fletching Class Reference

Handles the fletching skill. More...

Inheritance diagram for com.runehive.content.skill.impl.fletching.Fletching:
Collaboration diagram for com.runehive.content.skill.impl.fletching.Fletching:

Public Member Functions

boolean fletch (Player player, int index, int amount)
 Fletching (int level, double experience)
boolean start (Player player, Fletchable fletchable, int index, int amount)
Public Member Functions inherited from com.runehive.game.world.entity.skill.Skill
double addExperience (double amount)
 Adds experiences to this skill by the given amount.
void addLevel (int amount)
 Adds levels to this skill by the given amount.
void divideExperience (double amount)
 Divides the current experience of this skill by a given amount.
void divideLevel (double amount)
 Divides the current level of this skill by a given amount.
double getExperience ()
 Gets the skill experience.
int getLevel ()
 Gets the current skill level.
int getMaxLevel ()
 Gets the maximum skill level.
int getRoundedExperience ()
 Gets the floor experience.
int getSkill ()
 Gets the skill id.
boolean isDoingSkill ()
double modifyExperience (Function< Double, Double > function)
 Modifies the current experience with a given function.
double modifyExperience (Function< Double, Double > function, int lowerBounds, int upperBounds)
 Modifies the current experience with a given function.
void modifyLevel (Function< Integer, Integer > function)
 Modifies the current level with a given function.
void modifyLevel (Function< Integer, Integer > function, int lowerBounds, int upperBounds)
 Modifies the current level with a given function.
void multiplyExperience (double amount)
 Multiplies the current experience of this skill by a given amount.
void multiplyLevel (double amount)
 Multiplies the current level of this skill by a given amount.
boolean onEvent (Player player, InteractionEvent interactionEvent)
void removeExperience (double amount)
 Removes experiences from this skill by the given amount.
void removeLevel (int amount)
 Removes levels from this skill by the given amount.
boolean reqLevel (int level)
 Determines if your level is greater than or equal to level.
void setDoingSkill (boolean doingSkill)
void setExperience (double experience)
 Sets the experience for this skill.
void setLevel (int level)
 Sets the level for this skill.
void setMaxLevel (int maxLevel)
 Sets the maximum level for this skill.
 Skill (int skill, int level, double experience)
 Constructs a new Skill.
String toString ()

Static Public Member Functions

static void addFletchable (Fletchable fletchable)
Static Public Member Functions inherited from com.runehive.game.world.entity.skill.Skill
static Function< Integer, Integer > add (int amount)
 Creates a function that adds a number by an amount.
static Function< Integer, Integer > divide (double amount)
 Creates a function that divides a number by an amount.
static final int getExperienceForLevel (int level)
 Gets the experience for a given level.
static final byte getLevelForExperience (double experience)
 Gets the level for a given experience amount.
static String getName (int skill)
 Gets the name for a skill id.
static Function< Integer, Integer > multiply (double amount)
 Creates a function that multiplies a number by an amount.
static Function< Integer, Integer > subtract (int amount)
 Creates a function that subtracts a number by an amount.

Protected Member Functions

boolean clickButton (Player player, ClickButtonInteractionEvent event)
double modifier ()
boolean useItem (Player player, ItemOnItemInteractionEvent event)
Protected Member Functions inherited from com.runehive.game.world.entity.skill.Skill
boolean clickItem (Player player, ItemInteractionEvent event)
boolean clickNpc (Player player, NpcInteractionEvent event)
boolean clickObject (Player player, ObjectInteractionEvent event)
boolean itemContainerAction (Player player, ItemContainerInteractionEvent event)
boolean useItem (Player player, ItemOnObjectInteractionEvent event)

Private Member Functions

Action< Playerfletch (Player player, Fletchable fletchable, FletchableItem item, int amount)
Fletchable getFletchable (int use, int with)

Static Private Attributes

static final String FLETCHABLE_KEY = "FLETCHABLE_KEY"
static final HashMap< Integer, FletchableFLETCHABLES = new HashMap<>()
static final Logger logger = LogManager.getLogger(Fletching.class)

Additional Inherited Members

Public Attributes inherited from com.runehive.game.world.entity.skill.Skill
transient final Stopwatch stopwatch = Stopwatch.start()
Static Public Attributes inherited from com.runehive.game.world.entity.skill.Skill
static final int AGILITY = 16
 The agility skill id.
static final int ATTACK = 0
 The attack skill id.
static final int CONSTRUCTION = 21
 The construction skill id.
static final int COOKING = 7
 The cooking skill id.
static final int CRAFTING = 12
 The crafting skill id.
static final int DEFENCE = 1
 The defence skill id.
static final int FARMING = 19
 The farming skill id.
static final int FIREMAKING = 11
 The firemaking skill id.
static final int FISHING = 10
 The fishing skill id.
static final int FLETCHING = 9
 The fletching skill id.
static final int HERBLORE = 15
 The herblore skill id.
static final int HITPOINTS = 3
 The hitpoints skill id.
static final int HUNTER = 22
 The hunter skill id.
static final int[][] INTERFACE_DATA
 Skill tab string data.
static final int MAGIC = 6
 The magic skill id.
static final int MINING = 14
 The mining skill id.
static final int PRAYER = 5
 The prayer skill id.
static final int RANGED = 4
 The ranged skill id.
static final int RUNECRAFTING = 20
 The runecrafting skill id.
static final int SKILL_COUNT = 23
 The amount of available skills.
static final int SLAYER = 18
 The slayer skill id.
static final int SMITHING = 13
 The smithing skill id.
static final int STRENGTH = 2
 The strength skill id.
static final int THIEVING = 17
 The thieving skill id.
static final int TOTAL_SKILL_LEVEL = 99 * SKILL_COUNT
 The total skill amount.
static final int WOODCUTTING = 8
 The woodcutting skill id.

Detailed Description

Handles the fletching skill.

Author
Daniel

Definition at line 34 of file Fletching.java.

Constructor & Destructor Documentation

◆ Fletching()

com.runehive.content.skill.impl.fletching.Fletching.Fletching ( int level,
double experience )

Definition at line 42 of file Fletching.java.

42 {
43 super(Skill.FLETCHING, level, experience);
44 }

References com.runehive.game.world.entity.skill.Skill.experience, com.runehive.game.world.entity.skill.Skill.level, and com.runehive.game.world.entity.skill.Skill.Skill().

Here is the call graph for this function:

Member Function Documentation

◆ addFletchable()

void com.runehive.content.skill.impl.fletching.Fletching.addFletchable ( Fletchable fletchable)
static

Definition at line 46 of file Fletching.java.

46 {
47 if (FLETCHABLES.put(fletchable.getWith().getId(), fletchable) != null) {
48 System.out.println("[Fletching] Conflicting item values: " + fletchable.getWith().getId() + " Type: " + fletchable.getClass().getSimpleName());
49 }
50 }

References FLETCHABLES, com.runehive.game.world.items.Item.getId(), and com.runehive.content.skill.impl.fletching.Fletchable.getWith().

Referenced by 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(), and com.runehive.content.skill.impl.fletching.impl.Stringable.load().

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

◆ clickButton()

boolean com.runehive.content.skill.impl.fletching.Fletching.clickButton ( Player player,
ClickButtonInteractionEvent event )
protected

Reimplemented from com.runehive.game.world.entity.skill.Skill.

Definition at line 135 of file Fletching.java.

135 {
136 if (player.attributes.get(FLETCHABLE_KEY, Fletchable.class) == null) {
137 return false;
138 }
139
140 Fletchable fletchable = player.attributes.get(FLETCHABLE_KEY, Fletchable.class);
141
142 int button = event.getButton();
143
144 switch (button) {
145
146 /* Option 1 - Make all */
147 case 1747:
148 start(player, fletchable, 0, 15);
149 return true;
150
151 /* Option 1 - Make 1 */
152 case 2799:
153 case 8909:
154 case 8874:
155 case 8889:
156 start(player, fletchable, 0, 1);
157 return true;
158
159 /* Option 1 - Make 5 */
160 case 2798:
161 case 8908:
162 case 8873:
163 case 8888:
164 start(player, fletchable, 0, 5);
165 return true;
166
167 /* Option 1 - Make 10 */
168 case 8907:
169 case 8872:
170 case 8887:
171 start(player, fletchable, 0, 10);
172 return true;
173 //TODO: Make X limited to 150.
174
175 /* Option 1 - Make X */
176 case 1748:
177 case 8906:
178 case 8871:
179 case 8886:
180 case 6212:
181 try {
182 player.send(new SendInputAmount("Enter amount", 3, input ->
183 start(player, fletchable, 0, Integer.parseInt(input))));
184
185 } catch (Exception ex) {
186 logger.error(String.format("player=%s error fletching option1: make-x", player.getName()), ex);
187 }
188 return true;
189
190 /* Option 2 - Make 1 */
191 case 8913:
192 case 8878:
193 case 8893:
194 start(player, fletchable, 1, 1);
195 return true;
196
197 /* Option 2 - Make 5 */
198 case 8912:
199 case 8877:
200 case 8892:
201 start(player, fletchable, 1, 5);
202 return true;
203
204 /* Option 2 - Make 10 */
205 case 8911:
206 case 8876:
207 case 8891:
208 start(player, fletchable, 1, 10);
209 return true;
210
211 /* Option 2 - Make X */
212 case 8910:
213 case 8875:
214 case 8890:
215 try {
216 player.send(new SendInputAmount("Enter amount", 2, input -> start(player, fletchable, 1, Integer.parseInt(input))));
217 } catch (Exception ex) {
218 logger.error(String.format("player=%s error fletching option2: make-x", player.getName()), ex);
219 }
220 return true;
221
222 /* Option 3 - Make 1 */
223 case 8917:
224 case 8897:
225 start(player, fletchable, 2, 1);
226 return true;
227
228 /* Option 3 - Make 5 */
229 case 8916:
230 case 8896:
231 start(player, fletchable, 2, 5);
232 return true;
233
234 /* Option 3 - Make 10 */
235 case 8915:
236 case 8895:
237 start(player, fletchable, 2, 10);
238 return true;
239
240 /* Option 3 - Make X */
241 case 8914:
242 case 8894:
243 try {
244 player.send(new SendInputAmount("Enter amount", 2, input -> start(player, fletchable, 2, Integer.parseInt(input))));
245 } catch (Exception ex) {
246 logger.error(String.format("player=%s error fletching option3: make-x", player.getName()), ex);
247 }
248 return true;
249
250 /* Option 4 - Make 1 */
251 case 8921:
252 start(player, fletchable, 3, 1);
253 return true;
254
255 /* Option 4 - Make 5 */
256 case 8920:
257 start(player, fletchable, 3, 5);
258 return true;
259
260 /* Option 4 - Make 10 */
261 case 8919:
262 start(player, fletchable, 3, 10);
263 return true;
264
265 /* Option 4 - Make X */
266 case 8918:
267 try {
268
269 player.send(new SendInputAmount("Enter amount", 2, input -> start(player, fletchable, 3, Integer.parseInt(input))));
270 } catch (Exception ex) {
271 logger.error(String.format("player=%s error fletching option3: make-x", player.getName()), ex);
272 }
273 return true;
274
275 default:
276 return false;
277 }
278 }
final GenericAttributes attributes
Definition Mob.java:95
String getName()
Gets the name of this entity.
Definition Player.java:774
public< K, E > E get(K key)
Gets a generic attribute.

References com.runehive.game.world.entity.mob.Mob.attributes, FLETCHABLE_KEY, com.runehive.util.generic.GenericAttributes.get(), com.runehive.game.world.entity.mob.player.Player.getName(), logger, com.runehive.game.world.entity.mob.player.Player.send(), and start().

Here is the call graph for this function:

◆ fletch() [1/2]

Action< Player > com.runehive.content.skill.impl.fletching.Fletching.fletch ( Player player,
Fletchable fletchable,
FletchableItem item,
int amount )
private

Definition at line 351 of file Fletching.java.

351 {
352 return new Action<Player>(player, 2, true) {
353 int iterations = 0;
354
355 @Override
356 public void execute() {
357 ++iterations;
358 player.animate(new Animation(fletchable.getAnimation()));
359 player.graphic(new Graphic(fletchable.getGraphics()));
360 final boolean saveMaterial = SkillCape.isEquipped(player, SkillCape.FLETCHING) && Utility.random(1, 3) == 1;
361
362 if (fletchable == Carvable.AMETHYST) {
363 player.skills.addExperience(Skill.CRAFTING, item.getExperience() * modifier());
364 } else {
365 player.skills.addExperience(Skill.FLETCHING, item.getExperience() * modifier());
366 }
367
368 if (!saveMaterial) {
369 player.inventory.removeAll(fletchable.getIngredients());
370 }
371
372 player.inventory.addOrDrop(item.getProduct());
374 RandomEventHandler.trigger(player);
375
376 if (fletchable.getProductionMessage() != null) {
377 player.send(new SendMessage(fletchable.getProductionMessage()));
378 }
379
380 if (fletchable == Stringable.MAGIC_SHORTBOWS) {
381 getMob().forClan(channel -> channel.activateTask(ClanTaskKey.MAGIC_SHORTBOW, getMob().getName()));
382 } else if (fletchable == Stringable.YEW_SHORTBOWS) {
383 getMob().forClan(channel -> channel.activateTask(ClanTaskKey.YEW_SHORTBOW, getMob().getName()));
384 } else if (fletchable instanceof Arrow) {
385 AchievementHandler.activate(player, AchievementKey.FLETCHING);
386 }
387
388 if (iterations == amount || iterations > 28 || !(player.inventory.containsAll(fletchable.getIngredients()))) {
389 cancel();
390 if (!(player.inventory.containsAll(fletchable.getIngredients()))) {
391 player.send(new SendMessage("<col=369>You have run out of materials."));
392 }
393 return;
394 }
395 }
396
397
398 @Override
399 public String getName() {
400 return "Fletching";
401 }
402
403 @Override
404 public boolean prioritized() {
405 return false;
406 }
407
408 @Override
409 public WalkablePolicy getWalkablePolicy() {
410 return WalkablePolicy.NON_WALKABLE;
411 }
412 };
413 }
Optional< Graphic > graphic
Definition Mob.java:91
void addExperience(int id, double experience)
Adds experience to a given skill.
boolean removeAll(Collection<? extends Item > items)
Attempts to withdraw items in bulk from this container.
final boolean containsAll(int... identifiers)
Determines if this container contains all identifiers.
void addOrDrop(List< Item > items)
Attempts to deposit an item to the players inventory, if there is no space it'll bank the item instea...

References com.runehive.content.achievement.AchievementHandler.activate(), com.runehive.game.world.entity.mob.player.PlayerAssistant.activateSkilling(), com.runehive.game.world.entity.skill.SkillManager.addExperience(), com.runehive.game.world.items.containers.inventory.Inventory.addOrDrop(), com.runehive.content.skill.impl.fletching.impl.Carvable.AMETHYST, com.runehive.game.world.entity.mob.Mob.animate(), com.runehive.game.world.items.containers.ItemContainer.containsAll(), com.runehive.content.achievement.AchievementKey.FLETCHING, com.runehive.content.skillcape.SkillCape.FLETCHING, com.runehive.content.skill.impl.fletching.Fletchable.getAnimation(), com.runehive.content.skill.impl.fletching.FletchableItem.getExperience(), com.runehive.content.skill.impl.fletching.Fletchable.getGraphics(), com.runehive.content.skill.impl.fletching.Fletchable.getIngredients(), com.runehive.game.world.entity.skill.Skill.getName(), com.runehive.content.skill.impl.fletching.FletchableItem.getProduct(), com.runehive.content.skill.impl.fletching.Fletchable.getProductionMessage(), com.runehive.game.world.entity.mob.Mob.graphic, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.content.skillcape.SkillCape.isEquipped(), com.runehive.content.clanchannel.content.ClanTaskKey.MAGIC_SHORTBOW, com.runehive.content.skill.impl.fletching.impl.Stringable.MAGIC_SHORTBOWS, modifier(), com.runehive.game.action.policy.WalkablePolicy.NON_WALKABLE, com.runehive.game.world.entity.mob.player.Player.playerAssistant, com.runehive.util.Utility.random(), com.runehive.game.world.items.containers.ItemContainer.removeAll(), com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.game.world.entity.skill.Skill.Skill(), com.runehive.game.world.entity.mob.Mob.skills, com.runehive.content.activity.randomevent.RandomEventHandler.trigger(), com.runehive.content.clanchannel.content.ClanTaskKey.YEW_SHORTBOW, and com.runehive.content.skill.impl.fletching.impl.Stringable.YEW_SHORTBOWS.

Here is the call graph for this function:

◆ fletch() [2/2]

boolean com.runehive.content.skill.impl.fletching.Fletching.fletch ( Player player,
int index,
int amount )

Definition at line 280 of file Fletching.java.

280 {
281 Fletchable fletchable = player.attributes.get(FLETCHABLE_KEY);
282
283 if (fletchable == null) {
284 return false;
285 }
286
287 return start(player, fletchable, index, amount);
288
289 }

References com.runehive.game.world.entity.mob.Mob.attributes, FLETCHABLE_KEY, com.runehive.util.generic.GenericAttributes.get(), and start().

Referenced by start().

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

◆ getFletchable()

Fletchable com.runehive.content.skill.impl.fletching.Fletching.getFletchable ( int use,
int with )
private

Definition at line 52 of file Fletching.java.

52 {
53 return FLETCHABLES.getOrDefault(use, FLETCHABLES.get(with));
54 }

References FLETCHABLES.

Referenced by useItem().

Here is the caller graph for this function:

◆ modifier()

double com.runehive.content.skill.impl.fletching.Fletching.modifier ( )
protected

Reimplemented from com.runehive.game.world.entity.skill.Skill.

Definition at line 57 of file Fletching.java.

57 {
58 return Config.FLETCHING_MODIFICATION;
59 }

References com.runehive.Config.FLETCHING_MODIFICATION.

Referenced by fletch().

Here is the caller graph for this function:

◆ start()

boolean com.runehive.content.skill.impl.fletching.Fletching.start ( Player player,
Fletchable fletchable,
int index,
int amount )

Definition at line 291 of file Fletching.java.

291 {
292 if (fletchable == null) {
293 return false;
294 }
295
296 player.attributes.remove(FLETCHABLE_KEY);
297 FletchableItem item = fletchable.getFletchableItems()[index];
298 player.interfaceManager.close();
299
300 if (player.skills.getLevel(Skill.FLETCHING) < item.getLevel()) {
301 player.dialogueFactory.sendStatement("<col=369>You need a Fletching level of " + item.getLevel() + " to do that.").execute();
302 return true;
303 }
304
305 if (!(player.inventory.containsAll(fletchable.getIngredients()))) {
306 String firstName = fletchable.getUse().getName().toLowerCase();
307 String secondName = fletchable.getWith().getName().toLowerCase();
308
309 if (fletchable.getUse().getAmount() > 1 && !firstName.endsWith("s")) {
310 firstName = firstName.concat("s");
311 }
312
313 if (fletchable.getWith().getAmount() > 1 && !secondName.endsWith("s")) {
314 secondName = secondName.concat("s");
315 }
316
317 if (fletchable.getUse().getAmount() == 1 && firstName.endsWith("s")) {
318 firstName = firstName.substring(0, firstName.length() - 1);
319 }
320
321 if (fletchable.getWith().getAmount() == 1 && secondName.endsWith("s")) {
322 secondName = secondName.substring(0, secondName.length() - 1);
323 }
324
325 final String firstAmount;
326
327 if (fletchable.getUse().getAmount() == 1) {
328 firstAmount = Utility.getAOrAn(fletchable.getUse().getName());
329 } else {
330 firstAmount = String.valueOf(fletchable.getUse().getAmount());
331 }
332
333 final String secondAmount;
334
335 if (fletchable.getWith().getAmount() == 1) {
336 secondAmount = Utility.getAOrAn(fletchable.getWith().getName());
337 } else {
338 secondAmount = String.valueOf(fletchable.getWith().getAmount());
339 }
340
341 String firstRequirement = firstAmount + " " + firstName;
342 String secondRequirement = secondAmount + " " + secondName;
343 player.send(new SendMessage("You need " + firstRequirement + " and " + secondRequirement + " to do that."));
344 return true;
345 }
346
347 player.action.execute(fletch(player, fletchable, item, amount), true);
348 return true;
349 }
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue to the current dialogue chain.
public< A extends Action<?> > void execute(A action)
int getLevel(int id)
Gets the level of a skill.
public< K > void remove(K key)
Removes a generic attribute.
val index

References com.runehive.game.world.entity.mob.Mob.action, com.runehive.game.world.entity.mob.Mob.attributes, com.runehive.game.world.entity.mob.player.InterfaceManager.close(), com.runehive.game.world.items.containers.ItemContainer.containsAll(), com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.content.dialogue.DialogueFactory.execute(), com.runehive.game.action.ActionManager.execute(), fletch(), FLETCHABLE_KEY, com.runehive.game.world.items.Item.getAmount(), com.runehive.util.Utility.getAOrAn(), com.runehive.content.skill.impl.fletching.Fletchable.getFletchableItems(), com.runehive.content.skill.impl.fletching.Fletchable.getIngredients(), com.runehive.content.skill.impl.fletching.FletchableItem.getLevel(), com.runehive.game.world.entity.skill.SkillManager.getLevel(), com.runehive.game.world.items.Item.getName(), com.runehive.content.skill.impl.fletching.Fletchable.getUse(), com.runehive.content.skill.impl.fletching.Fletchable.getWith(), com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.util.generic.GenericAttributes.remove(), com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.content.dialogue.DialogueFactory.sendStatement(), com.runehive.game.world.entity.skill.Skill.Skill(), and com.runehive.game.world.entity.mob.Mob.skills.

Referenced by clickButton(), and fletch().

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

◆ useItem()

boolean com.runehive.content.skill.impl.fletching.Fletching.useItem ( Player player,
ItemOnItemInteractionEvent event )
protected

Reimplemented from com.runehive.game.world.entity.skill.Skill.

Definition at line 62 of file Fletching.java.

62 {
63 Item first = event.getFirst();
64 Item second = event.getSecond();
65
66 if (FiremakingData.forId(first.getId()).isPresent() && FiremakingData.forId(second.getId()).isPresent()) {
67 return false;
68 }
69
70 Fletchable fletchable = getFletchable(first.getId(), second.getId());
71
72 if (fletchable == null || first.getId() == 590 || second.getId() == 590 || first.getId() == 8792 || second.getId() == 8792) {
73 return false;
74 }
75
76 if (!fletchable.getUse().equalIds(first) && !fletchable.getUse().equalIds(second)) {
77 player.message("You need to use this with " + Utility.getAOrAn(fletchable.getUse().getName()) + " " + fletchable.getUse().getName().toLowerCase() + " to fletch this item.");
78 return true;
79 }
80
81 String prefix = fletchable.getWith().getName().split(" ")[0];
82
83 switch (fletchable.getFletchableItems().length) {
84
85 case 1:
86 player.attributes.set(FLETCHABLE_KEY, fletchable);
87 player.send(new SendString("\\n \\n \\n \\n" + fletchable.getFletchableItems()[0].getProduct().getName(), 2799));
88 player.send(new SendItemOnInterfaceZoom(1746, 170, fletchable.getFletchableItems()[0].getProduct().getId()));
89 player.send(new SendChatBoxInterface(4429));
90 return true;
91 case 2:
92 player.attributes.set(FLETCHABLE_KEY, fletchable);
93 player.send(new SendItemOnInterfaceZoom(8869, 170, fletchable.getFletchableItems()[0].getProduct().getId()));
94 player.send(new SendItemOnInterfaceZoom(8870, 170, fletchable.getFletchableItems()[1].getProduct().getId()));
95 player.send(new SendString("\\n \\n \\n \\n".concat(prefix + " Short Bow"), 8874));
96 player.send(new SendString("\\n \\n \\n \\n".concat(prefix + " Long Bow"), 8878));
97 player.send(new SendChatBoxInterface(8866));
98 return true;
99 case 3:
100 player.attributes.set(FLETCHABLE_KEY, fletchable);
101 player.send(new SendItemOnInterfaceZoom(8883, 170, fletchable.getFletchableItems()[0].getProduct().getId()));
102 player.send(new SendItemOnInterfaceZoom(8884, 170, fletchable.getFletchableItems()[1].getProduct().getId()));
103 player.send(new SendItemOnInterfaceZoom(8885, 170, fletchable.getFletchableItems()[2].getProduct().getId()));
104 player.send(new SendString("\\n \\n \\n \\n".concat("Arrow heads"), 8889));
105 player.send(new SendString("\\n \\n \\n \\n".concat(prefix + " Short Bow"), 8893));
106 player.send(new SendString("\\n \\n \\n \\n".concat(prefix + " Long Bow"), 8897));
107 player.send(new SendChatBoxInterface(8880));
108 return true;
109 case 4:
110 player.attributes.set(FLETCHABLE_KEY, fletchable);
111 player.send(new SendItemOnInterfaceZoom(8902, 170, fletchable.getFletchableItems()[0].getProduct().getId()));
112 player.send(new SendItemOnInterfaceZoom(8903, 170, fletchable.getFletchableItems()[1].getProduct().getId()));
113 player.send(new SendItemOnInterfaceZoom(8904, 170, fletchable.getFletchableItems()[2].getProduct().getId()));
114 player.send(new SendItemOnInterfaceZoom(8905, 170, fletchable.getFletchableItems()[3].getProduct().getId()));
115
116 String[] productNames;
117 if (fletchable == Carvable.AMETHYST) {
118 productNames = new String[]{"Arrowtips", "Bolt tips", "Javelin heads", "Dart tips"};
119 } else {
120 productNames = new String[]{"Arrow Shafts", "Short Bow", "Long Bow", "Crossbow Stock"};
121 }
122
123 player.send(new SendString("\\n \\n \\n \\n".concat(productNames[0]), 8909));
124 player.send(new SendString("\\n \\n \\n \\n".concat(productNames[1]), 8913));
125 player.send(new SendString("\\n \\n \\n \\n".concat(productNames[2]), 8917));
126 player.send(new SendString("\\n \\n \\n \\n".concat(productNames[3]), 8921));
127 player.send(new SendChatBoxInterface(8899));
128 return true;
129 default:
130 return false;
131 }
132 }
final int getId()
Gets the identification of this item.
Definition Item.java:324
public< K, E > void set(K key, E attribute)
Sets a generic attribute.

References com.runehive.content.skill.impl.fletching.impl.Carvable.AMETHYST, com.runehive.game.world.entity.mob.Mob.attributes, com.runehive.game.world.items.Item.equalIds(), FLETCHABLE_KEY, com.runehive.content.skill.impl.firemaking.FiremakingData.forId(), com.runehive.util.Utility.getAOrAn(), getFletchable(), com.runehive.content.skill.impl.fletching.Fletchable.getFletchableItems(), com.runehive.game.world.items.Item.getId(), com.runehive.game.world.items.Item.getName(), com.runehive.content.skill.impl.fletching.FletchableItem.getProduct(), com.runehive.content.skill.impl.fletching.Fletchable.getUse(), com.runehive.content.skill.impl.fletching.Fletchable.getWith(), com.runehive.game.world.entity.mob.player.Player.message(), com.runehive.game.world.entity.mob.player.Player.send(), and com.runehive.util.generic.GenericAttributes.set().

Here is the call graph for this function:

Member Data Documentation

◆ FLETCHABLE_KEY

final String com.runehive.content.skill.impl.fletching.Fletching.FLETCHABLE_KEY = "FLETCHABLE_KEY"
staticprivate

Definition at line 38 of file Fletching.java.

Referenced by clickButton(), fletch(), start(), and useItem().

◆ FLETCHABLES

final HashMap<Integer, Fletchable> com.runehive.content.skill.impl.fletching.Fletching.FLETCHABLES = new HashMap<>()
staticprivate

Definition at line 40 of file Fletching.java.

Referenced by addFletchable(), and getFletchable().

◆ logger

final Logger com.runehive.content.skill.impl.fletching.Fletching.logger = LogManager.getLogger(Fletching.class)
staticprivate

Definition at line 36 of file Fletching.java.

Referenced by clickButton().


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