updated oppInfo to have Opponent HP percent

This commit is contained in:
noremac201
2017-02-05 13:37:48 -06:00
committed by Adam
parent 5d8396cf59
commit eb6b71616b
12 changed files with 1165 additions and 25 deletions

View File

@@ -25,6 +25,12 @@
package net.runelite.api;
import net.runelite.rs.api.CombatInfo1;
import net.runelite.rs.api.CombatInfo2;
import net.runelite.rs.api.CombatInfoList;
import net.runelite.rs.api.CombatInfoListHolder;
import net.runelite.rs.api.Node;
public abstract class Actor extends Renderable
{
private Client client;
@@ -38,6 +44,8 @@ public abstract class Actor extends Renderable
this.actor = actor;
}
public abstract int getCombatLevel();
public abstract String getName();
public Actor getInteracting()
@@ -58,4 +66,45 @@ public abstract class Actor extends Renderable
i = i - 32767 - 1;
return client.getPlayers()[i];
}
public int getHealthRatio()
{
CombatInfoList combatInfoList = actor.getCombatInfoList();
if (combatInfoList != null)
{
Node node = combatInfoList.getNode();
Node next = node.getNext();
if (next instanceof CombatInfoListHolder)
{
CombatInfoListHolder combatInfoListWrapper = (CombatInfoListHolder) next;
CombatInfoList combatInfoList1 = combatInfoListWrapper.getCombatInfo1();
Node node2 = combatInfoList1.getNode();
Node next2 = node2.getNext();
if (next2 instanceof CombatInfo1)
{
CombatInfo1 combatInfo = (CombatInfo1) next2;
return combatInfo.getHealthRatio();
}
}
}
return -1;
}
public int getHealth()
{
CombatInfoList combatInfoList = actor.getCombatInfoList();
if (combatInfoList != null)
{
Node node = combatInfoList.getNode();
Node next = node.getNext();
if (next instanceof CombatInfoListHolder)
{
CombatInfoListHolder combatInfoListWrapper = (CombatInfoListHolder) next;
CombatInfo2 cf = combatInfoListWrapper.getCombatInfo2();
return cf.getHealthScale();
}
}
return -1;
}
}

View File

@@ -42,4 +42,11 @@ public class NPC extends Actor
{
return npc.getComposition().getName();
}
@Override
public int getCombatLevel()
{
return npc.getComposition().getCombatLevel();
}
}

View File

@@ -43,4 +43,11 @@ public class Player extends Actor
{
return player.getName();
}
@Override
public int getCombatLevel()
{
return player.getCombatLevel();
}
}

View File

@@ -62,6 +62,11 @@
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>net.runelite</groupId>

View File

@@ -25,6 +25,12 @@
package net.runelite.client.plugins.opponentinfo;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.util.Map;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.ui.overlay.Overlay;
@@ -37,4 +43,13 @@ public class OpponentInfo extends Plugin
{
return overlay;
}
public static Map<String, Integer> loadNpcHealth()
{
Gson gson = new Gson();
Type type = new TypeToken<Map<String, Integer>>(){}.getType();
InputStream healthFile = OpponentInfo.class.getResourceAsStream("/npc_health.json");
return gson.fromJson(new InputStreamReader(healthFile), type);
}
}

View File

@@ -31,11 +31,16 @@ import java.awt.FontMetrics;
import java.awt.Graphics2D;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.Player;
import net.runelite.client.RuneLite;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import java.text.DecimalFormat;
import java.time.Duration;
import java.time.Instant;
import java.util.Map;
class OpponentInfoOverlay extends Overlay
{
@@ -51,6 +56,15 @@ class OpponentInfoOverlay extends Overlay
private static final Color HP_GREEN = new Color(0, 146, 54, 230);
private static final Color HP_RED = new Color(102, 15, 16, 230);
private static final Duration WAIT = Duration.ofSeconds(3);
private Integer lastMaxHealth;
private DecimalFormat df = new DecimalFormat("0.0");
private float lastRatio = 0;
private Instant lastTime = Instant.now();
private String opponentName;
private Map<String, Integer> oppInfoHealth = OpponentInfo.loadNpcHealth();
OpponentInfoOverlay()
{
super(OverlayPosition.TOP_LEFT, OverlayPriority.HIGH);
@@ -70,42 +84,42 @@ class OpponentInfoOverlay extends Overlay
@Override
public Dimension render(Graphics2D graphics)
{
Actor opponent = getOpponent();
if (opponent == null)
if (RuneLite.getClient().getGameState() != GameState.LOGGED_IN)
return null;
// int cur = opponent.getHealth();
// int max = opponent.getMaxHealth();
int cur = 0, max = 0; // XXX
Actor opponent = getOpponent();
if (opponent != null && opponent.getHealth() > 0)
{
lastTime = Instant.now();
lastRatio = (float) opponent.getHealthRatio() / (float) opponent.getHealth();
opponentName = opponent.getName();
lastMaxHealth = oppInfoHealth.get(opponent.getName() + "_" + opponent.getCombatLevel());
}
if (Duration.between(Instant.now(), lastTime).abs().compareTo(WAIT) > 0)
return null; //don't draw anything.
FontMetrics fm = graphics.getFontMetrics();
int height = TOP_BORDER
+ fm.getHeight(); // opponent name
if (max > 0)
height += 1 // between name and hp bar
int height = TOP_BORDER + fm.getHeight(); // opponent name
if (lastRatio >= 0)
{
height += 2 // between name and hp bar
+ BAR_HEIGHT; // bar
}
height += BOTTOM_BORDER;
graphics.setColor(BACKGROUND);
graphics.fillRect(0, 0, WIDTH, height);
String str = opponent.getName();
int x = (WIDTH - fm.stringWidth(str)) / 2;
int x = (WIDTH - fm.stringWidth(opponentName)) / 2;
graphics.setColor(Color.white);
graphics.drawString(str, x, fm.getHeight() + TOP_BORDER);
graphics.drawString(opponentName, x, fm.getHeight() + TOP_BORDER);
// hp bar
if (max > 0)
if (lastRatio >= 0)
{
float percent = (float) cur / (float) max;
if (percent > 100f)
percent = 100f;
int barWidth = (int) (percent * (float) BAR_WIDTH);
int barWidth = (int) (lastRatio * (float) BAR_WIDTH);
int barY = TOP_BORDER + fm.getHeight() + 1;
graphics.setColor(HP_GREEN);
@@ -114,10 +128,21 @@ class OpponentInfoOverlay extends Overlay
graphics.setColor(HP_RED);
graphics.fillRect(((WIDTH - BAR_WIDTH) / 2) + barWidth, barY, BAR_WIDTH - barWidth, BAR_HEIGHT);
str = cur + " / " + max;
x = (WIDTH - fm.stringWidth(str)) / 2;
graphics.setColor(Color.white);
graphics.drawString(str, x, barY + fm.getHeight());
String str;
if (lastMaxHealth != null)
{
int currHealth = (int) (lastRatio * lastMaxHealth);
str = currHealth + "/" + lastMaxHealth;
}
else
{
str = df.format(lastRatio * 100) + "%";
}
graphics.drawString(str, (WIDTH - fm.stringWidth(str)) / 2, barY + fm.getHeight());
}
return new Dimension(WIDTH, height);

View File

@@ -0,0 +1,884 @@
{
"Stick_104": 135,
"Fire Warrior of Lesarkus_84": 59,
"Mammoth_80": 130,
"Molanisk_51": 52,
"Rooster_2": 5,
"Nail beast_98": 55,
"Aviansie_79": 70,
"Scorpia's guardian_47": 70,
"Rooster_3": 5,
"Zygomite_86": 65,
"Dwarf_20": 16,
"Zulrah_725": 500,
"Sigmund_64": 70,
"Blessed spider_39": 32,
"Undead Lumberjack_40": 12,
"Big frog_10": 18,
"Ogre chieftain_81": 60,
"White golem_75": 80,
"Undead Lumberjack_45": 12,
"Barrelchest_190": 134,
"Ogre_63": 60,
"Yt-HurKot_108": 60,
"Tok-Xil_90": 40,
"Spiritual warrior_134": 100,
"Imp Champion_14": 40,
"Sea Troll Queen_170": 200,
"A Doubt_78": 50,
"Cave slime_23": 25,
"Aviansie_71": 70,
"Broodoo victim_1": 100,
"Dessous_139": 200,
"Aviansie_73": 70,
"Nechryael_115": 105,
"Ice giant_53": 70,
"Sea troll_101": 80,
"Ice wolf_96": 70,
"Desert snake_5": 6,
"Aviansie_69": 70,
"Undead chicken_1": 2,
"Turoth_83": 76,
"Big frog_24": 18,
"Elder Chaos druid_129": 150,
"Turoth_86": 76,
"Turoth_85": 76,
"Turoth_88": 76,
"Undead Lumberjack_50": 12,
"Turoth_87": 76,
"Sigmund_50": 70,
"Ent_101": 75,
"Turoth_89": 76,
"Rockslug_29": 27,
"Tentacle_136": 75,
"Kalrag_89": 91,
"Undead Lumberjack_55": 12,
"Angry unicorn_45": 200,
"Kalphite Worker_28": 40,
"Tough Guy_75": 75,
"Spiritual warrior_123": 100,
"Spiritual warrior_125": 100,
"Angry unicorn_47": 200,
"Brine rat_70": 50,
"Warped Jelly_112": 140,
"Black Guard_25": 30,
"Cockatrice_37": 37,
"Mogre_60": 48,
"Treus Dayth_95": 100,
"Jeff_2": 7,
"Undead Lumberjack_60": 12,
"Twig_71": 90,
"Guthan the Infested_115": 100,
"Undead Lumberjack_64": 12,
"Ahrim the Blighted_98": 100,
"Infernal Mage_66": 60,
"Imp_7": 8,
"TzHaar-Xil_133": 120,
"Imp_3": 8,
"Dark Ankou_95": 60,
"Harpie Bug Swarm_46": 25,
"Spiritual warrior_115": 100,
"Skeleton Mage_64": 17,
"TzTok-Jad_702": 250,
"Mugger_6": 8,
"Gnome guard_1337": 31,
"King Scorpion_32": 30,
"Giant crypt rat_76": 70,
"Abyssal walker_81": 95,
"Sir Bedivere_110": 90,
"Monkey guard_86": 130,
"Imp_2": 8,
"Imp_1": 8,
"Zombie rat_3": 5,
"Undead Lumberjack_70": 12,
"Dagannoth spawn_42": 35,
"Berserk barbarian spirit_166": 190,
"Dwarf_11": 16,
"Confused barbarian_132": 124,
"Dwarf_10": 16,
"Experiment No.2_109": 101,
"Speedy Keith_34": 37,
"Torag the Corrupted_115": 100,
"Ogre_58": 60,
"Entrana firebird_2": 5,
"Moss giant_48": 60,
"Ghast_30": 45,
"Ogre_53": 60,
"Ghoul Champion_85": 100,
"Warrior woman_24": 20,
"Fever spider_49": 40,
"Banshee_23": 22,
"Nezikchened_187": 150,
"Moss giant_42": 60,
"Ram_2": 8,
"Black Guard_48": 30,
"Abyssal demon_124": 150,
"Ulfric_100": 60,
"Vampyre Juvinate_54": 60,
"Bloodworm_52": 45,
"Deadly red spider_34": 35,
"Vampyre Juvinate_50": 60,
"Summoned Zombie_13": 22,
"Jail guard_26": 32,
"Alomone_13": 25,
"Enormous Tentacle_112": 120,
"Rusty_2": 7,
"Lost barbarian_132": 124,
"Guard dog_44": 49,
"Sir Leye_20": 20,
"Scion_100": 50,
"Saradomin wizard_108": 120,
"Billy Goat_33": 28,
"Starlight_149": 160,
"Culinaromancer_75": 150,
"Icefiend_18": 15,
"Kourend guard_21": 22,
"Enclave guard_83": 80,
"Vampyre Juvinate_64": 60,
"Newtroost_19": 18,
"Zogre_44": 71,
"San Tojalon_106": 120,
"Dharok the Wretched_115": 100,
"Icefiend_13": 15,
"Steel dragon_246": 210,
"Water elemental_34": 30,
"Animated Rune Armour_138": 120,
"Air elemental_34": 30,
"Skeleton Mage_16": 17,
"Goblin Champion_24": 32,
"Fiyr Shade_120": 111,
"Gargoyle_111": 105,
"Possessed pickaxe_50": 40,
"Brutal green dragon_227": 175,
"Agrith-Na-Na_146": 200,
"Woman_14": 7,
"Bloodveld_76": 120,
"Vampyre Juvinate_75": 60,
"Giant Sea Snake_149": 100,
"Steel dragon_274": 210,
"Sir Gawain_122": 110,
"Lizardman brute_73": 60,
"Lesser Demon Champion_162": 148,
"Gnome guard_23": 31,
"Bird_5": 5,
"Khazard warlord_112": 170,
"Animated Steel Armour_46": 40,
"Yak_22": 50,
"Cave kraken_127": 125,
"Ankou_75": 60,
"Scion_1": 50,
"Aviansie_92": 70,
"Zombie pirate_57": 52,
"Rogue_135": 17,
"Aviansie_94": 70,
"Werewolf_88": 60,
"Aviansie_97": 70,
"Cuffs_3": 7,
"Kalphite Guardian_141": 171,
"Sir Kay_124": 110,
"Aviansie_89": 70,
"Stag_15": 19,
"Blood Blamish Snail_20": 10,
"Duck_1": 3,
"Kob_185": 200,
"Scorpia_225": 200,
"Skogre_44": 71,
"Nail beast_69": 55,
"Mercenary Captain_47": 80,
"Lizardman shaman_150": 150,
"Jogre_53": 60,
"Bloodveld_81": 120,
"Loar Shade_40": 38,
"Doomion_91": 90,
"Jogre_58": 60,
"Kalphite Queen_333": 255,
"Othainian_91": 87,
"Werewolf_93": 60,
"Ankou_82": 60,
"Crawling Hand_7": 16,
"Growler_139": 146,
"Crawling Hand_8": 16,
"Ankou_86": 60,
"Woman_12": 7,
"Thrantax the Mighty_92": 80,
"Tanglefoot_111": 102,
"Nazastarool_68": 70,
"Aviansie_83": 70,
"Aviansie_84": 70,
"Bedabin Nomad Fighter_56": 50,
"Giant frog_13": 23,
"Gorilla_1": 130,
"Menaphite Thug_55": 60,
"Air wizard_13": 25,
"Evil spirit_150": 90,
"Weaponsmaster_23": 20,
"Greater Nechryael_200": 205,
"Ghost_19": 27,
"Red dragon_152": 140,
"Killerwatt_55": 51,
"Pyrefiend_48": 45,
"Ice Troll King_122": 150,
"Ice troll female_82": 80,
"Tentacle_99": 75,
"Pyrefiend_43": 45,
"Ankou_95": 60,
"Gelatinnoth Mother_130": 240,
"Poison spider_31": 64,
"Spawn_60": 15,
"Dust devil_110": 105,
"Al-Kharid warrior_9": 19,
"Duckling_1": 3,
"Vampyre Juvenile_45": 60,
"Brutal red dragon_289": 285,
"Animated Black Armour_69": 60,
"Armadylian guard_97": 132,
"White wolf_38": 35,
"Tortoise_92": 100,
"Cave bug_96": 5,
"Soldier (tier 2)_48": 50,
"Gnome troop_3": 2,
"Thermonuclear smoke devil_301": 240,
"Druid_33": 30,
"Iron dragon_189": 165,
"Gnome troop_1": 2,
"Cave horror_80": 55,
"Reanimated demon spawn_87": 85,
"Giant snail_80": 125,
"Black Knight Titan_120": 142,
"Baby black dragon_83": 80,
"Mounted terrorbird gnome_31": 36,
"Poltenip_21": 22,
"Rowdy slave_10": 16,
"Slug Prince_62": 70,
"Confusion beast_43": 64,
"K'ril Tsutsaroth_650": 255,
"Dad_101": 120,
"Mountain troll_69": 90,
"White wolf_25": 35,
"Foreman_23": 20,
"Angry barbarian spirit_166": 190,
"Snake_24": 6,
"Hellhound_122": 116,
"Hellhound_127": 116,
"Aviansie_137": 70,
"Snakeling_90": 1,
"Undead cow_2": 8,
"Tstanon Karlak_145": 142,
"Padulah_149": 130,
"Smoke devil_160": 185,
"Unicorn_15": 19,
"Zamorak wizard_65": 73,
"Mountain troll_71": 90,
"Elvarg_83": 80,
"Mounted terrorbird gnome_49": 36,
"Giant Roc_172": 250,
"Gorad_68": 80,
"Phrin Shade_60": 56,
"Swordchick_46": 35,
"Baby tanglefoot_45": 40,
"Snake_35": 6,
"Unicow_25": 24,
"Giant bat_27": 32,
"Baby red dragon_65": 50,
"Tortoise_79": 100,
"Ugthanki_42": 45,
"Callisto_470": 255,
"Tok-Xil_135": 40,
"Shadow Hound_63": 62,
"Aviansie_131": 70,
"Gadderanks_35": 20,
"Dagannoth fledgeling_70": 100,
"Agrith Naar_100": 100,
"Gangster_50": 40,
"Animated steel armour_53": 50,
"Poison spider_64": 64,
"Jungle spider_44": 51,
"Chaos Fanatic_202": 225,
"Enraged barbarian spirit_166": 190,
"Big Snake_84": 120,
"Tribesman_32": 40,
"Skeleton warlord_132": 124,
"Wormbrain_2": 5,
"Brutal blue dragon_271": 245,
"Animated Bronze Armour_11": 10,
"Gnome Archer_5": 10,
"Jungle spider_37": 51,
"Tortured soul_59": 51,
"Giant Mole_230": 200,
"Poison Scorpion_20": 23,
"Soldier (tier 1)_39": 50,
"Glod_138": 160,
"The Draugen_69": 60,
"Kolodion_112": 3,
"Thrower troll_68": 95,
"The Inadequacy_343": 180,
"Souless_18": 24,
"Glough_378": 575,
"Bat_6": 8,
"Pit Scorpion_28": 32,
"Witch's experiment_19": 21,
"Knight of Saradomin_103": 108,
"Basilisk_61": 75,
"Giant snail_109": 125,
"Knight of Saradomin_101": 108,
"Tz-Kek_45": 20,
"Mouse_95": 70,
"Rock Crab_13": 50,
"Cow calf_2": 6,
"Dagannoth Rex_303": 255,
"Animated Adamant Armour_113": 99,
"Grey golem_75": 80,
"Cow_2": 8,
"Karamel_136": 250,
"Ungadulu_70": 65,
"Rocnar_97": 100,
"Palmer_37": 50,
"Invrigar the Necromancer_20": 24,
"Black bear_19": 25,
"The Illusive_1": 140,
"Fareed_167": 130,
"Giant snail_139": 125,
"Tortured gorilla_142": 210,
"Sergeant Grimspike_142": 146,
"Khazard trooper_19": 22,
"Tortured gorilla_141": 210,
"Lizard_42": 40,
"TzHaar-Hur_74": 80,
"Stranger_95": 80,
"Locust rider_106": 90,
"Monkey Guard_167": 130,
"Suqah_111": 105,
"Animated Mithril Armour_92": 80,
"Albino bat_52": 33,
"Black dragon_227": 190,
"Skeleton brute_132": 124,
"Death wing_83": 80,
"Leech_52": 45,
"Spidine_42": 35,
"Zygomite_74": 65,
"Thrower Troll_67": 95,
"Tz-Kek_22": 20,
"Kree'arra_580": 255,
"Dark energy core_75": 25,
"Hobgoblin Champion_56": 58,
"Confusion beast_63": 64,
"Evil Chicken_159": 120,
"Colonel Radick_38": 65,
"Sir Lancelot_127": 115,
"Penance Queen_209": 250,
"Shipyard worker_11": 10,
"Black Heather_34": 37,
"Farmer_7": 13,
"Zombie swab_55": 50,
"Sir Pelleas_112": 99,
"Giant frog_99": 23,
"Tower guard_28": 22,
"Big Wolf_73": 10,
"Giant Rock Crab_137": 180,
"Man_4": 7,
"Sergeant Strongstack_141": 128,
"Death spawn_46": 60,
"Man_2": 7,
"Gnome Mage_5": 10,
"Otherworldly being_64": 66,
"Monkey Guard_149": 130,
"Disciple of Iban_13": 20,
"Bardur_94": 99,
"Ancient Wizard_98": 80,
"Jubster_87": 60,
"City guard_83": 80,
"Elf warrior_108": 105,
"Shadow spider_52": 55,
"Mercenary_45": 60,
"Riyl Shade_80": 76,
"Mudskipper_30": 20,
"Mudskipper_31": 20,
"Vyrewatch_110": 90,
"Ghost_95": 27,
"Wilson_37": 50,
"Jogre Champion_107": 120,
"Mutated Bloodveld_123": 170,
"Possessed Priest_91": 90,
"Skeleton fremennik_40": 40,
"Scarab mage_93": 50,
"Chompy bird_6": 10,
"Cave goblin miner_11": 10,
"Double agent_108": 80,
"Kraka_91": 120,
"Renegade knight_37": 50,
"Iron dragon_215": 165,
"Sir Palomedes_118": 100,
"Spider_24": 2,
"Vyrewatch_125": 90,
"Dwarf_9": 16,
"Blue dragon_111": 105,
"Dwarf_7": 16,
"The Kendal_70": 50,
"Vyrewatch_120": 90,
"Ghost_77": 27,
"Scarab mage_66": 50,
"Animated spade_50": 40,
"Jailer_47": 47,
"Gang boss_76": 80,
"Skeleton fremennik_50": 40,
"Bronze dragon_131": 122,
"The Illusive_108": 140,
"Spiritual mage_120": 75,
"Lesser demon_94": 79,
"Spiritual mage_121": 75,
"Spiritual mage_122": 75,
"Ork_20": 110,
"Jake_37": 50,
"Crypt spider_56": 60,
"Chaos druid_13": 20,
"Skeleton thug_132": 124,
"The Everlasting_223": 230,
"Kamil_154": 130,
"Balfrug Kreeyath_151": 161,
"Sir Jerro_62": 57,
"Ghost_76": 27,
"Renegade Knight_37": 50,
"Gang boss_83": 80,
"Wolf_64": 10,
"H.A.M. Archer_30": 35,
"Skeleton fremennik_60": 40,
"Bronze dragon_143": 122,
"Kourend head guard_84": 86,
"Sea Snake Young_90": 85,
"Lesser demon_87": 79,
"Brassican Mage_140": 150,
"Soldier (tier 5)_99": 90,
"Lesser demon_82": 79,
"Bree_146": 162,
"Highwayman_5": 13,
"Giant lobster_32": 50,
"Commander Zilyana_596": 255,
"Ice spider_61": 65,
"Gorak_149": 115,
"Monkey Archer_86": 50,
"H.A.M. Mage_30": 35,
"Ocga_5": 10,
"Pee Hat_91": 120,
"Crawling Hand_11": 16,
"Cave goblin guard_26": 26,
"Kraken_291": 255,
"Lava dragon_252": 230,
"Cave goblin guard_24": 26,
"Gorak_145": 115,
"Crawling Hand_12": 16,
"Dark beast_182": 220,
"General Khazard_112": 117,
"Yt-MejKot_180": 80,
"Ghast_139": 45,
"Khazard Guard_25": 25,
"King Sand Crab_107": 200,
"Terrorbird_28": 34,
"Sea troll_87": 80,
"Slagilith_92": 60,
"Sea troll_79": 80,
"Monkey Zombie_98": 60,
"Kurask_106": 97,
"Skeletal miner_42": 39,
"Ice Queen_111": 105,
"Demonic gorilla_275": 380,
"Gangster_45": 40,
"Sir Carl_62": 57,
"Giant mosquito_13": 15,
"Hero_69": 82,
"Vulture_31": 10,
"Rogue_15": 17,
"Dagannoth mother_100": 120,
"Kruk_149": 210,
"Soldier (tier 4)_70": 65,
"Magic axe_42": 45,
"Slash Bash_111": 100,
"Spiritual ranger_118": 120,
"Me_79": 45,
"Maniacal monkey_48": 65,
"Spiritual ranger_115": 120,
"Double agent_141": 80,
"Ferocious barbarian spirit_166": 190,
"The Untouchable_274": 90,
"Aviansie_148": 70,
"Tarn_69": 80,
"Goblin guard_42": 43,
"Khazard Guard_23": 25,
"Green dragon_79": 75,
"Kruk_142": 210,
"Chaos Elemental_305": 250,
"Cerberus_318": 600,
"Elf warrior_90": 105,
"Wingman Skree_143": 121,
"Spinolyp_76": 100,
"Locust_18": 27,
"Tyras guard_110": 110,
"Knight of Ardougne_46": 52,
"Spiritual ranger_122": 120,
"Kalphite Soldier_85": 90,
"Wolf_11": 10,
"Rat_1": 2,
"Soldier (tier 3)_58": 55,
"Spiritual ranger_127": 120,
"Deviant spectre_169": 190,
"Chronozon_170": 60,
"Tz-Kih_22": 10,
"Flockleader Geerin_149": 132,
"Fire elemental_35": 30,
"Sea troll_65": 80,
"Lizardman_62": 60,
"Minotaur_27": 10,
"Ranalph Devere_92": 130,
"Twisted Banshee_89": 100,
"Minotaur_19": 10,
"Chicken_1": 3,
"Broodoo victim_60": 100,
"Sea troll_58": 80,
"Vanstrom Klause_169": 155,
"Wolf_14": 10,
"Black unicorn_27": 29,
"Bunny_2": 5,
"Chicken_3": 3,
"Ghast_109": 45,
"Lizardman_53": 60,
"Ghost_24": 27,
"Aberrant spectre_96": 90,
"Ghost_29": 27,
"Echned Zekin_187": 150,
"Minotaur_12": 10,
"Spider_1": 2,
"Ent_86": 75,
"Gunthor the brave_29": 35,
"Head_140": 150,
"Ungadulu_169": 65,
"Nail beast_141": 55,
"Monkey Zombie_129": 60,
"Mithril dragon_304": 255,
"Wolf_25": 10,
"Damis_103": 90,
"Monkey Zombie_82": 60,
"Jonny the beard_2": 7,
"Sir Harry_62": 57,
"Abyssal Sire_350": 400,
"Troll spectator_71": 90,
"Sir Tristram_115": 105,
"Catablepon_49": 40,
"Black golem_75": 80,
"Cave bug_6": 5,
"Vampire_77": 40,
"Crypt rat_43": 35,
"Earth Warrior Champion_102": 108,
"Mosquito swarm_20": 3,
"Rock lobster_127": 150,
"Scarab swarm_98": 25,
"Ghast_79": 45,
"Forester_15": 17,
"Desert Wolf_27": 34,
"Goat_23": 21,
"Greater Skeleton Hellhound_281": 190,
"Thief_16": 17,
"Ice troll grunt_100": 80,
"Thief_14": 17,
"Asyn Shade_100": 90,
"Vampire_72": 40,
"Bouncer_160": 116,
"Black Knight_32": 42,
"Black Knight_33": 42,
"Abyssal leech_41": 10,
"Ice Troll_123": 100,
"Mosquito swarm_17": 3,
"Ice Troll_121": 100,
"Nazastarool_93": 70,
"The Shaikahan_83": 100,
"Ice Troll_120": 100,
"Chaos druid warrior_37": 40,
"Abyssal guardian_59": 55,
"Skotizo_321": 450,
"Berry_71": 90,
"Troll general_113": 140,
"Juvinate_90": 50,
"Nazastarool_91": 70,
"Wall beast_49": 105,
"King Black Dragon_276": 240,
"Mutant tarn_69": 80,
"Gnome child_1": 2,
"Wizard_9": 14,
"Snake_5": 6,
"Skeleton heavy_132": 124,
"Battle mage_54": 100,
"Lucien_14": 17,
"Wallasalki_98": 120,
"Catablepon_64": 40,
"Waterfiend_115": 128,
"Ice troll male_82": 80,
"Ice Troll_124": 100,
"Woman_2": 7,
"Monk_5": 15,
"Rabbit_1": 5,
"Woman_4": 7,
"Rabbit_2": 5,
"Woman_3": 7,
"Huge spider_81": 9,
"Paladin_62": 66,
"Giant scarab_191": 130,
"Catablepon_68": 40,
"Monk_3": 15,
"Crazy archaeologist_204": 225,
"Ghoul_42": 50,
"Ice troll runt_74": 60,
"Skeleton Hellhound_214": 55,
"Suit of armour_19": 27,
"Paladin_59": 66,
"Holthion_91": 87,
"Jelly_78": 75,
"Saradomin priest_113": 89,
"Small Lizard_12": 15,
"Double agent_65": 80,
"Icelord_51": 60,
"Ice warrior_57": 59,
"Pheasant_3": 5,
"Ice troll grunt_102": 80,
"Jungle Demon_195": 170,
"Juvinate_119": 50,
"Swamp snake_80": 120,
"Borrokar_48": 50,
"Maniacal monkey_140": 65,
"Sir Lucan_120": 105,
"Frogeel_103": 90,
"Count Draynor_34": 35,
"Jackal_21": 27,
"Radat_21": 22,
"Water wizard_13": 25,
"Vampire_61": 40,
"Temple guardian_30": 45,
"Thug_10": 18,
"Khazard Ogre_63": 60,
"Flambeed_149": 210,
"Honour guard_115": 100,
"Kebbit_13": 50,
"Animated Iron Armour_23": 20,
"Chaos dwarf_48": 61,
"Arrg_113": 140,
"Brutal black dragon_318": 315,
"Clivet_13": 25,
"Ice troll_124": 100,
"Ice troll_121": 100,
"Terror dog_100": 82,
"Ice troll_120": 100,
"Skeleton Mage_83": 17,
"Grizzly bear_21": 27,
"Skeletal Wyvern_140": 210,
"Ice troll_123": 100,
"Maniacal Monkey Archer_132": 60,
"Blue dragon_27": 105,
"Sorebones_57": 52,
"Flesh Crawler_28": 25,
"Frog_5": 8,
"Hill Giant_28": 35,
"Melzar the Mad_43": 44,
"Narf_2": 7,
"Damis_174": 90,
"Jubbly bird_9": 21,
"Head Thief_26": 37,
"Bandosian guard_125": 130,
"Giant crypt spider_79": 80,
"Ork_107": 110,
"Flight Kilisa_159": 159,
"Sand Crab_15": 60,
"Venenatis_464": 255,
"Vet'ion_454": 255,
"Jungle horror_70": 45,
"Desert Lizard_24": 25,
"Ket-Zek_360": 160,
"Culinaromancer_1": 150,
"Terror dog_110": 82,
"Giant Champion_56": 70,
"Locust rider_98": 90,
"Swamp snake_139": 120,
"Crocodile_63": 62,
"Runite Golem_178": 170,
"Angry goblin_45": 200,
"Sir Mordred_39": 50,
"Bird_11": 5,
"Zakl'n Gritch_142": 150,
"Bandit champion_70": 50,
"Angry goblin_47": 200,
"Dessourt_121": 130,
"Skeleton Hellhound_97": 55,
"Dire Wolf_88": 85,
"TzHaar-Ket_149": 140,
"Skeleton hero_149": 124,
"Khazard commander_48": 22,
"Earth elemental_35": 35,
"Locust rider_68": 90,
"Bouncer_137": 116,
"Ice wolf_132": 70,
"Sea Snake Hatchling_62": 50,
"Grizzly bear_42": 27,
"Gnome Driver_5": 10,
"Karil the Tainted_98": 100,
"Swamp snake_109": 120,
"Scarabs_92": 25,
"General Graardor_624": 255,
"Juvinate_59": 50,
"Earth warrior_51": 54,
"Angry giant rat_47": 200,
"Dagannoth Supreme_303": 255,
"Flesh Crawler_41": 25,
"Keef_178": 180,
"Angry giant rat_45": 200,
"Guardian of Armadyl_45": 49,
"Vampire_25": 40,
"Plague frog_11": 10,
"Shadow_73": 15,
"Penda_5": 10,
"Vyrewatch_105": 90,
"Verac the Defiled_115": 100,
"Fire wizard_13": 25,
"Irvig Senay_100": 125,
"Baby Roc_75": 47,
"Black knight_33": 42,
"Undead Lumberjack_30": 12,
"Guardian of Armadyl_43": 49,
"Dagannoth Prime_303": 255,
"Shadow warrior_48": 67,
"Wild dog_63": 62,
"Flesh Crawler_35": 25,
"Undead Lumberjack_35": 12,
"Corporeal Beast_785": 2000,
"King Roald_47": 60,
"Sergeant Steelwill_142": 127,
"Earth wizard_13": 25,
"Ancient Wizard_112": 80,
"Moss giant_84": 60,
"Outlaw_32": 20,
"Skeleton Champion_40": 58,
"Dust devil_93": 105,
"Guard_21": 22,
"Fire giant_86": 111,
"Fire giant_104": 130,
"Fire giant_109": 150,
"Shifter_38": 23,
"Shifter_57": 38,
"Shifter_76": 53,
"Shifter_90": 68,
"Shifter_104": 83,
"Mummy_84": 68,
"Mummy_96": 86,
"Mummy_100": 90,
"Mummy_103": 91,
"Mummy_125": 91,
"Mummy_138": 91,
"Pirate_23": 20,
"Pirate_26": 23,
"Skeleton_13": 18,
"Skeleton_21": 24,
"Skeleton_22": 29,
"Skeleton_25": 17,
"Skeleton_60": 70,
"Skeleton_68": 70,
"Skeleton_77": 50,
"Skeleton_85": 77,
"Monk of Zamorak_17": 11,
"Monk of Zamorak_22": 25,
"Monk of Zamorak_30": 26,
"Monk of Zamorak_45": 40,
"Hobgoblin_28": 29,
"Hobgoblin_42": 49,
"Mourner_11": 19,
"Mourner_18": 13,
"Mourner_24": 25,
"Mourner_108": 105,
"Ravager_36": 23,
"Ravager_53": 38,
"Ravager_71": 53,
"Ravager_89": 68,
"Ravager_106": 83,
"Goblin_2": 3,
"Goblin_5": 5,
"Goblin_11": 12,
"Goblin_12": 7,
"Goblin_13": 15,
"Goblin_16": 22,
"Goblin_25": 27,
"Cyclops_56": 75,
"Cyclops_76": 100,
"Cyclops_81": 110,
"Cyclops_106": 150,
"Greater demon_92": 87,
"Greater demon_100": 115,
"Greater demon_101": 120,
"Greater demon_113": 130,
"Brawler_51": 53,
"Brawler_76": 83,
"Brawler_89": 97,
"Brawler_101": 113,
"Brawler_129": 143,
"Scorpion_14": 17,
"Scorpion_37": 37,
"Scorpion_59": 55,
"Black Demon_172": 157,
"Black demon_178": 160,
"Black demon_184": 170,
"Crab_21": 18,
"Crab_23": 19,
"Torcher_33": 18,
"Torcher_49": 30,
"Torcher_66": 45,
"Torcher_79": 57,
"Torcher_92": 71,
"Experiment_25": 100,
"Experiment_51": 40,
"Defiler_33": 27,
"Defiler_50": 45,
"Defiler_66": 62,
"Defiler_67": 62,
"Defiler_80": 78,
"Defiler_97": 97,
"White Knight_36": 52,
"White Knight_38": 52,
"White Knight_39": 52,
"White Knight_42": 56,
"Giant rat_3": 5,
"Giant rat_6": 10,
"Giant rat_26": 25,
"Barbarian_9": 18,
"Barbarian_10": 18,
"Barbarian_15": 25,
"Barbarian_17": 25,
"Afflicted_30": 24,
"Afflicted_32": 26,
"Afflicted_34": 28,
"Afflicted_37": 30,
"Dark wizard_7": 12,
"Dark wizard_11": 12,
"Dark wizard_20": 24,
"Dark wizard_22": 24,
"Dark wizard_23": 24,
"Splatter_22": 13,
"Splatter_33": 23,
"Splatter_44": 33,
"Splatter_54": 43,
"Splatter_65": 53,
"Cave crawler_23": 22,
"Spinner_36": 33,
"Spinner_55": 53,
"Spinner_74": 73,
"Spinner_88": 93,
"Spinner_92": 101,
"Giant spider_2": 5,
"Giant spider_27": 33,
"Giant spider_50": 50,
"Dark warrior_8": 17,
"Dark warrior_145": 165,
"H.A.M. Guard_12": 15,
"H.A.M. Guard_18": 20,
"H.A.M. Guard_22": 30,
"Dwarf gang member_44": 40,
"Dwarf gang member_48": 25,
"Dwarf gang member_49": 25,
"Seagull_2": 6,
"Seagull_3": 10,
"Chinchompa": 2,
"Gardener_3": 7,
"Gardener_4": 8
}

View File

@@ -49,4 +49,7 @@ public interface Actor extends Renderable
@Import("animation")
int getAnimation();
@Import("combatInfoList")
CombatInfoList getCombatInfoList();
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.rs.api;
import net.runelite.mapping.Import;
public interface CombatInfo1
{
@Import("healthRatio")
int getHealthRatio();
@Import("health")
int getHealth();
}

View File

@@ -0,0 +1,34 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.rs.api;
import net.runelite.mapping.Import;
public interface CombatInfo2
{
@Import("healthScale")
int getHealthScale();
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.rs.api;
import net.runelite.mapping.Import;
/**
* Created by bold on 2/2/17.
*/
public interface CombatInfoList
{
@Import("node")
Node getNode();
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.rs.api;
import net.runelite.mapping.Import;
public interface CombatInfoListHolder extends Node
{
@Import("combatInfo1")
CombatInfoList getCombatInfo1();
@Import("combatInfo2")
CombatInfo2 getCombatInfo2();
}