Hi, I'm having a few problems on the ErasedPkz source where items aren't dropped on death, you're not always teleported away from the duel arena, sometimes you get teleported to the tzhaar caves.
If you're in a duel and the opponent logs out when they log back in they're in the arena on their own but can teleport away. And sometimes when you win a duel and the opponent logs out you get spam teleported and the victory window keeps appearing.
Just wondering if anyone has managed to find a fix for this, here's the code I've got in PlayerAssistant.java for applying dead, if you need any more let me know.
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) {
c.playerKilled = c.playerId;
if(o.duelStatus == 5) {
o.duelStatus++;
}
if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
o.pkPoints = (o.pkPoints + 4);
o.sendMessage("You recieved 4 pkPoints");
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.inArena()) {
c.sendMessage("You have lost the duel!");
o.getPA().movePlayer(Config.DUELING_RESPAWN_X + (Misc.random(Config.RANDOM_DUELING_RESPAWN)),Config.DUELING_RESPAWN_Y + (Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0);
c.getPA().movePlayer(Config.DUELING_RESPAWN_X + (Misc.random(Config.RANDOM_DUELING_RESPAWN)),Config.DUELING_RESPAWN_Y + (Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0);
}
resetDamageDone();
c.DC++;
o.KC++;
c.specAmount = 10;
c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]);
c.lastVeng = 0;
c.vengOn = false;
resetFollowers();
c.attackTimer = 10;
if (Server.playerHandler.players[c.killerId].connectedFrom.equals(Server.playerHandler.players[c.playerKilled].connectedFrom)) {
o.sendMessage("You Don't Recieve PK Points for killing yourself!");
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.lastVeng = 0;
c.vengOn = false;
resetFollowers();
c.attackTimer = 10;
removeAllWindows();
c.tradeResetNeeded = true;
return;
}
}
Thanks.