RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.skill.impl.smithing.Smithing Class Reference
Inheritance diagram for com.runehive.content.skill.impl.smithing.Smithing:
Collaboration diagram for com.runehive.content.skill.impl.smithing.Smithing:

Public Member Functions

boolean clickButton (Player player, ClickButtonInteractionEvent event)
boolean itemContainerAction (Player player, ItemContainerInteractionEvent event)
 Smithing (int level, double experience)
boolean useItem (Player player, ItemOnObjectInteractionEvent event)
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 ()

Protected Member Functions

boolean clickObject (Player player, ObjectInteractionEvent 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)
double modifier ()
boolean useItem (Player player, ItemOnItemInteractionEvent event)

Additional Inherited Members

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.
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

Author
Stand Up
Since
11-2-2017.

Definition at line 17 of file Smithing.java.

Constructor & Destructor Documentation

◆ Smithing()

com.runehive.content.skill.impl.smithing.Smithing.Smithing ( int level,
double experience )

Definition at line 19 of file Smithing.java.

19 {
20 super(Skill.SMITHING, level, experience);
21 }

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

◆ clickButton()

boolean com.runehive.content.skill.impl.smithing.Smithing.clickButton ( Player player,
ClickButtonInteractionEvent event )

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

Definition at line 50 of file Smithing.java.

50 {
51 switch(event.getType()) {
52 case CLICK_BUTTON:
53 return Smelting.smelt(player, event.getButton());
54 default:
55 return false;
56 }
57 }

References com.runehive.content.skill.impl.smithing.Smelting.smelt().

Here is the call graph for this function:

◆ clickObject()

boolean com.runehive.content.skill.impl.smithing.Smithing.clickObject ( Player player,
ObjectInteractionEvent event )
protected

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

Definition at line 70 of file Smithing.java.

70 {
71 if (event.getObject().getId() == 2097) {
72 Item foundBar = null;
73 for (int bar : Smelting.SMELT_BARS) {
74 if (player.inventory.contains(bar)) {
75 foundBar = new Item(bar);
76 break;
77 }
78 }
79 if (foundBar != null) {
80 SmithingArmour.openInterface(player, foundBar, event.getObject());
81 } else {
82 player.send(new SendMessage("You have no bar which you have the required Smithing level to use."));
83 }
84 return true;
85 }
86 switch(event.getType()) {
87 case FIRST_CLICK_OBJECT:
88 case SECOND_CLICK_OBJECT:
89 return Smelting.openInterface(player, event.getObject());
90 default:
91 return false;
92 }
93 }

References com.runehive.game.world.items.containers.ItemContainer.contains(), com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.content.skill.impl.smithing.Smelting.openInterface(), com.runehive.content.skill.impl.smithing.SmithingArmour.openInterface(), com.runehive.game.world.entity.mob.player.Player.send(), and com.runehive.content.skill.impl.smithing.Smelting.SMELT_BARS.

Here is the call graph for this function:

◆ itemContainerAction()

boolean com.runehive.content.skill.impl.smithing.Smithing.itemContainerAction ( Player player,
ItemContainerInteractionEvent event )

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

Definition at line 24 of file Smithing.java.

24 {
25 switch(event.id) {
26 case 1:
27 return SmithingArmour.forge(player, event.interfaceId, event.removeSlot, 1);
28 case 2:
29 return SmithingArmour.forge(player, event.interfaceId, event.removeSlot, 5);
30 case 3:
31 return SmithingArmour.forge(player, event.interfaceId, event.removeSlot, 10);
32 case 4:
33 return SmithingArmour.forge(player, event.interfaceId, event.removeSlot, Integer.MAX_VALUE);
34 case 5:
35 switch(event.interfaceId) {
36 case 1119:
37 case 1120:
38 case 1121:
39 case 1122:
40 case 1123:
41 player.send(new SendInputAmount("Enter amount", 2, input -> SmithingArmour.forge(player, event.interfaceId, event.removeSlot, Integer.parseInt(input))));
42 return true;
43 }
44 return false;
45 default:
46 return false;
47 }
48 }

References com.runehive.content.skill.impl.smithing.SmithingArmour.forge(), and com.runehive.game.world.entity.mob.player.Player.send().

Here is the call graph for this function:

◆ useItem()

boolean com.runehive.content.skill.impl.smithing.Smithing.useItem ( Player player,
ItemOnObjectInteractionEvent event )

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

Definition at line 60 of file Smithing.java.

60 {
61 switch(event.getType()) {
62 case ITEM_ON_OBJECT:
63 return SmithingArmour.openInterface(player, event.getItem(), event.getObject());
64 default:
65 return false;
66 }
67 }

References com.runehive.content.skill.impl.smithing.SmithingArmour.openInterface().

Here is the call graph for this function:

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