Thread: [PI] Delaying Hit

Results 1 to 3 of 3
  1. #1 [PI] Delaying Hit 
    Banned

    Join Date
    Dec 2011
    Posts
    967
    Thanks given
    234
    Thanks received
    208
    Rep Power
    0
    I'm trying to make my steel titan do a special attack on other NPCs, so it hits four times, for a single damage, but since all the hits try to show up at once, only two of them are seen, I want to delay the last two hits, just like dragon claws, so they appear afterwards.

    Here is my code right now, I've tried using loops ect... neither works, I've tried copying the dragon claws, but I want it to attack my NPC opponent with the range symbol, not melee

    Code:
    					if(c.npcIndex > 0) {
    							c.summonSpec -= 20;
    							c.getItems().deleteItem2(12825, 1);
    							Server.npcHandler.npcs[c.npcIndex].hitDiff2 = (damage * 2);
    							Server.npcHandler.npcs[c.npcIndex].HP -= (damage * 2);
    							c.startAnimation(7660);
    							NPC x = Server.npcHandler.npcs[c.npcIndex];
    							c.gfx0(1316);
    							//c.waitGfx(1311);
    					 		if(x != null) {
    								if ((damage * 2) > x.HP)
    								damage = (int)(x.HP/2);
    									x.gfx0(1449);
    										x.handleHitMask(damage, 0, 1);
    										x.handleHitMask((int)(damage/2), 0, 1);
    										x.handleHitMask((int)(damage/4), 0, 1);
    										x.handleHitMask((int)(damage/4), 0, 1);										
    										}
    					}
    Stuff like

    Code:
    					if(c.npcIndex > 0) {
    							c.summonSpec -= 20;
    							c.getItems().deleteItem2(12825, 1);
    							Server.npcHandler.npcs[c.npcIndex].hitDiff2 = (damage * 2);
    							Server.npcHandler.npcs[c.npcIndex].HP -= (damage * 2);
    							c.startAnimation(7660);
    							NPC x = Server.npcHandler.npcs[c.npcIndex];
    							c.gfx0(1316);
    							//c.waitGfx(1311);
    					 		if(x != null) {
    								if ((damage * 2) > x.HP)
    								damage = (int)(x.HP/2);
    									x.gfx0(1449);
                                                                            do{
                                                                                    if (c.hitDelay3 == 2) {
    										x.handleHitMask(damage, 0, 1);
    										x.handleHitMask((int)(damage/2), 0, 1);
                                                                                    }
                                                                                    if (c.hitDelay3 == 1)
    										x.handleHitMask((int)(damage/4), 0, 1);
                                                                                    if (c.hitDelay3 == 0)
    										x.handleHitMask((int)(damage/4), 0, 1);	
                                                                                    c.hitDelay3--;
                                                                                    }while(c.hitDelay3 > 0)							
    										}
    					}
    doesn't work.
    Reply With Quote  
     

  2. #2  
    Dotnet / Unity Dev

    Join Date
    May 2013
    Posts
    299
    Thanks given
    31
    Thanks received
    27
    Rep Power
    37
    u can use a timeout function, no idea if this will work, may need an import and make sure to use eclipse

    Code:
    if(c.npcIndex > 0) {
    							c.summonSpec -= 20;
    							c.getItems().deleteItem2(12825, 1);
    							Server.npcHandler.npcs[c.npcIndex].hitDiff2 = (damage * 2);
    							Server.npcHandler.npcs[c.npcIndex].HP -= (damage * 2);
    							c.startAnimation(7660);
    							NPC x = Server.npcHandler.npcs[c.npcIndex];
    							c.gfx0(1316);
    							//c.waitGfx(1311);
    					 		if(x != null) {
    								if ((damage * 2) > x.HP)
    								damage = (int)(x.HP/2);
    									x.gfx0(1449);
    										x.handleHitMask(damage, 0, 1);
    										x.handleHitMask((int)(damage/2), 0, 1);
    										x.handleHitMask((int)(damage/4), 0, 1);
    										setTimeout(function(){
    										x.handleHitMask((int)(damage/4), 0, 1);										
    										}
    									} 100,);
    					}
    Reply With Quote  
     

  3. #3  
    Super Donator


    Join Date
    Mar 2009
    Age
    28
    Posts
    1,388
    Thanks given
    316
    Thanks received
    408
    Rep Power
    608
    get a task manager
    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. [PI] NPC Hit Delays [REP]
    By Zilis in forum Help
    Replies: 3
    Last Post: 12-13-2012, 05:16 PM
  2. [Pi] X10 hits
    By MetalGear in forum Help
    Replies: 19
    Last Post: 08-31-2010, 05:53 PM
  3. [pi]prayer hit
    By Romania Clan in forum Help
    Replies: 9
    Last Post: 08-20-2010, 07:14 PM
  4. Replies: 13
    Last Post: 05-28-2010, 02:02 PM
  5. Replies: 20
    Last Post: 05-02-2009, 07:28 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
  •