hang on ill ask my mate
|
I tried to make Vengeance+recoil+deflect smoother but something went wrong...
only npcs that are using melee can hit me now
can anyone spot the problem?
Code:if(plr.recoil1 > 0.0 || plr.recoil2 > 0.0 || plr.recoil3 > 0.0){ plr.hitDiff = (int)(hitDiff * (plr.recoil1+plr.recoil2+plr.recoil3)); // Simple math, 100 divided by 1.30, and you get 76. npcs[NPCID].HP -= (int)(hitDiff * (plr.recoil1+plr.recoil2+plr.recoil3)); plr.refreshSkills(); npcs[NPCID].hitDiff = plr.hitDiff; npcs[NPCID].updateRequired = true; npcs[NPCID].hitUpdateRequired = true; npcs[NPCID].hit = true; if(plr.vengTimer == 1 && plr.inCombat){ plr.plrText = "Taste vengeance!"; // This says it in itself. plr.plrTextUpdateRequired = true; // Make sure the txt4 will update. } if(System.currentTimeMillis() - plr.vengDelay == 20000){ plr.plrText = "Taste vengeance!"; // This says it in itself. plr.plrTextUpdateRequired = true; // Make sure the txt4 will update. } //npcs[NPCID].Killing[server.playerHandler.players[Player].playerId] += hitDiff; //npcs[NPCID].appearanceUpdateRequired = true; // So the hit will append to you. if(npcs[NPCID].HP < 1){ npcs[NPCID].IsDead = true; } } if(plr.DeflectMelee == true && npcs[NPCID].melee == 1 || plr.DeflectMelee == true && npcs[NPCID].melee == 2 || plr.DeflectMelee == true && npcs[NPCID].melee == 3 || plr.DeflectRange == true && npcs[NPCID].melee == 5 || plr.DeflectMage == true && npcs[NPCID].melee == 4){ plr.recoil2 = 0.5; } else if(plr.DeflectMelee == false && npcs[NPCID].melee == 1 || plr.DeflectMelee == false && npcs[NPCID].melee == 2 || plr.DeflectMelee == false && npcs[NPCID].melee == 3 || plr.DeflectRange == false && npcs[NPCID].melee == 5 || plr.DeflectMage == false && npcs[NPCID].melee == 4){ plr.recoil2 = 0.0; } if(plr.vengTimer == 1 && plr.inCombat){ plr.recoil3 = 0.75; plr.vengon = false; plr.vengTimer = 0; plr.plrText = "Taste vengeance!"; // This says it in itself. plr.plrTextUpdateRequired = true; // Make sure the txt4 will update. plr.toX = plr.absX; plr.toY = plr.absY; plr.recoil3 = 0.0; } if(System.currentTimeMillis() - plr.vengDelay == 20000){ plr.recoil3 = 0.75; plr.vengon = false; plr.vengTimer = 0; plr.plrText = "Taste vengeance!"; // This says it in itself. plr.plrTextUpdateRequired = true; // Make sure the txt4 will update. plr.toX = plr.absX; plr.toY = plr.absY; plr.recoil3 = 0.0; } if(plr.playerEquipment[plr.playerRing] == 2550){ plr.recoil1 = 0.1; } if(plr.playerEquipment[plr.playerRing] != 2550){ plr.recoil1 = 0.0; } if(npcs[NPCID].melee == 1 && npcs[NPCID].meleeAtk >= randstab){ hitDiff = hitDiff; } else if(npcs[NPCID].melee == 2 && npcs[NPCID].meleeAtk >= randslash){ hitDiff = hitDiff; } else if(npcs[NPCID].melee == 3 && npcs[NPCID].meleeAtk >= randcrush){ hitDiff = hitDiff; } else if(npcs[NPCID].melee == 4 && npcs[NPCID].mageAtk >= randmage){ hitDiff = hitDiff; } else if(npcs[NPCID].melee == 5 && npcs[NPCID].rangeAtk >= randrange){ hitDiff = hitDiff; } else if(npcs[NPCID].melee == 1 && npcs[NPCID].meleeAtk < randstab){ hitDiff = 0; } else if(npcs[NPCID].melee == 2 && npcs[NPCID].meleeAtk < randslash){ hitDiff = 0; } else if(npcs[NPCID].melee == 3 && npcs[NPCID].meleeAtk < randcrush){ hitDiff = 0; } else if(npcs[NPCID].melee == 4 && npcs[NPCID].mageAtk < randmage){ hitDiff = 0; } else if(npcs[NPCID].melee == 5 && npcs[NPCID].rangeAtk < randrange){ hitDiff = 0; } if(plr.ProtMelee == true || plr.DeflectMelee == true){ hitDiff -= npcs[NPCID].meleeHit; } else if(plr.ProtRange == true || plr.DeflectRange == true){ hitDiff -= npcs[NPCID].rangeHit; } else if(plr.ProtMage == true || plr.DeflectMage == true){ hitDiff -= npcs[NPCID].mageHit; } npcs[NPCID].animUpdateRequired = true; npcs[NPCID].updateRequired = true; if(hitDiff < 0){ hitDiff = 0; }
hang on ill ask my mate
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |