I'm sorry but this looks awful. It looks like your going with a design pattern that completely ruins the point of being entity based.
|
hello i am new to hyperion so sorry about this but why does this not work i added it from scratch i fixed my combat in wildy aswell and im just fixing attacking npcs as it wont attack the npcs
here is my code:
Code:/** * Carries out a single attack. * @param source The entity source of the attack. * @param victim The entity victim of the attack. * @param attackType The type of attack. */ public static void doAttackNpc(final Entity sourceNpc, final Entity VictimNpc, final AttackType attackType) { if(!canAttackNpc(sourceNpc, VictimNpc)) return; sourceNpc.setInteractingEntity(VictimNpc); if(sourceNpc instanceof NPC) { final NPC attacker = (NPC) sourceNpc; if(VictimNpc instanceof NPC) { final NPC defender = (NPC) VictimNpc; if(defender.getCurrentAnimation() == null) { VictimNpc.playAnimation(defender.getDefinition()); } else { if(defender.getCurrentAnimation().getId() != defender.getAttackAnimation().getId()) { VictimNpc.playAnimation(defender.getDefinition()); } } } } }
please let me know and can anyone get me a tutorial for adding npc combat? please haha
I'm sorry but this looks awful. It looks like your going with a design pattern that completely ruins the point of being entity based.
i did say im new to hyperion? lol and it doesn't even work i need a tutorial on attacking npcs
You need to set up a hit delay (the delay before the damage is dealt), and an attack delay ( the delay before the next attack ). You need to flag the HIT and HIT_2 update flags upon applying the damage. You need to remove the npcs HP and the players hitpoints upon applying the damge. Theres a LOT more to combat htne you think. I released a decent base you can use which has a near full combat system in hyperion. You can find it in the downloads section title "Fury v5" which is based on my Fury v1.3.
Thank you so your saying i can just rip it off the fury v5? thanks Arithium!
Btw where is the actionsender() in the hyperion fury??
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |