Thread: [PI] NPC "Fake" Attacking

Results 1 to 7 of 7
  1. #1 [PI] NPC "Fake" Attacking 
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Okay.. so I added bandos boss NPC to the server, the problem is, the boss has 2 attack styles: Melee and Range

    When the Boss uses the range attack it works as it should, but when it attacks with melee no hit-splat is show in or HP bar above my character and it doesn't count me as im in combat, just the boss does his attack animation but with no result

    Sever base is: Rune Fusion
    My boss ID is: 6260
    Here is what I have in NPCHandler:

    multi attack part:
    Code:
    	public boolean multiAttacks(int i) {
    		switch (npcs[i].npcType) {
    			case 6260: 
    			if (npcs[i].attackType == 1)
    				return true;
    
    			case 6247://saradomin
    			if (npcs[i].attackType == 2)
    				return true;
    
    			case 1160://KQ
    			if (npcs[i].attackType == 1)
    				return true;
    				
    			case 6222://armadyl
    				return true;	
    				
    			default:
    			return false;
    		}
    	
    	
    	}
    Attack action:

    Code:
    			
    			case 6260://bandos
    				random = Misc.random(3);
    				if (random == 0 || random == 1 || random == 2)
    					npcs[i].attackType = 0;
    				else {
    					npcs[i].attackType = 1;
    					npcs[i].projectileId = 1200;
    				}
    			break;
    
    			case 1160: //KQ
    				random = Misc.random(2);
    				if (random == 0 || random == 1) {
    					npcs[i].attackType = 0;
    					npcs[i].projectileId = -1; }
    				else {
    					npcs[i].attackType = 1;
    					npcs[i].projectileId = 288;
    				}
    max hit place:

    Code:
    			case 1160: 
    				if (npcs[i].attackType == 1) 
    					return 33; 
    				else 
    					return 30; 
    			case 6260: 
    				if (npcs[i].attackType == 1) 
    					return 35;
    				else 
    					return 64;
    Bandos, Saradomin, KQ bosses all have same problem, Melee doesn't work while mage and range works only
    I also added their death, attack animations etc.. but I'm not showing it because I dont think it can make the problem
    Reply With Quote  
     

  2. #2  
    Registered Member
    Nuevo's Avatar
    Join Date
    Jul 2008
    Posts
    647
    Thanks given
    7
    Thanks received
    13
    Rep Power
    169
    rewrite that part of combat OR pull out the bandos npc before you hit that point where you must choose what style and make the entire combat old style in a handler.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    The problem started when i added KQ boss in the server, Bandos and Saradomin boss have problem with their melee attack
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jan 2010
    Posts
    3,664
    Thanks given
    533
    Thanks received
    918
    Rep Power
    0
    Quote Originally Posted by Nuevo View Post
    rewrite that part of combat OR pull out the bandos npc before you hit that point where you must choose what style and make the entire combat old style in a handler.
    ^ He can't rewrite anything. He doesn't know how.


    @OT: Why so many if statements? why not return the attack style rather than return true if the attack style is such?
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    It returns true if the attack style i want it to be a multi attack
    Reply With Quote  
     

  6. #6  
    Extreme Donator


    Join Date
    Nov 2009
    Posts
    1,421
    Thanks given
    559
    Thanks received
    266
    Rep Power
    236
    I had this problem when I added zammy boss. The melee attack never registered but the magic attack did. However when i changed the style == 0 (melee) to == 1(range). They both registered.. Idk it's weird lol. Melee wont work for me but range and mage does.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Yes very weird.. I replaced the whole NPCHandler.java with the one that came with the source before i edit anything and it worked, but when i replaced everything about bandos boss only it didnt work
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •