I assume it's doing this:
Code:o.pkPoints += Misc.random(25);
|
I have searched through numerous tutorials on here and other sites and none seemed to fix this.
Kills and Deaths in the wilderness are fine, the only problem is whenever you die to an npc anywhere on the server you earn pk points. What part am I missing here and what do I need to edit.
Code:public void applyDead() { c.respawnTimer = 15; c.isDead = false; if (c.duelStatus != 6) { c.killerId = findKiller(); Client o = (Client) Server.playerHandler.players[c.killerId]; if (o != null) { c.DC++; o.KC++; c.playerKilled = c.playerId; if (o.duelStatus == 5) { o.duelStatus++; } if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && !c.inPits) { o.pkPoints += Misc.random(25); o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom; } else { o.sendMessage("You do not recieve pk points because you have killed " + c.playerName + " twice in a row."); } } } c.faceUpdate(0); c.npcIndex = 0; c.playerIndex = 0; c.stopMovement(); if (c.duelStatus <= 4) { c.sendMessage("Oh dear you are dead!"); } else if (c.duelStatus != 6) { c.sendMessage("You have lost the duel!"); } resetDamageDone(); c.specAmount = 10; c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]); c.lastVeng = 0; c.vengOn = false; resetFollowers(); c.attackTimer = 10; }
I assume it's doing this:
Code:o.pkPoints += Misc.random(25);
Nevermind, thought I had it lol.
You could try, I am not understanding what is wrong with the code.
Replace:
Code:if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && !c.inPits)
With:
Code:if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && isInWild(or what ever you use) && !c.inPits)
This keeps you from getting pk points if you die in fight caves, but gives them to you if you die anywhere else to an npc. I do not want you to get pkp if you die somewhere on the server, like Bandos or something. That's what's happening that I can't fix.
Code:public void applyDead() { c.respawnTimer = 15; c.isDead = false; Client o = (Client) Server.playerHandler.players[c.killerId]; if(c.duelStatus != 6) { c.killerId = findKiller(); if(o != null) { if(!(c.npcIndex > 0) && c.inPits == false){ } c.playerKilled = c.playerId; if(o.duelStatus == 5) { o.duelStatus++; } if (c.killerId != c.playerId) o.sendMessage("You have defeated "+Misc.optimizeText(c.playerName)+" and received 4 pkPoints."); if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && !c.inPits) { o.pkPoints += Misc.random(25); o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom; } else { o.sendMessage("You have recently defeated "+c.playerName+", you don't receive any pk points."); } } } c.faceUpdate(0); EventManager.getSingleton().addEvent(new Event() { public void execute(EventContainer b) { c.npcIndex = 0; c.playerIndex = 0; b.stop(); } }, 2500); c.stopMovement(); if(c.duelStatus <= 4) { c.sendMessage("Oh dear you are dead!"); } else if(c.duelStatus != 6) { c.sendMessage("You have lost the duel!"); } resetDamageDone(); c.specAmount = 10; c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]); c.lastVeng = 0; c.vengOn = false; resetFollowers(); c.attackTimer = 10; removeAllWindows(); c.tradeResetNeeded = true; }
I understand the problem you have, but idk why your code isn't working properly.
Fixed it, just changed
if(!(c.npcIndex > 0) && c.inPits == false){
to
if(!(c.npcIndex < 0) && c.inPits == false){
lol
1. It needs to be c.inWild not !c.inWild. That will make sure that the player is in the wild for that to even attempt to work.
2. Show me that line of code after you added it.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |