RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.skill.impl.hunter.Hunter Class Reference

Handles the hunter skill. More...

Inheritance diagram for com.runehive.content.skill.impl.hunter.Hunter:
Collaboration diagram for com.runehive.content.skill.impl.hunter.Hunter:

Public Member Functions

 Hunter (int level, double experience)
 Creates a new Hunter
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 clickItem (Player player, ItemInteractionEvent event)
boolean clickNpc (Player player, NpcInteractionEvent event)
boolean clickObject (Player player, ObjectInteractionEvent event)
double modifier ()
Protected Member Functions inherited from com.runehive.game.world.entity.skill.Skill
boolean clickButton (Player player, ClickButtonInteractionEvent event)
boolean itemContainerAction (Player player, ItemContainerInteractionEvent event)
boolean useItem (Player player, ItemOnItemInteractionEvent event)
boolean useItem (Player player, ItemOnObjectInteractionEvent 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

Handles the hunter skill.

Author
Daniel

Definition at line 32 of file Hunter.java.

Constructor & Destructor Documentation

◆ Hunter()

com.runehive.content.skill.impl.hunter.Hunter.Hunter ( int level,
double experience )

Creates a new Hunter

Definition at line 35 of file Hunter.java.

35 {
36 super(Skill.HUNTER, level, experience);
37 }

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

◆ clickItem()

boolean com.runehive.content.skill.impl.hunter.Hunter.clickItem ( Player player,
ItemInteractionEvent event )
protected

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

Definition at line 95 of file Hunter.java.

95 {
96 Item item = event.getItem();
97
98 if (event.getOpcode() == 0) {
99 switch (item.getId()) {
100 case 10006:
101 TrapManager.layTrap(player, new SnareTrap(new CustomGameObject(19175, new Position(player.getX(), player.getY(), player.getHeight())), Trap.TrapState.SET, 200, player));
102 return true;
103 case 10008:
104 TrapManager.layTrap(player, new BoxTrap(new CustomGameObject(19187, new Position(player.getX(), player.getY(), player.getHeight())), Trap.TrapState.SET, 200, player));
105 return true;
106 }
107 }
108
109 if (event.getOpcode() != 1) {
110 return false;
111 }
112
113 if (!ImplingReward.forId(item.getId()).isPresent()) {
114 return false;
115 }
116
117 ImplingReward impling = ImplingReward.forId(item.getId()).get();
118 Item reward = Utility.randomElement(impling.getLootation());
119
120 if (player.inventory.getFreeSlots() == 0) {
121 player.send(new SendMessage("You do not have enough inventory space to enter this."));
122 return true;
123 }
124
125 boolean shatter = Utility.random(10) == 1;
126 player.inventory.remove(item);
127
128 if (!shatter) {
129 player.inventory.add(11260, 1);
130 player.send(new SendMessage("You successfully open the jar.", true));
131 } else {
132 player.send(new SendMessage("The jar breaks as you open the jar, cutting you a bit.", true));
133 player.damage(new Hit(Utility.random(3)));
134 }
135
136 player.inventory.add(reward);
137 return true;
138 }

References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.game.world.entity.mob.Mob.damage(), com.runehive.content.skill.impl.hunter.net.ImplingReward.forId(), com.runehive.game.world.items.containers.ItemContainer.getFreeSlots(), com.runehive.game.world.entity.Entity.getHeight(), com.runehive.game.world.items.Item.getId(), com.runehive.content.skill.impl.hunter.net.ImplingReward.getLootation(), com.runehive.game.world.entity.Entity.getX(), com.runehive.game.world.entity.Entity.getY(), com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.content.skill.impl.hunter.trap.TrapManager.layTrap(), com.runehive.util.Utility.random(), com.runehive.util.Utility.randomElement(), com.runehive.game.world.items.containers.ItemContainer.remove(), com.runehive.game.world.entity.mob.player.Player.send(), and com.runehive.content.skill.impl.hunter.trap.Trap.TrapState.SET.

Here is the call graph for this function:

◆ clickNpc()

boolean com.runehive.content.skill.impl.hunter.Hunter.clickNpc ( Player player,
NpcInteractionEvent event )
protected

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

Definition at line 70 of file Hunter.java.

70 {
71 if (event.getOpcode() != 0) {
72 return false;
73 }
74
75 Npc npc = event.getNpc();
76
77 if (!npc.isVisible()) {
78 return false;
79 }
80
81 if (Impling.forId(npc.id).isPresent()) {
82 Impling imp = Impling.forId(npc.id).get();
83 World.schedule(new Netting(player, npc, imp.experience, imp.level, 11260, imp.reward));
84 return true;
85 } else if (Butterfly.forId(npc.id).isPresent()) {
86 Butterfly fly = Butterfly.forId(npc.id).get();
87 World.schedule(new Netting(player, npc, fly.experience, fly.level, 10012, fly.reward));
88 return true;
89 }
90
91 return false;
92 }

References com.runehive.content.skill.impl.hunter.net.impl.Butterfly.experience, com.runehive.content.skill.impl.hunter.net.impl.Impling.experience, com.runehive.content.skill.impl.hunter.net.impl.Butterfly.forId(), com.runehive.content.skill.impl.hunter.net.impl.Impling.forId(), com.runehive.game.world.entity.mob.Mob.getNpc(), com.runehive.game.world.entity.mob.Mob.id, com.runehive.game.world.entity.Entity.isVisible(), com.runehive.content.skill.impl.hunter.net.impl.Butterfly.level, com.runehive.content.skill.impl.hunter.net.impl.Impling.level, com.runehive.content.skill.impl.hunter.net.impl.Butterfly.reward, com.runehive.content.skill.impl.hunter.net.impl.Impling.reward, and com.runehive.game.world.World.schedule().

Here is the call graph for this function:

◆ clickObject()

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

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

Definition at line 45 of file Hunter.java.

45 {
46 if (event.getOpcode() == 0) {
47 switch (event.getObject().getId()) {
48 case 25016:
49 case 25029:
50 player.action.execute(new PuroPuroAction(player, event.getObject()));
51 return true;
52 case 19187:
53 case 19175:
54 TrapManager.dismantle(player, event.getObject());
55 return true;
56 case 19191:
57 case 19189:
58 case 19180:
59 case 19184:
60 case 19182:
61 case 19178:
62 TrapManager.lootTrap(player, event.getObject());
63 return true;
64 }
65 }
66 return false;
67 }

References com.runehive.game.world.entity.mob.Mob.action, com.runehive.content.skill.impl.hunter.trap.TrapManager.dismantle(), com.runehive.game.action.ActionManager.execute(), and com.runehive.content.skill.impl.hunter.trap.TrapManager.lootTrap().

Here is the call graph for this function:

◆ modifier()

double com.runehive.content.skill.impl.hunter.Hunter.modifier ( )
protected

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

Definition at line 40 of file Hunter.java.

40 {
41 return Config.HUNTER_MODIFICATION;
42 }

References com.runehive.Config.HUNTER_MODIFICATION.


The documentation for this class was generated from the following file:
  • java/com/runehive/content/skill/impl/hunter/Hunter.java