October 24, 20169 yr Is there any way to retrieve hit splats (damage digits shown at your head)? I remember there were Player.getHitSplats() but it was removed long time ago. Thanks, darkxor.
October 24, 20169 yr Is there any way to retrieve hit splats (damage digits shown at your head)? I remember there were Player.getHitSplats() but it was removed long time ago. Thanks, darkxor. I'm not sure if there are hitsplats in the API anymore, but to work out the damage to your player you could just do: private int previousHealth; @ Override public final void onStart() { previousHealth = getHealth(); } @ Override public final int onLoop() throws InterruptedException { final int currentHealth = getHealth(); if (currentHealth < previousHealth) { final int damage = previousHealth - currentHealth; // Calculate the damage previousHealth = currentHealth; } return random(100, 150); } private int getHealth() { return getSkills().getDynamic(Skill.HITPOINTS); } Or if you just want to know the % of hp remaining, for example to know when to eat, you can do: public final int getHealthPercent() { return (getSkills().getDynamic(Skill.HITPOINTS) * 100) / getSkills().getStatic(Skill.HITPOINTS); } Edited October 24, 20169 yr by Explv
October 24, 20169 yr Author Its not same thing as hit splats. I want be able get not amounts of damage taken by myself but amount of damage dealt to other players/npcs. getHealth() returns percent for other entities, and also it cant retrieve hits (if two hits received in one tick - it will sum them)
October 24, 20169 yr Its not same thing as hit splats. I want be able get not amounts of damage taken by myself but amount of damage dealt to other players/npcs. getHealth() returns percent for other entities, and also it cant retrieve hits (if two hits received in one tick - it will sum them) You could try: NPC npc = npcs.closest("Cow"); // Can be a Player instead int[] splatDamage = npc.accessor.getSplatDamage(); int[] splatTimes = npc.accessor.getSplatTime(); Edited October 24, 20169 yr by Explv
October 24, 20169 yr Cant u split the gained exp into hits? 5xp would be hitsplat 1. Would work with melee and ranged.
October 24, 20169 yr Cant u split the gained exp into hits? 5xp would be hitsplat 1. Would work with melee and ranged. This is a possible alternative, although it isn't 5xp per 1 damage, and it depends on attack type and method: http://2007.runescape.wikia.com/wiki/Combat_Options
October 24, 20169 yr Author You could try: NPC npc = npcs.closest("Cow"); // Can be a Player instead int[] splatDamage = npc.accessor.getSplatDamage(); int[] splatTimes = npc.accessor.getSplatTime(); Ok thanks. Seems hooks are mismatched and time is in getSplatSecondaryType(). But still can use.
October 27, 20169 yr Ok thanks. Seems hooks are mismatched and time is in getSplatSecondaryType(). But still can use. There was an issue with the HitSplatListener (I think that was the name). We used to use it in legacy code a while back, then found a more efficient way. After some time the listener broke, nobody used it, and I believe I either deprecated it or deleted it.
November 1, 20169 yr Author There was an issue with the HitSplatListener (I think that was the name). We used to use it in legacy code a while back, then found a more efficient way. After some time the listener broke, nobody used it, and I believe I either deprecated it or deleted it. If you're interested - hit splat times now in XPlayer.getSplatSecondaryType(). I successfully implemented hit splats tracking using it + XPlayer.getSplatDamage(). Was using HitSplat functionality before (not HitSplatListener tho) but needed to comment when you removed support. Now using again.
Create an account or sign in to comment