Thread: Magic doesn't work?

Results 1 to 6 of 6
  1. #1 Magic doesn't work? 
    Extreme Donator

    Join Date
    Jul 2011
    Posts
    546
    Thanks given
    31
    Thanks received
    18
    Rep Power
    39
    Whenever I try to do any magic spell on my server it does no damage... And if you switch to a sword the sword then does no damage untill you relog?

    I get this error message when I perform a magic attack:



    I NEED HELP WITH THIS ASAP Will REP++

    Btw this is what my combatassistant looks like around line 598:

    Code:
    				if (c.killingNpcIndex != c.oldNpcIndex) {
    					c.totalDamageDealt = 0;				
    				}
    				c.killingNpcIndex = c.oldNpcIndex;
    				c.totalDamageDealt += damage;
    				Server.npcHandler.npcs[i].hitUpdateRequired = true;
    				if (damage2 > -1)
    					Server.npcHandler.npcs[i].hitUpdateRequired2 = true;
    				Server.npcHandler.npcs[i].updateRequired = true;
    
    			} else if (c.projectileStage > 0) { // magic hit damage
    				int damage = Misc.random(finalMagicDamage(c));
    				Client o = (Client) Server.playerHandler.players[i];
    	
    				if(godSpells()) {
    					if(System.currentTimeMillis() - c.godSpellDelay < Config.GOD_SPELL_CHARGE) {
    						damage += Misc.random(10);
    					}
    				}
    				boolean magicFailed = false;
    				Server.npcHandler.npcs[i].CIcon = 2;
    				//c.npcIndex = 0;
    				int bonusAttack = getBonusAttack(i);
    				if (Misc.random(Server.npcHandler.npcs[i].defence) > 10+ Misc.random(mageAtk()) + bonusAttack) {
    					damage = 0;
    					magicFailed = true;
    				} else if (Server.npcHandler.npcs[i].npcType == 2881 || Server.npcHandler.npcs[i].npcType == 2882) {
    					damage = 0;
    					magicFailed = true;
    				}
    				
    				if (Server.npcHandler.npcs[i].HP - damage < 0) { 
    					damage = Server.npcHandler.npcs[i].HP;
    				}
    				
    				c.getPA().addSkillXP((c.MAGIC_SPELLS[c.oldSpellId][7] + damage*Config.MAGIC_EXP_RATE), 6); 
    				c.getPA().addSkillXP((c.MAGIC_SPELLS[c.oldSpellId][7] + damage*Config.MAGIC_EXP_RATE/3), 3);
    				c.getPA().refreshSkill(3);
    				c.getPA().refreshSkill(6);
    				if (damage > 0) {
    					if (Server.npcHandler.npcs[i].npcType >= 6142 && Server.npcHandler.npcs[i].npcType <= 6145) {
    						c.pcDamage += damage;					
    					}				
    				}
    				if(getEndGfxHeight() == 100 && !magicFailed){ // end GFX
    					Server.npcHandler.npcs[i].gfx100(c.MAGIC_SPELLS[c.oldSpellId][5]);
    				} else if (!magicFailed){
    					Server.npcHandler.npcs[i].gfx0(c.MAGIC_SPELLS[c.oldSpellId][5]);
    				}
    				
    				if(magicFailed) {	
    					Server.npcHandler.npcs[i].gfx100(85);
    				}			
    				if(!magicFailed) {
    					int freezeDelay = getFreezeTime();//freeze 
    					if(freezeDelay > 0 && Server.npcHandler.npcs[i].freezeTimer == 0) {
    						Server.npcHandler.npcs[i].freezeTimer = freezeDelay;
    						Server.npcHandler.npcs[i].barrageorb = 1;
    					}
    Reply With Quote  
     

  2. #2  
    Middle Finger is Here


    Join Date
    Feb 2012
    Age
    31
    Posts
    2,546
    Thanks given
    377
    Thanks received
    502
    Rep Power
    162
    Wierd, does that happen when you use magic on npcs or players or only for other?
    Hi
    Reply With Quote  
     

  3. #3  
    Extreme Donator

    Join Date
    Jul 2011
    Posts
    546
    Thanks given
    31
    Thanks received
    18
    Rep Power
    39
    Quote Originally Posted by Braveyy View Post
    Wierd, does that happen when you use magic on npcs or players or only for other?
    Nps's Im going to test on players right now
    Reply With Quote  
     

  4. #4  
    Extreme Donator

    Join Date
    Jul 2011
    Posts
    546
    Thanks given
    31
    Thanks received
    18
    Rep Power
    39
    Only npc's
    Reply With Quote  
     

  5. #5  
    Middle Finger is Here


    Join Date
    Feb 2012
    Age
    31
    Posts
    2,546
    Thanks given
    377
    Thanks received
    502
    Rep Power
    162
    Quote Originally Posted by rar349 View Post
    Only npc's
    so look how its done for players and then make the npc look like same just rename it.
    Hi
    Reply With Quote  
     

  6. #6  
    Extreme Donator

    Join Date
    Jul 2011
    Posts
    546
    Thanks given
    31
    Thanks received
    18
    Rep Power
    39
    Quote Originally Posted by Braveyy View Post
    so look how its done for players and then make the npc look like same just rename it.
    All fixed up. Lol I guess i could of figured that out myself. Btw if you didnt notice I used to play complexity. Lol
    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: 0
    Last Post: 06-30-2009, 01:40 PM
  2. Magic timer?? Not working..
    By ike izzle in forum Help
    Replies: 2
    Last Post: 06-26-2009, 09:58 PM
  3. Protect Item doesn't work?
    By Aza in forum Help
    Replies: 4
    Last Post: 04-25-2009, 01:39 AM
  4. My tele command doesn't work why?
    By Rasmux in forum Help
    Replies: 4
    Last Post: 03-28-2009, 02:24 AM
  5. Replies: 5
    Last Post: 03-11-2009, 06:42 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
  •