Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.rs.game.player;
- import java.io.BufferedWriter;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.net.InetAddress;
- import java.net.UnknownHostException;
- import java.text.DateFormat;
- import java.text.DecimalFormat;
- import java.text.NumberFormat;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Date;
- import java.util.LinkedList;
- import java.util.List;
- import java.util.Locale;
- import java.util.TimerTask;
- import java.util.concurrent.ConcurrentLinkedQueue;
- import java.util.concurrent.CopyOnWriteArrayList;
- import java.util.concurrent.TimeUnit;
- import com.rs.Settings;
- import com.rs.cache.loaders.ConfigDefinitions;
- import com.rs.cores.CoresManager;
- import com.rs.game.Animation;
- import com.rs.game.Entity;
- import com.rs.game.ForceTalk;
- import com.rs.game.Graphics;
- import com.rs.game.Hit;
- import com.rs.game.Hit.HitLook;
- import com.rs.game.World;
- import com.rs.game.WorldObject;
- import com.rs.game.WorldTile;
- import com.rs.game.item.FloorItem;
- import com.rs.game.item.Item;
- import com.rs.game.minigames.GameController;
- import com.rs.game.minigames.LobbyController;
- import com.rs.game.minigames.clanwars.FfaZone;
- import com.rs.game.minigames.clanwars.WarControler;
- import com.rs.game.minigames.duel.DuelArena;
- import com.rs.game.minigames.duel.DuelRules;
- import com.rs.game.npc.NPC;
- import com.rs.game.npc.familiar.Familiar;
- import com.rs.game.npc.godwars.zaros.Nex;
- import com.rs.game.npc.pet.Pet;
- import com.rs.game.player.actions.PlayerCombat;
- import com.rs.game.player.content.BountyHunter;
- import com.rs.game.player.content.DropLog;
- import com.rs.game.player.content.FriendChatsManager;
- import com.rs.game.player.content.GrinderList;
- import com.rs.game.player.content.ItemConstants;
- import com.rs.game.player.content.Magic;
- import com.rs.game.player.content.MoneyPouch;
- import com.rs.game.player.content.Notes;
- import com.rs.game.player.content.Pots;
- import com.rs.game.player.content.PuzzleBox;
- import com.rs.game.player.content.ReaperAssignment;
- import com.rs.game.player.content.SkillCapeCustomizer;
- import com.rs.game.player.content.clans.ClansManager;
- import com.rs.game.player.content.pet.PetManager;
- import com.rs.game.player.content.slayer.SlayerManager;
- import com.rs.game.player.controlers.BarrelchestControler;
- import com.rs.game.player.controlers.CorpBeastControler;
- import com.rs.game.player.controlers.CrucibleControler;
- import com.rs.game.player.controlers.DTControler;
- import com.rs.game.player.controlers.DungeoneeringControler;
- import com.rs.game.player.controlers.FightCaves;
- import com.rs.game.player.controlers.FightKiln;
- import com.rs.game.player.controlers.GodWars;
- import com.rs.game.player.controlers.ImpossibleJad;
- import com.rs.game.player.controlers.JailControler;
- import com.rs.game.player.controlers.NomadsRequiem;
- import com.rs.game.player.controlers.QueenBlackDragonController;
- import com.rs.game.player.controlers.StartTutorial;
- import com.rs.game.player.controlers.Wilderness;
- import com.rs.game.player.controlers.ZGDControler;
- import com.rs.game.player.controlers.battleterrace.battleTerraceGame;
- import com.rs.game.player.controlers.castlewars.CastleWarsPlaying;
- import com.rs.game.player.controlers.castlewars.CastleWarsWaiting;
- import com.rs.game.player.controlers.events.DeathEvent;
- import com.rs.game.player.controlers.fightpits.FightPitsArena;
- import com.rs.game.player.controlers.pestcontrol.PestControlGame;
- import com.rs.game.player.controlers.pestcontrol.PestControlLobby;
- import com.rs.game.player.dialogues.Dialogue;
- import com.rs.game.tasks.WorldTask;
- import com.rs.game.tasks.WorldTasksManager;
- import com.rs.net.Session;
- import com.rs.net.decoders.WorldPacketsDecoder;
- import com.rs.net.decoders.handlers.ButtonHandler;
- import com.rs.net.encoders.WorldPacketsEncoder;
- import com.rs.utils.DbLogs;
- import com.rs.utils.IsaacKeyPair;
- import com.rs.utils.Lend;
- import com.rs.utils.Logger;
- import com.rs.utils.LoggingSystem;
- import com.rs.utils.PkRank;
- import com.rs.utils.SerializableFilesManager;
- import com.rs.utils.Utils;
- import com.rs.utils.economy.Prices;
- import com.rs.utils.mysql.impl.Highscores;
- public class Player extends Entity {
- public int start = 0;
- public DropLog dropLogs;
- public int dropTestingAmount = 1;
- public boolean dropTesting;
- public DropLog getDropLogs() {
- return dropLogs;
- }
- public long WorldXp;// its
- public long cooldown;
- private static final long serialVersionUID = 2011932556974180375L;
- public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1, RUN_MOVE_TYPE = 2;
- private static final DecimalFormat dFormatter = new DecimalFormat("#,###,###,###");
- public long lastDailyGiven;
- public static String getFormattedNumber(int amount) {
- return dFormatter.format(amount);
- }
- public String getTitleColor() {
- return titleColor;
- }
- public LoyaltyManager getLoyaltyManager() {
- return loyaltyManager;
- }
- private transient PuzzleBox puzzleBox;
- public PuzzleBox getPuzzleBox() {
- return puzzleBox;
- }
- public void setPuzzleBox(int puzzleId) {
- this.puzzleBox = new PuzzleBox(this, puzzleId);
- }
- public double gainedXP;
- public String getRankPrefix() {
- if (isOwner())
- return "<shad=0008F5><col=B51BE0>[Owner]</col></shad> <img=16> <shad=C42BE3>";
- if (isHeadAdmin())
- return "[<col=0000FF><shad=0000ff>Head Administrator</col>] <img=6> ";
- if (isForumsAdmin())
- return "[<col=ffff00><shad=ffff00>Forum Administrator</col>] <img=14> ";
- if (getRights() == 2)
- return "[<col=00FFFF><shad=00FFFF>Administrator</col>] <img=1> ";
- if (isHeadMod())
- return "[<col=FF0000><shad=C0C0C0>Head Moderator</col>] <img=15> ";
- if (isForumModerator())
- return "[<col=238500><shad=238500>Forum Moderator</col>] <img=10> ";
- if (getRights() == 1)
- return "[<col=FF8800><shad=FF0000>Moderator</col>] <img=0> ";
- if (isSupporter())
- return "[<col=FF66CC><shad=FF66CC>Server Supporter</col>] <img=12> ";
- return "";
- }
- public String getRankMessage() {
- if (isOwner())
- return "</shad>: <shad=B50424><col=051FE6>Remember to vote daily for rewards and to help the server grow!</col></shad>";
- if (isHeadAdmin())
- return ": <col=0000FF><shad=0000ff>Remember to vote daily for rewards and to help the server grow!</col></shad>";
- if (isForumsAdmin())
- return ": <col=FFff00>Remember to vote daily for rewards and to help the server grow!</col></shad>";
- if (getRights() == 2)
- return ": <col=00FFFF><shad=00FFFF>Remember to vote daily for rewards and to help the server grow!</col></shad>";
- if (isHeadMod())
- return ": <col=FF0000><shad=C0C0C0>Remember to vote daily for rewards and to help the server grow!</col></shad>";
- if (isForumModerator())
- return ": <col=238500><shad=238500>Remember to vote daily for rewards and to help the server grow!</col></shad>";
- if (getRights() == 1)
- return ": <col=FF8800><shad=FF0000>Remember to vote daily for rewards and to help the server grow!</col></shad>";
- if (isSupporter())
- return ": <col=FF66CC><shad=FF66CC>Remember to vote daily for rewards and to help the server grow!</col></shad>";
- return "";
- }
- public void sendBossInterface() {
- getInterfaceManager().sendInterface(275);
- for (int i = 2; i < 11; i++)
- getPackets().sendIComponentText(275, i, "");
- for (int n = 24; n > 300; n++)
- getPackets().sendIComponentText(275, n, "");
- getPackets().sendIComponentText(275, 1, "Boss Pet Killcounts");
- getPackets().sendIComponentText(275, 11, "Bandos - 3000");
- getPackets().sendIComponentText(275, 12, "Armadyl - 3000");
- getPackets().sendIComponentText(275, 13, "Zamorak - 2500");
- getPackets().sendIComponentText(275, 14, "Saradomin - 3000");
- getPackets().sendIComponentText(275, 15, "Nex - 750");
- getPackets().sendIComponentText(275, 16, "Corporeal Beast - 1500");
- getPackets().sendIComponentText(275, 17, "Blink - 1500");
- getPackets().sendIComponentText(275, 18, "KBD - 1750");
- getPackets().sendIComponentText(275, 19, "Glacors - 2000");
- getPackets().sendIComponentText(275, 20, "Tormented Demon - 2000");
- getPackets().sendIComponentText(275, 21, "Party Demon - 1500");
- getPackets().sendIComponentText(275, 22, "Hope Devourer - 1750");
- getPackets().sendIComponentText(275, 23, "Bork - 3000");
- getPackets().sendIComponentText(275, 24, "AOD - 2500");
- }
- public int reaperPoints;
- public int rerolls;
- public int taskPoints;
- public boolean bossTaskCompleted;
- public boolean hasLearnedDeath;
- private ReaperAssignment reaperAssignment;
- public boolean hasLearnedBossPets;
- public boolean HasBoughtBandos;
- public boolean HasBoughtArmadyl;
- public boolean HasBoughtZamorak;
- public boolean HasBoughtSaradomin;
- public boolean HasBoughtNex;
- public boolean HasBoughtCorp;
- public boolean HasBoughtGlacor;
- public boolean HasBoughtPD;
- public boolean HasBoughtKBD;
- public boolean HasBoughtHope;
- public boolean HasBoughtAOD;
- public boolean HasBoughtBork;
- public boolean HasBoughtBlink;
- public boolean HasBoughtTD;
- /*
- * public boolean rerollTask() { if (rerolls <= 0) {
- * sendMessage("You are out of task rerolls. Continue with the current one, or wait till tomorrow."
- * ); return false; } rerolls--; reaperAssignment =
- * ReaperAssignment.create(); sendMessage(reaperAssignment.getMessage());
- * return true; }
- */
- public boolean changeTask() {
- reaperAssignment = ReaperAssignment.create();
- sendMessage(reaperAssignment.getMessage());
- return true;
- }
- public boolean hasBossTask() {
- return reaperAssignment != null;
- }
- public ReaperAssignment getBossTask() {
- return reaperAssignment;
- }
- public void setBossTask(ReaperAssignment bossTask) {
- this.reaperAssignment = bossTask;
- }
- public void setTaskPoints(int taskPoints) {
- this.taskPoints = taskPoints;
- }
- public boolean setHasLearnedDeath(boolean b) {
- return hasLearnedDeath = b;
- }
- public boolean hasLearnedDeath() {
- return hasLearnedDeath;
- }
- public boolean setHasLearnedBossPets(boolean b) {
- return hasLearnedBossPets = b;
- }
- public boolean hasLearnedBossPets() {
- return hasLearnedBossPets;
- }
- public int BossPoints;
- public int getBossPoints() {
- return BossPoints;
- }
- /**
- * Start
- */
- public boolean setBoughtBandos(boolean b) {
- return HasBoughtBandos = b;
- }
- public boolean hasBoughtBandos() {
- return HasBoughtBandos;
- }
- public boolean setBoughtArmadyl(boolean b) {
- return HasBoughtArmadyl = b;
- }
- public boolean hasBoughtArmadyl() {
- return HasBoughtArmadyl;
- }
- public boolean setBoughtSaradomin(boolean b) {
- return HasBoughtSaradomin = b;
- }
- public boolean hasBoughtSaradomin() {
- return HasBoughtSaradomin;
- }
- public boolean setBoughtZamorak(boolean b) {
- return HasBoughtZamorak = b;
- }
- public boolean hasBoughtZamorak() {
- return HasBoughtZamorak;
- }
- public boolean setBoughtNex(boolean b) {
- return HasBoughtNex = b;
- }
- public boolean hasBoughtNex() {
- return HasBoughtNex;
- }
- public boolean setBoughtCorp(boolean b) {
- return HasBoughtCorp = b;
- }
- public boolean hasBoughtCorp() {
- return HasBoughtCorp;
- }
- public boolean setBoughtBork(boolean b) {
- return HasBoughtBork = b;
- }
- public boolean hasBoughtBork() {
- return HasBoughtBork;
- }
- public boolean setBoughtBlink(boolean b) {
- return HasBoughtBlink = b;
- }
- public boolean hasBoughtBlink() {
- return HasBoughtBlink;
- }
- public boolean setBoughtPD(boolean b) {
- return HasBoughtPD = b;
- }
- public boolean hasBoughtPD() {
- return HasBoughtPD;
- }
- public boolean setBoughtKBD(boolean b) {
- return HasBoughtKBD = b;
- }
- public boolean hasBoughtKBD() {
- return HasBoughtKBD;
- }
- public boolean setBoughtGlacor(boolean b) {
- return HasBoughtGlacor = b;
- }
- public boolean hasBoughtGlacor() {
- return HasBoughtGlacor;
- }
- public boolean setBoughtTD(boolean b) {
- return HasBoughtTD = b;
- }
- public boolean hasBoughtTD() {
- return HasBoughtTD;
- }
- public boolean setBoughtHope(boolean b) {
- return HasBoughtHope = b;
- }
- public boolean hasBoughtHope() {
- return HasBoughtHope;
- }
- public boolean setBoughtAOD(boolean b) {
- return HasBoughtAOD = b;
- }
- public boolean hasBoughtAOD() {
- return HasBoughtAOD;
- }
- /**
- * End
- */
- public int WGuildPotential;
- transient LoyaltyManager loyaltyManager;
- public String getTitle() {
- return Title;
- }
- public void settitlecolor(String titleColor) {
- this.titleColor = titleColor;
- }
- public void setTitle(String Title) {
- this.Title = Title;
- }
- private String titleColor = "FF0000";
- private String Title = "Extreme Donator";
- public static String getFormattedNumber(double amount, char seperator) {
- String str = new DecimalFormat("#,###,###").format(amount);
- char[] rebuff = new char[str.length()];
- for (int i = 0; i < str.length(); i++) {
- char c = str.charAt(i);
- if (c >= '0' && c <= '9')
- rebuff[i] = c;
- else
- rebuff[i] = seperator;
- }
- return new String(rebuff);
- }
- public static String formatNumber(int number) {
- return NumberFormat.getNumberInstance(Locale.UK).format(number);
- }
- public int TRiviapoints;
- public int getTriviaPoints() {
- return TRiviapoints;
- }
- public long getLastCorrectTrivia() {
- return lastAnswered;
- }
- public void setLastAnswer(long time) {
- this.lastAnswered = time;
- }
- public int getCorrectAnswers() {
- return correctAnswers;
- }
- public void setCorrectAnswers(int amount) {
- this.correctAnswers = amount;
- }
- public void setDisableTrivia(boolean value) {
- this.disabledTrivia = value;
- }
- public boolean hasDisabledTrivia() {
- return disabledTrivia;
- }
- private boolean disabledTrivia;
- private long lastAnswered;
- public int correctAnswers;
- private boolean untillLogout;
- public transient ActionManager actionManager;
- public void setUnlimitedRunPerk(boolean unlimitedRunPerk) {
- }
- public boolean addedWeedstoCompost;
- private boolean agrithNaNa;
- private boolean allowChatEffects;
- private Appearence appearence;
- private int assistStatus;
- public AuraManager auraManager;
- private Bank bank;
- private KcTab kcTab;
- public int bandosKc, armadylKc, zamorakKc, saradominKc, thunderousKc, pdemonKc, dkKc, blinkKc, corpKc, kbdKc, qbdKc,
- hatiKc, glacorKc, nomadKc, avatarKc, tdKc, kqKc, nexKc, bcKc, borkKc, gulegaKc, dagSKc, dagPKc, dagRKc;
- private long banned;
- private int barbarianAdvancedLaps;
- private int barrowsKillCount;
- private int barsDone;
- public int battlePoints;
- public Player battleTarget;
- private Item prize;
- private transient long boneDelay;
- public transient BountyHunter bountyHunter;
- private transient boolean canPvp;
- private transient boolean cantTrade;
- private int customNpcId = -1;
- public boolean hasPin;
- public int securityPin;
- public int getSecurityPin() {
- return securityPin;
- }
- public void setSecurityPin(int pin) {
- this.securityPin = pin;
- }
- public void setCustomNpcId(int customNpcId) {
- this.customNpcId = customNpcId;
- }
- private transient boolean castedVeng;
- private ChargesManager charges;
- private int clanStatus;
- public transient boolean clientLoadedMapRegion;
- // Triviapoints}
- public void setHsUpdate(long time) {
- this.lastHsUpdate = time;
- }
- private long donationtimer;
- public void setDonationTimer(long time) {
- this.donationtimer = time;
- }
- public long getDonationTimer() {
- return donationtimer;
- }
- public void addBlueCharm(int amount) {
- this.blueCharms += amount;
- }
- public void addGreenCharm(int amount) {
- this.greenCharms += amount;
- }
- public void addCrimCharm(int amount) {
- this.crimCharms += amount;
- }
- public void addGoldCharm(int amount) {
- this.goldCharms += amount;
- }
- public int goldCharms;
- public int crimCharms;
- public int blueCharms;
- public int greenCharms;
- public int checkGolds() {
- return goldCharms;
- }
- public int checkBlues() {
- return blueCharms;
- }
- public int checkGreens() {
- return greenCharms;
- }
- public int checkCrims() {
- return crimCharms;
- }
- public void removeGoldCharms(int amount) {
- this.goldCharms -= amount;
- }
- public void removeCrimCharms(int amount) {
- this.crimCharms -= amount;
- }
- public void removeBlueCharms(int amount) {
- this.blueCharms -= amount;
- }
- public void removeGreenCharms(int amount) {
- this.greenCharms -= amount;
- }
- private transient Runnable closeInterfacesEvent;
- private int clueReward;
- public int cluenoreward;
- private CombatDefinitions combatDefinitions;
- // completionistcape reqs
- private boolean completedFightCaves;
- private boolean completedFightKiln;
- private boolean completedRfd;
- private int[] completionistCapeCustomized;
- public ControlerManager controlerManager;
- public transient CoordsEvent coordsEvent;
- /* count partyhats obtained from mystery box */
- public int countPartyHat;
- private long creationDate;
- private int crucibleHighScore;
- private boolean culinaromancer;
- public transient FriendChatsManager currentFriendChat;
- private String currentFriendChatOwner;
- // lobby
- private int currentWorldLobby;
- private String customTitle;
- public transient CutscenesManager cutscenesManager;
- private boolean dessourt;
- // Hide Tanning
- public boolean tanning;
- // public void setDungPoints(int i) {
- // private boolean DungShop;
- public int DungPoints;
- public int DungeoneeringTokens;
- public int getDungeoneeringTokens() {
- return DungeoneeringTokens;
- }
- public void setDungeoneeringTokens(int DungeoneeringTokens) {
- this.DungeoneeringTokens = DungeoneeringTokens;
- }
- public void setTriviaPoints(int TRiviapoints) {
- this.TRiviapoints = TRiviapoints;
- }
- public void addDungPoints(int DungPoints) {
- this.DungPoints += DungPoints;
- }
- public void takeDungPoints(int DungPoints) {
- this.DungPoints -= DungPoints;
- }
- public int getDungPoints() {
- return DungPoints;
- }
- public void setDungPoints(int DungPoints) {
- this.DungPoints = DungPoints;
- }
- public void addDungeoneeringTokens(int DungeoneeringTokens) {
- this.DungeoneeringTokens += DungeoneeringTokens;
- }
- public void takeDungeoneeringTokens(int DungeoneeringTokens) {
- this.DungeoneeringTokens -= DungeoneeringTokens;
- }
- // public int setDungPoints() {
- // return dungpoints;
- // }
- /**
- * Farming
- */
- // Falador
- private int faladorHerbPatch;
- private int faladorNorthAllotmentPatch;
- private int faladorSouthAllotmentPatch;
- private int faladorFlowerPatch;
- private boolean faladorHerbPatchRaked;
- private boolean faladorNorthAllotmentPatchRaked;
- private boolean faladorSouthAllotmentPatchRaked;
- private boolean faladorFlowerPatchRaked;
- // Catherby
- private int catherbyHerbPatch;
- private int catherbyNorthAllotmentPatch;
- private int catherbySouthAllotmentPatch;
- private int catherbyFlowerPatch;
- private boolean catherbyHerbPatchRaked;
- private boolean catherbyNorthAllotmentPatchRaked;
- private boolean catherbySouthAllotmentPatchRaked;
- private boolean catherbyFlowerPatchRaked;
- // Ardougne
- private int ardougneHerbPatch;
- private int ardougneNorthAllotmentPatch;
- private int ardougneSouthAllotmentPatch;
- private int ardougneFlowerPatch;
- private boolean ardougneHerbPatchRaked;
- private boolean ardougneNorthAllotmentPatchRaked;
- private boolean ardougneSouthAllotmentPatchRaked;
- private boolean ardougneFlowerPatchRaked;
- // Canifis
- private int canifisHerbPatch;
- private int canifisNorthAllotmentPatch;
- private int canifisSouthAllotmentPatch;
- private int canifisFlowerPatch;
- private boolean canifisHerbPatchRaked;
- private boolean canifisNorthAllotmentPatchRaked;
- private boolean canifisSouthAllotmentPatchRaked;
- private boolean canifisFlowerPatchRaked;
- // Lumbridge
- private int lummyTreePatch;
- private boolean lummyTreePatchRaked;
- // Varrock
- private int varrockTreePatch;
- private boolean varrockTreePatchRaked;
- // Falador
- private int faladorTreePatch;
- private boolean faladorTreePatchRaked;
- // Taverly
- private int taverlyTreePatch;
- private boolean taverlyTreePatchRaked;
- //
- // END FARMING
- //
- /**
- * Farming Methods
- */
- // Falador
- public int getFaladorHerbPatch() {
- return faladorHerbPatch;
- }
- public void setFaladorHerbPatch(int seed) {
- this.faladorHerbPatch = seed;
- }
- public int getFaladorNorthAllotmentPatch() {
- return faladorNorthAllotmentPatch;
- }
- public void setFaladorNorthAllotmentPatch(int seed) {
- this.faladorNorthAllotmentPatch = seed;
- }
- public int getFaladorSouthAllotmentPatch() {
- return faladorSouthAllotmentPatch;
- }
- public void setFaladorSouthAllotmentPatch(int seed) {
- this.faladorSouthAllotmentPatch = seed;
- }
- public int getFaladorFlowerPatch() {
- return faladorFlowerPatch;
- }
- public void setFaladorFlowerPatch(int seed) {
- this.faladorFlowerPatch = seed;
- }
- public boolean getFaladorHerbPatchRaked() {
- return faladorHerbPatchRaked;
- }
- public void setFaladorHerbPatchRaked(boolean raked) {
- this.faladorHerbPatchRaked = raked;
- }
- public boolean getFaladorNorthAllotmentPatchRaked() {
- return faladorNorthAllotmentPatchRaked;
- }
- public void setFaladorNorthAllotmentPatchRaked(boolean raked) {
- this.faladorNorthAllotmentPatchRaked = raked;
- }
- public boolean getFaladorSouthAllotmentPatchRaked() {
- return faladorSouthAllotmentPatchRaked;
- }
- public void setFaladorSouthAllotmentPatchRaked(boolean raked) {
- this.faladorSouthAllotmentPatchRaked = raked;
- }
- public boolean getFaladorFlowerPatchRaked() {
- return faladorFlowerPatchRaked;
- }
- public void setFaladorFlowerPatchRaked(boolean raked) {
- this.faladorFlowerPatchRaked = raked;
- }
- // Ardougne
- public int getArdougneHerbPatch() {
- return ardougneHerbPatch;
- }
- public void setArdougneHerbPatch(int seed) {
- this.ardougneHerbPatch = seed;
- }
- public int getArdougneNorthAllotmentPatch() {
- return ardougneNorthAllotmentPatch;
- }
- public void setArdougneNorthAllotmentPatch(int seed) {
- this.ardougneNorthAllotmentPatch = seed;
- }
- public int getArdougneSouthAllotmentPatch() {
- return ardougneSouthAllotmentPatch;
- }
- public void setArdougneSouthAllotmentPatch(int seed) {
- this.ardougneSouthAllotmentPatch = seed;
- }
- public int getArdougneFlowerPatch() {
- return ardougneFlowerPatch;
- }
- public void setArdougneFlowerPatch(int seed) {
- this.ardougneFlowerPatch = seed;
- }
- public boolean getArdougneHerbPatchRaked() {
- return ardougneHerbPatchRaked;
- }
- public void setArdougneHerbPatchRaked(boolean raked) {
- this.ardougneHerbPatchRaked = raked;
- }
- public boolean getArdougneNorthAllotmentPatchRaked() {
- return ardougneNorthAllotmentPatchRaked;
- }
- public void setArdougneNorthAllotmentPatchRaked(boolean raked) {
- this.ardougneNorthAllotmentPatchRaked = raked;
- }
- public boolean getArdougneSouthAllotmentPatchRaked() {
- return ardougneSouthAllotmentPatchRaked;
- }
- public void setArdougneSouthAllotmentPatchRaked(boolean raked) {
- this.ardougneSouthAllotmentPatchRaked = raked;
- }
- public boolean getArdougneFlowerPatchRaked() {
- return ardougneFlowerPatchRaked;
- }
- public void setArdougneFlowerPatchRaked(boolean raked) {
- this.ardougneFlowerPatchRaked = raked;
- }
- // Catherby
- public int getCatherbyHerbPatch() {
- return catherbyHerbPatch;
- }
- public void setCatherbyHerbPatch(int seed) {
- this.catherbyHerbPatch = seed;
- }
- public int getCatherbyNorthAllotmentPatch() {
- return catherbyNorthAllotmentPatch;
- }
- public void setCatherbyNorthAllotmentPatch(int seed) {
- this.catherbyNorthAllotmentPatch = seed;
- }
- public int getCatherbySouthAllotmentPatch() {
- return catherbySouthAllotmentPatch;
- }
- public void setCatherbySouthAllotmentPatch(int seed) {
- this.catherbySouthAllotmentPatch = seed;
- }
- public int getCatherbyFlowerPatch() {
- return catherbyFlowerPatch;
- }
- public void setCatherbyFlowerPatch(int seed) {
- this.catherbyFlowerPatch = seed;
- }
- public boolean getCatherbyHerbPatchRaked() {
- return catherbyHerbPatchRaked;
- }
- public void setCatherbyHerbPatchRaked(boolean raked) {
- this.catherbyHerbPatchRaked = raked;
- }
- public boolean getCatherbyNorthAllotmentPatchRaked() {
- return catherbyNorthAllotmentPatchRaked;
- }
- public void setCatherbyNorthAllotmentPatchRaked(boolean raked) {
- this.catherbyNorthAllotmentPatchRaked = raked;
- }
- public boolean getCatherbySouthAllotmentPatchRaked() {
- return catherbySouthAllotmentPatchRaked;
- }
- public void setCatherbySouthAllotmentPatchRaked(boolean raked) {
- this.catherbySouthAllotmentPatchRaked = raked;
- }
- public boolean getCatherbyFlowerPatchRaked() {
- return catherbyFlowerPatchRaked;
- }
- public void setCatherbyFlowerPatchRaked(boolean raked) {
- this.catherbyFlowerPatchRaked = raked;
- }
- // Canifis
- public int getCanifisHerbPatch() {
- return canifisHerbPatch;
- }
- public void setCanifisHerbPatch(int seed) {
- this.canifisHerbPatch = seed;
- }
- public int getCanifisNorthAllotmentPatch() {
- return canifisNorthAllotmentPatch;
- }
- public void setCanifisNorthAllotmentPatch(int seed) {
- this.canifisNorthAllotmentPatch = seed;
- }
- public int getCanifisSouthAllotmentPatch() {
- return canifisSouthAllotmentPatch;
- }
- public void setCanifisSouthAllotmentPatch(int seed) {
- this.canifisSouthAllotmentPatch = seed;
- }
- public int getCanifisFlowerPatch() {
- return canifisFlowerPatch;
- }
- public void setCanifisFlowerPatch(int seed) {
- this.canifisFlowerPatch = seed;
- }
- public boolean getCanifisHerbPatchRaked() {
- return canifisHerbPatchRaked;
- }
- public void setCanifisHerbPatchRaked(boolean raked) {
- this.canifisHerbPatchRaked = raked;
- }
- public boolean getCanifisNorthAllotmentPatchRaked() {
- return canifisNorthAllotmentPatchRaked;
- }
- public void setCanifisNorthAllotmentPatchRaked(boolean raked) {
- this.canifisNorthAllotmentPatchRaked = raked;
- }
- public boolean getCanifisSouthAllotmentPatchRaked() {
- return canifisSouthAllotmentPatchRaked;
- }
- public void setCanifisSouthAllotmentPatchRaked(boolean raked) {
- this.canifisSouthAllotmentPatchRaked = raked;
- }
- public boolean getCanifisFlowerPatchRaked() {
- return canifisFlowerPatchRaked;
- }
- public void setCanifisFlowerPatchRaked(boolean raked) {
- this.canifisFlowerPatchRaked = raked;
- }
- // Lumbridge
- public int getLummyTreePatch() {
- return lummyTreePatch;
- }
- public void setLummyTreePatch(int sapling) {
- this.lummyTreePatch = sapling;
- }
- public boolean getLummyTreePatchRaked() {
- return lummyTreePatchRaked;
- }
- public void setLummyTreePatchRaked(boolean raked) {
- this.lummyTreePatchRaked = raked;
- }
- // Varrock
- public int getVarrockTreePatch() {
- return varrockTreePatch;
- }
- public void setVarrockTreePatch(int sapling) {
- this.varrockTreePatch = sapling;
- }
- public boolean getVarrockTreePatchRaked() {
- return varrockTreePatchRaked;
- }
- public void setVarrockTreePatchRaked(boolean raked) {
- this.varrockTreePatchRaked = raked;
- }
- // Falador
- public int getFaladorTreePatch() {
- return faladorTreePatch;
- }
- public void setFaladorTreePatch(int sapling) {
- this.faladorTreePatch = sapling;
- }
- public boolean getFaladorTreePatchRaked() {
- return faladorTreePatchRaked;
- }
- public void setFaladorTreePatchRaked(boolean raked) {
- this.faladorTreePatchRaked = raked;
- }
- // Taverly
- public int getTaverlyTreePatch() {
- return taverlyTreePatch;
- }
- public void setTaverlyTreePatch(int sapling) {
- this.taverlyTreePatch = sapling;
- }
- public boolean getTaverlyTreePatchRaked() {
- return taverlyTreePatchRaked;
- }
- public void setTaverlyTreePatchRaked(boolean raked) {
- this.taverlyTreePatchRaked = raked;
- }
- //
- // END FARMING
- //
- // lend
- public int lendMessage;
- // toolbelt brah
- public Toolbelt toolbelt;
- public Toolbelt getToolbelt() {
- return toolbelt;
- }
- // cannon
- public DwarfCannon dwarfCannon;
- public DwarfCannon getDwarfCannon() {
- // TODO Auto-generated method stub
- return dwarfCannon;
- }
- // interface
- // zeals /sw
- private int zeals;
- public void increaseZeals(int zeals) {
- this.zeals += zeals;
- }
- public int getZeals() {
- return zeals;
- }
- public void setZeals(int zeals) {
- this.zeals = zeals;
- }
- // Money Well
- private double dropBoost;
- private long totalDonated;
- private long boostTime;
- public long getBoostTime() {
- return boostTime;
- }
- public void setBoostTime(long time) {
- this.boostTime = time;
- }
- public double getDropBoost() {
- return dropBoost;
- }
- public long getTotalDonatedToWell() {
- return totalDonated;
- }
- public void setDropBoost(double amount) {
- this.dropBoost = amount;
- }
- public void setTotalDonatedToWell(long amount) {
- this.totalDonated = amount;
- }
- // colored chats
- private int ColorID;
- public void setColorID(int ColorID) {
- this.ColorID = ColorID;
- }
- public int getColorID() {
- return ColorID;
- }
- // sof
- public SquealOfFortuneL squealOfFortuneL;
- public void setSquealOfFortuneL(SquealOfFortuneL squealOfFortuneL) {
- this.squealOfFortuneL = squealOfFortuneL;
- }
- // Title Color Stuff
- /*
- * public String getTitleColor() { return titleColor; }
- *
- * public String getTitle() { return Title; }
- *
- * public void settitlecolor(String titleColor) { this.titleColor =
- * titleColor; }
- *
- * public void setTitle(String Title) { this.Title = Title; }
- *
- * private String titleColor = "C12006";
- *
- * private String Title = "custom";
- */
- // Yell Stuff
- public int YellTokens = 0;
- public String getPrefix() {
- return yellPrefix;
- }
- public void setPrefix(String yellPrefix) {
- this.yellPrefix = yellPrefix;
- }
- private String yellPrefix = "Donator";
- public String getYellColor() {
- return yellColor;
- }
- public void setYellColor(String yellColor) {
- this.yellColor = yellColor;
- }
- private String yellColor = "ff0000";
- public String getShadColor() {
- return yellShade;
- }
- public void setYellShade(String yellShade) {
- this.yellShade = yellShade;
- }
- private String yellShade = "";
- // Boss Count
- public int nex = 0;
- public int bandos = 0;
- public int saradomin = 0;
- public int armadyl = 0;
- public int zamorak = 0;
- public int cannoneer = 0;
- public int corp = 0;
- public int jadinko = 0;
- public int glacor = 0;
- public int dks = 0;
- public int qbd = 0;
- // Xp Modes
- public boolean easy = false, medium = false, hard = false, insane = false;
- public void setEasy(boolean easy) {
- this.easy = easy;
- }
- public void setMedium(boolean medium) {
- this.medium = medium;
- }
- public void setHard(boolean hard) {
- this.hard = hard;
- }
- public void setInsane(boolean insane) {
- this.insane = insane;
- }
- public boolean isEasy() {
- return easy;
- }
- public boolean isMedium() {
- return medium;
- }
- public boolean isHard() {
- return hard;
- }
- public boolean isInsane() {
- return insane;
- }
- private SlayerManager slayerManager;
- public void setSlayerManager(SlayerManager manager) {
- this.slayerManager = manager;
- }
- public SlayerManager getSlayerManager() {
- return slayerManager;
- }
- // XpModeCommand
- /*
- * private int gameMode; //0 = easy, 1 = medium, 2 = hard, 3 = insane
- *
- * public String getMode() { if(gameMode == 0) return "easy"; else
- * if(gameMode == 1) return "medium"; else if(gameMode == 2) return "hard";
- * else if (gameMode == 3) return "insane"; return "error"; } public void
- * setMode(int modeID) { gameMode = modeID; }
- */
- // Dfs
- private boolean dfsActivated;
- private int dfscoolDown;
- public transient DialogueManager dialogueManager;
- public transient Dialogue dialogue;
- private transient boolean disableEquip;
- public transient int displayMode;
- private String displayName;
- private long displayTime;
- private int dominionFactor;
- public DominionTower dominionTower;
- private boolean donator;
- private boolean dicer;
- private boolean isIronman;
- public boolean isOwner() {
- return getRights() == 7;
- }
- public boolean isHeadMod() {
- return getRights() == 15;
- }
- public void setHeadMod(boolean isHeadMod) {
- if (isHeadMod == true) {
- this.setRights(15);
- return;
- } else {
- return;
- }
- }
- public boolean isHeadAdmin() {
- return getRights() == 6;
- }
- public void setHeadAdmin(boolean isHeadAdmin) {
- if (isHeadAdmin == true) {
- this.setRights(6);
- return;
- } else {
- return;
- }
- }
- public void setOwner(boolean isOwner) {
- }
- public boolean isForumsAdmin() {
- return getRights() == 14;
- }
- public boolean isAdmin() {
- return getRights() == 2;
- }
- public void setMod(boolean isMod) {
- if (isMod == true) {
- this.setRights(1);
- return;
- } else {
- return;
- }
- }
- public void setForumsAdmin(boolean isForumsAdmin) {
- if (isForumsAdmin == true) {
- this.setRights(14);
- return;
- } else {
- return;
- }
- }
- public void setAdmin(boolean isAdmin) {
- if (isAdmin == true) {
- this.setRights(2);
- return;
- } else {
- return;
- }
- }
- public boolean isIronman() {
- return isIronman;
- }
- public void setIronman(boolean isIronman) {
- this.isIronman = isIronman;
- }
- private long donatorTill;
- private DuelArena duelarena;
- public int dungeoneeringTokens;
- private int easterPoints;
- private String email;
- private EmotesManager emotesManager;
- private String enteredPinString = null;
- private Equipment equipment;
- private boolean extremeDonator;
- private long extremeDonatorTill;
- public int[] fairyRingCombination = new int[3];
- public Familiar familiar;
- private boolean filterGame;
- private transient boolean finishing;
- private long fireImmune;
- private boolean flamBeed;
- private transient long foodDelay;
- private boolean forceNextMapLoadRefresh;
- private int friendChatSetup;
- private FriendsIgnores friendsIgnores;
- private int gnomeAdvancedLaps;
- private boolean gotInfernoAdze;
- private boolean hasCutEnoughLogs;
- private boolean hasFinishedBarrows;
- private boolean hasCutMoreEnoughLogs;
- // Battle Terrace
- public boolean hasTut;
- private int hiddenBrother;
- private boolean hideSofInterface;
- private boolean hideWorldAnnouncements;
- public transient HintIconsManager hintIconsManager;
- private transient double hpBoostMultiplier;
- private boolean inAnimationRoom;
- public transient InterfaceManager interfaceManager;
- private Inventory inventory;
- private transient boolean invulnerable;
- public transient IsaacKeyPair isaacKeyPair;
- public boolean isBurying = false;
- private boolean isForumModerator;
- private boolean isGraphicDesigner;
- private boolean isInDefenderRoom;
- private boolean isInLobby;
- // supportteam
- private boolean isSupporter;
- private long jailed;
- private boolean karamel;
- // objects
- private boolean khalphiteLairEntranceSetted;
- private boolean khalphiteLairSetted;
- // honor
- private int killCount, deathCount;
- // barrows
- private boolean[] killedBarrowBrothers;
- private boolean killedBork;
- private boolean killedQueenBlackDragon;
- private transient boolean largeSceneView;
- private int lastBonfire;
- public transient DuelRules lastDuelRules;
- private String lastIP;
- private String lastKilled;
- private long lastLoggedIn;
- private String lastMsg;
- private transient long lastPublicMessage;
- private long lastRequestSQL;
- public long lastWalkedMillis;
- private int loadedLogs;
- public transient LocalNPCUpdate localNPCUpdate;
- // used for update
- public transient LocalPlayerUpdate localPlayerUpdate;
- private transient long lockDelay; // used for doors and stuff like that
- private int loggedWorld;
- // used for packets logic
- public transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
- private int logsCut;
- private boolean lootshareEnabled;
- public int Loyaltypoints;
- private boolean macBanned;
- // comp req stuff
- private int magicLogsBurned;
- // skill capes customizing
- private int[] maxedCapeCustomized;
- private int money;
- private boolean mouseButtons;
- private MusicsManager musicsManager;
- private long muted;
- public Notes notes;
- // voting
- private boolean oldItemsLook;
- public int ordinanceTimer;
- private int overloadDelay;
- private List<String> ownedObjectsManagerKeys;
- private String Owner = "";
- private transient long packetsDecoderPing;
- // saving stuff
- private String password;
- private boolean permBanned;
- private boolean permMuted;
- private int pestControlGames;
- private int pestPoints;
- public transient Pet pet;
- public PetManager petManager;
- private int pkPoints;
- private long poisonImmune;
- private transient long polDelay;
- private transient long potDelay;
- public MoneyPouch pouch;
- private int[] pouches;
- public Prayer prayer;
- private int prayerRenewalDelay;
- private int prestige;
- public transient PriceCheckManager priceCheckManager;
- private int privateChatSetup;
- // game bar status
- private int publicStatus;
- public int pvmPoints;
- public QuestManager questManager;
- private String recovAnswer;
- // Recovery ques. & ans.
- private String recovQuestion;
- private String registeredMac, currentMac;
- private boolean reportOption;
- private transient boolean resting;
- private int rights;
- private int rocktailsCooked;
- private byte runEnergy;
- private int runeSpanPoints;
- private transient boolean running;
- public transient int screenHeight;
- public transient int screenWidth;
- public String selectedClass;
- public transient Session session;
- public String setMutedBy, mutedReason;
- private boolean setStarter;
- private Skills skills;
- private int skullDelay;
- private int skullId;
- public int slayerPoints;
- private transient boolean spawnsMode;
- private int specRestoreTimer;
- // player stages
- private transient boolean started;
- private int summoningLeftClickOption;
- private transient List<Integer> switchItemCache;
- private boolean talkedtoCook;
- // crucible
- private boolean talkedWithMarv;
- // Vannaka
- private boolean talkedWithVannaka;
- // Slayer
- // private SlayerTask task;
- private int temporaryMovementType;
- public transient Trade trade;
- private int tradeStatus;
- private int uniquePlayerId;
- private boolean updateMovementType;
- public int usedMacs;
- // transient stuff
- public transient String username;
- private int vecnaTimer;
- private boolean Legend;
- public int votePoints;
- public int warriorKills, archerKills, mageKills;
- public int warriorLevel, archerLevel, mageLevel;
- private boolean wonFightPits;
- private boolean xpLocked;
- private boolean yellDisabled;
- private boolean yellOff;
- private boolean zenRest;
- // creates Player and saved classes
- public Player(String password) {
- super(Settings.START_PLAYER_LOCATION);
- setHitpoints(Settings.START_PLAYER_HITPOINTS);
- squealOfFortuneL = new SquealOfFortuneL();
- this.password = password;
- appearence = new Appearence();
- loyaltyManager = new LoyaltyManager(this);
- inventory = new Inventory();
- equipment = new Equipment();
- gearPresets = new GearPresets();
- skills = new Skills();
- toolbelt = new Toolbelt();
- combatDefinitions = new CombatDefinitions();
- prayer = new Prayer();
- bank = new Bank(this);
- notes = new Notes();
- controlerManager = new ControlerManager();
- musicsManager = new MusicsManager();
- emotesManager = new EmotesManager();
- friendsIgnores = new FriendsIgnores();
- dominionTower = new DominionTower();
- charges = new ChargesManager();
- auraManager = new AuraManager();
- questManager = new QuestManager();
- petManager = new PetManager();
- slayerManager = new SlayerManager(this);
- runEnergy = 100;
- allowChatEffects = true;
- mouseButtons = true;
- pouches = new int[4];
- fairyRingCombination = new int[3];
- resetBarrows();
- SkillCapeCustomizer.resetSkillCapes(this);
- ownedObjectsManagerKeys = new LinkedList<String>();
- setCreationDate(Utils.currentTimeMillis());
- currentFriendChatOwner = Settings.MAIN_ACESSS[0];
- }
- public void giveDailies() {
- if ((Utils.currentTimeMillis() - lastDailyGiven) < (12 * 60 * 60 * 1000)) // 12
- // hours
- return;
- lastDailyGiven = Utils.currentTimeMillis();
- rerolls = 3;
- }
- public void resetfl() {
- friendsIgnores = new FriendsIgnores();
- FriendChatsManager.refreshChat(this);
- }
- public void addBoneDelay(long time) {
- boneDelay = time + Utils.currentTimeMillis();
- }
- public void addDisplayTime(long i) {
- this.displayTime = i + Utils.currentTimeMillis();
- }
- public void addFireImmune(long time) {
- fireImmune = time + Utils.currentTimeMillis();
- }
- public void addFoodDelay(long time) {
- foodDelay = time + Utils.currentTimeMillis();
- }
- public static String now(String dateFormat) {
- Calendar cal = Calendar.getInstance();
- SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
- return sdf.format(cal.getTime());
- }
- public void addLogicPacketToQueue(LogicPacket packet) {
- for (LogicPacket p : logicPackets) {
- if (p.getId() == packet.getId()) {
- logicPackets.remove(p);
- break;
- }
- }
- logicPackets.add(packet);
- }
- public void addPoisonImmune(long time) {
- poisonImmune = time + Utils.currentTimeMillis();
- getPoison().reset();
- }
- public void addPolDelay(long delay) {
- polDelay = delay + Utils.currentTimeMillis();
- }
- public void addPotDelay(long time) {
- potDelay = time + Utils.currentTimeMillis();
- }
- /**
- * Adds points
- *
- * @param points
- */
- public void addRunespanPoints(int points) {
- this.runeSpanPoints += points;
- }
- public static final int MAX_STARTER_COUNT = 2;
- public int Ironman = 0;
- public int Ironmanstage = 0;
- public int newplayer = 0;
- public int newplayerstage = 0;
- public void addStarterPackage(boolean extraCoins) {
- String ip = getSession().getIP();
- int count = StarterMap.getSingleton().getCount(ip);
- if (count >= MAX_STARTER_COUNT) {
- setStarter(true);
- sendMessage("You have already claimed the maximum amount of starter sets.");
- return;
- }
- }
- public boolean canSpawn() {
- if (Wilderness.isAtWild(this) || getControlerManager().getControler() instanceof FightPitsArena
- || getControlerManager().getControler() instanceof CorpBeastControler
- || getControlerManager().getControler() instanceof PestControlLobby
- || getControlerManager().getControler() instanceof PestControlGame
- || getControlerManager().getControler() instanceof DungeoneeringControler
- || getControlerManager().getControler() instanceof ZGDControler
- || getControlerManager().getControler() instanceof GodWars
- || getControlerManager().getControler() instanceof StartTutorial
- || getControlerManager().getControler() instanceof JailControler
- || getControlerManager().getControler() instanceof DTControler
- || getControlerManager().getControler() instanceof WarControler
- || getControlerManager().getControler() instanceof DeathEvent
- || getControlerManager().getControler() instanceof BarrelchestControler
- || getControlerManager().getControler() instanceof DuelArena
- || getControlerManager().getControler() instanceof CastleWarsPlaying
- || getControlerManager().getControler() instanceof CastleWarsWaiting
- || getControlerManager().getControler() instanceof LobbyController
- || getControlerManager().getControler() instanceof GameController
- || getControlerManager().getControler() instanceof FightCaves
- || getControlerManager().getControler() instanceof FightKiln
- || getControlerManager().getControler() instanceof ImpossibleJad
- || getControlerManager().getControler() instanceof BarrelchestControler
- || getControlerManager().getControler() instanceof battleTerraceGame || FfaZone.inPvpArea(this)
- || getControlerManager().getControler() instanceof NomadsRequiem
- || getControlerManager().getControler() instanceof QueenBlackDragonController) {
- return false;
- }
- if (getControlerManager().getControler() instanceof CrucibleControler) {
- CrucibleControler controler = (CrucibleControler) getControlerManager().getControler();
- return !controler.isInside();
- }
- return true;
- }
- public void checkMovement(int x, int y, int plane) {
- Magic.teleControlersCheck(this, new WorldTile(x, y, plane));
- }
- @Override
- public void checkMultiArea() {
- if (!started)
- return;
- boolean isAtMultiArea = isForceMultiArea() ? true : World.isMultiArea(this);
- if (isAtMultiArea && !isAtMultiArea()) {
- setAtMultiArea(isAtMultiArea);
- getPackets().sendGlobalConfig(616, 1);
- } else if (!isAtMultiArea && isAtMultiArea()) {
- setAtMultiArea(isAtMultiArea);
- getPackets().sendGlobalConfig(616, 0);
- }
- }
- public int checkTotalLevel(int checktotal) {
- checktotal = 0;
- for (int i = 0; i < 25; i++) {
- checktotal += getSkills().getLevel(i);
- }
- return checktotal;
- }
- public boolean clientHasLoadedMapRegion() {
- return clientLoadedMapRegion;
- }
- public void closeInterfaces() {
- //System.out.println("Its using closeInterfaces.");
- if (interfaceManager.containsScreenInter())
- interfaceManager.closeScreenInterface();
- if (interfaceManager.containsInventoryInter())
- interfaceManager.closeInventoryInterface();
- dialogueManager.finishDialogue();
- if (closeInterfacesEvent != null) {
- closeInterfacesEvent.run();
- closeInterfacesEvent = null;
- }
- }
- public void drainRunEnergy() {
- if (extremeDonator == true) {
- setRunEnergy(runEnergy - 0);
- } else
- setRunEnergy(runEnergy - 1);
- }
- @Override
- public void finish() {
- finish(0);
- }
- public void finish(final int tryCount) {
- if (finishing || hasFinished()) {
- if (World.containsPlayer(username)) {
- World.removePlayer(this);
- }
- if (World.containsLobbyPlayer(username)) {
- World.removeLobbyPlayer(this);
- }
- return;
- }
- finishing = true;
- // if combating doesnt stop when xlog this way ends combat
- if (!World.containsLobbyPlayer(username)) {
- stopAll(false, true, !(actionManager.getAction() instanceof PlayerCombat));
- }
- long currentTime = Utils.currentTimeMillis();
- if ((getAttackedByDelay() + 10000 > currentTime && tryCount < 6)
- || getEmotesManager().getNextEmoteEnd() >= currentTime || lockDelay >= currentTime || isDead()) {
- CoresManager.slowExecutor.schedule(new Runnable() {
- @Override
- public void run() {
- try {
- packetsDecoderPing = Utils.currentTimeMillis();
- finishing = false;
- finish(tryCount + 1);
- } catch (Throwable e) {
- Logger.handle(e);
- }
- }
- }, 10, TimeUnit.SECONDS);
- return;
- }
- realFinish();
- }
- public void forceLogout() {
- getPackets().sendLogout(false);
- setRunning(false);
- realFinish();
- }
- public void forceSession() {
- setRunning(false);
- realFinish();
- }
- public ActionManager getActionManager() {
- return actionManager;
- }
- public Appearence getAppearence() {
- return appearence;
- }
- public int getAssistStatus() {
- return assistStatus;
- }
- public AuraManager getAuraManager() {
- return auraManager;
- }
- public Bank getBank() {
- return bank;
- }
- public KcTab getKcTab() {//not here, loginmanager
- return kcTab;
- }
- /*
- * public String getBankPin() { return bankPinString; }
- */
- public long getBanned() {
- return banned;
- }
- public int getBarbarianAdvancedLaps() {
- return barbarianAdvancedLaps;
- }
- public int getBarrowsKillCount() {
- return barrowsKillCount;
- }
- public int getBarsDone() {
- return barsDone;
- }
- public long getBoneDelay() {
- return boneDelay;
- }
- public BountyHunter getBountyHunter() {
- return bountyHunter;
- }
- public ChargesManager getCharges() {
- return charges;
- }
- public SquealOfFortuneL getSquealOfFortune() {
- return squealOfFortuneL;
- }
- public int getClanStatus() {
- return clanStatus;
- }
- public int getClueReward() {
- return clueReward;
- }
- public CombatDefinitions getCombatDefinitions() {
- return combatDefinitions;
- }
- public int[] getCompletionistCapeCustomized() {
- return completionistCapeCustomized;
- }
- public ControlerManager getControlerManager() {
- return controlerManager;
- }
- public long getCreationDate() {
- return creationDate;
- }
- public int getCrucibleHighScore() {
- return crucibleHighScore;
- }
- public FriendChatsManager getCurrentFriendChat() {
- return currentFriendChat;
- }
- public String getCurrentFriendChatOwner() {
- return currentFriendChatOwner;
- }
- public String getCurrentMac() {
- return currentMac;
- }
- public int getCurrentWorldLobby() {
- return currentWorldLobby;
- }
- public String getCustomTitle() {
- return customTitle;
- }
- public CutscenesManager getCutscenesManager() {
- return cutscenesManager;
- }
- public int getDeathCount() {
- return deathCount;
- }
- public int getdfscoolDown() {
- return dfscoolDown;
- }
- public Dialogue getDialogue() {
- return dialogue;
- }
- public DialogueManager getDialogueManager() {
- return dialogueManager;
- }
- public boolean hasLoginPin;
- public int pin;
- public int getLoginPin() {
- return pin;
- }
- public void setLoginPin(int pin) {
- this.pin = pin;
- }
- public int keysOpened;
- public String getKeysOpened() {
- return keysOpened + " Crystal Chests!";
- }
- public int totaldonated;
- public int getTotalDonated() {
- return totaldonated;
- }
- public int getDisplayMode() {
- return displayMode;
- }
- public String getDisplayName() {
- if (displayName != null)
- return displayName;
- return Utils.formatPlayerNameForDisplay(username);
- }
- public long getDisplayTime() {
- return displayTime;
- }
- public int getDominionFactor() {
- return dominionFactor;
- }
- public DominionTower getDominionTower() {
- return dominionTower;
- }
- @SuppressWarnings("deprecation")
- public String getDonatorTill() {
- return (donator ? "never" : new Date(donatorTill).toGMTString()) + ".";
- }
- public DuelArena getDuelArena() {
- return duelarena;
- }
- public int getEasterPoints() {
- return easterPoints;
- }
- public String getEmailAttached() {
- return email;
- }
- public EmotesManager getEmotesManager() {
- return emotesManager;
- }
- public String getEnteredBankPin() {
- return enteredPinString;
- }
- public Equipment getEquipment() {
- return equipment;
- }
- @SuppressWarnings("deprecation")
- public String getExtremeDonatorTill() {
- return (extremeDonator ? "never" : new Date(extremeDonatorTill).toGMTString()) + ".";
- }
- public int[] getFairyRingCombination() {
- return fairyRingCombination;
- }
- public Familiar getFamiliar() {
- return familiar;
- }
- public long getFireImmune() {
- return fireImmune;
- }
- public long getFoodDelay() {
- return foodDelay;
- }
- public FriendsIgnores getFriendsIgnores() {
- return friendsIgnores;
- }
- public int getGnomeAdvancedLaps() {
- return gnomeAdvancedLaps;
- }
- public int getHiddenBrother() {
- return hiddenBrother;
- }
- public HintIconsManager getHintIconsManager() {
- return hintIconsManager;
- }
- public double getHpBoostMultiplier() {
- return hpBoostMultiplier;
- }
- public InterfaceManager getInterfaceManager() {
- return interfaceManager;
- }
- public final boolean isAtWild() {
- return (getX() >= 3011 && getX() <= 3132 && getY() >= 10052 && getY() <= 10175)
- || (getX() >= 2940 && getX() <= 3395 && getY() >= 3525 && getY() <= 4000)
- || (getX() >= 3264 && getX() <= 3279 && getY() >= 3279 && getY() <= 3672)
- || (getX() >= 3158 && getX() <= 3181 && getY() >= 3679 && getY() <= 3697)
- || (getX() >= 3280 && getX() <= 3183 && getY() >= 3885 && getY() <= 3888)
- || (getX() >= 3012 && getX() <= 3059 && getY() >= 10303 && getY() <= 10351)
- || (getX() >= 3060 && getX() <= 3072 && getY() >= 10251 && getY() <= 10263);
- }
- public final boolean isInClanwars() {
- return (getX() >= 2981 && getX() <= 3006 && getY() >= 9664 && getY() <= 9694)
- || (getX() >= 2947 && getX() <= 3070 && getY() >= 5506 && getY() <= 5630)
- || (getX() >= 2755 && getX() <= 2876 && getY() >= 5506 && getY() <= 5630);
- }
- public final boolean isInRedPortal() {
- return (getX() >= 2948 && getX() <= 3069 && getY() >= 5507 && getY() <= 5629);
- }
- public final boolean isInClanwarsLobby() {
- return (getX() >= 2981 && getX() <= 3006 && getY() >= 9664 && getY() <= 9694);
- }
- public final boolean atJail() {
- return (getX() >= 1385 && getX() <= 3198 && getY() >= 9816 && getY() <= 9837);
- }
- public final boolean isAtTourny() {
- return (getX() >= 4441 && getX() <= 4474 && getY() >= 4121 && getY() <= 4158);
- }
- public final boolean isAtNonprod() {
- return (getX() >= 1859 && getX() <= 1915 && getY() >= 3215 && getY() <= 3249);
- }
- public Inventory getInventory() {
- return inventory;
- }
- public IsaacKeyPair getIsaacKeyPair() {
- return isaacKeyPair;
- }
- public boolean getIsInLobby() {
- return isInLobby;
- }
- public long getJailed() {
- return jailed;
- }
- public long getWorldXp() {
- return WorldXp;
- }
- public int getKillCount() {
- return killCount;
- }
- public boolean[] getKilledBarrowBrothers() {
- return killedBarrowBrothers;
- }
- public int getLastBonfire() {
- return lastBonfire;
- }
- /**
- * END RFD
- */
- public DuelRules getLastDuelRules() {
- return lastDuelRules;
- }
- public String getLastHostname() {
- InetAddress addr;
- try {
- addr = InetAddress.getByName(getLastIP());
- String hostname = addr.getHostName();
- return hostname;
- } catch (UnknownHostException e) {
- e.printStackTrace();
- }
- return null;
- }
- public String getLastIP() {
- return lastIP;
- }
- public long getLastLoggedIn() {
- // TODO Auto-generated method stub
- return lastLoggedIn;
- }
- public String getLastMsg() {
- return lastMsg;
- }
- public long getLastPublicMessage() {
- return lastPublicMessage;
- }
- public long getLastRequestSQL() {
- // TODO Auto-generated method stub
- return lastRequestSQL;
- }
- public long getLastWalked() {
- return lastWalkedMillis;
- }
- public boolean warned;
- public boolean isWarned() {
- return warned;
- }
- public void setWarned(boolean warned) {
- this.warned = warned;
- }
- public int getLoadedLogs() {
- return loadedLogs;
- }
- public LocalNPCUpdate getLocalNPCUpdate() {
- return localNPCUpdate;
- }
- public LocalPlayerUpdate getLocalPlayerUpdate() {
- return localPlayerUpdate;
- }
- public long getLockDelay() {
- return lockDelay;
- }
- public int getLoggedInWorld() {
- // TODO Auto-generated method stub
- return loggedWorld;
- }
- public int getLogsCut() {
- return logsCut;
- }
- public int getLoyaltyPoints() {
- return Loyaltypoints;
- }
- @Override
- public double getMagePrayerMultiplier() {
- return 0.6;
- }
- public int getMagicLogsBurned() {
- return magicLogsBurned;
- }
- public boolean hasKilledEveryBoss() {
- if (bandosKc >= 1 && armadylKc >= 1 && saradominKc >= 1 && zamorakKc >= 1 && nexKc >= 1 && corpKc >= 1
- && blinkKc >= 1 && pdemonKc >= 1 && kbdKc >= 1 && qbdKc >= 1 && glacorKc >= 1 && tdKc >= 1
- && borkKc >= 1 && aodKc >= 1 && hopeKc >= 1)
- return true;
- return false;
- }
- public boolean hasKilledEveryBoss100() {
- if (bandosKc >= 100 && armadylKc >= 100 && saradominKc >= 100 && zamorakKc >= 100 && corpKc >= 100
- && blinkKc >= 100 && pdemonKc >= 100 && kbdKc >= 100 && glacorKc >= 100 && tdKc >= 100 && borkKc >= 100
- && aodKc >= 100 && hopeKc >= 100)
- return true;
- return false;
- }
- // LOL, bad way to do it, dont complain
- public int[] getMaxedCapeCustomized() {
- return maxedCapeCustomized;
- }
- @Override
- public int getMaxHitpoints() {
- return skills.getLevel(Skills.HITPOINTS) * 10 + equipment.getEquipmentHpIncrease();
- }
- @Override
- public double getMeleePrayerMultiplier() {
- return 0.6;
- }
- public int getMessageIcon() {
- if (isOwner())
- return 16;
- if (isHeadAdmin())
- return 6;
- if (isForumsAdmin())
- return 14;
- if (getRights() == 2)
- return 2;
- if (isHeadMod())
- return 15;
- if (isForumModerator())
- return 10;
- if (getRights() == 1)
- return 1;
- if (isSupporter())
- return 12;
- if (isGold())
- return 17;
- if (isSilver())
- return 19;
- if (isDicer())
- return 18;
- if (isLegendary())
- return 13;
- if (isExtremeDonator())
- return 9;
- if (isDonator())
- return 8;
- if (isGraphicDesigner())
- return 20;
- if (isIronman())
- return 4;
- return getRights();
- }
- public MoneyPouch getMoneyPouch() {
- return pouch;
- }
- public int getMoneyPouchValue() {
- return money;
- }
- public int getMovementType() {
- if (getTemporaryMoveType() != -1)
- return getTemporaryMoveType();
- return getRun() ? RUN_MOVE_TYPE : WALK_MOVE_TYPE;
- }
- public MusicsManager getMusicsManager() {
- return musicsManager;
- }
- public long getMuted() {
- return muted;
- }
- public Notes getNotes() {
- return notes;
- }
- public int getOverloadDelay() {
- return overloadDelay;
- }
- public List<String> getOwnedObjectManagerKeys() {
- if (ownedObjectsManagerKeys == null) // temporary
- ownedObjectsManagerKeys = new LinkedList<String>();
- return ownedObjectsManagerKeys;
- }
- public String getOwner() {
- return Owner;
- }
- public WorldPacketsEncoder getPackets() {
- return session.getWorldPackets();
- }
- public long getPacketsDecoderPing() {
- return packetsDecoderPing;
- }
- public String getPassword() {
- return password;
- }
- public int getPestControlGames() {
- return pestControlGames;
- }
- public int getPestPoints() {
- return pestPoints;
- }
- /**
- * Gets the pet.
- *
- * @return The pet.
- */
- public Pet getPet() {
- return pet;
- }
- /**
- * Gets the petManager.
- *
- * @return The petManager.
- */
- public PetManager getPetManager() {
- return petManager;
- }
- public int getPkPoints() {
- return pkPoints;
- }
- public long getPoisonImmune() {
- return poisonImmune;
- }
- public long getPolDelay() {
- return polDelay;
- }
- public long getPotDelay() {
- return potDelay;
- }
- public int[] getPouches() {
- return pouches;
- }
- public Prayer getPrayer() {
- return prayer;
- }
- public long getPrayerDelay() {
- Long teleblock = (Long) getTemporaryAttributtes().get("PrayerBlocked");
- if (teleblock == null)
- return 0;
- return teleblock;
- }
- public int getPrestige() {
- return prestige;
- }
- public PriceCheckManager getPriceCheckManager() {
- return priceCheckManager;
- }
- public int getPrivateChatSetup() {
- return privateChatSetup;
- }
- public int getPublicStatus() {
- return publicStatus;
- }
- public int getPvmPoints() {
- return pvmPoints;
- }
- public QuestManager getQuestManager() {
- return questManager;
- }
- @Override
- public double getRangePrayerMultiplier() {
- return 0.6;
- }
- public String getRecovAnswer() {
- return recovAnswer;
- }
- public String getRecovQuestion() {
- return recovQuestion;
- }
- public String getRegisteredMac() {
- return registeredMac;
- }
- public int getRights() {
- return rights;
- }
- public int getRocktailsCooked() {
- return rocktailsCooked;
- }
- public byte getRunEnergy() {
- return runEnergy;
- }
- /**
- * @return the runeSpanPoint
- */
- public int getRuneSpanPoints() {
- return runeSpanPoints;
- }
- public int getScreenHeight() {
- return screenHeight;
- }
- public int getScreenWidth() {
- return screenWidth;
- }
- public Session getSession() {
- return session;
- }
- @Override
- public int getSize() {
- return appearence.getSize();
- }
- public Skills getSkills() {
- return skills;
- }
- public int getSkullId() {
- return skullId;
- }
- public int getSlayerPoints() {
- return slayerPoints;
- }
- public int getSpecRestoreTimer() {
- return specRestoreTimer;
- }
- public int getSummoningLeftClickOption() {
- return summoningLeftClickOption;
- }
- public int getTotalKc() {
- return bandosKc + armadylKc + saradominKc + corpKc + nexKc + blinkKc + pdemonKc + kbdKc + qbdKc + glacorKc
- + tdKc + borkKc + hopeKc + aodKc;
- }
- public List<Integer> getSwitchItemCache() {
- return switchItemCache;
- }
- /**
- * @return the task
- */
- // public SlayerTask getTask() {
- // return task;
- // }
- public long getTeleBlockDelay() {
- Long teleblock = (Long) getTemporaryAttributtes().get("TeleBlocked");
- if (teleblock == null)
- return 0;
- return teleblock;
- }
- public int getTemporaryMovementType() {
- return temporaryMovementType;
- }
- public int getTemporaryMoveType() {
- return getTemporaryMovementType();
- }
- public Trade getTrade() {
- return trade;
- }
- public int getTradeStatus() {
- return tradeStatus;
- }
- public int getUniquePlayerId() {
- return uniquePlayerId;
- }
- public String getUsername() {
- return username;
- }
- public int getVecnaTimer() {
- return vecnaTimer;
- }
- public int getVotePoints() {
- return votePoints;
- }
- public int getGanodermicFlakes() {
- return ganodermicFlakes;
- }
- @Override
- public void handleIngoingHit(final Hit hit) {
- if (hit.getLook() != HitLook.MELEE_DAMAGE && hit.getLook() != HitLook.RANGE_DAMAGE
- && hit.getLook() != HitLook.MAGIC_DAMAGE)
- return;
- if (invulnerable) {
- hit.setDamage(0);
- return;
- }
- if (auraManager.usingPenance()) {
- int amount = (int) (hit.getDamage() * 0.2);
- if (amount > 0)
- prayer.restorePrayer(amount);
- }
- Entity source = hit.getSource();
- if (source == null)
- return;
- if (polDelay > Utils.currentTimeMillis())
- hit.setDamage((int) (hit.getDamage() * 0.5));
- if (prayer.hasPrayersOn() && hit.getDamage() != 0) {
- if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
- if (prayer.usingPrayer(0, 17))
- hit.setDamage((int) (hit.getDamage() * source.getMagePrayerMultiplier()));
- else if (prayer.usingPrayer(1, 7)) {
- int deflectedDamage = source instanceof Nex ? 0 : (int) (hit.getDamage() * 0.1);
- hit.setDamage((int) (hit.getDamage() * source.getMagePrayerMultiplier()));
- if (deflectedDamage > 0) {
- source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
- setNextGraphics(new Graphics(2228));
- setNextAnimation(new Animation(12573));
- }
- }
- } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
- if (prayer.usingPrayer(0, 18))
- hit.setDamage((int) (hit.getDamage() * source.getRangePrayerMultiplier()));
- else if (prayer.usingPrayer(1, 8)) {
- int deflectedDamage = source instanceof Nex ? 0 : (int) (hit.getDamage() * 0.1);
- hit.setDamage((int) (hit.getDamage() * source.getRangePrayerMultiplier()));
- if (deflectedDamage > 0) {
- source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
- setNextGraphics(new Graphics(2229));
- setNextAnimation(new Animation(12573));
- }
- }
- } else if (hit.getLook() == HitLook.MELEE_DAMAGE) {
- if (prayer.usingPrayer(0, 19))
- hit.setDamage((int) (hit.getDamage() * source.getMeleePrayerMultiplier()));
- else if (prayer.usingPrayer(1, 9)) {
- int deflectedDamage = source instanceof Nex ? 0 : (int) (hit.getDamage() * 0.1);
- hit.setDamage((int) (hit.getDamage() * source.getMeleePrayerMultiplier()));
- if (deflectedDamage > 0) {
- source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
- setNextGraphics(new Graphics(2230));
- setNextAnimation(new Animation(12573));
- }
- }
- }
- }
- if (hit.getDamage() >= 200) {
- if (hit.getLook() == HitLook.MELEE_DAMAGE) {
- int reducedDamage = hit.getDamage()
- * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MELEE_BONUS] / 100;
- if (reducedDamage > 0) {
- hit.setDamage(hit.getDamage() - reducedDamage);
- hit.setSoaking(new Hit(source, reducedDamage, HitLook.ABSORB_DAMAGE));
- }
- } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
- int reducedDamage = hit.getDamage()
- * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_RANGE_BONUS] / 100;
- if (reducedDamage > 0) {
- hit.setDamage(hit.getDamage() - reducedDamage);
- hit.setSoaking(new Hit(source, reducedDamage, HitLook.ABSORB_DAMAGE));
- }
- } else if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
- int reducedDamage = hit.getDamage()
- * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MAGE_BONUS] / 100;
- if (reducedDamage > 0) {
- hit.setDamage(hit.getDamage() - reducedDamage);
- hit.setSoaking(new Hit(source, reducedDamage, HitLook.ABSORB_DAMAGE));
- }
- }
- }
- int shieldId = equipment.getShieldId();
- if (shieldId == 13742 || shieldId == 23699) { // elsyian
- if (Utils.getRandom(100) <= 70)
- hit.setDamage((int) (hit.getDamage() * 0.75));
- } else if (shieldId == 13740 || shieldId == 23698) { // divine
- int drain = (int) (Math.ceil(hit.getDamage() * 0.3) / 2);
- if (prayer.getPrayerpoints() >= drain) {
- hit.setDamage((int) (hit.getDamage() * 0.70));
- prayer.drainPrayer(drain);
- }
- }
- if (castedVeng && hit.getDamage() >= 4) {
- castedVeng = false;
- setNextForceTalk(new ForceTalk("Taste vengeance!"));
- source.applyHit(new Hit(this, (int) (hit.getDamage() * 0.75), HitLook.REGULAR_DAMAGE));
- }
- if (source instanceof Player) {
- final Player p2 = (Player) source;
- if (p2.prayer.hasPrayersOn()) {
- if (p2.prayer.usingPrayer(0, 24)) { // smite
- int drain = hit.getDamage() / 4;
- if (drain > 0)
- prayer.drainPrayer(drain);
- } else {
- if (hit.getDamage() == 0)
- return;
- if (!p2.prayer.isBoostedLeech()) {
- if (hit.getLook() == HitLook.MELEE_DAMAGE) {
- if (p2.prayer.usingPrayer(1, 19)) {
- if (Utils.getRandom(4) == 0) {
- p2.prayer.increaseTurmoilBonus(this);
- p2.prayer.setBoostedLeech(true);
- return;
- }
- } else if (p2.prayer.usingPrayer(1, 1)) { // sap att
- if (Utils.getRandom(4) == 0) {
- if (p2.prayer.reachedMax(0)) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your sap curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(0);
- p2.getPackets().sendGameMessage(
- "Your curse drains Attack from the enemy, boosting your Attack.", true);
- }
- p2.setNextAnimation(new Animation(12569));
- p2.setNextGraphics(new Graphics(2214));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2215, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2216));
- }
- }, 1);
- return;
- }
- } else {
- if (p2.prayer.usingPrayer(1, 10)) {
- if (Utils.getRandom(7) == 0) {
- if (p2.prayer.reachedMax(3)) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(3);
- p2.getPackets().sendGameMessage(
- "Your curse drains Attack from the enemy, boosting your Attack.",
- true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2231, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2232));
- }
- }, 1);
- return;
- }
- }
- if (lendMessage != 0) {
- if (lendMessage == 1)
- getPackets().sendGameMessage(
- "<col=FF0000>An item you lent out has been added back to your bank.");
- else if (lendMessage == 2)
- getPackets().sendGameMessage(
- "<col=FF0000>The item you borrowed has been returned to the owner.");
- lendMessage = 0;
- }
- if (p2.prayer.usingPrayer(1, 14)) {
- if (Utils.getRandom(7) == 0) {
- if (p2.prayer.reachedMax(7)) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(7);
- p2.getPackets().sendGameMessage(
- "Your curse drains Strength from the enemy, boosting your Strength.",
- true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2248, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2250));
- }
- }, 1);
- return;
- }
- }
- }
- }
- if (hit.getLook() == HitLook.RANGE_DAMAGE) {
- if (p2.prayer.usingPrayer(1, 2)) { // sap range
- if (Utils.getRandom(4) == 0) {
- if (p2.prayer.reachedMax(1)) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your sap curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(1);
- p2.getPackets().sendGameMessage(
- "Your curse drains Range from the enemy, boosting your Range.", true);
- }
- p2.setNextAnimation(new Animation(12569));
- p2.setNextGraphics(new Graphics(2217));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2218, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2219));
- }
- }, 1);
- return;
- }
- } else if (p2.prayer.usingPrayer(1, 11)) {
- if (Utils.getRandom(7) == 0) {
- if (p2.prayer.reachedMax(4)) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(4);
- p2.getPackets().sendGameMessage(
- "Your curse drains Range from the enemy, boosting your Range.", true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2236, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2238));
- }
- });
- return;
- }
- }
- }
- if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
- if (p2.prayer.usingPrayer(1, 3)) { // sap mage
- if (Utils.getRandom(4) == 0) {
- if (p2.prayer.reachedMax(2)) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your sap curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(2);
- p2.getPackets().sendGameMessage(
- "Your curse drains Magic from the enemy, boosting your Magic.", true);
- }
- p2.setNextAnimation(new Animation(12569));
- p2.setNextGraphics(new Graphics(2220));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2221, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2222));
- }
- }, 1);
- return;
- }
- } else if (p2.prayer.usingPrayer(1, 12)) {
- if (Utils.getRandom(7) == 0) {
- if (p2.prayer.reachedMax(5)) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(5);
- p2.getPackets().sendGameMessage(
- "Your curse drains Magic from the enemy, boosting your Magic.", true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2240, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2242));
- }
- }, 1);
- return;
- }
- }
- }
- // overall
- if (p2.prayer.usingPrayer(1, 13)) { // leech defence
- if (Utils.getRandom(10) == 0) {
- if (p2.prayer.reachedMax(6)) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(6);
- p2.getPackets().sendGameMessage(
- "Your curse drains Defence from the enemy, boosting your Defence.", true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2244, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2246));
- }
- }, 1);
- return;
- }
- }
- if (p2.prayer.usingPrayer(1, 15)) {
- if (Utils.getRandom(10) == 0) {
- if (getRunEnergy() <= 0) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.setRunEnergy(p2.getRunEnergy() > 90 ? 100 : p2.getRunEnergy() + 10);
- setRunEnergy(p2.getRunEnergy() > 10 ? getRunEnergy() - 10 : 0);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2256, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2258));
- }
- }, 1);
- return;
- }
- }
- if (p2.prayer.usingPrayer(1, 16)) {
- if (Utils.getRandom(10) == 0) {
- if (combatDefinitions.getSpecialAttackPercentage() <= 0) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.combatDefinitions.restoreSpecialAttack();
- combatDefinitions.desecreaseSpecialAttack(10);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2252, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2254));
- }
- }, 1);
- return;
- }
- }
- if (p2.prayer.usingPrayer(1, 4)) { // sap spec
- if (Utils.getRandom(10) == 0) {
- p2.setNextAnimation(new Animation(12569));
- p2.setNextGraphics(new Graphics(2223));
- p2.prayer.setBoostedLeech(true);
- if (combatDefinitions.getSpecialAttackPercentage() <= 0) {
- p2.getPackets().sendGameMessage(
- "Your opponent has been weakened so much that your sap curse has no effect.",
- true);
- } else {
- combatDefinitions.desecreaseSpecialAttack(10);
- }
- World.sendProjectile(p2, this, 2224, 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2225));
- }
- }, 1);
- return;
- }
- }
- }
- }
- }
- } else {
- NPC n = (NPC) source;
- if (prayer.usingPrayer(1, 19)) {
- if (Utils.getRandom(4) == 0) {
- prayer.increaseTurmoilBonus(n);
- prayer.setBoostedLeech(true);
- }
- }
- if (n.getId() == 13448)
- sendSoulSplit(hit, n);
- /*
- * if (n instanceof Glacor) { Glacor glacor = (Glacor) n; if
- * (glacor.getEffect() == GlacorEffect.SAPPING) {
- * this.getPrayer().drainPrayer( (int) Utils.getPercent(10,
- * this.getPrayer() .getPrayerpoints())); } } else if (n instanceof
- * SappingGlacyte) { this.getPrayer().drainPrayer( (int)
- * Utils.getPercent(5, this.getPrayer() .getPrayerpoints())); } } }
- */}
- }
- public boolean hasDisabledYell() {
- return yellDisabled;
- }
- public boolean hasDisplayName() {
- return displayName != null;
- }
- public boolean hasInstantSpecial(final int weaponId) {
- switch (weaponId) {
- case 4153:
- case 15486:
- case 22207:
- case 22209:
- case 22211:
- case 22213:
- case 1377:
- case 13472:
- case 35:// Excalibur
- case 8280:
- case 14632:
- return true;
- default:
- return false;
- }
- }
- public boolean hasLargeSceneView() {
- return largeSceneView;
- }
- public boolean hasRecievedStarter() {
- return setStarter;
- }
- public boolean hasSkull() {
- return skullDelay > 0;
- }
- public boolean hasStarted() {
- return started;
- }
- public boolean hasTalkedtoCook() {
- return talkedtoCook;
- }
- @Override
- public void heal(int ammount, int extra) {
- super.heal(ammount, extra);
- refreshHitPoints();
- }
- public boolean hideSofInterface() {
- // TODO Auto-generated method stub
- return hideSofInterface;
- }
- public void increaseCrucibleHighScore() {
- crucibleHighScore++;
- }
- public void increaseKillCount(Player killed) {
- if (lastKilled == killed.getUsername()) {
- sendMessage("You haven't been awarded any pk points for killing; " + killed.getDisplayName() + " twice.");
- return;
- }
- killed.deathCount++;
- PkRank.checkRank(killed);
- lastKilled = killed.getUsername();
- if (killed.getSession().getIP().equals(getSession().getIP()))
- return;
- if (isLegend()) {
- setPkPoints(getPkPoints() + 15);
- } else if (Wilderness.isAtWild(this)) {
- setPkPoints(getPkPoints() + 10);
- } else {
- setPkPoints(getPkPoints() + 3);
- }
- killCount++;
- sendMessage("<shad=000000><col=ff0000>You have been awarded a pk point for killing; " + killed.getDisplayName()
- + ".");
- PkRank.checkRank(this);
- }
- // @SuppressWarnings("null")
- public void init(Session session, String string, IsaacKeyPair isaacKeyPair) {
- username = string;
- this.session = session;
- this.isaacKeyPair = isaacKeyPair;
- World.addLobbyPlayer(this);
- if (Settings.DEBUG) {
- Logger.log(this, new StringBuilder("Lobby Inited Player: ").append(string).append(", pass: ")
- .append(password).toString());
- }
- }
- public boolean isApeAtoll() {
- return (getX() >= 2693 && getX() <= 2821 && getY() >= 2693 && getY() <= 2817);
- }
- public boolean isCanPvp() {
- return canPvp;
- }
- public boolean isCantTrade() {
- return cantTrade;
- }
- public boolean isCastVeng() {
- return castedVeng;
- }
- public boolean isCompletedFightCaves() {
- return completedFightCaves;
- }
- public boolean isCompletedFightKiln() {
- return completedFightKiln;
- }
- public boolean isCompletedRfd() {
- return completedRfd;
- }
- public boolean isDfsActivated() {
- return dfsActivated;
- }
- public boolean isDonator() {
- return isExtremeDonator() || isLegendary() || isGold() || isSilver() || donator
- || donatorTill > Utils.currentTimeMillis();
- }
- public boolean isDicer() {
- return dicer;
- }
- public boolean isEquipDisabled() {
- return disableEquip;
- }
- public boolean wearingMasterCape(int id) {
- if (getEquipment().getCapeId() == id)
- return true;
- return false;
- }
- public boolean isExtremeDonator() {
- return isLegendary() || extremeDonator || extremeDonatorTill > Utils.currentTimeMillis();
- }
- public boolean isExtremePermDonator() {
- return extremeDonator;
- }
- public boolean isFilterGame() {
- return filterGame;
- }
- public boolean isForceNextMapLoadRefresh() {
- return forceNextMapLoadRefresh;
- }
- public boolean isForumModerator() {
- return isForumModerator;
- }
- public boolean isGotInfernoAdze() {
- return gotInfernoAdze;
- }
- public boolean isGraphicDesigner() {
- return isGraphicDesigner;
- }
- public boolean isHasCutEnoughLogs() {
- return hasCutEnoughLogs;
- }
- public boolean hasFinishedBarrows() {
- return hasFinishedBarrows;
- }
- public boolean isHasCutMoreEnoughLogs() {
- return hasCutMoreEnoughLogs;
- }
- public boolean isHidden() {
- // TODO Auto-generated method stub
- return true;
- }
- public boolean isHidingWorldMessages() {
- return hideWorldAnnouncements;
- }
- public boolean isInAnimationRoom() {
- return inAnimationRoom;
- }
- public boolean isInDefenderRoom() {
- return isInDefenderRoom;
- }
- public boolean isKalphiteLairEntranceSetted() {
- return khalphiteLairEntranceSetted;
- }
- public boolean isKalphiteLairSetted() {
- return khalphiteLairSetted;
- }
- public boolean isKilledAgrithNaNa() {
- return agrithNaNa;
- }
- public boolean isKilledBork() {
- return killedBork;
- }
- /**
- * RFD
- */
- public boolean isKilledCulinaromancer() {
- return culinaromancer;
- }
- public boolean isKilledDessourt() {
- return dessourt;
- }
- public boolean isKilledFlambeed() {
- return flamBeed;
- }
- public boolean isKilledKaramel() {
- return karamel;
- }
- /**
- * Gets the killedQueenBlackDragon.
- *
- * @return The killedQueenBlackDragon.
- */
- public boolean isKilledQueenBlackDragon() {
- return killedQueenBlackDragon;
- }
- public boolean isLocked() {
- return lockDelay >= Utils.currentTimeMillis();
- }
- public boolean isMacBanned() {
- return macBanned;
- }
- public boolean isOldItemsLook() {
- return oldItemsLook;
- }
- public boolean isPermBanned() {
- return permBanned;
- }
- public boolean isPermMuted() {
- return permMuted;
- }
- public boolean isResting() {
- return resting;
- }
- public boolean isRunning() {
- return running;
- }
- public boolean isSpawnsMode() {
- return spawnsMode;
- }
- public boolean isSupporter() {
- return isSupporter;
- }
- public boolean hasAccountPin;
- public boolean hasEnteredPin;
- public int accountpin;
- public int getAccountPin() {
- return accountpin;
- }
- /*
- * public boolean hasAccountPin() { return hasAccountPin; }
- */
- public void setAccountPin(int accountpin) {
- this.accountpin = accountpin;
- }
- public boolean isMod() {
- return getRights() == 1;
- }
- public boolean isTalkedWithMarv() {
- return talkedWithMarv;
- }
- public boolean isTalkedWithVannaka() {
- return talkedWithVannaka;
- }
- public boolean isUpdateMovementType() {
- return updateMovementType;
- }
- public boolean isUsingReportOption() {
- return reportOption;
- }
- public boolean isUsingZenRest() {
- // TODO Auto-generated method stub
- return zenRest;
- }
- public boolean isLegend() {
- return Legend;
- }
- public boolean isWonFightPits() {
- return wonFightPits;
- }
- public boolean isXpLocked() {
- return xpLocked;
- }
- public boolean isYellOff() {
- return yellOff;
- }
- public void kickPlayerFromFriendsChannel(String name) {
- if (currentFriendChat == null)
- return;
- currentFriendChat.kickPlayerFromChat(this, name);
- }
- @Override
- public void loadMapRegions() {
- boolean wasAtDynamicRegion = isAtDynamicRegion();
- super.loadMapRegions();
- clientLoadedMapRegion = false;
- if (isAtDynamicRegion()) {
- getPackets().sendDynamicMapRegion(!started);
- if (!wasAtDynamicRegion)
- localNPCUpdate.reset();
- } else {
- getPackets().sendMapRegion(!started);
- if (wasAtDynamicRegion)
- localNPCUpdate.reset();
- }
- forceNextMapLoadRefresh = false;
- }
- public void lock() {
- lockDelay = Long.MAX_VALUE;
- }
- public void lock(long time) {
- lockDelay = Utils.currentTimeMillis() + (time * 600);
- }
- /**
- * Logs the player out.
- *
- * @param lobby
- * If we're logging out to the lobby.
- */
- public void logout(boolean lobby) {
- if (!isRunning())
- return;
- long currentTime = Utils.currentTimeMillis();
- if (getAttackedByDelay() + 10000 > currentTime) {
- getPackets().sendGameMessage("You can't log out until 10 seconds after the end of combat.");
- return;
- }
- if (getEmotesManager().getNextEmoteEnd() >= currentTime) {
- sendMessage("You can't log out while performing an emote.");
- return;
- }
- if (lockDelay >= currentTime) {
- sendMessage("You can't log out while performing an action.");
- return;
- }
- GrinderList.remove(this);
- if (!isAdministrator()) {
- // new Thread(new Highscores(this)).start();
- // System.out.println("Saving " + getDisplayName() + " to highscores.");
- // new Thread(new KCHighscores(this)).start();
- // System.out.println("Saving " + getDisplayName() + " to killcount
- // highscores.");
- }
- getPackets().sendLogout(lobby && Settings.MANAGMENT_SERVER_ENABLED);
- setRunning(false);
- }
- public static int dayOfWeek() {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.DAY_OF_WEEK);
- }
- public static boolean isWeekend() {
- return dayOfWeek() == 1 ? true : dayOfWeek() == 6 ? true : dayOfWeek() == 7 ? true : false;
- }
- public int MutePoints;
- public boolean isAdministrator() {
- return getRights() == 2 || isOwner() || isForumsAdmin() || isHeadAdmin();
- }
- public int getMutePoints() {
- return MutePoints;
- }
- public void setMutePoints(int MutePoints) {
- this.MutePoints = MutePoints;
- }
- public boolean lootshareEnabled() {
- return lootshareEnabled;
- }
- @SuppressWarnings("deprecation")
- public void makeDonator(int months) {
- if (donatorTill < Utils.currentTimeMillis())
- donatorTill = Utils.currentTimeMillis();
- Date date = new Date(donatorTill);
- date.setMonth(date.getMonth() + months);
- donatorTill = date.getTime();
- }
- @Override
- public boolean needMasksUpdate() {
- return super.needMasksUpdate() || getTemporaryMovementType() != -1 || isUpdateMovementType();
- }
- public void ordinanceTimer() {
- CoresManager.fastExecutor.schedule(new TimerTask() {
- @Override
- public void run() {
- if (ordinanceTimer > 0)
- ordinanceTimer--;
- if (ordinanceTimer == 0) {
- getPackets().sendGameMessage("<col=FFCC00>You are able to take more items from the ordinance.");
- cancel();
- }
- }
- }, 0, 1);
- }
- public void performInstantSpecial(final int weaponId) {
- int specAmt = PlayerCombat.getSpecialAmmount(weaponId);
- if (combatDefinitions.hasRingOfVigour())
- specAmt *= 0.9;
- if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
- sendMessage("You don't have enough power left.");
- combatDefinitions.desecreaseSpecialAttack(0);
- return;
- }
- if (this.getSwitchItemCache().size() > 0) {
- ButtonHandler.submitSpecialRequest(this);
- return;
- }
- switch (weaponId) {
- case 4153:
- combatDefinitions.setInstantAttack(true);
- combatDefinitions.switchUsingSpecialAttack();
- Entity target = (Entity) getTemporaryAttributtes().get("last_target");
- if (target != null && target.getTemporaryAttributtes().get("last_attacker") == this) {
- if (!(getActionManager().getAction() instanceof PlayerCombat)
- || ((PlayerCombat) getActionManager().getAction()).getTarget() != target) {
- getActionManager().setAction(new PlayerCombat(target));
- }
- }
- gmaulSpecCheapFix(true);
- break;
- case 1377:
- case 13472:
- setNextAnimation(new Animation(1056));
- setNextGraphics(new Graphics(246));
- setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
- int defence = (int) (skills.getLevelForXp(Skills.DEFENCE) * 0.90D);
- int attack = (int) (skills.getLevelForXp(Skills.ATTACK) * 0.90D);
- int range = (int) (skills.getLevelForXp(Skills.RANGE) * 0.90D);
- int magic = (int) (skills.getLevelForXp(Skills.MAGIC) * 0.90D);
- int strength = (int) (skills.getLevelForXp(Skills.STRENGTH) * 1.2D);
- skills.set(Skills.DEFENCE, defence);
- skills.set(Skills.ATTACK, attack);
- skills.set(Skills.RANGE, range);
- skills.set(Skills.MAGIC, magic);
- skills.set(Skills.STRENGTH, strength);
- combatDefinitions.desecreaseSpecialAttack(specAmt);
- break;
- case 35:// Excalibur
- case 8280:
- case 14632:
- setNextAnimation(new Animation(1168));
- setNextGraphics(new Graphics(247));
- final boolean enhanced = weaponId == 14632;
- skills.set(Skills.DEFENCE, enhanced ? (int) (skills.getLevelForXp(Skills.DEFENCE) * 1.15D)
- : (skills.getLevel(Skills.DEFENCE) + 8));
- WorldTasksManager.schedule(new WorldTask() {
- int count = 5;
- @Override
- public void run() {
- if (isDead() || hasFinished() || getHitpoints() >= getMaxHitpoints()) {
- stop();
- return;
- }
- heal(enhanced ? 80 : 40);
- if (count-- == 0) {
- stop();
- return;
- }
- }
- }, 4, 2);
- combatDefinitions.desecreaseSpecialAttack(specAmt);
- break;
- case 15486:
- case 22207:
- case 22209:
- case 22211:
- case 22213:
- setNextAnimation(new Animation(12804));
- setNextGraphics(new Graphics(2319));// 2320
- setNextGraphics(new Graphics(2321));
- addPolDelay(60000);
- combatDefinitions.desecreaseSpecialAttack(specAmt);
- break;
- }
- }
- private boolean gmaulSpecCheapFix;
- public boolean getGmaulSpecCheapFix() {
- return gmaulSpecCheapFix;
- }
- public void gmaulSpecCheapFix(boolean b) {
- gmaulSpecCheapFix = b;
- }
- public void addItemEvent(Runnable addItemEvent) {
- this.addItemEvent = addItemEvent;
- }
- private transient Runnable addItemEvent;
- @Override
- public void processEntity() {
- processLogicPackets();
- cutscenesManager.process();
- if (coordsEvent != null && coordsEvent.processEvent(this))
- coordsEvent = null;
- if (routeEvent != null && routeEvent.processEvent(this))
- routeEvent = null;
- if (addItemEvent != null) {
- addItemEvent.run();
- addItemEvent = null;
- }
- super.processEntity();
- if (musicsManager.musicEnded())
- musicsManager.replayMusic();
- if (hasSkull()) {
- skullDelay--;
- if (!hasSkull())
- appearence.generateAppearenceData();
- }
- if (polDelay != 0 && polDelay <= Utils.currentTimeMillis()) {
- getPackets().sendGameMessage(
- "The power of the light fades. Your resistance to melee attacks return to normal.");
- polDelay = 0;
- }
- if (overloadDelay > 0) {
- if (overloadDelay == 1 || isDead()) {
- Pots.resetOverLoadEffect(this);
- return;
- } else if ((overloadDelay - 1) % 25 == 0)
- Pots.applyOverLoadEffect(this);
- overloadDelay--;
- }
- if (prayerRenewalDelay > 0) {
- if (prayerRenewalDelay == 1 || isDead()) {
- sendMessage("<col=0000FF>Your prayer renewal has ended.");
- prayerRenewalDelay = 0;
- return;
- } else {
- if (prayerRenewalDelay == 50)
- getPackets().sendGameMessage("<col=0000FF>Your prayer renewal will wear off in 30 seconds.");
- if (!prayer.hasFullPrayerpoints()) {
- getPrayer().restorePrayer(1);
- if ((prayerRenewalDelay - 1) % 25 == 0)
- setNextGraphics(new Graphics(1295));
- }
- }
- prayerRenewalDelay--;
- }
- if (dfscoolDown > 0) {
- dfscoolDown--;
- }
- if (specRestoreTimer > 0) {
- specRestoreTimer--;
- }
- if (lastBonfire > 0) {
- lastBonfire--;
- if (lastBonfire == 500)
- getPackets().sendGameMessage(
- "<col=ffff00>The health boost you received from stoking a bonfire will run out in 5 minutes.");
- else if (lastBonfire == 0) {
- getPackets().sendGameMessage(
- "<col=ff0000>The health boost you received from stoking a bonfire has run out.");
- equipment.refreshConfigs(false);
- }
- }
- charges.process();
- auraManager.process();
- actionManager.process();
- prayer.processPrayer();
- controlerManager.process();
- }
- public void processLogicPackets() {
- LogicPacket packet;
- while ((packet = logicPackets.poll()) != null)
- WorldPacketsDecoder.decodeLogicPacket(this, packet);
- }
- @Override
- public void processReceivedHits() {
- if (lockDelay > Utils.currentTimeMillis())
- return;
- super.processReceivedHits();
- }
- public void realFinish() {
- if (hasFinished())
- return;
- if (!World.containsLobbyPlayer(username)) {
- stopAll();
- cutscenesManager.logout();
- // controlerManager.logout();
- }
- /* ITEM LEDNING */
- Lend lend = LendingManager.getLend(this);
- Lend hasLendedOut = LendingManager.getHasLendedItemsOut(this);
- if (lend != null) {
- if (isUntillLogout()) {
- LendingManager.unLend(lend);
- }
- }
- if (hasLendedOut != null) {
- if (isUntillLogout()) {
- LendingManager.unLend(hasLendedOut);
- }
- }
- /* END OF ITEM LEDNING */
- setRunning(false);
- if (!World.containsLobbyPlayer(username)) {
- friendsIgnores.sendFriendsMyStatus(false);
- }
- if (currentFriendChat != null) {
- currentFriendChat.leaveChat(this, true);
- }
- if (getDwarfCannon().hasCannon())
- getDwarfCannon().pickUpDwarfCannon(0, getDwarfCannon().getObject());
- if (clanManager != null)
- clanManager.disconnect(this, false);
- if (guestClanManager != null)
- guestClanManager.disconnect(this, true);
- if (getSlayerManager() != null)
- getSlayerManager().removePartner(true);
- if (familiar != null && !familiar.isFinished()) {
- familiar.dissmissFamiliar(true);
- } else if (pet != null) {
- pet.finish();
- }
- setFinished(true);
- session.setDecoder(-1);
- this.lastLoggedIn = System.currentTimeMillis();
- SerializableFilesManager.savePlayer(this);
- if (!World.isUpdating())
- GrinderList.remove(this);
- if (World.containsLobbyPlayer(username)) {
- World.removeLobbyPlayer(this);
- }
- World.updateEntityRegion(this);
- if (World.containsPlayer(username)) {
- World.removePlayer(this);
- }
- if (Settings.DEBUG) {
- Logger.log(this, "Finished Player: " + username + ", pass: " + password);
- }
- }
- public void refreshAllowChatEffects() {
- getPackets().sendConfig(171, allowChatEffects ? 0 : 1);
- }
- private void refreshFightKilnEntrance() {
- if (completedFightCaves)
- getPackets().sendConfigByFile(10838, 1);
- }
- public void refreshHitPoints() {
- getPackets().sendConfigByFile(7198, getHitpoints());
- }
- private void refreshKalphiteLair() {
- if (khalphiteLairSetted)
- getPackets().sendConfigByFile(7263, 1);
- }
- private void refreshKalphiteLairEntrance() {
- if (khalphiteLairEntranceSetted)
- getPackets().sendConfigByFile(7262, 1);
- }
- public boolean lumby, draynor, port, alkarid, varrock, falador, burth, tav, adrougne, cath, seers, yanille, edge;
- public void refreshLodestoneNetwork() {
- getPackets().sendConfigByFile(358, 15); // unlocks bandit camp lodestone
- getPackets().sendConfigByFile(2448, 190); // unlocks lunar isle
- // lodestone
- getPackets().sendConfigByFile(10907, 1); // unlocks lumbridge lodestone
- // unlocks alkarid lodestone
- if (alkarid == true) {
- getPackets().sendConfigByFile(10900, 1);
- }
- // unlocks ardougne lodestone
- if (adrougne == true) {
- getPackets().sendConfigByFile(10901, 1);
- }
- // unlocks burthorpe lodestone
- if (burth == true) {
- getPackets().sendConfigByFile(10902, 1);
- }
- // unlocks catherbay lodestone
- if (cath == true) {
- getPackets().sendConfigByFile(10903, 1);
- }
- // unlocks draynor lodestone
- if (draynor == true) {
- getPackets().sendConfigByFile(10904, 1);
- }
- // unlocks edgeville lodestone
- if (edge == true) {
- getPackets().sendConfigByFile(10905, 1);
- }
- // unlocks falador lodestone
- if (falador == true) {
- getPackets().sendConfigByFile(10906, 1);
- }
- // unlocks port sarim lodestone
- if (port == true) {
- getPackets().sendConfigByFile(10908, 1);
- }
- // unlocks seers village lodestone
- if (seers == true) {
- getPackets().sendConfigByFile(10909, 1);
- }
- // unlocks taverley lodestone
- if (tav == true) {
- getPackets().sendConfigByFile(10910, 1);
- }
- // unlocks varrock lodestone
- if (varrock == true) {
- getPackets().sendConfigByFile(10911, 1);
- }
- // unlocks yanille lodestone
- if (yanille == true) {
- getPackets().sendConfigByFile(10912, 1);
- }
- }
- /*private void refreshLodestoneNetworkClosed() {
- // unlocks bandit camp lodestone
- getPackets().sendConfigByFile(359, 15); // Nomal Lodestone = 358, 15
- // unlocks lunar isle lodestone
- getPackets().sendConfigByFile(2449, 190); // Nomal Lodestone = 2448 190
- // unlocks alkarid lodestone
- getPackets().sendConfigByFile(10924, 1); // Nomal Lodestone = 10900
- // unlocks ardougne lodestone
- getPackets().sendConfigByFile(10923, 1); // Nomal Lodestone = 10901
- // unlocks burthorpe lodestone
- getPackets().sendConfigByFile(10922, 1); // Nomal Lodestone = 10902
- // unlocks catherbay lodestone
- getPackets().sendConfigByFile(10921, 1); // Nomal Lodestone = 10903
- // unlocks draynor lodestone
- getPackets().sendConfigByFile(10920, 1); // Nomal Lodestone = 10904
- // unlocks edgeville lodestone
- getPackets().sendConfigByFile(10910, 1); // Nomal Lodestone = 10905
- // unlocks falador lodestone
- getPackets().sendConfigByFile(10919, 1); // Nomal Lodestone = 10906
- // unlocks lumbridge lodestone
- getPackets().sendConfigByFile(10907, 1); // Normal Lodestone = 10907
- // unlocks port sarim lodestone
- getPackets().sendConfigByFile(10917, 1); // Normal Lodestone = 10908
- // unlocks seers village lodestone
- getPackets().sendConfigByFile(10916, 1); //// Normal Lodestone = 10909
- // unlocks taverley lodestone
- getPackets().sendConfigByFile(10915, 1); // Normal Lodestone = 10910
- // unlocks varrock lodestone
- getPackets().sendConfigByFile(10914, 1); // Normal Lodestone = 10911
- // unlocks yanille lodestone
- getPackets().sendConfigByFile(10913, 1); // Normal Lodestone = 10912
- }
- */
- public void refreshMoneyPouch() {
- getPackets().sendRunScript(5560, getMoneyPouch().getTotal());
- }
- public void refreshMouseButtons() {
- getPackets().sendConfig(170, mouseButtons ? 0 : 1);
- }
- private transient ClansManager clanManager, guestClanManager;
- public ClansManager getClanManager() {
- return clanManager;
- }
- public void setClanManager(ClansManager clanManager) {
- this.clanManager = clanManager;
- }
- private String clanName;
- private int clanChatSetup;
- public int getClanChatSetup() {
- return clanChatSetup;
- }
- public void setClanChatSetup(int clanChatSetup) {
- this.clanChatSetup = clanChatSetup;
- }
- private int guestChatSetup;
- public void refreshOtherChatsSetup() {
- int value = friendChatSetup << 6;
- getPackets().sendConfig(1438, value);
- getPackets().sendConfigByFile(3612, clanChatSetup);
- getPackets().sendConfigByFile(9191, guestChatSetup);
- }
- public void kickPlayerFromClanChannel(String name) {
- if (clanManager == null)
- return;
- clanManager.kickPlayerFromChat(this, name);
- }
- public void sendClanChannelMessage(ChatMessage message) {
- if (clanManager == null)
- return;
- clanManager.sendMessage(this, message);
- }
- public void sendClanChannelQuickMessage(QuickChatMessage message) {
- if (clanManager == null)
- return;
- clanManager.sendQuickMessage(this, message);
- }
- public void sendGuestClanChannelMessage(ChatMessage message) {
- if (guestClanManager == null)
- return;
- guestClanManager.sendMessage(this, message);
- }
- public void sendGuestClanChannelQuickMessage(QuickChatMessage message) {
- if (guestClanManager == null)
- return;
- guestClanManager.sendQuickMessage(this, message);
- }
- private boolean connectedClanChannel;
- public int ganodermicFlakes;
- public void refreshPrivateChatSetup() {
- getPackets().sendConfig(287, privateChatSetup);
- }
- public void refreshSpawnedItems() {
- for (int regionId : getMapRegionsIds()) {
- List<FloorItem> floorItems = World.getRegion(regionId).getFloorItems();
- if (floorItems == null)
- continue;
- for (FloorItem item : floorItems) {
- if ((item.isInvisible() || !this.getDisplayName().equalsIgnoreCase(item.getOwner())
- || item.getTile().getPlane() != getPlane()))
- continue;
- getPackets().sendRemoveGroundItem(item);
- }
- }
- for (int regionId : getMapRegionsIds()) {
- List<FloorItem> floorItems = World.getRegion(regionId).getFloorItems();
- if (floorItems == null)
- continue;
- for (FloorItem item : floorItems) {
- if ((item.isInvisible() || !this.getDisplayName().equalsIgnoreCase(item.getOwner())
- || item.getTile().getPlane() != getPlane()))
- continue;
- getPackets().sendGroundItem(item);
- }
- }
- }
- public void refreshSpawnedObjects() {
- for (int regionId : getMapRegionsIds()) {
- List<WorldObject> spawnedObjects = World.getRegion(regionId).getSpawnedObjects();
- if (spawnedObjects != null) {
- for (WorldObject object : spawnedObjects)
- if (object.getPlane() == getPlane())
- getPackets().sendSpawnedObject(object);
- }
- List<WorldObject> removedObjects = World.getRegion(regionId).getRemovedObjects();
- if (removedObjects != null) {
- for (WorldObject object : removedObjects)
- if (object.getPlane() == getPlane())
- getPackets().sendDestroyObject(object);
- }
- }
- }
- @Override
- public void removeHitpoints(Hit hit) {
- super.removeHitpoints(hit);
- refreshHitPoints();
- }
- public void removeSkull() {
- skullDelay = -1;
- appearence.generateAppearenceData();
- }
- @Override
- public void reset() {
- reset(true);
- }
- @Override
- public void reset(boolean attributes) {
- super.reset(attributes);
- refreshHitPoints();
- hintIconsManager.removeAll();
- skills.restoreSkills();
- combatDefinitions.resetSpecialAttack();
- prayer.reset();
- combatDefinitions.resetSpells(true);
- resting = false;
- lastBonfire = 0;
- equipment.refreshConfigs(false);
- skullDelay = 0;
- foodDelay = 0;
- potDelay = 0;
- poisonImmune = 0;
- fireImmune = 0;
- castedVeng = false;
- setDfsActivated(false);
- dfscoolDown = 0;
- getEquipment().refreshConfigs(false);
- if (getOverloadDelay() > 0)
- Pots.resetOverLoadEffect(this);
- setRunEnergy(100);
- removeDamage(this);
- appearence.generateAppearenceData();
- if (getFamiliar() != null) {
- familiar.sendDeath(this);
- return;
- }
- }
- public void resetBarrows() {
- hiddenBrother = -1;
- killedBarrowBrothers = new boolean[7]; // includes new bro for future
- // use
- barrowsKillCount = 0;
- }
- @Override
- public void resetMasks() {
- super.resetMasks();
- setTemporaryMovementType(-1);
- setUpdateMovementType(false);
- if (!clientHasLoadedMapRegion()) {
- // load objects and items here
- setClientHasLoadedMapRegion();
- refreshSpawnedObjects();
- refreshSpawnedItems();
- }
- }
- @Override
- public boolean restoreHitPoints() {
- boolean update = super.restoreHitPoints();
- if (update) {
- if (prayer.usingPrayer(0, 9))
- super.restoreHitPoints();
- if (resting)
- super.restoreHitPoints();
- refreshHitPoints();
- }
- return update;
- }
- public void restoreRunEnergy() {
- if (getNextRunDirection() == -1 && runEnergy < 100) {
- runEnergy++;
- if (resting && runEnergy < 100)
- runEnergy++;
- getPackets().sendRunEnergy();
- }
- }
- /*
- * public void run() { if (getRights() == 2) for (Player players:
- * World.getPlayers()) { if (players == null) continue;
- * players.getPackets().
- * sendGameMessage("<col=0000FF><img=1> An Administrator has just logged on!<img=1>"
- * ); } }
- */
- @Override
- public void sendDeath(final Entity source) {
- if (prayer.hasPrayersOn() && getTemporaryAttributtes().get("startedDuel") != Boolean.TRUE) {
- if (prayer.usingPrayer(0, 22)) {
- setNextGraphics(new Graphics(437));
- final Player target = this;
- if (isAtMultiArea()) {
- for (int regionId : getMapRegionsIds()) {
- List<Integer> playersIndexes = World.getRegion(regionId).getPlayerIndexes();
- if (playersIndexes != null) {
- for (int playerIndex : playersIndexes) {
- Player player = World.getPlayers().get(playerIndex);
- if (player == null || !player.hasStarted() || player.isDead() || player.hasFinished()
- || !player.withinDistance(this, 1) || !player.isCanPvp()
- || !target.getControlerManager().canHit(player))
- continue;
- player.applyHit(new Hit(target,
- Utils.getRandom((int) (skills.getLevelForXp(Skills.PRAYER) * 2.5)),
- HitLook.REGULAR_DAMAGE));
- }
- }
- List<Integer> npcsIndexes = World.getRegion(regionId).getNPCsIndexes();
- if (npcsIndexes != null) {
- for (int npcIndex : npcsIndexes) {
- NPC npc = World.getNPCs().get(npcIndex);
- if (npc == null || npc.isDead() || npc.hasFinished() || !npc.withinDistance(this, 1)
- || !npc.getDefinitions().hasAttackOption()
- || !target.getControlerManager().canHit(npc))
- continue;
- npc.applyHit(new Hit(target,
- Utils.getRandom((int) (skills.getLevelForXp(Skills.PRAYER) * 2.5)),
- HitLook.REGULAR_DAMAGE));
- }
- }
- }
- } else {
- if (source != null && source != this && !source.isDead() && !source.hasFinished()
- && source.withinDistance(this, 1))
- source.applyHit(
- new Hit(target, Utils.getRandom((int) (skills.getLevelForXp(Skills.PRAYER) * 2.5)),
- HitLook.REGULAR_DAMAGE));
- }
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() - 1, target.getY(), target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() + 1, target.getY(), target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX(), target.getY() - 1, target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX(), target.getY() + 1, target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() - 1, target.getY() - 1, target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() - 1, target.getY() + 1, target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() + 1, target.getY() - 1, target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() + 1, target.getY() + 1, target.getPlane()));
- }
- });
- } else if (prayer.usingPrayer(1, 17)) {
- World.sendProjectile(this, new WorldTile(getX() + 2, getY() + 2, getPlane()), 2260, 24, 0, 41, 35, 30,
- 0);
- World.sendProjectile(this, new WorldTile(getX() + 2, getY(), getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX() + 2, getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30,
- 0);
- World.sendProjectile(this, new WorldTile(getX() - 2, getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30,
- 0);
- World.sendProjectile(this, new WorldTile(getX() - 2, getY(), getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX() - 2, getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30,
- 0);
- World.sendProjectile(this, new WorldTile(getX(), getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX(), getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- final Player target = this;
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2259));
- if (isAtMultiArea()) {
- for (int regionId : getMapRegionsIds()) {
- List<Integer> playersIndexes = World.getRegion(regionId).getPlayerIndexes();
- if (playersIndexes != null) {
- for (int playerIndex : playersIndexes) {
- Player player = World.getPlayers().get(playerIndex);
- if (player == null || !player.hasStarted() || player.isDead()
- || player.hasFinished() || !player.isCanPvp()
- || !player.withinDistance(target, 2)
- || !target.getControlerManager().canHit(player))
- continue;
- player.applyHit(new Hit(target,
- Utils.getRandom((skills.getLevelForXp(Skills.PRAYER) * 3)),
- HitLook.REGULAR_DAMAGE));
- }
- }
- List<Integer> npcsIndexes = World.getRegion(regionId).getNPCsIndexes();
- if (npcsIndexes != null) {
- for (int npcIndex : npcsIndexes) {
- NPC npc = World.getNPCs().get(npcIndex);
- if (npc == null || npc.isDead() || npc.hasFinished()
- || !npc.withinDistance(target, 2)
- || !npc.getDefinitions().hasAttackOption()
- || !target.getControlerManager().canHit(npc))
- continue;
- npc.applyHit(new Hit(target,
- Utils.getRandom((skills.getLevelForXp(Skills.PRAYER) * 3)),
- HitLook.REGULAR_DAMAGE));
- }
- }
- }
- } else {
- if (source != null && source != target && !source.isDead() && !source.hasFinished()
- && source.withinDistance(target, 2))
- source.applyHit(
- new Hit(target, Utils.getRandom((skills.getLevelForXp(Skills.PRAYER) * 3)),
- HitLook.REGULAR_DAMAGE));
- }
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 2, getY() + 2, getPlane()));
- World.sendGraphics(target, new Graphics(2260), new WorldTile(getX() + 2, getY(), getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 2, getY() - 2, getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 2, getY() + 2, getPlane()));
- World.sendGraphics(target, new Graphics(2260), new WorldTile(getX() - 2, getY(), getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 2, getY() - 2, getPlane()));
- World.sendGraphics(target, new Graphics(2260), new WorldTile(getX(), getY() + 2, getPlane()));
- World.sendGraphics(target, new Graphics(2260), new WorldTile(getX(), getY() - 2, getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 1, getY() + 1, getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 1, getY() - 1, getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 1, getY() + 1, getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 1, getY() - 1, getPlane()));
- }
- });
- }
- }
- setNextAnimation(new Animation(-1));
- if (!controlerManager.sendDeath())
- return;
- lock();
- stopAll();
- if (familiar != null)
- familiar.sendDeath(this);
- WorldTasksManager.schedule(new WorldTask() {
- int loop;
- @Override
- public void run() {
- if (loop == 0) {
- setNextAnimation(new Animation(836));
- } else if (loop == 1) {
- sendMessage("Oh dear, you have died.");
- if (source instanceof Player) {
- Player killer = (Player) source;
- killer.setAttackedByDelay(4);
- }
- } else if (loop == 3) {
- lock();
- reset();
- setNextWorldTile(new WorldTile(Settings.RESPAWN_PLAYER_LOCATION));
- setNextAnimation(new Animation(-1));
- unlock();
- } else if (loop == 4) {
- getPackets().sendMusicEffect(90);
- stop();
- }
- loop++;
- }
- }, 0, 1);
- }
- public void sendDefaultPlayersOptions() {
- getPackets().sendPlayerOption("Follow", 2, false);
- getPackets().sendPlayerOption("Trade with", 4, false);
- getPackets().sendPlayerOption("View stats", 5, false);
- /*
- * if (getRights() == 1 || getRights() == 2) {
- * getPackets().sendPlayerOption("<col=FF0000>Mod Panel</col>", 6,
- * false); }
- */
- getPackets().sendPlayerOption("Challenge", 6, false);
- }
- public void sendFriendsChannelMessage(ChatMessage message) {
- if (currentFriendChat == null)
- return;
- currentFriendChat.sendMessage(this, message);
- }
- public void sendFriendsChannelQuickMessage(QuickChatMessage message) {
- if (currentFriendChat == null)
- return;
- currentFriendChat.sendQuickMessage(this, message);
- }
- /*
- * public boolean hasAccountPin; public boolean hasEnteredPin; public int
- * accountpin;
- *
- * public int getAccountPin() { return accountpin; }
- *
- * public void setAccountPin(int accountpin) { this.accountpin = accountpin;
- * }
- */
- public void sendItemsOnDeath(Player killer, int wildernessTimer) {
- int total = 0;
- int reqTotal = 300;
- for (int i = 0; i < 25; i++) {
- total += getSkills().getLevel(i);
- }
- if (total < reqTotal) {
- return;
- }
- if (total < reqTotal) {
- return;
- }
- if (getUsername().equalsIgnoreCase(" "))
- return;
- /*
- * if (Commands.isAllowedToSpawn(this)) return;
- */
- if (killer == null) {
- // System.out.println("Killer was null for " + getUsername());
- return;
- }
- // charges.die();
- auraManager.removeAura();
- CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
- for (int i = 0; i < 14; i++) {
- if (equipment.getItem(i) != null && equipment.getItem(i).getId() != -1
- && equipment.getItem(i).getAmount() != -1)
- containedItems.add(new Item(equipment.getItem(i).getId(), equipment.getItem(i).getAmount()));
- }
- for (int i = 0; i < 28; i++) {
- if (inventory.getItem(i) != null && inventory.getItem(i).getId() != -1
- && inventory.getItem(i).getAmount() != -1)
- containedItems.add(new Item(getInventory().getItem(i).getId(), getInventory().getItem(i).getAmount()));
- }
- if (containedItems.isEmpty())
- return;
- int keptAmount = 0;
- if (!(controlerManager.getControler() instanceof CorpBeastControler)) {
- keptAmount = hasSkull() ? 0 : 3;
- if (prayer.usingPrayer(0, 10) || prayer.usingPrayer(1, 0))
- keptAmount++;
- }
- CopyOnWriteArrayList<Item> keptItems = new CopyOnWriteArrayList<Item>();
- Item lastItem = new Item(1, 1);
- for (int i = 0; i < keptAmount; i++) {
- for (Item item : containedItems) {
- int price = Prices.getDeathPrice(item);
- if (price >= lastItem.getDefinitions().getValue()) {
- lastItem = item;
- }
- }
- keptItems.add(lastItem);
- containedItems.remove(lastItem);
- lastItem = new Item(1, 1);
- }
- // LENDED ITEMS ON DEATH WILL NOT BE REMOVED
- for (Item item : containedItems) {
- if (item.getDefinitions().isLended()) {
- keptItems.add(item);
- containedItems.remove(item);
- }
- }
- inventory.reset();
- equipment.reset();
- for (Item item : keptItems) {
- getInventory().addItem(item);
- }
- for (Item item : containedItems) {
- charges.death(item);
- // charges.dust(item);
- }
- for (Item item : containedItems) {
- if (!ItemConstants.isTradeable(item)) {
- if (isDonator()) {
- // charges.dust(item);
- containedItems.remove(item);
- getInventory().addItem(item);
- } else if (!isDonator()) {
- containedItems.remove(item);
- World.addGroundItem(item, getLastWorldTile(), this, false, 180, true, false);
- continue;
- }
- }
- }
- LoggingSystem.logDeath(this, killer, containedItems);
- DbLogs.logDeath(this, killer, containedItems);
- for (Item item : containedItems) {
- World.addGroundItem(item, getLastWorldTile(), killer, false, 180, true, false);
- }
- SerializableFilesManager.savePlayer(this);
- }
- public boolean isUntillLogout() {
- return untillLogout;
- }
- public void setUntillLogout(boolean untillLogout) {
- this.untillLogout = untillLogout;
- }
- public void sendLobbyConfigs(Player player) {
- for (int i = 0; i < Utils.DEFAULT_LOBBY_CONFIGS.length; i++) {
- int val = Utils.DEFAULT_LOBBY_CONFIGS[i];
- if (val != 0) {
- player.getPackets().sendConfig(i, val);
- }
- }
- }
- public void sendMessage(String message) {
- getPackets().sendGameMessage(message);
- }
- public void sendPublicChatMessage(PublicChatMessage message) {
- for (int regionId : getMapRegionsIds()) {
- List<Integer> playersIndexes = World.getRegion(regionId).getPlayerIndexes();
- if (playersIndexes == null)
- continue;
- for (Integer playerIndex : playersIndexes) {
- Player p = World.getPlayers().get(playerIndex);
- if (p == null || !p.hasStarted() || p.hasFinished()
- || p.getLocalPlayerUpdate().getLocalPlayers()[getIndex()] == null)
- continue;
- p.getPackets().sendPublicMessage(this, message);
- }
- }
- }
- public void sendRandomJail(Player p) {
- p.resetWalkSteps();
- switch (Utils.getRandom(2)) {
- case 0:
- p.setNextWorldTile(new WorldTile(2931, 9698, 0));
- break;
- case 1:
- p.setNextWorldTile(new WorldTile(2931, 9687, 0));
- break;
- case 2:
- p.setNextWorldTile(new WorldTile(2933, 9703, 0));
- break;
- }
- }
- public void sendRunButtonConfig() {
- getPackets().sendConfig(173, resting ? 3 : getRun() ? 1 : 0);
- }
- public void sendSoulSplit(final Hit hit, final Entity user) {
- final Player target = this;
- if (hit.getDamage() > 0)
- World.sendProjectile(user, this, 2263, 11, 11, 20, 5, 0, 0);
- user.heal(hit.getDamage() / 5);
- prayer.drainPrayer(hit.getDamage() / 5);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2264));
- if (hit.getDamage() > 0)
- World.sendProjectile(target, user, 2263, 11, 11, 20, 5, 0, 0);
- }
- }, 0);
- }
- public void sendUnlockedObjectConfigs() {
- refreshKalphiteLairEntrance();
- refreshKalphiteLair();
- refreshLodestoneNetwork();
- refreshFightKilnEntrance();
- }
- public void setAssistStatus(int assistStatus) {
- this.assistStatus = assistStatus;
- }
- public void setBankPin(String bankPinString) {
- }
- public void setBanned(long banned) {
- this.banned = banned;
- }
- public void setBarbarianAdvancedLaps(int barbarianAdvancedLaps) {
- this.barbarianAdvancedLaps = barbarianAdvancedLaps;
- }
- public int setBarrowsKillCount(int barrowsKillCount) {
- return this.barrowsKillCount = barrowsKillCount;
- }
- public void setBarsDone(int barsDone) {
- this.barsDone = barsDone;
- }
- public void setCanPvp(boolean canPvp) {
- this.canPvp = canPvp;
- appearence.generateAppearenceData();
- getPackets().sendPlayerOption(canPvp ? "Attack" : "null", 1, true);
- getPackets().sendPlayerUnderNPCPriority(canPvp);
- }
- public void setCantTrade(boolean canTrade) {
- this.cantTrade = canTrade;
- }
- public void setCastVeng(boolean castVeng) {
- this.castedVeng = castVeng;
- }
- public void setClanStatus(int clanStatus) {
- this.clanStatus = clanStatus;
- }
- public void setClientHasLoadedMapRegion() {
- clientLoadedMapRegion = true;
- }
- public void setClientHasntLoadedMapRegion() {
- clientLoadedMapRegion = false;
- }
- public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
- this.closeInterfacesEvent = closeInterfacesEvent;
- }
- public void setClueReward(int clueReward) {
- this.clueReward = clueReward;
- }
- public void setCompletedFightCaves() {
- if (!completedFightCaves) {
- completedFightCaves = true;
- refreshFightKilnEntrance();
- }
- }
- public void setCompletedFightKiln() {
- completedFightKiln = true;
- }
- public void setCompletedRfd() {
- completedRfd = true;
- }
- public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
- this.completionistCapeCustomized = skillcapeCustomized;
- }
- /*
- * public void setCoordsEvent(CoordsEvent coordsEvent) { this.coordsEvent =
- * coordsEvent; }
- */
- public void setCreationDate(long creationDate) {
- this.creationDate = creationDate;
- }
- public void setCurrentFriendChat(FriendChatsManager currentFriendChat) {
- this.currentFriendChat = currentFriendChat;
- }
- public void setCurrentFriendChatOwner(String currentFriendChatOwner) {
- this.currentFriendChatOwner = currentFriendChatOwner;
- }
- public void setCurrentMac(String currentMac) {
- this.currentMac = currentMac;
- }
- public void setCurrentWorldLobby(int currentWorldLobby) {
- this.currentWorldLobby = currentWorldLobby;
- }
- public void setCustomTitle(String customTitle) {
- this.customTitle = customTitle;
- }
- public int setDeathCount(int deathCount) {
- return this.deathCount = deathCount;
- }
- public void setDefenderRoom(boolean isInDefenderRoom) {
- this.isInDefenderRoom = isInDefenderRoom;
- }
- public void setDfsActivated(boolean dfsActivated) {
- this.dfsActivated = dfsActivated;
- }
- public void setdfscoolDown(int dfscoolDown) {
- this.dfscoolDown = dfscoolDown;
- }
- public void setDisableEquip(boolean equip) {
- disableEquip = equip;
- }
- public void setDisplayMode(int displayMode) {
- this.displayMode = displayMode;
- }
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
- public void setDominionFactor(int dominionFactor) {
- this.dominionFactor = dominionFactor;
- }
- public void setDonator(boolean donator) {
- this.donator = donator;
- }
- public void setDicer(boolean dicer) {
- this.dicer = dicer;
- }
- public void setEasterPoints(int easterPoints) {
- this.easterPoints = easterPoints;
- }
- public void setEmailAttached(String email) {
- this.email = email;
- }
- public void setEnteredBankPin(String enteredPinString) {
- this.enteredPinString = enteredPinString;
- }
- public void setExtremeDonator(boolean extremeDonator) {
- this.extremeDonator = extremeDonator;
- }
- public void setFamiliar(Familiar familiar) {
- this.familiar = familiar;
- }
- public void setFightPitsSkull() {
- skullDelay = Integer.MAX_VALUE;
- skullId = 1;
- appearence.generateAppearenceData();
- }
- public void setFilterGame(boolean filterGame) {
- this.filterGame = filterGame;
- }
- public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
- this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
- }
- public void setForumModerator(boolean isForumModerator) {
- this.isForumModerator = isForumModerator;
- }
- public void setFriendChatSetup(int friendChatSetup) {
- this.friendChatSetup = friendChatSetup;
- }
- public void setGnomeAdvancedLaps(int gnomeAdvancedLaps) {
- this.gnomeAdvancedLaps = gnomeAdvancedLaps;
- }
- public void setGotInfernoAdze(boolean gotInfernoAdze) {
- this.gotInfernoAdze = gotInfernoAdze;
- }
- public void setGraphicDesigner(boolean isGraphicDesigner) {
- this.isGraphicDesigner = isGraphicDesigner;
- }
- public void setHasCutEnoughLogs(boolean hasCutEnoughLogs) {
- this.hasCutEnoughLogs = hasCutEnoughLogs;
- }
- private boolean hadEnoughVotes;
- public boolean hadEnoughVotes() {
- return hadEnoughVotes;
- }
- public void setHadEnoughVotes(boolean hadEnoughVotes) {
- this.hadEnoughVotes = hadEnoughVotes;
- }
- public void setHasFinishedBarrows(boolean hasFinishedBarrows) {
- this.hasFinishedBarrows = hasFinishedBarrows;
- }
- public void setHasCutMoreEnoughLogs(boolean hasCutMoreEnoughLogs) {
- this.hasCutMoreEnoughLogs = hasCutMoreEnoughLogs;
- }
- public void setHiddenBrother(int hiddenBrother) {
- this.hiddenBrother = hiddenBrother;
- }
- public void setHideSofInterface(boolean hideSofInterface) {
- // TODO Auto-generated method stub
- this.hideSofInterface = hideSofInterface;
- }
- public void setHideWorldMessages(boolean hideWorldAnnouncements) {
- this.hideWorldAnnouncements = hideWorldAnnouncements;
- }
- public void setHpBoostMultiplier(double hpBoostMultiplier) {
- this.hpBoostMultiplier = hpBoostMultiplier;
- }
- public void setInAnimationRoom(boolean inAnimationRoom) {
- this.inAnimationRoom = inAnimationRoom;
- }
- public void setInvulnerable(boolean invulnerable) {
- this.invulnerable = invulnerable;
- }
- public void setIsInLobby(boolean isInLobby) {
- this.isInLobby = isInLobby;
- }
- public void setJailed(long jailed) {
- this.jailed = jailed;
- }
- public void setCoolDown(long cooldown) {
- this.cooldown = cooldown;
- }
- public void setWorldXp(long WorldXp) {
- this.WorldXp = WorldXp;
- }
- public void setKalphiteLair() {
- khalphiteLairSetted = true;
- refreshKalphiteLair();
- }
- public void setKalphiteLairEntrance() {
- khalphiteLairEntranceSetted = true;
- refreshKalphiteLairEntrance();
- }
- public int setKillCount(int killCount) {
- return this.killCount = killCount;
- }
- public void setKilledAgrithNaNa(boolean agrithNaNa) {
- this.agrithNaNa = agrithNaNa;
- }
- public void setKilledBork(boolean killedBork) {
- this.killedBork = killedBork;
- }
- public void setKilledCulinaromancer(boolean culinaromancer) {
- this.culinaromancer = culinaromancer;
- }
- public void setKilledDessourt(boolean dessourt) {
- this.dessourt = dessourt;
- }
- public void setKilledFlamBeed(boolean flamBeed) {
- this.flamBeed = flamBeed;
- }
- public void setKilledKaramel(boolean karamel) {
- this.karamel = karamel;
- }
- /**
- * Sets the killedQueenBlackDragon.
- *
- * @param killedQueenBlackDragon
- * The killedQueenBlackDragon to set.
- */
- public void setKilledQueenBlackDragon(boolean killedQueenBlackDragon) {
- this.killedQueenBlackDragon = killedQueenBlackDragon;
- }
- public void setLargeSceneView(boolean largeSceneView) {
- this.largeSceneView = largeSceneView;
- }
- public void setLastBonfire(int lastBonfire) {
- this.lastBonfire = lastBonfire;
- }
- public void setLastDuelRules(DuelRules duelRules) {
- this.lastDuelRules = duelRules;
- }
- public void setLastIP(String lastIP) {
- this.lastIP = lastIP;
- }
- public void setLastMsg(String lastMsg) {
- this.lastMsg = lastMsg;
- }
- public void setLastPublicMessage(long lastPublicMessage) {
- this.lastPublicMessage = lastPublicMessage;
- }
- public void setLastRequestSQL(long lastRequestSQL) {
- // TODO Auto-generated method stub
- this.lastRequestSQL = lastRequestSQL;
- }
- public void setLastUsedGodwarsAltar(long l) {
- // TODO Auto-generated method stub
- }
- public void setLastWalked(long lastWalkedMillis) {
- // TODO Auto-generated method stub
- this.lastWalkedMillis = lastWalkedMillis;
- }
- public void setLoadedLogs(int loadedLogs) {
- this.loadedLogs = loadedLogs;
- }
- public void setLoggedInWorld(int loggedWorld) {
- this.loggedWorld = loggedWorld;
- }
- public void setLogsCut(int logsCut) {
- this.logsCut = logsCut;
- }
- public void setLoyaltyPoints(int Loyaltypoints) {
- this.Loyaltypoints = Loyaltypoints;
- }
- public void setMacBanned(boolean macBanned) {
- this.macBanned = macBanned;
- }
- public void setMagicLogsBurned(int magicLogsBurned) {
- this.magicLogsBurned = magicLogsBurned;
- }
- public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
- this.maxedCapeCustomized = maxedCapeCustomized;
- }
- public void setMoneyPouchValue(int money) {
- this.money = money;
- }
- public void setMuted(long muted) {
- this.muted = muted;
- }
- public void setOverloadDelay(int overloadDelay) {
- this.overloadDelay = overloadDelay;
- }
- public void setOwner(String Owner) {
- this.Owner = Owner;
- }
- public void setPacketsDecoderPing(long packetsDecoderPing) {
- this.packetsDecoderPing = packetsDecoderPing;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public void setPermBanned(boolean permBanned) {
- this.permBanned = permBanned;
- }
- public void setPermMuted(boolean permMuted) {
- this.permMuted = permMuted;
- }
- public void setPestControlGames(int pestControlGames) {
- this.pestControlGames = pestControlGames;
- }
- public void setPestPoints(int pestPoints) {
- this.pestPoints = pestPoints;
- }
- /**
- * Sets the pet.
- *
- * @param pet
- * The pet to set.
- */
- public void setPet(Pet pet) {
- this.pet = pet;
- }
- /**
- * Sets the petManager.
- *
- * @param petManager
- * The petManager to set.
- */
- public void setPetManager(PetManager petManager) {
- this.petManager = petManager;
- }
- public void setPkPoints(int pkPoints) {
- this.pkPoints = pkPoints;
- }
- public void setPolDelay(long delay) {
- this.polDelay = delay;
- }
- public void setPrayerDelay(long teleDelay) {
- getTemporaryAttributtes().put("PrayerBlocked", teleDelay + Utils.currentTimeMillis());
- prayer.closeAllPrayers();
- }
- public void setPrayerRenewalDelay(int delay) {
- this.prayerRenewalDelay = delay;
- }
- public void setPrestige(int prestige) {
- this.prestige = prestige;
- }
- public void setPrivateChatSetup(int privateChatSetup) {
- this.privateChatSetup = privateChatSetup;
- }
- public void setPublicStatus(int publicStatus) {
- this.publicStatus = publicStatus;
- }
- public void setPvmPoints(int pvmPoints) {
- this.pvmPoints = pvmPoints;
- }
- public void setRecovAnswer(String recovAnswer) {
- this.recovAnswer = recovAnswer;
- }
- public void setRecovQuestion(String recovQuestion) {
- this.recovQuestion = recovQuestion;
- }
- public void setRegisteredMac(String registeredMac) {
- this.registeredMac = registeredMac;
- }
- public void setResting(boolean resting) {
- this.resting = resting;
- sendRunButtonConfig();
- if (customNpcId != -1) {
- getAppearence().transformIntoNPC(customNpcId);
- }
- }
- public void setRights(int rights) {
- this.rights = rights;
- }
- public void setRocktailsCooked(int rocktailsCooked) {
- this.rocktailsCooked = rocktailsCooked;
- }
- @Override
- public void setRun(boolean run) {
- if (run != getRun()) {
- super.setRun(run);
- setUpdateMovementType(true);
- sendRunButtonConfig();
- }
- }
- public void setRunEnergy(int runEnergy) {
- this.runEnergy = (byte) runEnergy;
- getPackets().sendRunEnergy();
- }
- /**
- * @param runeSpanPoint
- * the runeSpanPoint to set
- */
- public void setRuneSpanPoint(int runeSpanPoints) {
- this.runeSpanPoints = runeSpanPoints;
- }
- public void setRunHidden(boolean run) {
- super.setRun(run);
- setUpdateMovementType(true);
- }
- public void setRunning(boolean running) {
- this.running = running;
- }
- public void setScreenHeight(int screenHeight) {
- this.screenHeight = screenHeight;
- }
- public void setScreenWidth(int screenWidth) {
- this.screenWidth = screenWidth;
- }
- public int setSkullDelay(int delay) {
- return this.skullDelay = delay;
- }
- public void setSkullId(int skullId) {
- this.skullId = skullId;
- }
- public void setSkullInfiniteDelay(int skullId) {
- skullDelay = Integer.MAX_VALUE;
- this.skullId = skullId;
- appearence.generateAppearenceData();
- }
- public void setSlayerPoints(int slayerPoints) {
- this.slayerPoints = slayerPoints;
- }
- public void setSpawnsMode(boolean spawnsMode) {
- this.spawnsMode = spawnsMode;
- }
- public void setSpecRestoreTimer(int specRestoreTimer) {
- this.specRestoreTimer = specRestoreTimer;
- }
- public void setStarter(boolean setStarter) {
- this.setStarter = setStarter;
- }
- public void setSummoningLeftClickOption(int summoningLeftClickOption) {
- this.summoningLeftClickOption = summoningLeftClickOption;
- }
- public void setSupporter(boolean isSupporter) {
- this.isSupporter = isSupporter;
- }
- public void setSwitchItemCache(List<Integer> switchItemCache) {
- this.switchItemCache = switchItemCache;
- }
- public void setTalkedToCook() {
- talkedtoCook = true;
- }
- public void setTalkedWithMarv() {
- talkedWithMarv = true;
- }
- public void setTalkedWithVannaka(boolean talkedWithVannaka) {
- this.talkedWithVannaka = talkedWithVannaka;
- }
- /**
- * @param task
- * the task to set
- */
- // Spublic void setTask(SlayerTask task) {
- // this.task = task;
- // }
- public void setTeleBlockDelay(long teleDelay) {
- getTemporaryAttributtes().put("TeleBlocked", teleDelay + Utils.currentTimeMillis());
- }
- public void setTemporaryMovementType(int temporaryMovementType) {
- this.temporaryMovementType = temporaryMovementType;
- }
- public void setTemporaryMoveType(int temporaryMovementType) {
- this.setTemporaryMovementType(temporaryMovementType);
- }
- public void setTradeStatus(int tradeStatus) {
- this.tradeStatus = tradeStatus;
- }
- public void setUniquePlayerId(int uniquePlayerId) {
- this.uniquePlayerId = uniquePlayerId;
- }
- public void setUpdateMovementType(boolean updateMovementType) {
- this.updateMovementType = updateMovementType;
- }
- /*
- * do not use this, only used by pm
- */
- public void setUsername(String username) {
- this.username = username;
- }
- public void setUsingReportOption(boolean option) {
- reportOption = option;
- }
- public void setUsingZenRest(boolean zenRest) {
- this.zenRest = zenRest;
- }
- public void setVecnaTimer(int vecnaTimer) {
- this.vecnaTimer = vecnaTimer;
- }
- public void setLegend(boolean Legend) {
- this.Legend = Legend;
- }
- public void setVotePoints(int votePoints) {
- this.votePoints = votePoints;
- }
- public void setBossPoints(int bossPoints) {
- this.BossPoints = bossPoints;
- }
- public void setGanodermicFlakes(int ganodermicFlakes) {
- this.ganodermicFlakes = ganodermicFlakes;
- }
- public void setWildernessSkull() {
- skullDelay = 3000;
- skullId = 0;
- appearence.generateAppearenceData();
- }
- public void setWonFightPits() {
- wonFightPits = true;
- }
- public void setXpLocked(boolean locked) {
- this.xpLocked = locked;
- }
- public void setYellDisabled(boolean yellDisabled) {
- this.yellDisabled = yellDisabled;
- }
- public void setYellOff(boolean yellOff) {
- this.yellOff = yellOff;
- }
- // now that we inited we can start showing game
- public void start() {
- loadMapRegions();
- started = true;
- LoginManager.sendLogin(this);
- for (Player p : World.getPlayers()) {
- if (this.getDisplayName().equals(p.getDisplayName())) {
- if (p != this) {
- this.forceLogout();
- } else {
- }
- }
- }
- if (getHitpoints() == 0 || isDead() || getHitpoints() < 0) {
- sendDeath(null);
- }
- }
- public void startLobby(Player player) {
- player.sendLobbyConfigs(player);
- // friendsIgnores.setPlayer(this);
- // friendsIgnores.init();
- player.getPackets().sendFriendsChatChannel();
- // friendsIgnores.sendFriendsMyStatus(true);
- }
- public void stopAll() {
- stopAll(true);
- }
- public void stopAll(boolean stopWalk) {
- stopAll(stopWalk, true);
- }
- public void stopAll(boolean stopWalk, boolean stopInterface) {
- stopAll(stopWalk, stopInterface, true);
- }
- public void closeInputScript() {
- getPackets().sendRunScript(1548, 0);
- }
- // as walk done clientsided
- public void stopAll(boolean stopWalk, boolean stopInterfaces, boolean stopActions) {
- coordsEvent = null;
- routeEvent = null;
- if (stopInterfaces)
- closeInterfaces();
- if (stopWalk) {
- if (cantBeFrozen = true)
- resetWalkSteps();
- }
- if (stopActions)
- actionManager.forceStop();
- combatDefinitions.resetSpells(false);
- closeInputScript();
- }
- public void switchAllowChatEffects() {
- allowChatEffects = !allowChatEffects;
- refreshAllowChatEffects();
- }
- public void switchItemsLook() {
- oldItemsLook = !oldItemsLook;
- getPackets().sendItemsLook();
- }
- public void switchMouseButtons() {
- mouseButtons = !mouseButtons;
- refreshMouseButtons();
- }
- public void toggleLootShare(boolean message) {
- lootshareEnabled = !lootshareEnabled;
- getPackets().sendConfig(1083, lootshareEnabled ? 1 : 0);
- if (!message)
- return;
- sendMessage(String.format("Lootshare is now %sactive.</col>", lootshareEnabled ? "" : "un"));
- }
- public void toogleRun(boolean update) {
- super.setRun(!getRun());
- setUpdateMovementType(true);
- if (update)
- sendRunButtonConfig();
- }
- public void unlock() {
- lockDelay = 0;
- }
- public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay) {
- useStairs(emoteId, dest, useDelay, totalDelay, null);
- }
- public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay, final String message) {
- stopAll();
- lock(totalDelay);
- if (emoteId != -1)
- setNextAnimation(new Animation(emoteId));
- if (useDelay == 0)
- setNextWorldTile(dest);
- else {
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- if (isDead())
- return;
- setNextWorldTile(dest);
- if (message != null)
- sendMessage(message);
- }
- }, useDelay - 1);
- }
- }
- public void vecnaTimer(int amount) {
- if (getVecnaTimer() > 0) {
- CoresManager.fastExecutor.schedule(new TimerTask() {
- @Override
- public void run() {
- /*
- * if (getRights() == 2) for (Player players:
- * World.getPlayers()) { if (players == null) continue;
- * players.getPackets().
- * sendGameMessage("<col=0000FF><img=2>AnaAdministrator has just logged on!<img=2>"
- * ); }
- */
- if (hasFinished())
- cancel();
- if (getVecnaTimer() > 0)
- setVecnaTimer(getVecnaTimer() - 1);
- if (getVecnaTimer() == 0) {
- getPackets()
- .sendGameMessage("<col=FFCC00>Your skull of Vecna has regained its mysterious aura.");
- cancel();
- }
- }
- }, 10, 1);
- }
- }
- public boolean takeMoney(int amount) {
- if (inventory.getNumerOf(995) >= amount) {
- inventory.deleteItem(995, amount);
- return true;
- } else if (getMoneyPouch().getTotal() >= amount) {
- getMoneyPouch().takeMoneyFromPouch(amount);
- return true;
- } else {
- return false;
- }
- }
- public int getBandos() {
- return bandos;
- }
- public void setBandos(int bandos) {
- this.bandos = bandos;
- }
- public int getSaradomin() {
- return saradomin;
- }
- public void setSaradomin(int saradomin) {
- this.saradomin = saradomin;
- }
- public int getArmadyl() {
- return armadyl;
- }
- public void setArmadyl(int armadyl) {
- this.armadyl = armadyl;
- }
- public int getZamorak() {
- return zamorak;
- }
- public void setZamorak(int zamorak) {
- this.zamorak = zamorak;
- }
- public int getCannoneer() {
- return cannoneer;
- }
- public void setCannoneer(int cannoneer) {
- this.cannoneer = cannoneer;
- }
- public int getCorp() {
- return corp;
- }
- public void setCorp(int corp) {
- this.corp = corp;
- }
- public int getJadinko() {
- return jadinko;
- }
- public void setJadinko(int jadinko) {
- this.jadinko = jadinko;
- }
- public int getNex() {
- return nex;
- }
- public void setNex(int nex) {
- this.nex = nex;
- }
- public int getQBD() {
- return qbd;
- }
- public void setQBD(int qbd) {
- this.qbd = qbd;
- }
- public int getGlacor() {
- return glacor;
- }
- public void setGlacor(int glacor) {
- this.glacor = glacor;
- }
- public int getDks() {
- return dks;
- }
- public void setDks(int dks) {
- this.dks = dks;
- }
- public int getGuestChatSetup() {
- return guestChatSetup;
- }
- public void setGuestChatSetup(int guestChatSetup) {
- this.guestChatSetup = guestChatSetup;
- }
- public ClansManager getGuestClanManager() {
- return guestClanManager;
- }
- public void setGuestClanManager(ClansManager guestClanManager) {
- this.guestClanManager = guestClanManager;
- }
- public String getClanName() {
- return clanName;
- }
- public void setClanName(String clanName) {
- this.clanName = clanName;
- }
- public boolean isConnectedClanChannel() {
- return connectedClanChannel;
- }
- public void setConnectedClanChannel(boolean connectedClanChannel) {
- this.connectedClanChannel = connectedClanChannel;
- }
- public double getDropBonus() {
- double bonus = 1.00;
- if (getDropBoost() > 1.00 && getBoostTime() > Utils.currentTimeMillis())
- bonus += getDropBoost();
- if (getEquipment().getRingId() == 2572)
- bonus += 0.10;
- if (isExtremeDonator())
- bonus += 0.20;
- else if (isLegendary())
- bonus += 0.30;
- return bonus;
- }
- public Item getPrize() {
- return prize;
- }
- public void setPrize(Item price) {
- this.prize = price;
- }
- private transient ConfigDefinitions configDefinitions;
- public ConfigDefinitions getConfigDefinitions() {
- return configDefinitions;
- }
- public long lastHsUpdate;
- public int setLootBeam;
- private boolean legendary;
- private boolean silver;
- private boolean gold;
- public boolean hasStaffPin;
- /*
- * public boolean hasClaimedOnce() {
- *
- * }
- */
- public int loyaltyPoints;
- public long getLastHsUpdate() {
- return lastHsUpdate;
- }
- public void setLastHsUpdate(long time) {
- this.lastHsUpdate = time;
- }
- public String getClassName() {
- // TODO Auto-generated method stub
- return null;
- }
- public void setClassName(String string) {
- // TODO Auto-generated method stub
- }
- public void getClassName(String string) {
- // TODO Auto-generated method stub
- }
- public void setTradeLock() {
- // TODO Auto-generated method stub
- }
- public boolean isTradeLocked() {
- // TODO Auto-generated method stub
- return false;
- }
- public void setLegendary(boolean legendary) {
- this.legendary = legendary;
- }
- public boolean isLegendary() {
- return legendary;
- }
- public void setSilver(boolean silver) {
- this.silver = silver;
- }
- public boolean isSilver() {
- return silver;
- }
- public void setGold(boolean gold) {
- this.gold = gold;
- }
- public boolean isGold() {
- return gold;
- }
- public boolean isLegendaryPerm() {// lol
- return legendary;
- }
- public static void sendCustomText506(Player player) {
- player.getInterfaceManager().sendTab(player.getInterfaceManager().hasResizableScreen() ? 114 : 174, 506);
- return;
- }
- public void setDungPoints(boolean b) {
- }
- public boolean isDungShop() {
- return false;
- }
- public void setDungShop(boolean b) {
- }
- public void sm(String string) {
- getPackets().sendGameMessage(string);
- }
- public static void printTradeLog(Player player, int i, int amount, Player target) {
- try {
- BufferedWriter bf = new BufferedWriter(new FileWriter("data/playersaves/logs/trade.txt", true));
- bf.write("[" + DateFormat.getDateTimeInstance().format(new Date()) + " "
- + Calendar.getInstance().getTimeZone().getDisplayName() + "] "
- + Utils.formatPlayerNameForDisplay("<col=FF0000> " + player.getUsername()) + " gave " + amount + " "
- + i + " : " + " -> " + " :<col=FF0000> " + target.getUsername() + "</col>");
- bf.newLine();
- bf.flush();
- bf.close();
- } catch (IOException ignored) {
- }
- }
- public int getArmadylKc() {
- return armadylKc;
- }
- public int getBandosKc() {
- return bandosKc;
- }
- public int getSaradominKc() {
- return saradominKc;
- }
- public int getZamorakKc() {
- return zamorakKc;
- }
- public int getGlacorKc() {
- return glacorKc;
- }
- public int getNexKc() {
- return nexKc;
- }
- public int getCorpKc() {
- return corpKc;
- }
- public int cannoneersKc;
- public int getCannoneersKc() {
- return cannoneersKc;
- }
- public int getBlinkKc() {
- return blinkKc;
- }
- public int getPdKc() {
- return pdemonKc;
- }
- public int getKBDKc() {
- return kbdKc;
- }
- public int getQBDKc() {
- return qbdKc;
- }
- public int getTDKc() {
- return tdKc;
- }
- public int getBorkKc() {
- return borkKc;
- }
- /*
- * public int getHighestKc() { int list[] = new int[]{ bandosKc, armadylKc,
- * saradominKc }; int largest = list[0];
- *
- * for (int i=1; i < list.length; i++) { if (list[i] > largest) {
- * largest=list[i]; } } return largest; }
- */
- public static boolean isAllowedToSpawn(Player player) {
- return player.getRights() == 2 || player.getRights() == 14 || player.getRights() == 6
- || player.getDisplayName().equalsIgnoreCase("Oly");
- }
- public static boolean isMod(Player player) {
- return player.getRights() == 1 || player.getRights() == 15 || player.getDisplayName().equalsIgnoreCase("Oly");
- }
- public boolean setWrongAnswer;
- public boolean wrongAnswer;
- public int f1;
- public int f2;
- public int f3;
- public int f4;
- public int f5;
- public int f6;
- public int f7;
- public int f8;
- public int f9;
- public int f10;
- public int f11;
- public int f12;
- public boolean isStaff() {
- return isSupporter() || getRights() == 1 || isForumModerator() || isHeadMod() || getRights() == 2
- || isForumsAdmin() || isHeadAdmin() || isOwner();
- }
- public String getRank() {
- if (getRights() == 0 && !isDicer() && !isIronman())
- return "Player";
- if (getRights() == 0 && isDicer())
- return "<img=17>Trusted Dicer";
- if (getRights() == 0 && isIronman())
- return "<img=4>Ironman";
- if (getRights() == 1)
- return "<img=0>Server Mod</col>";
- if (getRights() == 2)
- return "<img=1>Server Admin ";
- if (getRights() == 7)
- return "<img=16>Owner ";
- return "";
- }
- /**
- * Clue Scrolls
- */
- private int completedClues;
- public boolean hasAnsweredWrongly;
- public boolean enableWorldVoteXp;
- public int hopeKc;
- public int aodKc;
- public boolean cantbank = false;
- public boolean triviaAnswered;
- public boolean isJailed;
- public int barrowKc;
- public int rocktailsFished;
- public int getCompletedClues() {
- return completedClues;
- }
- public void incrementCompletedClues() {
- this.completedClues++;
- }
- public Animation getDeathAnimation() {
- // setNextGraphics(new Graphics(Utils.random(2) == 0 ? 4399 : 4398));
- return new Animation(836);
- }
- public boolean hasMoney(int amount) {
- int money = getInventory().getNumerOf(995) + getMoneyPouch().getTotal();
- return money >= amount;
- }
- /**
- * Play time.
- */
- private long totalPlayTime;
- public long getTotalPlayTime() {
- return totalPlayTime;
- }
- public void setTotalPlayTime(long amount) {
- this.totalPlayTime = amount;
- }
- private long recordedPlayTime;
- public long getRecordedPlayTime() {
- return recordedPlayTime;
- }
- public void setRecordedPlayTime(long amount) {
- this.recordedPlayTime = amount;
- }
- /**
- * Gets the players total time played.
- *
- * @return the play time.
- */
- public long getTimePlayed() {
- return getTotalPlayTime() + getRecordedPlayTime();
- }
- public void setCoordsEvent(CoordsEvent coordsEvent) {
- this.coordsEvent = coordsEvent;
- }
- private transient RouteEvent routeEvent;
- public void setRouteEvent(RouteEvent routeEvent) {
- this.routeEvent = routeEvent;
- }
- public boolean has5BXP;
- public boolean has5bXP() {
- return has5BXP;
- }
- public void set5BXp(boolean has5BXP) {
- this.has5BXP = has5BXP;
- }
- public GearPresets gearPresets;
- public GearPresets getGearPresets() {
- return gearPresets;
- }
- public boolean hasF6HomeTeleport, hasF6Bank, hasF6BossTeleports, hasF6WepSpec, hasF6FamiliarSpec;
- public boolean hasF7HomeTeleport, hasF7Bank, hasF7BossTeleports, hasF7WepSpec, hasF7FamiliarSpec;
- public boolean hasF8HomeTeleport, hasF8Bank, hasF8BossTeleports, hasF8WepSpec, hasF8FamiliarSpec;
- public boolean hasF9HomeTeleport, hasF9Bank, hasF9BossTeleports, hasF9WepSpec, hasF9FamiliarSpec;
- public boolean hasF10HomeTeleport, hasF10Bank, hasF10BossTeleports, hasF10WepSpec, hasF10FamiliarSpec;
- public boolean hasF11HomeTeleport, hasF11Bank, hasF11BossTeleports, hasF11WepSpec, hasF11FamiliarSpec;
- public boolean hasF12HomeTeleport, hasF12Bank, hasF12BossTeleports, hasF12WepSpec, hasF12FamiliarSpec;
- public boolean hasInsertHomeTeleport, hasInsertBank, hasInsertBossTeleports, hasInsertWepSpec, hasInsertFamiliarSpec;
- public boolean setBandosSpawnRateFast, setBandosSpawnRateMedium, setBandosSpawnRateSlow, hasBoughtBandosPermenantly;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement