RuneHive-Game
Loading...
Searching...
No Matches
DharokListener.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.attack.listener.item;
2
3import com.runehive.content.achievement.AchievementHandler;
4import com.runehive.content.achievement.AchievementKey;
5import com.runehive.game.world.entity.combat.attack.listener.ItemCombatListenerSignature;
6import com.runehive.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
7import com.runehive.game.world.entity.combat.attack.listener.SimplifiedListener;
8import com.runehive.game.world.entity.combat.hit.Hit;
9import com.runehive.game.world.entity.mob.Mob;
10
11/**
12 * Handles the Dharok's armor effects to the assigned npc and item ids.
13 * @author Michael | Chex
14 */
15@NpcCombatListenerSignature(npcs = {1673})
16@ItemCombatListenerSignature(requireAll = true, items = {4716, 4718, 4720, 4722})
18
19 @Override
20 public int modifyDamage(Mob attacker, Mob defender, int damage) {
21 int health = attacker.getMaximumHealth() - attacker.getCurrentHealth();
22 if (health < 0) health = 0;
23 return damage + damage * health / 100;
24 }
25
26 @Override
27 public void onKill(Mob attacker, Mob defender, Hit hit) {
28 if (attacker.isPlayer() && defender.isPlayer()) {
30 }
31 }
32}
static void activate(Player player, AchievementKey achievement)
Activates the achievement for the individual player.
Handles the Dharok's armor effects to the assigned npc and item ids.
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