darkxor Posted October 24, 2016 Share Posted October 24, 2016 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. Quote Link to comment Share on other sites More sharing options...
Explv Posted October 24, 2016 Share Posted October 24, 2016 (edited) 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, 2016 by Explv 1 Quote Link to comment Share on other sites More sharing options...
darkxor Posted October 24, 2016 Author Share Posted October 24, 2016 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) Quote Link to comment Share on other sites More sharing options...
Explv Posted October 24, 2016 Share Posted October 24, 2016 (edited) 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, 2016 by Explv 1 Quote Link to comment Share on other sites More sharing options...
Bucket1337 Posted October 24, 2016 Share Posted October 24, 2016 Cant u split the gained exp into hits? 5xp would be hitsplat 1. Would work with melee and ranged. Quote Link to comment Share on other sites More sharing options...
Explv Posted October 24, 2016 Share Posted October 24, 2016 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 Quote Link to comment Share on other sites More sharing options...
darkxor Posted October 24, 2016 Author Share Posted October 24, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
Alek Posted October 27, 2016 Share Posted October 27, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
darkxor Posted November 1, 2016 Author Share Posted November 1, 2016 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. Quote Link to comment Share on other sites More sharing options...