Thread: ok im using [hyperion] just added a code for npc but didn't work?

Results 1 to 7 of 7
  1. #1 ok im using [hyperion] just added a code for npc but didn't work? 
    Registered Member ryansheps's Avatar
    Join Date
    Feb 2013
    Posts
    129
    Thanks given
    8
    Thanks received
    3
    Rep Power
    13
    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
    advertisement removed
    [/URL]
    Reply With Quote  
     

  2. #2  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114


    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.
    Reply With Quote  
     

  3. #3  
    Registered Member oren234's Avatar
    Join Date
    May 2014
    Posts
    28
    Thanks given
    1
    Thanks received
    2
    Rep Power
    0
    Quote Originally Posted by Arithium View Post


    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'm sorry but not everyone is a rsps coding genius like you Einstein
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Registered Member ryansheps's Avatar
    Join Date
    Feb 2013
    Posts
    129
    Thanks given
    8
    Thanks received
    3
    Rep Power
    13
    i did say im new to hyperion? lol and it doesn't even work i need a tutorial on attacking npcs
    advertisement removed
    [/URL]
    Reply With Quote  
     

  6. #5  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Quote Originally Posted by ryansheps View Post
    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.
    Reply With Quote  
     

  7. Thankful user:


  8. #6  
    Registered Member ryansheps's Avatar
    Join Date
    Feb 2013
    Posts
    129
    Thanks given
    8
    Thanks received
    3
    Rep Power
    13
    Thank you so your saying i can just rip it off the fury v5? thanks Arithium!
    advertisement removed
    [/URL]
    Reply With Quote  
     

  9. #7  
    Registered Member ryansheps's Avatar
    Join Date
    Feb 2013
    Posts
    129
    Thanks given
    8
    Thanks received
    3
    Rep Power
    13
    Btw where is the actionsender() in the hyperion fury??
    advertisement removed
    [/URL]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Need Code For Npc Vs Npc
    By fxscape in forum Help
    Replies: 4
    Last Post: 04-13-2010, 02:55 PM
  2. Replies: 5
    Last Post: 02-02-2010, 03:23 PM
  3. Replies: 2
    Last Post: 07-25-2009, 04:31 PM
  4. Im quiting coding for 2 week
    By Fubergen in forum Chat
    Replies: 2
    Last Post: 06-20-2008, 01:39 PM
  5. Replies: 4
    Last Post: 03-21-2008, 07:46 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •