Thread: Special Attack

Results 1 to 7 of 7
  1. #1 Special Attack 
    Donator


    Join Date
    Nov 2008
    Posts
    1,031
    Thanks given
    20
    Thanks received
    33
    Rep Power
    246
    Each time i am trying to do my special attack on a npc i got that my it dc me and i can't even log again until i restart the server...

    i am using emulous 1.7

    Reply With Quote  
     

  2. #2  
    Registered Member
    zezarak's Avatar
    Join Date
    May 2008
    Posts
    1,676
    Thanks given
    40
    Thanks received
    63
    Rep Power
    540
    See where it says combatAssistant.java:250 and the others, look at those lines that is what cause the dc/ errors.
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Nov 2008
    Posts
    1,031
    Thanks given
    20
    Thanks received
    33
    Rep Power
    246
    ok my combatassistant.java line 1600

    Code:
    	public void activateSpecial(int weapon, int i){
    		if(Server.npcHandler.npcs[i] == null && c.npcIndex > 0) {
    			return;
    		}
    line 1600--->		if(Server.playerHandler.players[i] == null && c.playerIndex > 0) {
    			return;
    		}
    		c.doubleHit = false;
    		c.specEffect = 0;
    		c.projectileStage = 0;
    		c.specMaxHitIncrease = 2;
    		if(c.npcIndex > 0) {
    			c.oldNpcIndex = i;
    		} else if (c.playerIndex > 0){
    			c.oldPlayerIndex = i;
    		}
    		switch(weapon) {
    			
    			case 1305: // dragon long
    			c.gfx100(248);
    			c.startAnimation(1058);
    c.hitDelay = getHitDelay();
    			break;
    			
    			case 1215: // dragon daggers
    			case 1231:
    			case 5680:
    			case 5698:
    			c.gfx100(252);
    			c.startAnimation(1062);
    c.hitDelay = getHitDelay();
    			c.doubleHit = true;
    			break;
    			
    			case 4151: // whip
    			if(Server.npcHandler.npcs[i] != null) {
    				Server.npcHandler.npcs[i].gfx100(341);
    			}
    			if(Server.playerHandler.players[i] != null) {
    				Server.playerHandler.players[i].gfx100(341);
    			}
    			c.startAnimation(1658);
    c.hitDelay = getHitDelay();
    			break;
    			
    			case 3204: // d hally
    			c.gfx100(282);
    			c.startAnimation(1203);
    			c.hitDelay =  c.getCombat().getHitDelay();
    			if(Server.npcHandler.npcs[i] != null && c.npcIndex > 0) {
    				if(!c.goodDistance(c.getX(), c.getY(), Server.npcHandler.npcs[i].getX(), Server.npcHandler.npcs[i].getY(), 1)){
    					c.doubleHit = true;
    				}
    			}
    			if(Server.playerHandler.players[i] != null && c.playerIndex > 0) {
    				if(!c.goodDistance(c.getX(), c.getY(), Server.playerHandler.players[i].getX(),Server.playerHandler.players[i].getY(), 1)){
    					c.doubleHit = true;
    				}
    			}
    			break;
    			
    			case 4153: // maul
    			c.startAnimation(1667);
    			c.hitDelay =  c.getCombat().getHitDelay();
    			attackNpc(i);
    			c.gfx100(337);
    			break;
    			
    			case 4587: // dscimmy
    			c.gfx100(347);
    			c.specEffect = 1;
    			c.startAnimation(1872);
    			c.hitDelay = c.getCombat().getHitDelay();
    			break;
    			
    			case 1434: // mace
    			c.startAnimation(1060);
    			c.gfx100(251);
    			c.specMaxHitIncrease = 3;
     			c.hitDelay =  c.getCombat().getHitDelay();
    			break;
    			
    			case 859: // magic long
    			c.usingBow = true;
    			c.bowSpecShot = 3;
    			c.rangeItemUsed = c.playerEquipment[c.playerArrows];
    			c.getItems().deleteArrow();	
    			c.lastWeaponUsed = weapon;
    			c.startAnimation(426);
    			c.gfx100(250);	
    			c.hitDelay =  c.getCombat().getHitDelay();
    			c.projectileStage = 1;
    			break;
    			
    			case 861: // magic short	
    			c.usingBow = true;			
    			c.bowSpecShot = 1;
    			c.rangeItemUsed = c.playerEquipment[c.playerArrows];
    			c.getItems().deleteArrow();	
    			c.lastWeaponUsed = weapon;
    			c.startAnimation(1074);
    			c.hitDelay = 3;
    			c.projectileStage = 1;
    			break;
    		}
    		c.usingSpecial = false;
    		c.getItems().updateSpecialBar();
    	}
    line 250:

    Code:
    				c.faceUpdate(i);
    				if(c.usingSpecial) {
    					if(checkSpecAmount(c.playerEquipment[c.playerWeapon])){
    line 250 -->			activateSpecial(c.playerEquipment[c.playerWeapon], i);
    						return;
    					} else {
    						c.sendMessage("You don't have the required special energy to use this attack.");
    						c.usingSpecial = false;
    						c.getItems().updateSpecialBar();
    						c.npcIndex = 0;
    						return;
    					}
    				}
    Reply With Quote  
     

  4. #4  
    Registered Member
    killamess's Avatar
    Join Date
    Dec 2007
    Age
    33
    Posts
    1,508
    Thanks given
    51
    Thanks received
    284
    Rep Power
    1956
    i would suggest making two different activateSpecial methods so one can be used for players and the other to be used for npcs otherwise you may get problems later on.


    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Apr 2009
    Posts
    988
    Thanks given
    12
    Thanks received
    22
    Rep Power
    0
    i would say dont put that special attack in
    Reply With Quote  
     

  6. #6  
    Registered Member
    Core's Avatar
    Join Date
    Sep 2007
    Posts
    4,194
    Thanks given
    11
    Thanks received
    393
    Rep Power
    1985
    Code:
    if(Server.playerHandler.players[i] == null && c.playerIndex > 0) {
    			return;
    		}
    Change that tooo

    Code:
    if(Server.playerHandler.players[i] == null ) {
    			return;
    		}
    that
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Nov 2008
    Posts
    1,031
    Thanks given
    20
    Thanks received
    33
    Rep Power
    246
    keep saying the same stupid thing ...

    i have this error when i have added my chivalry and piety :

    my tuts : http://www.rune-server.org/showthread.php?t=137314

    how can i fix it plz :\
    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
  •