Originally Posted by
Aviles
LOL WHAT!?
On the givelife method it sets the boolean isdead to false, the later on the code if the player dies in clan wars it handles the death, while the applydead does that too?
I need more than this though, like the whole method.
APPLY DEAD
Code:
public void applyDead() {
if(c.inClanWars()) {
c.getClanWars().handleKill(c, o);
}
c.getTradeAndDuel().stakedItems.clear();
Client o = (Client) PlayerHandler.players[c.killerId];
if (c.prayerActive[21] || c.curseActive[17] && !c.inDuelArena()) {
if (o != null) {
if(!(c.npcIndex > 0) && c.inPits == false){
}
applyWrath();
}
}
c.respawnTimer = 12;
c.isDead = false;
if (c.duelStatus != 6) {
c.killerId = findKiller();
if (o != null) {
o.hasGivenKS = false;
c.hasGivenKS = false;
o.hasSentDeathMessage = false;
c.hasSentDeathMessage = false;
GabbesAchievements.writeAchievementTab(c);
GabbesAchievements.writeAchievementTab(o);
if (c.inCwGame == false && o.inCwGame == false) {
if (c.killerId != c.playerId) {
o.getPkRewardSystem().add(c);
o.playerKilled = c.playerId;
if (o.duelStatus == 5) {
o.duelStatus++;
}
}
}
}
c.faceUpdate(0);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
if (c != null) {
c.npcIndex = 0;
c.playerIndex = 0;
}
container.stop();
}
@Override
public void stop() {
}
}, 5);
c.stopMovement();
if (c.inCw()) {
c.cwDeaths += 1;
Client o1 = (Client) PlayerHandler.players[c.killerId];
o1.cwKills += 1;
if(c.duelStatus <= 4) {
c.getTradeAndDuel().stakedItems.clear();
c.sendMessage("Oh dear you are dead!");
} else if(c.duelStatus != 6) {
c.getTradeAndDuel().stakedItems.clear();
c.sendMessage("You have lost the duel!!!");
}
}
resetDamageDone();
c.specAmount = 10;
c.getItems().addSpecialBar(c.playerEquipment[Player.playerWeapon]);
c.lastVeng = 0;
c.vengOn = false;
resetFollowers();
c.attackTimer = 10;
}
}
GIVE LIFE
Code:
public void giveLife() {
c.isDead = false;
resetDamageDone();
c.faceUpdate(-1);
c.freezeTimer = 0;
if (c.inClanWars()) {
c.getClanWars().handleDeath(c);
}
if(ClanWarHandler.clanWars[c.clanWarId].clan1Players.contains(c)) {
movePlayer(ClanWarConstants.DEATH_CLAN1X, ClanWarConstants.DEATH_CLAN1Y, ClanWarHandler.clanWars[c.clanWarId].getHeight());
} else {
movePlayer(ClanWarConstants.DEATH_CLAN2X, ClanWarConstants.DEATH_CLAN2Y, ClanWarHandler.clanWars[c.clanWarId].getHeight());
}
if(ClanWarHandler.clanWars[c.clanWarId].clan2Players.contains(c)) {
if(ClanWarHandler.clanWars[c.clanWarId].getClan1Kills() >= ClanWarConstants.MAX_KILLS) {
c.sendMessage("called");
c.getClanWars().handleWin("clan1", ClanWarHandler.clanWars[c.clanWarId]);
}
} else if (ClanWarHandler.clanWars[c.clanWarId].clan1Players.contains(c)) {
if(ClanWarHandler.clanWars[c.clanWarId].getClan2Kills() >= ClanWarConstants.MAX_KILLS) {
c.sendMessage("called");
c.getClanWars().handleWin("clan2", ClanWarHandler.clanWars[c.clanWarId]);
}
}
if (!CastleWars.isInCw(c) && !(c.duelStatus != 5) && !c.lostDuel && FightPits.getState(c) == null && !c.inFightCaves() && !c.inPcGame() && !c.inFunPk()) {
if (c.playerRights < 6) {
if (!c.isSkulled && !c.isInArd()) {
c.getItems().keepItem(0, true);
c.getItems().keepItem(1, true);
c.getItems().keepItem(2, true);
}
if (c.prayerActive[10] || c.curseActive[0]
&& System.currentTimeMillis() - c.lastProtItem > 700) {
c.getItems().keepItem(3, true);
}
c.getItems().dropAllItems();
c.getItems().deleteAllItems();
// GRAVE STONE
/*
* if(!c.inWild()) { c.playerDeathX = c.absX; c.playerDeathY =
* c.absY; c.theDeadGuy = c.playerName; c.GSTimer = 120;
* c.startGSEvent(); }
*/
if (!c.isSkulled && !c.isInArd()) {
for (int i1 = 0; i1 < 3; i1++) {
if (c.itemKeptId[i1] > 0) {
c.getItems().addItem(c.itemKeptId[i1], 1);
}
}
}
if (c.prayerActive[10] || c.isInArd()) { // if we have
// protect items
if (c.itemKeptId[3] > 0) {
c.getItems().addItem(c.itemKeptId[3], 1);
}
}
}
c.getItems().resetKeepItems();
}
c.getCombat().resetPrayers();
for (int i = 0; i < 25; i++) {
c.playerLevel[i] = getLevelForXP(c.playerXP[i]);
c.getPA().refreshSkill(i);
}
if (!c.inPits && !c.inFightCaves()) {
c.getItems().resetKeepItems();
}
if (c.inBarbDef) {
Server.barbDefence.endGame(c, false);
} else if (FightPits.getState(c) != null) {
FightPits.handleDeath(c);
} else if (c.fightPitsArea()) {
c.getPA().movePlayer(2399, 5178, 0);
} else if (c.inConquer()) {
c.getPA().resetConquer();
} else if (c.inCw()) {
if (CastleWars.getTeamNumber(c) == 1) {
c.getPlayerAssistant().movePlayer(2426 + Misc.random(3),
3076 - Misc.random(3), 1);
} else {
c.getPlayerAssistant().movePlayer(2373 + Misc.random(3),
3131 - Misc.random(3), 1);
}
} else if (c.inFightCaves()) {
c.getPA().resetTzhaar();
} else if (c.duelStatus != 5 && !c.lostDuel) { // if we are not in a
// duel repawn to wildy
movePlayer(Config.RESPAWN_X, Config.RESPAWN_Y, 0);
c.isSkulled = false;
c.skullTimer = 0;
c.attackedPlayers.clear();
} else if (c.duelStatus == 5 || c.lostDuel) { // we are in a duel,
// respawn outside of
// arena
Client o = (Client) PlayerHandler.players[c.duelingWith];
if (o != null) {
o.getPA().createPlayerHints(10, -1);
if (o.duelStatus == 6 && c.duelStatus == 5) {
o.getTradeAndDuel().duelVictory();
}
}
c.getPA().movePlayer(
Config.DUELING_RESPAWN_X
+ (Misc.random(Config.RANDOM_DUELING_RESPAWN)),
Config.DUELING_RESPAWN_Y
+ (Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0);
assert o != null;
if (o != null) {
o.getPA().movePlayer(
Config.DUELING_RESPAWN_X
+ (Misc.random(Config.RANDOM_DUELING_RESPAWN)),
Config.DUELING_RESPAWN_Y
+ (Misc.random(Config.RANDOM_DUELING_RESPAWN)),
0);
}
if (c.duelStatus != 6) { // if we have won but have died, don't
// reset the duel status.
c.getTradeAndDuel().resetDuel();
}
c.lostDuel = false;
}
PlayerSave.saveGame(c);
c.getCombat().resetPlayerAttack();
resetAnimation();
c.startAnimation(-1);
frame1();
resetTb();
c.isSkulled = false;
c.attackedPlayers.clear();
c.headIconPk = -1;
c.skullTimer = -1;
c.damageTaken = new int[Config.MAX_PLAYERS];
c.getPA().requestUpdates();
removeAllWindows();
c.getTradeAndDuel().resetTrade();
c.isFullHelm = Item
.isFullHelm(c.playerEquipment[Player.playerHat]);
c.isFullMask = Item
.isFullMask(c.playerEquipment[Player.playerHat]);
c.isFullBody = Item
.isFullBody(c.playerEquipment[Player.playerChest]);
}
This time I may have given you more than you needed oh well! thanks for helping me out here