RuneHive-Game
Loading...
Searching...
No Matches
TzKihListener.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.attack.listener.npc;
2
3import com.runehive.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
4import com.runehive.game.world.entity.combat.attack.listener.SimplifiedListener;
5import com.runehive.game.world.entity.combat.hit.Hit;
6import com.runehive.game.world.entity.mob.Mob;
7import com.runehive.game.world.entity.mob.npc.Npc;
8import com.runehive.game.world.entity.mob.player.Player;
9import com.runehive.game.world.entity.skill.Skill;
10
11/** @author Daniel */
12@NpcCombatListenerSignature(npcs = {2189})
14
15 @Override
16 public void hit(Npc attacker, Mob defender, Hit hit) {
17 if (!defender.isPlayer())
18 return;
19
20 Player player = defender.getPlayer();
21 int prayer = player.skills.get(Skill.PRAYER).getLevel();
22
23 if (prayer - 1 < 0)
24 return;
25
26 player.skills.setLevel(Skill.PRAYER, prayer - 1);
27 }
28}
A Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
Handles the mob class.
Definition Mob.java:66
final boolean isPlayer()
Check if an entity is a player.
Definition Mob.java:564
Represents a non-player character in the in-game world.
Definition Npc.java:29
This class represents a character controlled by a player.
Definition Player.java:125
Represents a trainable and usable skill.
Definition Skill.java:18
static final int PRAYER
The prayer skill id.
Definition Skill.java:36
int getLevel()
Gets the current skill level.
Definition Skill.java:205
Skill get(int id)
Gets the skill for an id.
void setLevel(int id, int level)
Sets the level of a skill.