Thread: Npc attacks (custom)

Results 1 to 4 of 4
  1. #1 Npc attacks (custom) 
    Registered Member
    Rock_Gyo's Avatar
    Join Date
    Oct 2009
    Posts
    505
    Thanks given
    27
    Thanks received
    35
    Rep Power
    104
    I recently tried adding custom attacks to a certain NPC, these attacks are range and magic based but I have a slight problem with them.

    The range attack works fine, yet the magic attack (ice barrage) starts at the middle of the character not at the bottom.

    Code:
    case 189:
    				Client c = (Client) Server.playerHandler.players[npcs[i].oldIndex];
    				random = Misc.random(2);
    			if (random == 0) {
    					npcs[i].attackType = 1; //magic
    					npcs[i].endGfx = 369;	
    					//npcs[i].projectileId = 369;
    					c.freezeTimer = 30;
    	                                c.frozenBy = c.playerId;
    	                                c.stopMovement();
    	                                c.getCombat().resetPlayerAttack();
    	                                c.sendMessage("You have been frozen.");
                                            npcs[i].forcedText = "You can't escape now!";
    		                        npcs[i].forcedChatRequired = true;
    		                        npcs[i].updateRequired = true;
    			} else if (random == 1);
    					npcs[i].attackType = 2; //RANGE
    					npcs[i].endGfx = 24;
    					//npcs[i].projectileId = 24;
    			break;
    I also have another problem with the npc crashing the server, this mainly happens when walking away from the npc while it is shooting/using magic at me.
    Reply With Quote  
     

  2. #2  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Do you have any other npcs that use magic based attacks?

    I'm thinking it has to do with endGfx? Look for the gfx method and look for other ones. I haven't coded rsps in a while but if I remember right there was one called lowGfx or something? Use that instead or post your endGfx method and i'll make a new one for you that has the ground as the height.

    Okay and about the npc crashing the server I can't help you without more information. Do some debugging to find the root of the problem or tell me the specifics.

    (:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Rock_Gyo's Avatar
    Join Date
    Oct 2009
    Posts
    505
    Thanks given
    27
    Thanks received
    35
    Rep Power
    104
    case 2892:
    npcs[i].projectileId = 94;
    npcs[i].attackType = 2;
    npcs[i].endGfx = 95;
    break;

    that's the magic attacking for water strike (npc shooting it at you)
    Reply With Quote  
     

  4. #4  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Well that's not a good example cause water strike is meant to be centered. Show me your endGfx method.
    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. Replies: 2
    Last Post: 11-14-2011, 11:55 AM
  2. Custome npc attack emote?
    By Slay No More in forum Help
    Replies: 4
    Last Post: 12-13-2009, 04:01 PM
  3. Replies: 0
    Last Post: 09-13-2009, 08:44 AM
  4. Help with Making Custom Npc attack?
    By brighterstr in forum Help
    Replies: 2
    Last Post: 01-06-2009, 12:41 AM
  5. Editing NPC Attack Emotes
    By Shawn101 in forum Tutorials
    Replies: 5
    Last Post: 08-13-2007, 10:07 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •