Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 146.11 KB | None | 0 0
  1. package com.rs.game.player;
  2.  
  3. import java.io.BufferedWriter;
  4. import java.io.FileWriter;
  5. import java.io.IOException;
  6. import java.net.InetAddress;
  7. import java.net.UnknownHostException;
  8. import java.text.DateFormat;
  9. import java.text.DecimalFormat;
  10. import java.text.NumberFormat;
  11. import java.text.SimpleDateFormat;
  12. import java.util.Calendar;
  13. import java.util.Date;
  14. import java.util.LinkedList;
  15. import java.util.List;
  16. import java.util.Locale;
  17. import java.util.TimerTask;
  18. import java.util.concurrent.ConcurrentLinkedQueue;
  19. import java.util.concurrent.CopyOnWriteArrayList;
  20. import java.util.concurrent.TimeUnit;
  21.  
  22. import com.rs.Settings;
  23. import com.rs.cache.loaders.ConfigDefinitions;
  24. import com.rs.cores.CoresManager;
  25. import com.rs.game.Animation;
  26. import com.rs.game.Entity;
  27. import com.rs.game.ForceTalk;
  28. import com.rs.game.Graphics;
  29. import com.rs.game.Hit;
  30. import com.rs.game.Hit.HitLook;
  31. import com.rs.game.World;
  32. import com.rs.game.WorldObject;
  33. import com.rs.game.WorldTile;
  34. import com.rs.game.item.FloorItem;
  35. import com.rs.game.item.Item;
  36. import com.rs.game.minigames.GameController;
  37. import com.rs.game.minigames.LobbyController;
  38. import com.rs.game.minigames.clanwars.FfaZone;
  39. import com.rs.game.minigames.clanwars.WarControler;
  40. import com.rs.game.minigames.duel.DuelArena;
  41. import com.rs.game.minigames.duel.DuelRules;
  42. import com.rs.game.npc.NPC;
  43. import com.rs.game.npc.familiar.Familiar;
  44. import com.rs.game.npc.godwars.zaros.Nex;
  45. import com.rs.game.npc.pet.Pet;
  46. import com.rs.game.player.actions.PlayerCombat;
  47. import com.rs.game.player.content.BountyHunter;
  48. import com.rs.game.player.content.DropLog;
  49. import com.rs.game.player.content.FriendChatsManager;
  50. import com.rs.game.player.content.GrinderList;
  51. import com.rs.game.player.content.ItemConstants;
  52. import com.rs.game.player.content.Magic;
  53. import com.rs.game.player.content.MoneyPouch;
  54. import com.rs.game.player.content.Notes;
  55. import com.rs.game.player.content.Pots;
  56. import com.rs.game.player.content.PuzzleBox;
  57. import com.rs.game.player.content.ReaperAssignment;
  58. import com.rs.game.player.content.SkillCapeCustomizer;
  59. import com.rs.game.player.content.clans.ClansManager;
  60. import com.rs.game.player.content.pet.PetManager;
  61. import com.rs.game.player.content.slayer.SlayerManager;
  62. import com.rs.game.player.controlers.BarrelchestControler;
  63. import com.rs.game.player.controlers.CorpBeastControler;
  64. import com.rs.game.player.controlers.CrucibleControler;
  65. import com.rs.game.player.controlers.DTControler;
  66. import com.rs.game.player.controlers.DungeoneeringControler;
  67. import com.rs.game.player.controlers.FightCaves;
  68. import com.rs.game.player.controlers.FightKiln;
  69. import com.rs.game.player.controlers.GodWars;
  70. import com.rs.game.player.controlers.ImpossibleJad;
  71. import com.rs.game.player.controlers.JailControler;
  72. import com.rs.game.player.controlers.NomadsRequiem;
  73. import com.rs.game.player.controlers.QueenBlackDragonController;
  74. import com.rs.game.player.controlers.StartTutorial;
  75. import com.rs.game.player.controlers.Wilderness;
  76. import com.rs.game.player.controlers.ZGDControler;
  77. import com.rs.game.player.controlers.battleterrace.battleTerraceGame;
  78. import com.rs.game.player.controlers.castlewars.CastleWarsPlaying;
  79. import com.rs.game.player.controlers.castlewars.CastleWarsWaiting;
  80. import com.rs.game.player.controlers.events.DeathEvent;
  81. import com.rs.game.player.controlers.fightpits.FightPitsArena;
  82. import com.rs.game.player.controlers.pestcontrol.PestControlGame;
  83. import com.rs.game.player.controlers.pestcontrol.PestControlLobby;
  84. import com.rs.game.player.dialogues.Dialogue;
  85. import com.rs.game.tasks.WorldTask;
  86. import com.rs.game.tasks.WorldTasksManager;
  87. import com.rs.net.Session;
  88. import com.rs.net.decoders.WorldPacketsDecoder;
  89. import com.rs.net.decoders.handlers.ButtonHandler;
  90. import com.rs.net.encoders.WorldPacketsEncoder;
  91. import com.rs.utils.DbLogs;
  92. import com.rs.utils.IsaacKeyPair;
  93. import com.rs.utils.Lend;
  94. import com.rs.utils.Logger;
  95. import com.rs.utils.LoggingSystem;
  96. import com.rs.utils.PkRank;
  97. import com.rs.utils.SerializableFilesManager;
  98. import com.rs.utils.Utils;
  99. import com.rs.utils.economy.Prices;
  100. import com.rs.utils.mysql.impl.Highscores;
  101.  
  102. public class Player extends Entity {
  103.  
  104.     public int start = 0;
  105.  
  106.     public DropLog dropLogs;
  107.  
  108.     public int dropTestingAmount = 1;
  109.     public boolean dropTesting;
  110.  
  111.     public DropLog getDropLogs() {
  112.         return dropLogs;
  113.     }
  114.  
  115.     public long WorldXp;// its
  116.  
  117.     public long cooldown;
  118.  
  119.     private static final long serialVersionUID = 2011932556974180375L;
  120.  
  121.     public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1, RUN_MOVE_TYPE = 2;
  122.     private static final DecimalFormat dFormatter = new DecimalFormat("#,###,###,###");
  123.  
  124.     public long lastDailyGiven;
  125.  
  126.     public static String getFormattedNumber(int amount) {
  127.         return dFormatter.format(amount);
  128.     }
  129.  
  130.     public String getTitleColor() {
  131.         return titleColor;
  132.     }
  133.  
  134.     public LoyaltyManager getLoyaltyManager() {
  135.         return loyaltyManager;
  136.     }
  137.  
  138.     private transient PuzzleBox puzzleBox;
  139.     public PuzzleBox getPuzzleBox() {
  140.         return puzzleBox;
  141.     }
  142.     public void setPuzzleBox(int puzzleId) {
  143.         this.puzzleBox = new PuzzleBox(this, puzzleId);
  144.     }
  145.    
  146.     public double gainedXP;
  147.    
  148.     public String getRankPrefix() {
  149.         if (isOwner())
  150.             return "<shad=0008F5><col=B51BE0>[Owner]</col></shad> <img=16> <shad=C42BE3>";
  151.         if (isHeadAdmin())
  152.             return "[<col=0000FF><shad=0000ff>Head Administrator</col>] <img=6> ";
  153.         if (isForumsAdmin())
  154.             return "[<col=ffff00><shad=ffff00>Forum Administrator</col>] <img=14> ";
  155.         if (getRights() == 2)
  156.             return "[<col=00FFFF><shad=00FFFF>Administrator</col>] <img=1> ";
  157.         if (isHeadMod())
  158.             return "[<col=FF0000><shad=C0C0C0>Head Moderator</col>] <img=15> ";
  159.         if (isForumModerator())
  160.             return "[<col=238500><shad=238500>Forum Moderator</col>] <img=10> ";
  161.         if (getRights() == 1)
  162.             return "[<col=FF8800><shad=FF0000>Moderator</col>] <img=0> ";
  163.         if (isSupporter())
  164.             return "[<col=FF66CC><shad=FF66CC>Server Supporter</col>] <img=12> ";
  165.         return "";
  166.     }
  167.  
  168.     public String getRankMessage() {
  169.         if (isOwner())
  170.             return "</shad>: <shad=B50424><col=051FE6>Remember to vote daily for rewards and to help the server grow!</col></shad>";
  171.         if (isHeadAdmin())
  172.             return ": <col=0000FF><shad=0000ff>Remember to vote daily for rewards and to help the server grow!</col></shad>";
  173.         if (isForumsAdmin())
  174.             return ": <col=FFff00>Remember to vote daily for rewards and to help the server grow!</col></shad>";
  175.         if (getRights() == 2)
  176.             return ": <col=00FFFF><shad=00FFFF>Remember to vote daily for rewards and to help the server grow!</col></shad>";
  177.         if (isHeadMod())
  178.             return ": <col=FF0000><shad=C0C0C0>Remember to vote daily for rewards and to help the server grow!</col></shad>";
  179.         if (isForumModerator())
  180.             return ": <col=238500><shad=238500>Remember to vote daily for rewards and to help the server grow!</col></shad>";
  181.         if (getRights() == 1)
  182.             return ": <col=FF8800><shad=FF0000>Remember to vote daily for rewards and to help the server grow!</col></shad>";
  183.         if (isSupporter())
  184.             return ": <col=FF66CC><shad=FF66CC>Remember to vote daily for rewards and to help the server grow!</col></shad>";
  185.         return "";
  186.     }
  187.  
  188.     public void sendBossInterface() {
  189.         getInterfaceManager().sendInterface(275);
  190.         for (int i = 2; i < 11; i++)
  191.             getPackets().sendIComponentText(275, i, "");
  192.         for (int n = 24; n > 300; n++)
  193.             getPackets().sendIComponentText(275, n, "");
  194.         getPackets().sendIComponentText(275, 1, "Boss Pet Killcounts");
  195.         getPackets().sendIComponentText(275, 11, "Bandos               -                3000");
  196.         getPackets().sendIComponentText(275, 12, "Armadyl              -                3000");
  197.         getPackets().sendIComponentText(275, 13, "Zamorak              -                2500");
  198.         getPackets().sendIComponentText(275, 14, "Saradomin            -                3000");
  199.         getPackets().sendIComponentText(275, 15, "Nex                  -                750");
  200.         getPackets().sendIComponentText(275, 16, "Corporeal Beast      -                1500");
  201.         getPackets().sendIComponentText(275, 17, "Blink                -                1500");
  202.         getPackets().sendIComponentText(275, 18, "KBD                  -                1750");
  203.         getPackets().sendIComponentText(275, 19, "Glacors              -                2000");
  204.         getPackets().sendIComponentText(275, 20, "Tormented Demon      -                2000");
  205.         getPackets().sendIComponentText(275, 21, "Party Demon          -                1500");
  206.         getPackets().sendIComponentText(275, 22, "Hope Devourer        -                1750");
  207.         getPackets().sendIComponentText(275, 23, "Bork                 -                3000");
  208.         getPackets().sendIComponentText(275, 24, "AOD                  -                2500");
  209.     }
  210.  
  211.     public int reaperPoints;
  212.     public int rerolls;
  213.     public int taskPoints;
  214.     public boolean bossTaskCompleted;
  215.     public boolean hasLearnedDeath;
  216.     private ReaperAssignment reaperAssignment;
  217.  
  218.     public boolean hasLearnedBossPets;
  219.  
  220.     public boolean HasBoughtBandos;
  221.     public boolean HasBoughtArmadyl;
  222.     public boolean HasBoughtZamorak;
  223.     public boolean HasBoughtSaradomin;
  224.     public boolean HasBoughtNex;
  225.     public boolean HasBoughtCorp;
  226.     public boolean HasBoughtGlacor;
  227.     public boolean HasBoughtPD;
  228.     public boolean HasBoughtKBD;
  229.     public boolean HasBoughtHope;
  230.     public boolean HasBoughtAOD;
  231.     public boolean HasBoughtBork;
  232.     public boolean HasBoughtBlink;
  233.     public boolean HasBoughtTD;
  234.  
  235.     /*
  236.      * public boolean rerollTask() { if (rerolls <= 0) {
  237.      * sendMessage("You are out of task rerolls. Continue with the current one, or wait till tomorrow."
  238.      * ); return false; } rerolls--; reaperAssignment =
  239.      * ReaperAssignment.create(); sendMessage(reaperAssignment.getMessage());
  240.      * return true; }
  241.      */
  242.  
  243.     public boolean changeTask() {
  244.         reaperAssignment = ReaperAssignment.create();
  245.         sendMessage(reaperAssignment.getMessage());
  246.         return true;
  247.     }
  248.  
  249.     public boolean hasBossTask() {
  250.         return reaperAssignment != null;
  251.     }
  252.  
  253.     public ReaperAssignment getBossTask() {
  254.         return reaperAssignment;
  255.     }
  256.  
  257.     public void setBossTask(ReaperAssignment bossTask) {
  258.         this.reaperAssignment = bossTask;
  259.     }
  260.  
  261.     public void setTaskPoints(int taskPoints) {
  262.         this.taskPoints = taskPoints;
  263.     }
  264.  
  265.     public boolean setHasLearnedDeath(boolean b) {
  266.         return hasLearnedDeath = b;
  267.     }
  268.  
  269.     public boolean hasLearnedDeath() {
  270.         return hasLearnedDeath;
  271.     }
  272.  
  273.     public boolean setHasLearnedBossPets(boolean b) {
  274.         return hasLearnedBossPets = b;
  275.     }
  276.  
  277.     public boolean hasLearnedBossPets() {
  278.         return hasLearnedBossPets;
  279.     }
  280.  
  281.     public int BossPoints;
  282.  
  283.     public int getBossPoints() {
  284.         return BossPoints;
  285.     }
  286.  
  287.     /**
  288.      * Start
  289.      */
  290.     public boolean setBoughtBandos(boolean b) {
  291.         return HasBoughtBandos = b;
  292.     }
  293.  
  294.     public boolean hasBoughtBandos() {
  295.         return HasBoughtBandos;
  296.     }
  297.  
  298.     public boolean setBoughtArmadyl(boolean b) {
  299.         return HasBoughtArmadyl = b;
  300.     }
  301.  
  302.     public boolean hasBoughtArmadyl() {
  303.         return HasBoughtArmadyl;
  304.     }
  305.  
  306.     public boolean setBoughtSaradomin(boolean b) {
  307.         return HasBoughtSaradomin = b;
  308.     }
  309.  
  310.     public boolean hasBoughtSaradomin() {
  311.         return HasBoughtSaradomin;
  312.     }
  313.  
  314.     public boolean setBoughtZamorak(boolean b) {
  315.         return HasBoughtZamorak = b;
  316.     }
  317.  
  318.     public boolean hasBoughtZamorak() {
  319.         return HasBoughtZamorak;
  320.     }
  321.  
  322.     public boolean setBoughtNex(boolean b) {
  323.         return HasBoughtNex = b;
  324.     }
  325.  
  326.     public boolean hasBoughtNex() {
  327.         return HasBoughtNex;
  328.     }
  329.  
  330.     public boolean setBoughtCorp(boolean b) {
  331.         return HasBoughtCorp = b;
  332.     }
  333.  
  334.     public boolean hasBoughtCorp() {
  335.         return HasBoughtCorp;
  336.     }
  337.  
  338.     public boolean setBoughtBork(boolean b) {
  339.         return HasBoughtBork = b;
  340.     }
  341.  
  342.     public boolean hasBoughtBork() {
  343.         return HasBoughtBork;
  344.     }
  345.  
  346.     public boolean setBoughtBlink(boolean b) {
  347.         return HasBoughtBlink = b;
  348.     }
  349.  
  350.     public boolean hasBoughtBlink() {
  351.         return HasBoughtBlink;
  352.     }
  353.  
  354.     public boolean setBoughtPD(boolean b) {
  355.         return HasBoughtPD = b;
  356.     }
  357.  
  358.     public boolean hasBoughtPD() {
  359.         return HasBoughtPD;
  360.     }
  361.  
  362.     public boolean setBoughtKBD(boolean b) {
  363.         return HasBoughtKBD = b;
  364.     }
  365.  
  366.     public boolean hasBoughtKBD() {
  367.         return HasBoughtKBD;
  368.     }
  369.  
  370.     public boolean setBoughtGlacor(boolean b) {
  371.         return HasBoughtGlacor = b;
  372.     }
  373.  
  374.     public boolean hasBoughtGlacor() {
  375.         return HasBoughtGlacor;
  376.     }
  377.  
  378.     public boolean setBoughtTD(boolean b) {
  379.         return HasBoughtTD = b;
  380.     }
  381.  
  382.     public boolean hasBoughtTD() {
  383.         return HasBoughtTD;
  384.     }
  385.  
  386.     public boolean setBoughtHope(boolean b) {
  387.         return HasBoughtHope = b;
  388.     }
  389.  
  390.     public boolean hasBoughtHope() {
  391.         return HasBoughtHope;
  392.     }
  393.  
  394.     public boolean setBoughtAOD(boolean b) {
  395.         return HasBoughtAOD = b;
  396.     }
  397.  
  398.     public boolean hasBoughtAOD() {
  399.         return HasBoughtAOD;
  400.     }
  401.  
  402.     /**
  403.      * End
  404.      */
  405.     public int WGuildPotential;
  406.  
  407.     transient LoyaltyManager loyaltyManager;
  408.  
  409.     public String getTitle() {
  410.         return Title;
  411.     }
  412.  
  413.     public void settitlecolor(String titleColor) {
  414.         this.titleColor = titleColor;
  415.     }
  416.  
  417.     public void setTitle(String Title) {
  418.         this.Title = Title;
  419.     }
  420.  
  421.     private String titleColor = "FF0000";
  422.  
  423.     private String Title = "Extreme Donator";
  424.  
  425.     public static String getFormattedNumber(double amount, char seperator) {
  426.         String str = new DecimalFormat("#,###,###").format(amount);
  427.         char[] rebuff = new char[str.length()];
  428.         for (int i = 0; i < str.length(); i++) {
  429.             char c = str.charAt(i);
  430.             if (c >= '0' && c <= '9')
  431.                 rebuff[i] = c;
  432.             else
  433.                 rebuff[i] = seperator;
  434.         }
  435.         return new String(rebuff);
  436.     }
  437.  
  438.     public static String formatNumber(int number) {
  439.         return NumberFormat.getNumberInstance(Locale.UK).format(number);
  440.     }
  441.  
  442.     public int TRiviapoints;
  443.  
  444.     public int getTriviaPoints() {
  445.         return TRiviapoints;
  446.     }
  447.  
  448.     public long getLastCorrectTrivia() {
  449.         return lastAnswered;
  450.     }
  451.  
  452.     public void setLastAnswer(long time) {
  453.         this.lastAnswered = time;
  454.     }
  455.  
  456.     public int getCorrectAnswers() {
  457.         return correctAnswers;
  458.     }
  459.  
  460.     public void setCorrectAnswers(int amount) {
  461.         this.correctAnswers = amount;
  462.     }
  463.  
  464.     public void setDisableTrivia(boolean value) {
  465.         this.disabledTrivia = value;
  466.     }
  467.  
  468.     public boolean hasDisabledTrivia() {
  469.         return disabledTrivia;
  470.     }
  471.  
  472.     private boolean disabledTrivia;
  473.     private long lastAnswered;
  474.     public int correctAnswers;
  475.     private boolean untillLogout;
  476.  
  477.     public transient ActionManager actionManager;
  478.  
  479.     public void setUnlimitedRunPerk(boolean unlimitedRunPerk) {
  480.     }
  481.  
  482.     public boolean addedWeedstoCompost;
  483.     private boolean agrithNaNa;
  484.     private boolean allowChatEffects;
  485.     private Appearence appearence;
  486.     private int assistStatus;
  487.     public AuraManager auraManager;
  488.     private Bank bank;
  489.     private KcTab kcTab;
  490.     public int bandosKc, armadylKc, zamorakKc, saradominKc, thunderousKc, pdemonKc, dkKc, blinkKc, corpKc, kbdKc, qbdKc,
  491.             hatiKc, glacorKc, nomadKc, avatarKc, tdKc, kqKc, nexKc, bcKc, borkKc, gulegaKc, dagSKc, dagPKc, dagRKc;
  492.     private long banned;
  493.     private int barbarianAdvancedLaps;
  494.     private int barrowsKillCount;
  495.     private int barsDone;
  496.     public int battlePoints;
  497.     public Player battleTarget;
  498.     private Item prize;
  499.     private transient long boneDelay;
  500.     public transient BountyHunter bountyHunter;
  501.     private transient boolean canPvp;
  502.     private transient boolean cantTrade;
  503.     private int customNpcId = -1;
  504.  
  505.     public boolean hasPin;
  506.    
  507.     public int securityPin;
  508.    
  509.     public int getSecurityPin() {
  510.         return securityPin;
  511.     }
  512.    
  513.     public void setSecurityPin(int pin) {
  514.         this.securityPin = pin;
  515.     }
  516.    
  517.     public void setCustomNpcId(int customNpcId) {
  518.         this.customNpcId = customNpcId;
  519.     }
  520.  
  521.     private transient boolean castedVeng;
  522.  
  523.     private ChargesManager charges;
  524.  
  525.     private int clanStatus;
  526.  
  527.     public transient boolean clientLoadedMapRegion;
  528.  
  529.     // Triviapoints}
  530.     public void setHsUpdate(long time) {
  531.         this.lastHsUpdate = time;
  532.     }
  533.  
  534.     private long donationtimer;
  535.  
  536.     public void setDonationTimer(long time) {
  537.         this.donationtimer = time;
  538.     }
  539.  
  540.     public long getDonationTimer() {
  541.         return donationtimer;
  542.     }
  543.  
  544.     public void addBlueCharm(int amount) {
  545.         this.blueCharms += amount;
  546.     }
  547.  
  548.     public void addGreenCharm(int amount) {
  549.         this.greenCharms += amount;
  550.     }
  551.  
  552.     public void addCrimCharm(int amount) {
  553.         this.crimCharms += amount;
  554.     }
  555.  
  556.     public void addGoldCharm(int amount) {
  557.         this.goldCharms += amount;
  558.     }
  559.  
  560.     public int goldCharms;
  561.     public int crimCharms;
  562.     public int blueCharms;
  563.     public int greenCharms;
  564.  
  565.     public int checkGolds() {
  566.         return goldCharms;
  567.     }
  568.  
  569.     public int checkBlues() {
  570.         return blueCharms;
  571.     }
  572.  
  573.     public int checkGreens() {
  574.         return greenCharms;
  575.     }
  576.  
  577.     public int checkCrims() {
  578.         return crimCharms;
  579.     }
  580.  
  581.     public void removeGoldCharms(int amount) {
  582.         this.goldCharms -= amount;
  583.     }
  584.  
  585.     public void removeCrimCharms(int amount) {
  586.         this.crimCharms -= amount;
  587.     }
  588.  
  589.     public void removeBlueCharms(int amount) {
  590.         this.blueCharms -= amount;
  591.     }
  592.  
  593.     public void removeGreenCharms(int amount) {
  594.         this.greenCharms -= amount;
  595.     }
  596.  
  597.     private transient Runnable closeInterfacesEvent;
  598.     private int clueReward;
  599.     public int cluenoreward;
  600.     private CombatDefinitions combatDefinitions;
  601.     // completionistcape reqs
  602.     private boolean completedFightCaves;
  603.     private boolean completedFightKiln;
  604.     private boolean completedRfd;
  605.     private int[] completionistCapeCustomized;
  606.     public ControlerManager controlerManager;
  607.     public transient CoordsEvent coordsEvent;
  608.     /* count partyhats obtained from mystery box */
  609.     public int countPartyHat;
  610.     private long creationDate;
  611.     private int crucibleHighScore;
  612.     private boolean culinaromancer;
  613.     public transient FriendChatsManager currentFriendChat;
  614.     private String currentFriendChatOwner;
  615.     // lobby
  616.     private int currentWorldLobby;
  617.     private String customTitle;
  618.     public transient CutscenesManager cutscenesManager;
  619.     private boolean dessourt;
  620.     // Hide Tanning
  621.     public boolean tanning;
  622.     // public void setDungPoints(int i) {
  623.  
  624.     // private boolean DungShop;
  625.  
  626.     public int DungPoints;
  627.  
  628.     public int DungeoneeringTokens;
  629.  
  630.     public int getDungeoneeringTokens() {
  631.         return DungeoneeringTokens;
  632.     }
  633.  
  634.     public void setDungeoneeringTokens(int DungeoneeringTokens) {
  635.         this.DungeoneeringTokens = DungeoneeringTokens;
  636.     }
  637.  
  638.     public void setTriviaPoints(int TRiviapoints) {
  639.         this.TRiviapoints = TRiviapoints;
  640.     }
  641.  
  642.     public void addDungPoints(int DungPoints) {
  643.         this.DungPoints += DungPoints;
  644.     }
  645.  
  646.     public void takeDungPoints(int DungPoints) {
  647.         this.DungPoints -= DungPoints;
  648.     }
  649.  
  650.     public int getDungPoints() {
  651.         return DungPoints;
  652.     }
  653.  
  654.     public void setDungPoints(int DungPoints) {
  655.         this.DungPoints = DungPoints;
  656.     }
  657.  
  658.     public void addDungeoneeringTokens(int DungeoneeringTokens) {
  659.         this.DungeoneeringTokens += DungeoneeringTokens;
  660.     }
  661.  
  662.     public void takeDungeoneeringTokens(int DungeoneeringTokens) {
  663.         this.DungeoneeringTokens -= DungeoneeringTokens;
  664.     }
  665.  
  666.     // public int setDungPoints() {
  667.     // return dungpoints;
  668.     // }
  669.     /**
  670.      * Farming
  671.      */
  672.  
  673.     // Falador
  674.     private int faladorHerbPatch;
  675.     private int faladorNorthAllotmentPatch;
  676.     private int faladorSouthAllotmentPatch;
  677.     private int faladorFlowerPatch;
  678.     private boolean faladorHerbPatchRaked;
  679.     private boolean faladorNorthAllotmentPatchRaked;
  680.     private boolean faladorSouthAllotmentPatchRaked;
  681.     private boolean faladorFlowerPatchRaked;
  682.  
  683.     // Catherby
  684.     private int catherbyHerbPatch;
  685.     private int catherbyNorthAllotmentPatch;
  686.     private int catherbySouthAllotmentPatch;
  687.     private int catherbyFlowerPatch;
  688.     private boolean catherbyHerbPatchRaked;
  689.     private boolean catherbyNorthAllotmentPatchRaked;
  690.     private boolean catherbySouthAllotmentPatchRaked;
  691.     private boolean catherbyFlowerPatchRaked;
  692.  
  693.     // Ardougne
  694.     private int ardougneHerbPatch;
  695.     private int ardougneNorthAllotmentPatch;
  696.     private int ardougneSouthAllotmentPatch;
  697.     private int ardougneFlowerPatch;
  698.     private boolean ardougneHerbPatchRaked;
  699.     private boolean ardougneNorthAllotmentPatchRaked;
  700.     private boolean ardougneSouthAllotmentPatchRaked;
  701.     private boolean ardougneFlowerPatchRaked;
  702.  
  703.     // Canifis
  704.     private int canifisHerbPatch;
  705.     private int canifisNorthAllotmentPatch;
  706.     private int canifisSouthAllotmentPatch;
  707.     private int canifisFlowerPatch;
  708.     private boolean canifisHerbPatchRaked;
  709.     private boolean canifisNorthAllotmentPatchRaked;
  710.     private boolean canifisSouthAllotmentPatchRaked;
  711.     private boolean canifisFlowerPatchRaked;
  712.  
  713.     // Lumbridge
  714.     private int lummyTreePatch;
  715.     private boolean lummyTreePatchRaked;
  716.  
  717.     // Varrock
  718.     private int varrockTreePatch;
  719.     private boolean varrockTreePatchRaked;
  720.  
  721.     // Falador
  722.     private int faladorTreePatch;
  723.     private boolean faladorTreePatchRaked;
  724.  
  725.     // Taverly
  726.     private int taverlyTreePatch;
  727.     private boolean taverlyTreePatchRaked;
  728.  
  729.     //
  730.     // END FARMING
  731.     //
  732.  
  733.     /**
  734.      * Farming Methods
  735.      */
  736.  
  737.     // Falador
  738.     public int getFaladorHerbPatch() {
  739.         return faladorHerbPatch;
  740.     }
  741.  
  742.     public void setFaladorHerbPatch(int seed) {
  743.         this.faladorHerbPatch = seed;
  744.     }
  745.  
  746.     public int getFaladorNorthAllotmentPatch() {
  747.         return faladorNorthAllotmentPatch;
  748.     }
  749.  
  750.     public void setFaladorNorthAllotmentPatch(int seed) {
  751.         this.faladorNorthAllotmentPatch = seed;
  752.     }
  753.  
  754.     public int getFaladorSouthAllotmentPatch() {
  755.         return faladorSouthAllotmentPatch;
  756.     }
  757.  
  758.     public void setFaladorSouthAllotmentPatch(int seed) {
  759.         this.faladorSouthAllotmentPatch = seed;
  760.     }
  761.  
  762.     public int getFaladorFlowerPatch() {
  763.         return faladorFlowerPatch;
  764.     }
  765.  
  766.     public void setFaladorFlowerPatch(int seed) {
  767.         this.faladorFlowerPatch = seed;
  768.     }
  769.  
  770.     public boolean getFaladorHerbPatchRaked() {
  771.         return faladorHerbPatchRaked;
  772.     }
  773.  
  774.     public void setFaladorHerbPatchRaked(boolean raked) {
  775.         this.faladorHerbPatchRaked = raked;
  776.     }
  777.  
  778.     public boolean getFaladorNorthAllotmentPatchRaked() {
  779.         return faladorNorthAllotmentPatchRaked;
  780.     }
  781.  
  782.     public void setFaladorNorthAllotmentPatchRaked(boolean raked) {
  783.         this.faladorNorthAllotmentPatchRaked = raked;
  784.     }
  785.  
  786.     public boolean getFaladorSouthAllotmentPatchRaked() {
  787.         return faladorSouthAllotmentPatchRaked;
  788.     }
  789.  
  790.     public void setFaladorSouthAllotmentPatchRaked(boolean raked) {
  791.         this.faladorSouthAllotmentPatchRaked = raked;
  792.     }
  793.  
  794.     public boolean getFaladorFlowerPatchRaked() {
  795.         return faladorFlowerPatchRaked;
  796.     }
  797.  
  798.     public void setFaladorFlowerPatchRaked(boolean raked) {
  799.         this.faladorFlowerPatchRaked = raked;
  800.     }
  801.  
  802.     // Ardougne
  803.     public int getArdougneHerbPatch() {
  804.         return ardougneHerbPatch;
  805.     }
  806.  
  807.     public void setArdougneHerbPatch(int seed) {
  808.         this.ardougneHerbPatch = seed;
  809.     }
  810.  
  811.     public int getArdougneNorthAllotmentPatch() {
  812.         return ardougneNorthAllotmentPatch;
  813.     }
  814.  
  815.     public void setArdougneNorthAllotmentPatch(int seed) {
  816.         this.ardougneNorthAllotmentPatch = seed;
  817.     }
  818.  
  819.     public int getArdougneSouthAllotmentPatch() {
  820.         return ardougneSouthAllotmentPatch;
  821.     }
  822.  
  823.     public void setArdougneSouthAllotmentPatch(int seed) {
  824.         this.ardougneSouthAllotmentPatch = seed;
  825.     }
  826.  
  827.     public int getArdougneFlowerPatch() {
  828.         return ardougneFlowerPatch;
  829.     }
  830.  
  831.     public void setArdougneFlowerPatch(int seed) {
  832.         this.ardougneFlowerPatch = seed;
  833.     }
  834.  
  835.     public boolean getArdougneHerbPatchRaked() {
  836.         return ardougneHerbPatchRaked;
  837.     }
  838.  
  839.     public void setArdougneHerbPatchRaked(boolean raked) {
  840.         this.ardougneHerbPatchRaked = raked;
  841.     }
  842.  
  843.     public boolean getArdougneNorthAllotmentPatchRaked() {
  844.         return ardougneNorthAllotmentPatchRaked;
  845.     }
  846.  
  847.     public void setArdougneNorthAllotmentPatchRaked(boolean raked) {
  848.         this.ardougneNorthAllotmentPatchRaked = raked;
  849.     }
  850.  
  851.     public boolean getArdougneSouthAllotmentPatchRaked() {
  852.         return ardougneSouthAllotmentPatchRaked;
  853.     }
  854.  
  855.     public void setArdougneSouthAllotmentPatchRaked(boolean raked) {
  856.         this.ardougneSouthAllotmentPatchRaked = raked;
  857.     }
  858.  
  859.     public boolean getArdougneFlowerPatchRaked() {
  860.         return ardougneFlowerPatchRaked;
  861.     }
  862.  
  863.     public void setArdougneFlowerPatchRaked(boolean raked) {
  864.         this.ardougneFlowerPatchRaked = raked;
  865.     }
  866.  
  867.     // Catherby
  868.     public int getCatherbyHerbPatch() {
  869.         return catherbyHerbPatch;
  870.     }
  871.  
  872.     public void setCatherbyHerbPatch(int seed) {
  873.         this.catherbyHerbPatch = seed;
  874.     }
  875.  
  876.     public int getCatherbyNorthAllotmentPatch() {
  877.         return catherbyNorthAllotmentPatch;
  878.     }
  879.  
  880.     public void setCatherbyNorthAllotmentPatch(int seed) {
  881.         this.catherbyNorthAllotmentPatch = seed;
  882.     }
  883.  
  884.     public int getCatherbySouthAllotmentPatch() {
  885.         return catherbySouthAllotmentPatch;
  886.     }
  887.  
  888.     public void setCatherbySouthAllotmentPatch(int seed) {
  889.         this.catherbySouthAllotmentPatch = seed;
  890.     }
  891.  
  892.     public int getCatherbyFlowerPatch() {
  893.         return catherbyFlowerPatch;
  894.     }
  895.  
  896.     public void setCatherbyFlowerPatch(int seed) {
  897.         this.catherbyFlowerPatch = seed;
  898.     }
  899.  
  900.     public boolean getCatherbyHerbPatchRaked() {
  901.         return catherbyHerbPatchRaked;
  902.     }
  903.  
  904.     public void setCatherbyHerbPatchRaked(boolean raked) {
  905.         this.catherbyHerbPatchRaked = raked;
  906.     }
  907.  
  908.     public boolean getCatherbyNorthAllotmentPatchRaked() {
  909.         return catherbyNorthAllotmentPatchRaked;
  910.     }
  911.  
  912.     public void setCatherbyNorthAllotmentPatchRaked(boolean raked) {
  913.         this.catherbyNorthAllotmentPatchRaked = raked;
  914.     }
  915.  
  916.     public boolean getCatherbySouthAllotmentPatchRaked() {
  917.         return catherbySouthAllotmentPatchRaked;
  918.     }
  919.  
  920.     public void setCatherbySouthAllotmentPatchRaked(boolean raked) {
  921.         this.catherbySouthAllotmentPatchRaked = raked;
  922.     }
  923.  
  924.     public boolean getCatherbyFlowerPatchRaked() {
  925.         return catherbyFlowerPatchRaked;
  926.     }
  927.  
  928.     public void setCatherbyFlowerPatchRaked(boolean raked) {
  929.         this.catherbyFlowerPatchRaked = raked;
  930.     }
  931.  
  932.     // Canifis
  933.     public int getCanifisHerbPatch() {
  934.         return canifisHerbPatch;
  935.     }
  936.  
  937.     public void setCanifisHerbPatch(int seed) {
  938.         this.canifisHerbPatch = seed;
  939.     }
  940.  
  941.     public int getCanifisNorthAllotmentPatch() {
  942.         return canifisNorthAllotmentPatch;
  943.     }
  944.  
  945.     public void setCanifisNorthAllotmentPatch(int seed) {
  946.         this.canifisNorthAllotmentPatch = seed;
  947.     }
  948.  
  949.     public int getCanifisSouthAllotmentPatch() {
  950.         return canifisSouthAllotmentPatch;
  951.     }
  952.  
  953.     public void setCanifisSouthAllotmentPatch(int seed) {
  954.         this.canifisSouthAllotmentPatch = seed;
  955.     }
  956.  
  957.     public int getCanifisFlowerPatch() {
  958.         return canifisFlowerPatch;
  959.     }
  960.  
  961.     public void setCanifisFlowerPatch(int seed) {
  962.         this.canifisFlowerPatch = seed;
  963.     }
  964.  
  965.     public boolean getCanifisHerbPatchRaked() {
  966.         return canifisHerbPatchRaked;
  967.     }
  968.  
  969.     public void setCanifisHerbPatchRaked(boolean raked) {
  970.         this.canifisHerbPatchRaked = raked;
  971.     }
  972.  
  973.     public boolean getCanifisNorthAllotmentPatchRaked() {
  974.         return canifisNorthAllotmentPatchRaked;
  975.     }
  976.  
  977.     public void setCanifisNorthAllotmentPatchRaked(boolean raked) {
  978.         this.canifisNorthAllotmentPatchRaked = raked;
  979.     }
  980.  
  981.     public boolean getCanifisSouthAllotmentPatchRaked() {
  982.         return canifisSouthAllotmentPatchRaked;
  983.     }
  984.  
  985.     public void setCanifisSouthAllotmentPatchRaked(boolean raked) {
  986.         this.canifisSouthAllotmentPatchRaked = raked;
  987.     }
  988.  
  989.     public boolean getCanifisFlowerPatchRaked() {
  990.         return canifisFlowerPatchRaked;
  991.     }
  992.  
  993.     public void setCanifisFlowerPatchRaked(boolean raked) {
  994.         this.canifisFlowerPatchRaked = raked;
  995.     }
  996.  
  997.     // Lumbridge
  998.     public int getLummyTreePatch() {
  999.         return lummyTreePatch;
  1000.     }
  1001.  
  1002.     public void setLummyTreePatch(int sapling) {
  1003.         this.lummyTreePatch = sapling;
  1004.     }
  1005.  
  1006.     public boolean getLummyTreePatchRaked() {
  1007.         return lummyTreePatchRaked;
  1008.     }
  1009.  
  1010.     public void setLummyTreePatchRaked(boolean raked) {
  1011.         this.lummyTreePatchRaked = raked;
  1012.     }
  1013.  
  1014.     // Varrock
  1015.     public int getVarrockTreePatch() {
  1016.         return varrockTreePatch;
  1017.     }
  1018.  
  1019.     public void setVarrockTreePatch(int sapling) {
  1020.         this.varrockTreePatch = sapling;
  1021.     }
  1022.  
  1023.     public boolean getVarrockTreePatchRaked() {
  1024.         return varrockTreePatchRaked;
  1025.     }
  1026.  
  1027.     public void setVarrockTreePatchRaked(boolean raked) {
  1028.         this.varrockTreePatchRaked = raked;
  1029.     }
  1030.  
  1031.     // Falador
  1032.     public int getFaladorTreePatch() {
  1033.         return faladorTreePatch;
  1034.     }
  1035.  
  1036.     public void setFaladorTreePatch(int sapling) {
  1037.         this.faladorTreePatch = sapling;
  1038.     }
  1039.  
  1040.     public boolean getFaladorTreePatchRaked() {
  1041.         return faladorTreePatchRaked;
  1042.     }
  1043.  
  1044.     public void setFaladorTreePatchRaked(boolean raked) {
  1045.         this.faladorTreePatchRaked = raked;
  1046.     }
  1047.  
  1048.     // Taverly
  1049.     public int getTaverlyTreePatch() {
  1050.         return taverlyTreePatch;
  1051.     }
  1052.  
  1053.     public void setTaverlyTreePatch(int sapling) {
  1054.         this.taverlyTreePatch = sapling;
  1055.     }
  1056.  
  1057.     public boolean getTaverlyTreePatchRaked() {
  1058.         return taverlyTreePatchRaked;
  1059.     }
  1060.  
  1061.     public void setTaverlyTreePatchRaked(boolean raked) {
  1062.         this.taverlyTreePatchRaked = raked;
  1063.     }
  1064.  
  1065.     //
  1066.     // END FARMING
  1067.     //
  1068.  
  1069.     // lend
  1070.     public int lendMessage;
  1071.  
  1072.     // toolbelt brah
  1073.  
  1074.     public Toolbelt toolbelt;
  1075.  
  1076.     public Toolbelt getToolbelt() {
  1077.         return toolbelt;
  1078.     }
  1079.  
  1080.     // cannon
  1081.     public DwarfCannon dwarfCannon;
  1082.  
  1083.     public DwarfCannon getDwarfCannon() {
  1084.         // TODO Auto-generated method stub
  1085.         return dwarfCannon;
  1086.     }
  1087.  
  1088.     // interface
  1089.  
  1090.     // zeals /sw
  1091.  
  1092.     private int zeals;
  1093.  
  1094.     public void increaseZeals(int zeals) {
  1095.         this.zeals += zeals;
  1096.     }
  1097.  
  1098.     public int getZeals() {
  1099.         return zeals;
  1100.     }
  1101.  
  1102.     public void setZeals(int zeals) {
  1103.         this.zeals = zeals;
  1104.     }
  1105.  
  1106.     // Money Well
  1107.  
  1108.     private double dropBoost;
  1109.     private long totalDonated;
  1110.     private long boostTime;
  1111.  
  1112.     public long getBoostTime() {
  1113.         return boostTime;
  1114.     }
  1115.  
  1116.     public void setBoostTime(long time) {
  1117.         this.boostTime = time;
  1118.     }
  1119.  
  1120.     public double getDropBoost() {
  1121.         return dropBoost;
  1122.     }
  1123.  
  1124.     public long getTotalDonatedToWell() {
  1125.         return totalDonated;
  1126.     }
  1127.  
  1128.     public void setDropBoost(double amount) {
  1129.         this.dropBoost = amount;
  1130.     }
  1131.  
  1132.     public void setTotalDonatedToWell(long amount) {
  1133.         this.totalDonated = amount;
  1134.     }
  1135.  
  1136.     // colored chats
  1137.  
  1138.     private int ColorID;
  1139.  
  1140.     public void setColorID(int ColorID) {
  1141.         this.ColorID = ColorID;
  1142.     }
  1143.  
  1144.     public int getColorID() {
  1145.         return ColorID;
  1146.     }
  1147.  
  1148.     // sof
  1149.     public SquealOfFortuneL squealOfFortuneL;
  1150.  
  1151.     public void setSquealOfFortuneL(SquealOfFortuneL squealOfFortuneL) {
  1152.         this.squealOfFortuneL = squealOfFortuneL;
  1153.     }
  1154.  
  1155.     // Title Color Stuff
  1156.     /*
  1157.      * public String getTitleColor() { return titleColor; }
  1158.      *
  1159.      * public String getTitle() { return Title; }
  1160.      *
  1161.      * public void settitlecolor(String titleColor) { this.titleColor =
  1162.      * titleColor; }
  1163.      *
  1164.      * public void setTitle(String Title) { this.Title = Title; }
  1165.      *
  1166.      * private String titleColor = "C12006";
  1167.      *
  1168.      * private String Title = "custom";
  1169.      */
  1170.  
  1171.     // Yell Stuff
  1172.  
  1173.     public int YellTokens = 0;
  1174.  
  1175.     public String getPrefix() {
  1176.         return yellPrefix;
  1177.     }
  1178.  
  1179.     public void setPrefix(String yellPrefix) {
  1180.         this.yellPrefix = yellPrefix;
  1181.     }
  1182.  
  1183.     private String yellPrefix = "Donator";
  1184.  
  1185.     public String getYellColor() {
  1186.         return yellColor;
  1187.     }
  1188.  
  1189.     public void setYellColor(String yellColor) {
  1190.         this.yellColor = yellColor;
  1191.     }
  1192.  
  1193.     private String yellColor = "ff0000";
  1194.  
  1195.     public String getShadColor() {
  1196.         return yellShade;
  1197.     }
  1198.  
  1199.     public void setYellShade(String yellShade) {
  1200.         this.yellShade = yellShade;
  1201.     }
  1202.  
  1203.     private String yellShade = "";
  1204.     // Boss Count
  1205.     public int nex = 0;
  1206.     public int bandos = 0;
  1207.     public int saradomin = 0;
  1208.     public int armadyl = 0;
  1209.     public int zamorak = 0;
  1210.     public int cannoneer = 0;
  1211.     public int corp = 0;
  1212.     public int jadinko = 0;
  1213.     public int glacor = 0;
  1214.     public int dks = 0;
  1215.     public int qbd = 0;
  1216.     // Xp Modes
  1217.     public boolean easy = false, medium = false, hard = false, insane = false;
  1218.  
  1219.     public void setEasy(boolean easy) {
  1220.         this.easy = easy;
  1221.     }
  1222.  
  1223.     public void setMedium(boolean medium) {
  1224.         this.medium = medium;
  1225.     }
  1226.  
  1227.     public void setHard(boolean hard) {
  1228.         this.hard = hard;
  1229.     }
  1230.  
  1231.     public void setInsane(boolean insane) {
  1232.         this.insane = insane;
  1233.     }
  1234.  
  1235.     public boolean isEasy() {
  1236.         return easy;
  1237.     }
  1238.  
  1239.     public boolean isMedium() {
  1240.         return medium;
  1241.     }
  1242.  
  1243.     public boolean isHard() {
  1244.         return hard;
  1245.     }
  1246.  
  1247.     public boolean isInsane() {
  1248.         return insane;
  1249.     }
  1250.  
  1251.     private SlayerManager slayerManager;
  1252.  
  1253.     public void setSlayerManager(SlayerManager manager) {
  1254.         this.slayerManager = manager;
  1255.     }
  1256.  
  1257.     public SlayerManager getSlayerManager() {
  1258.         return slayerManager;
  1259.     }
  1260.  
  1261.     // XpModeCommand
  1262.     /*
  1263.      * private int gameMode; //0 = easy, 1 = medium, 2 = hard, 3 = insane
  1264.      *
  1265.      * public String getMode() { if(gameMode == 0) return "easy"; else
  1266.      * if(gameMode == 1) return "medium"; else if(gameMode == 2) return "hard";
  1267.      * else if (gameMode == 3) return "insane"; return "error"; } public void
  1268.      * setMode(int modeID) { gameMode = modeID; }
  1269.      */
  1270.     // Dfs
  1271.     private boolean dfsActivated;
  1272.     private int dfscoolDown;
  1273.     public transient DialogueManager dialogueManager;
  1274.     public transient Dialogue dialogue;
  1275.     private transient boolean disableEquip;
  1276.     public transient int displayMode;
  1277.     private String displayName;
  1278.     private long displayTime;
  1279.     private int dominionFactor;
  1280.     public DominionTower dominionTower;
  1281.     private boolean donator;
  1282.     private boolean dicer;
  1283.     private boolean isIronman;
  1284.  
  1285.     public boolean isOwner() {
  1286.         return getRights() == 7;
  1287.     }
  1288.  
  1289.     public boolean isHeadMod() {
  1290.         return getRights() == 15;
  1291.     }
  1292.  
  1293.     public void setHeadMod(boolean isHeadMod) {
  1294.         if (isHeadMod == true) {
  1295.             this.setRights(15);
  1296.             return;
  1297.         } else {
  1298.             return;
  1299.         }
  1300.     }
  1301.  
  1302.     public boolean isHeadAdmin() {
  1303.         return getRights() == 6;
  1304.     }
  1305.  
  1306.     public void setHeadAdmin(boolean isHeadAdmin) {
  1307.         if (isHeadAdmin == true) {
  1308.             this.setRights(6);
  1309.             return;
  1310.         } else {
  1311.             return;
  1312.         }
  1313.     }
  1314.  
  1315.     public void setOwner(boolean isOwner) {
  1316.     }
  1317.  
  1318.     public boolean isForumsAdmin() {
  1319.         return getRights() == 14;
  1320.     }
  1321.    
  1322.     public boolean isAdmin() {
  1323.         return getRights() == 2;
  1324.     }
  1325.     public void setMod(boolean isMod) {
  1326.         if (isMod == true) {
  1327.             this.setRights(1);
  1328.             return;
  1329.         } else {
  1330.             return;
  1331.         }
  1332.     }
  1333.    
  1334.     public void setForumsAdmin(boolean isForumsAdmin) {
  1335.         if (isForumsAdmin == true) {
  1336.             this.setRights(14);
  1337.             return;
  1338.         } else {
  1339.             return;
  1340.         }
  1341.     }
  1342.  
  1343.     public void setAdmin(boolean isAdmin) {
  1344.         if (isAdmin == true) {
  1345.             this.setRights(2);
  1346.             return;
  1347.         } else {
  1348.             return;
  1349.         }
  1350.     }
  1351.  
  1352.     public boolean isIronman() {
  1353.         return isIronman;
  1354.     }
  1355.  
  1356.     public void setIronman(boolean isIronman) {
  1357.         this.isIronman = isIronman;
  1358.     }
  1359.  
  1360.     private long donatorTill;
  1361.     private DuelArena duelarena;
  1362.     public int dungeoneeringTokens;
  1363.     private int easterPoints;
  1364.     private String email;
  1365.     private EmotesManager emotesManager;
  1366.     private String enteredPinString = null;
  1367.     private Equipment equipment;
  1368.     private boolean extremeDonator;
  1369.     private long extremeDonatorTill;
  1370.     public int[] fairyRingCombination = new int[3];
  1371.     public Familiar familiar;
  1372.     private boolean filterGame;
  1373.     private transient boolean finishing;
  1374.     private long fireImmune;
  1375.     private boolean flamBeed;
  1376.     private transient long foodDelay;
  1377.     private boolean forceNextMapLoadRefresh;
  1378.     private int friendChatSetup;
  1379.     private FriendsIgnores friendsIgnores;
  1380.     private int gnomeAdvancedLaps;
  1381.     private boolean gotInfernoAdze;
  1382.     private boolean hasCutEnoughLogs;
  1383.     private boolean hasFinishedBarrows;
  1384.     private boolean hasCutMoreEnoughLogs;
  1385.     // Battle Terrace
  1386.     public boolean hasTut;
  1387.     private int hiddenBrother;
  1388.  
  1389.     private boolean hideSofInterface;
  1390.     private boolean hideWorldAnnouncements;
  1391.  
  1392.     public transient HintIconsManager hintIconsManager;
  1393.     private transient double hpBoostMultiplier;
  1394.     private boolean inAnimationRoom;
  1395.     public transient InterfaceManager interfaceManager;
  1396.     private Inventory inventory;
  1397.     private transient boolean invulnerable;
  1398.     public transient IsaacKeyPair isaacKeyPair;
  1399.     public boolean isBurying = false;
  1400.     private boolean isForumModerator;
  1401.     private boolean isGraphicDesigner;
  1402.     private boolean isInDefenderRoom;
  1403.     private boolean isInLobby;
  1404.     // supportteam
  1405.     private boolean isSupporter;
  1406.     private long jailed;
  1407.     private boolean karamel;
  1408.     // objects
  1409.     private boolean khalphiteLairEntranceSetted;
  1410.  
  1411.     private boolean khalphiteLairSetted;
  1412.     // honor
  1413.     private int killCount, deathCount;
  1414.     // barrows
  1415.     private boolean[] killedBarrowBrothers;
  1416.     private boolean killedBork;
  1417.     private boolean killedQueenBlackDragon;
  1418.     private transient boolean largeSceneView;
  1419.     private int lastBonfire;
  1420.  
  1421.     public transient DuelRules lastDuelRules;
  1422.     private String lastIP;
  1423.     private String lastKilled;
  1424.     private long lastLoggedIn;
  1425.     private String lastMsg;
  1426.     private transient long lastPublicMessage;
  1427.     private long lastRequestSQL;
  1428.     public long lastWalkedMillis;
  1429.     private int loadedLogs;
  1430.  
  1431.     public transient LocalNPCUpdate localNPCUpdate;
  1432.     // used for update
  1433.     public transient LocalPlayerUpdate localPlayerUpdate;
  1434.     private transient long lockDelay; // used for doors and stuff like that
  1435.     private int loggedWorld;
  1436.     // used for packets logic
  1437.     public transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
  1438.     private int logsCut;
  1439.     private boolean lootshareEnabled;
  1440.     public int Loyaltypoints;
  1441.     private boolean macBanned;
  1442.  
  1443.     // comp req stuff
  1444.     private int magicLogsBurned;
  1445.  
  1446.     // skill capes customizing
  1447.     private int[] maxedCapeCustomized;
  1448.     private int money;
  1449.     private boolean mouseButtons;
  1450.     private MusicsManager musicsManager;
  1451.  
  1452.     private long muted;
  1453.     public Notes notes;
  1454.  
  1455.     // voting
  1456.     private boolean oldItemsLook;
  1457.  
  1458.     public int ordinanceTimer;
  1459.  
  1460.     private int overloadDelay;
  1461.     private List<String> ownedObjectsManagerKeys;
  1462.     private String Owner = "";
  1463.     private transient long packetsDecoderPing;
  1464.     // saving stuff
  1465.     private String password;
  1466.     private boolean permBanned;
  1467.  
  1468.     private boolean permMuted;
  1469.     private int pestControlGames;
  1470.  
  1471.     private int pestPoints;
  1472.     public transient Pet pet;
  1473.     public PetManager petManager;
  1474.     private int pkPoints;
  1475.  
  1476.     private long poisonImmune;
  1477.     private transient long polDelay;
  1478.  
  1479.     private transient long potDelay;
  1480.     public MoneyPouch pouch;
  1481.  
  1482.     private int[] pouches;
  1483.     public Prayer prayer;
  1484.     private int prayerRenewalDelay;
  1485.  
  1486.     private int prestige;
  1487.     public transient PriceCheckManager priceCheckManager;
  1488.  
  1489.     private int privateChatSetup;
  1490.  
  1491.     // game bar status
  1492.     private int publicStatus;
  1493.  
  1494.     public int pvmPoints;
  1495.  
  1496.     public QuestManager questManager;
  1497.  
  1498.     private String recovAnswer;
  1499.  
  1500.     // Recovery ques. & ans.
  1501.     private String recovQuestion;
  1502.  
  1503.     private String registeredMac, currentMac;
  1504.     private boolean reportOption;
  1505.     private transient boolean resting;
  1506.     private int rights;
  1507.     private int rocktailsCooked;
  1508.     private byte runEnergy;
  1509.     private int runeSpanPoints;
  1510.     private transient boolean running;
  1511.     public transient int screenHeight;
  1512.  
  1513.     public transient int screenWidth;
  1514.  
  1515.     public String selectedClass;
  1516.  
  1517.     public transient Session session;
  1518.  
  1519.     public String setMutedBy, mutedReason;
  1520.  
  1521.     private boolean setStarter;
  1522.  
  1523.     private Skills skills;
  1524.  
  1525.     private int skullDelay;
  1526.  
  1527.     private int skullId;
  1528.  
  1529.     public int slayerPoints;
  1530.  
  1531.     private transient boolean spawnsMode;
  1532.  
  1533.     private int specRestoreTimer;
  1534.  
  1535.     // player stages
  1536.     private transient boolean started;
  1537.  
  1538.     private int summoningLeftClickOption;
  1539.  
  1540.     private transient List<Integer> switchItemCache;
  1541.  
  1542.     private boolean talkedtoCook;
  1543.  
  1544.     // crucible
  1545.     private boolean talkedWithMarv;
  1546.  
  1547.     // Vannaka
  1548.     private boolean talkedWithVannaka;
  1549.  
  1550.     // Slayer
  1551.     // private SlayerTask task;
  1552.  
  1553.     private int temporaryMovementType;
  1554.  
  1555.     public transient Trade trade;
  1556.  
  1557.     private int tradeStatus;
  1558.  
  1559.     private int uniquePlayerId;
  1560.  
  1561.     private boolean updateMovementType;
  1562.  
  1563.     public int usedMacs;
  1564.  
  1565.     // transient stuff
  1566.     public transient String username;
  1567.  
  1568.     private int vecnaTimer;
  1569.  
  1570.     private boolean Legend;
  1571.  
  1572.     public int votePoints;
  1573.  
  1574.     public int warriorKills, archerKills, mageKills;
  1575.  
  1576.     public int warriorLevel, archerLevel, mageLevel;
  1577.  
  1578.     private boolean wonFightPits;
  1579.  
  1580.     private boolean xpLocked;
  1581.  
  1582.     private boolean yellDisabled;
  1583.  
  1584.     private boolean yellOff;
  1585.  
  1586.     private boolean zenRest;
  1587.  
  1588.     // creates Player and saved classes
  1589.     public Player(String password) {
  1590.         super(Settings.START_PLAYER_LOCATION);
  1591.         setHitpoints(Settings.START_PLAYER_HITPOINTS);
  1592.         squealOfFortuneL = new SquealOfFortuneL();
  1593.         this.password = password;
  1594.         appearence = new Appearence();
  1595.         loyaltyManager = new LoyaltyManager(this);
  1596.         inventory = new Inventory();
  1597.         equipment = new Equipment();
  1598.         gearPresets = new GearPresets();
  1599.         skills = new Skills();
  1600.         toolbelt = new Toolbelt();
  1601.         combatDefinitions = new CombatDefinitions();
  1602.         prayer = new Prayer();
  1603.         bank = new Bank(this);
  1604.         notes = new Notes();
  1605.         controlerManager = new ControlerManager();
  1606.         musicsManager = new MusicsManager();
  1607.         emotesManager = new EmotesManager();
  1608.         friendsIgnores = new FriendsIgnores();
  1609.         dominionTower = new DominionTower();
  1610.         charges = new ChargesManager();
  1611.         auraManager = new AuraManager();
  1612.         questManager = new QuestManager();
  1613.         petManager = new PetManager();
  1614.         slayerManager = new SlayerManager(this);
  1615.         runEnergy = 100;
  1616.         allowChatEffects = true;
  1617.         mouseButtons = true;
  1618.         pouches = new int[4];
  1619.         fairyRingCombination = new int[3];
  1620.         resetBarrows();
  1621.         SkillCapeCustomizer.resetSkillCapes(this);
  1622.         ownedObjectsManagerKeys = new LinkedList<String>();
  1623.         setCreationDate(Utils.currentTimeMillis());
  1624.         currentFriendChatOwner = Settings.MAIN_ACESSS[0];
  1625.     }
  1626.  
  1627.     public void giveDailies() {
  1628.         if ((Utils.currentTimeMillis() - lastDailyGiven) < (12 * 60 * 60 * 1000)) // 12
  1629.                                                                                     // hours
  1630.             return;
  1631.         lastDailyGiven = Utils.currentTimeMillis();
  1632.         rerolls = 3;
  1633.     }
  1634.  
  1635.     public void resetfl() {
  1636.         friendsIgnores = new FriendsIgnores();
  1637.         FriendChatsManager.refreshChat(this);
  1638.     }
  1639.  
  1640.     public void addBoneDelay(long time) {
  1641.         boneDelay = time + Utils.currentTimeMillis();
  1642.     }
  1643.  
  1644.     public void addDisplayTime(long i) {
  1645.         this.displayTime = i + Utils.currentTimeMillis();
  1646.     }
  1647.  
  1648.     public void addFireImmune(long time) {
  1649.         fireImmune = time + Utils.currentTimeMillis();
  1650.     }
  1651.  
  1652.     public void addFoodDelay(long time) {
  1653.         foodDelay = time + Utils.currentTimeMillis();
  1654.     }
  1655.  
  1656.     public static String now(String dateFormat) {
  1657.         Calendar cal = Calendar.getInstance();
  1658.         SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
  1659.         return sdf.format(cal.getTime());
  1660.     }
  1661.  
  1662.     public void addLogicPacketToQueue(LogicPacket packet) {
  1663.         for (LogicPacket p : logicPackets) {
  1664.             if (p.getId() == packet.getId()) {
  1665.                 logicPackets.remove(p);
  1666.                 break;
  1667.             }
  1668.         }
  1669.         logicPackets.add(packet);
  1670.     }
  1671.  
  1672.     public void addPoisonImmune(long time) {
  1673.         poisonImmune = time + Utils.currentTimeMillis();
  1674.         getPoison().reset();
  1675.     }
  1676.  
  1677.     public void addPolDelay(long delay) {
  1678.         polDelay = delay + Utils.currentTimeMillis();
  1679.     }
  1680.  
  1681.     public void addPotDelay(long time) {
  1682.         potDelay = time + Utils.currentTimeMillis();
  1683.     }
  1684.  
  1685.     /**
  1686.      * Adds points
  1687.      *
  1688.      * @param points
  1689.      */
  1690.     public void addRunespanPoints(int points) {
  1691.         this.runeSpanPoints += points;
  1692.     }
  1693.  
  1694.     public static final int MAX_STARTER_COUNT = 2;
  1695.  
  1696.     public int Ironman = 0;
  1697.     public int Ironmanstage = 0;
  1698.     public int newplayer = 0;
  1699.     public int newplayerstage = 0;
  1700.  
  1701.     public void addStarterPackage(boolean extraCoins) {
  1702.         String ip = getSession().getIP();
  1703.         int count = StarterMap.getSingleton().getCount(ip);
  1704.         if (count >= MAX_STARTER_COUNT) {
  1705.             setStarter(true);
  1706.             sendMessage("You have already claimed the maximum amount of starter sets.");
  1707.             return;
  1708.         }
  1709.     }
  1710.  
  1711.     public boolean canSpawn() {
  1712.         if (Wilderness.isAtWild(this) || getControlerManager().getControler() instanceof FightPitsArena
  1713.                 || getControlerManager().getControler() instanceof CorpBeastControler
  1714.                 || getControlerManager().getControler() instanceof PestControlLobby
  1715.                 || getControlerManager().getControler() instanceof PestControlGame
  1716.                 || getControlerManager().getControler() instanceof DungeoneeringControler
  1717.                 || getControlerManager().getControler() instanceof ZGDControler
  1718.                 || getControlerManager().getControler() instanceof GodWars
  1719.                 || getControlerManager().getControler() instanceof StartTutorial
  1720.                 || getControlerManager().getControler() instanceof JailControler
  1721.                 || getControlerManager().getControler() instanceof DTControler
  1722.                 || getControlerManager().getControler() instanceof WarControler
  1723.                 || getControlerManager().getControler() instanceof DeathEvent
  1724.                 || getControlerManager().getControler() instanceof BarrelchestControler
  1725.                 || getControlerManager().getControler() instanceof DuelArena
  1726.                 || getControlerManager().getControler() instanceof CastleWarsPlaying
  1727.                 || getControlerManager().getControler() instanceof CastleWarsWaiting
  1728.                 || getControlerManager().getControler() instanceof LobbyController
  1729.                 || getControlerManager().getControler() instanceof GameController
  1730.                 || getControlerManager().getControler() instanceof FightCaves
  1731.                 || getControlerManager().getControler() instanceof FightKiln
  1732.                 || getControlerManager().getControler() instanceof ImpossibleJad
  1733.                 || getControlerManager().getControler() instanceof BarrelchestControler
  1734.                 || getControlerManager().getControler() instanceof battleTerraceGame || FfaZone.inPvpArea(this)
  1735.                 || getControlerManager().getControler() instanceof NomadsRequiem
  1736.                 || getControlerManager().getControler() instanceof QueenBlackDragonController) {
  1737.             return false;
  1738.         }
  1739.         if (getControlerManager().getControler() instanceof CrucibleControler) {
  1740.             CrucibleControler controler = (CrucibleControler) getControlerManager().getControler();
  1741.             return !controler.isInside();
  1742.         }
  1743.         return true;
  1744.     }
  1745.  
  1746.     public void checkMovement(int x, int y, int plane) {
  1747.         Magic.teleControlersCheck(this, new WorldTile(x, y, plane));
  1748.     }
  1749.  
  1750.     @Override
  1751.     public void checkMultiArea() {
  1752.         if (!started)
  1753.             return;
  1754.         boolean isAtMultiArea = isForceMultiArea() ? true : World.isMultiArea(this);
  1755.         if (isAtMultiArea && !isAtMultiArea()) {
  1756.             setAtMultiArea(isAtMultiArea);
  1757.             getPackets().sendGlobalConfig(616, 1);
  1758.         } else if (!isAtMultiArea && isAtMultiArea()) {
  1759.             setAtMultiArea(isAtMultiArea);
  1760.             getPackets().sendGlobalConfig(616, 0);
  1761.         }
  1762.     }
  1763.  
  1764.     public int checkTotalLevel(int checktotal) {
  1765.         checktotal = 0;
  1766.         for (int i = 0; i < 25; i++) {
  1767.             checktotal += getSkills().getLevel(i);
  1768.         }
  1769.         return checktotal;
  1770.     }
  1771.  
  1772.     public boolean clientHasLoadedMapRegion() {
  1773.         return clientLoadedMapRegion;
  1774.     }
  1775.  
  1776.     public void closeInterfaces() {
  1777.         //System.out.println("Its using closeInterfaces.");
  1778.         if (interfaceManager.containsScreenInter())
  1779.             interfaceManager.closeScreenInterface();
  1780.         if (interfaceManager.containsInventoryInter())
  1781.             interfaceManager.closeInventoryInterface();
  1782.         dialogueManager.finishDialogue();
  1783.         if (closeInterfacesEvent != null) {
  1784.             closeInterfacesEvent.run();
  1785.             closeInterfacesEvent = null;
  1786.         }
  1787.     }
  1788.  
  1789.     public void drainRunEnergy() {
  1790.         if (extremeDonator == true) {
  1791.             setRunEnergy(runEnergy - 0);
  1792.         } else
  1793.             setRunEnergy(runEnergy - 1);
  1794.     }
  1795.  
  1796.     @Override
  1797.     public void finish() {
  1798.         finish(0);
  1799.     }
  1800.  
  1801.     public void finish(final int tryCount) {
  1802.         if (finishing || hasFinished()) {
  1803.             if (World.containsPlayer(username)) {
  1804.                 World.removePlayer(this);
  1805.             }
  1806.             if (World.containsLobbyPlayer(username)) {
  1807.                 World.removeLobbyPlayer(this);
  1808.             }
  1809.             return;
  1810.         }
  1811.         finishing = true;
  1812.         // if combating doesnt stop when xlog this way ends combat
  1813.         if (!World.containsLobbyPlayer(username)) {
  1814.             stopAll(false, true, !(actionManager.getAction() instanceof PlayerCombat));
  1815.         }
  1816.         long currentTime = Utils.currentTimeMillis();
  1817.         if ((getAttackedByDelay() + 10000 > currentTime && tryCount < 6)
  1818.                 || getEmotesManager().getNextEmoteEnd() >= currentTime || lockDelay >= currentTime || isDead()) {
  1819.             CoresManager.slowExecutor.schedule(new Runnable() {
  1820.                 @Override
  1821.                 public void run() {
  1822.                     try {
  1823.                         packetsDecoderPing = Utils.currentTimeMillis();
  1824.                         finishing = false;
  1825.                         finish(tryCount + 1);
  1826.                     } catch (Throwable e) {
  1827.                         Logger.handle(e);
  1828.                     }
  1829.                 }
  1830.             }, 10, TimeUnit.SECONDS);
  1831.             return;
  1832.         }
  1833.         realFinish();
  1834.     }
  1835.  
  1836.     public void forceLogout() {
  1837.         getPackets().sendLogout(false);
  1838.         setRunning(false);
  1839.         realFinish();
  1840.     }
  1841.  
  1842.     public void forceSession() {
  1843.         setRunning(false);
  1844.         realFinish();
  1845.     }
  1846.  
  1847.     public ActionManager getActionManager() {
  1848.         return actionManager;
  1849.     }
  1850.  
  1851.     public Appearence getAppearence() {
  1852.         return appearence;
  1853.     }
  1854.  
  1855.     public int getAssistStatus() {
  1856.         return assistStatus;
  1857.     }
  1858.  
  1859.     public AuraManager getAuraManager() {
  1860.         return auraManager;
  1861.     }
  1862.  
  1863.     public Bank getBank() {
  1864.         return bank;
  1865.     }
  1866.  
  1867.     public KcTab getKcTab() {//not here, loginmanager
  1868.         return kcTab;
  1869.     }
  1870.  
  1871.     /*
  1872.      * public String getBankPin() { return bankPinString; }
  1873.      */
  1874.  
  1875.     public long getBanned() {
  1876.         return banned;
  1877.     }
  1878.  
  1879.     public int getBarbarianAdvancedLaps() {
  1880.         return barbarianAdvancedLaps;
  1881.     }
  1882.  
  1883.     public int getBarrowsKillCount() {
  1884.         return barrowsKillCount;
  1885.     }
  1886.  
  1887.     public int getBarsDone() {
  1888.         return barsDone;
  1889.     }
  1890.  
  1891.     public long getBoneDelay() {
  1892.         return boneDelay;
  1893.     }
  1894.  
  1895.     public BountyHunter getBountyHunter() {
  1896.         return bountyHunter;
  1897.     }
  1898.  
  1899.     public ChargesManager getCharges() {
  1900.         return charges;
  1901.     }
  1902.  
  1903.     public SquealOfFortuneL getSquealOfFortune() {
  1904.         return squealOfFortuneL;
  1905.     }
  1906.  
  1907.     public int getClanStatus() {
  1908.         return clanStatus;
  1909.     }
  1910.  
  1911.     public int getClueReward() {
  1912.         return clueReward;
  1913.     }
  1914.  
  1915.     public CombatDefinitions getCombatDefinitions() {
  1916.         return combatDefinitions;
  1917.     }
  1918.  
  1919.     public int[] getCompletionistCapeCustomized() {
  1920.         return completionistCapeCustomized;
  1921.     }
  1922.  
  1923.     public ControlerManager getControlerManager() {
  1924.         return controlerManager;
  1925.     }
  1926.  
  1927.     public long getCreationDate() {
  1928.         return creationDate;
  1929.     }
  1930.  
  1931.     public int getCrucibleHighScore() {
  1932.         return crucibleHighScore;
  1933.     }
  1934.  
  1935.     public FriendChatsManager getCurrentFriendChat() {
  1936.         return currentFriendChat;
  1937.     }
  1938.  
  1939.     public String getCurrentFriendChatOwner() {
  1940.         return currentFriendChatOwner;
  1941.     }
  1942.  
  1943.     public String getCurrentMac() {
  1944.         return currentMac;
  1945.     }
  1946.  
  1947.     public int getCurrentWorldLobby() {
  1948.         return currentWorldLobby;
  1949.     }
  1950.  
  1951.     public String getCustomTitle() {
  1952.         return customTitle;
  1953.     }
  1954.  
  1955.     public CutscenesManager getCutscenesManager() {
  1956.         return cutscenesManager;
  1957.     }
  1958.  
  1959.     public int getDeathCount() {
  1960.         return deathCount;
  1961.     }
  1962.  
  1963.     public int getdfscoolDown() {
  1964.         return dfscoolDown;
  1965.     }
  1966.  
  1967.     public Dialogue getDialogue() {
  1968.         return dialogue;
  1969.     }
  1970.  
  1971.     public DialogueManager getDialogueManager() {
  1972.         return dialogueManager;
  1973.     }
  1974.  
  1975.     public boolean hasLoginPin;
  1976.     public int pin;
  1977.  
  1978.     public int getLoginPin() {
  1979.         return pin;
  1980.     }
  1981.  
  1982.     public void setLoginPin(int pin) {
  1983.         this.pin = pin;
  1984.     }
  1985.  
  1986.     public int keysOpened;
  1987.  
  1988.     public String getKeysOpened() {
  1989.         return keysOpened + " Crystal Chests!";
  1990.     }
  1991.  
  1992.     public int totaldonated;
  1993.  
  1994.     public int getTotalDonated() {
  1995.         return totaldonated;
  1996.     }
  1997.  
  1998.     public int getDisplayMode() {
  1999.         return displayMode;
  2000.     }
  2001.  
  2002.     public String getDisplayName() {
  2003.         if (displayName != null)
  2004.             return displayName;
  2005.         return Utils.formatPlayerNameForDisplay(username);
  2006.     }
  2007.  
  2008.     public long getDisplayTime() {
  2009.         return displayTime;
  2010.     }
  2011.  
  2012.     public int getDominionFactor() {
  2013.         return dominionFactor;
  2014.     }
  2015.  
  2016.     public DominionTower getDominionTower() {
  2017.         return dominionTower;
  2018.     }
  2019.  
  2020.     @SuppressWarnings("deprecation")
  2021.     public String getDonatorTill() {
  2022.         return (donator ? "never" : new Date(donatorTill).toGMTString()) + ".";
  2023.     }
  2024.  
  2025.     public DuelArena getDuelArena() {
  2026.         return duelarena;
  2027.     }
  2028.  
  2029.     public int getEasterPoints() {
  2030.         return easterPoints;
  2031.     }
  2032.  
  2033.     public String getEmailAttached() {
  2034.         return email;
  2035.     }
  2036.  
  2037.     public EmotesManager getEmotesManager() {
  2038.         return emotesManager;
  2039.     }
  2040.  
  2041.     public String getEnteredBankPin() {
  2042.         return enteredPinString;
  2043.     }
  2044.  
  2045.     public Equipment getEquipment() {
  2046.         return equipment;
  2047.     }
  2048.  
  2049.     @SuppressWarnings("deprecation")
  2050.     public String getExtremeDonatorTill() {
  2051.         return (extremeDonator ? "never" : new Date(extremeDonatorTill).toGMTString()) + ".";
  2052.     }
  2053.  
  2054.     public int[] getFairyRingCombination() {
  2055.         return fairyRingCombination;
  2056.     }
  2057.  
  2058.     public Familiar getFamiliar() {
  2059.         return familiar;
  2060.     }
  2061.  
  2062.     public long getFireImmune() {
  2063.         return fireImmune;
  2064.     }
  2065.  
  2066.     public long getFoodDelay() {
  2067.         return foodDelay;
  2068.     }
  2069.  
  2070.     public FriendsIgnores getFriendsIgnores() {
  2071.         return friendsIgnores;
  2072.     }
  2073.  
  2074.     public int getGnomeAdvancedLaps() {
  2075.         return gnomeAdvancedLaps;
  2076.     }
  2077.  
  2078.     public int getHiddenBrother() {
  2079.         return hiddenBrother;
  2080.     }
  2081.  
  2082.     public HintIconsManager getHintIconsManager() {
  2083.         return hintIconsManager;
  2084.     }
  2085.  
  2086.     public double getHpBoostMultiplier() {
  2087.         return hpBoostMultiplier;
  2088.     }
  2089.  
  2090.     public InterfaceManager getInterfaceManager() {
  2091.         return interfaceManager;
  2092.     }
  2093.  
  2094.     public final boolean isAtWild() {
  2095.         return (getX() >= 3011 && getX() <= 3132 && getY() >= 10052 && getY() <= 10175)
  2096.                 || (getX() >= 2940 && getX() <= 3395 && getY() >= 3525 && getY() <= 4000)
  2097.                 || (getX() >= 3264 && getX() <= 3279 && getY() >= 3279 && getY() <= 3672)
  2098.                 || (getX() >= 3158 && getX() <= 3181 && getY() >= 3679 && getY() <= 3697)
  2099.                 || (getX() >= 3280 && getX() <= 3183 && getY() >= 3885 && getY() <= 3888)
  2100.                 || (getX() >= 3012 && getX() <= 3059 && getY() >= 10303 && getY() <= 10351)
  2101.                 || (getX() >= 3060 && getX() <= 3072 && getY() >= 10251 && getY() <= 10263);
  2102.     }
  2103.  
  2104.     public final boolean isInClanwars() {
  2105.         return (getX() >= 2981 && getX() <= 3006 && getY() >= 9664 && getY() <= 9694)
  2106.                 || (getX() >= 2947 && getX() <= 3070 && getY() >= 5506 && getY() <= 5630)
  2107.                 || (getX() >= 2755 && getX() <= 2876 && getY() >= 5506 && getY() <= 5630);
  2108.     }
  2109.  
  2110.     public final boolean isInRedPortal() {
  2111.         return (getX() >= 2948 && getX() <= 3069 && getY() >= 5507 && getY() <= 5629);
  2112.     }
  2113.  
  2114.     public final boolean isInClanwarsLobby() {
  2115.         return (getX() >= 2981 && getX() <= 3006 && getY() >= 9664 && getY() <= 9694);
  2116.     }
  2117.  
  2118.     public final boolean atJail() {
  2119.         return (getX() >= 1385 && getX() <= 3198 && getY() >= 9816 && getY() <= 9837);
  2120.     }
  2121.  
  2122.     public final boolean isAtTourny() {
  2123.         return (getX() >= 4441 && getX() <= 4474 && getY() >= 4121 && getY() <= 4158);
  2124.     }
  2125.  
  2126.     public final boolean isAtNonprod() {
  2127.         return (getX() >= 1859 && getX() <= 1915 && getY() >= 3215 && getY() <= 3249);
  2128.     }
  2129.  
  2130.     public Inventory getInventory() {
  2131.         return inventory;
  2132.     }
  2133.  
  2134.     public IsaacKeyPair getIsaacKeyPair() {
  2135.         return isaacKeyPair;
  2136.     }
  2137.  
  2138.     public boolean getIsInLobby() {
  2139.         return isInLobby;
  2140.     }
  2141.  
  2142.     public long getJailed() {
  2143.         return jailed;
  2144.     }
  2145.  
  2146.     public long getWorldXp() {
  2147.         return WorldXp;
  2148.     }
  2149.  
  2150.     public int getKillCount() {
  2151.         return killCount;
  2152.     }
  2153.  
  2154.     public boolean[] getKilledBarrowBrothers() {
  2155.         return killedBarrowBrothers;
  2156.     }
  2157.  
  2158.     public int getLastBonfire() {
  2159.         return lastBonfire;
  2160.     }
  2161.  
  2162.     /**
  2163.      * END RFD
  2164.      */
  2165.  
  2166.     public DuelRules getLastDuelRules() {
  2167.         return lastDuelRules;
  2168.     }
  2169.  
  2170.     public String getLastHostname() {
  2171.         InetAddress addr;
  2172.         try {
  2173.             addr = InetAddress.getByName(getLastIP());
  2174.             String hostname = addr.getHostName();
  2175.             return hostname;
  2176.         } catch (UnknownHostException e) {
  2177.             e.printStackTrace();
  2178.         }
  2179.         return null;
  2180.     }
  2181.  
  2182.     public String getLastIP() {
  2183.         return lastIP;
  2184.     }
  2185.  
  2186.     public long getLastLoggedIn() {
  2187.         // TODO Auto-generated method stub
  2188.         return lastLoggedIn;
  2189.     }
  2190.  
  2191.     public String getLastMsg() {
  2192.         return lastMsg;
  2193.     }
  2194.  
  2195.     public long getLastPublicMessage() {
  2196.         return lastPublicMessage;
  2197.     }
  2198.  
  2199.     public long getLastRequestSQL() {
  2200.         // TODO Auto-generated method stub
  2201.         return lastRequestSQL;
  2202.     }
  2203.  
  2204.     public long getLastWalked() {
  2205.         return lastWalkedMillis;
  2206.     }
  2207.  
  2208.     public boolean warned;
  2209.  
  2210.     public boolean isWarned() {
  2211.         return warned;
  2212.     }
  2213.  
  2214.     public void setWarned(boolean warned) {
  2215.         this.warned = warned;
  2216.     }
  2217.  
  2218.     public int getLoadedLogs() {
  2219.         return loadedLogs;
  2220.     }
  2221.  
  2222.     public LocalNPCUpdate getLocalNPCUpdate() {
  2223.         return localNPCUpdate;
  2224.     }
  2225.  
  2226.     public LocalPlayerUpdate getLocalPlayerUpdate() {
  2227.         return localPlayerUpdate;
  2228.     }
  2229.  
  2230.     public long getLockDelay() {
  2231.         return lockDelay;
  2232.     }
  2233.  
  2234.     public int getLoggedInWorld() {
  2235.         // TODO Auto-generated method stub
  2236.         return loggedWorld;
  2237.     }
  2238.  
  2239.     public int getLogsCut() {
  2240.         return logsCut;
  2241.     }
  2242.  
  2243.     public int getLoyaltyPoints() {
  2244.         return Loyaltypoints;
  2245.     }
  2246.  
  2247.     @Override
  2248.     public double getMagePrayerMultiplier() {
  2249.         return 0.6;
  2250.     }
  2251.  
  2252.     public int getMagicLogsBurned() {
  2253.         return magicLogsBurned;
  2254.     }
  2255.  
  2256.     public boolean hasKilledEveryBoss() {
  2257.         if (bandosKc >= 1 && armadylKc >= 1 && saradominKc >= 1 && zamorakKc >= 1 && nexKc >= 1 && corpKc >= 1
  2258.                 && blinkKc >= 1 && pdemonKc >= 1 && kbdKc >= 1 && qbdKc >= 1 && glacorKc >= 1 && tdKc >= 1
  2259.                 && borkKc >= 1 && aodKc >= 1 && hopeKc >= 1)
  2260.             return true;
  2261.         return false;
  2262.     }
  2263.  
  2264.     public boolean hasKilledEveryBoss100() {
  2265.         if (bandosKc >= 100 && armadylKc >= 100 && saradominKc >= 100 && zamorakKc >= 100 && corpKc >= 100
  2266.                 && blinkKc >= 100 && pdemonKc >= 100 && kbdKc >= 100 && glacorKc >= 100 && tdKc >= 100 && borkKc >= 100
  2267.                 && aodKc >= 100 && hopeKc >= 100)
  2268.             return true;
  2269.         return false;
  2270.     }
  2271.  
  2272.     // LOL, bad way to do it, dont complain
  2273.  
  2274.     public int[] getMaxedCapeCustomized() {
  2275.         return maxedCapeCustomized;
  2276.     }
  2277.  
  2278.     @Override
  2279.     public int getMaxHitpoints() {
  2280.         return skills.getLevel(Skills.HITPOINTS) * 10 + equipment.getEquipmentHpIncrease();
  2281.     }
  2282.  
  2283.     @Override
  2284.     public double getMeleePrayerMultiplier() {
  2285.         return 0.6;
  2286.     }
  2287.  
  2288.     public int getMessageIcon() {
  2289.         if (isOwner())
  2290.             return 16;
  2291.         if (isHeadAdmin())
  2292.             return 6;
  2293.         if (isForumsAdmin())
  2294.             return 14;
  2295.         if (getRights() == 2)
  2296.             return 2;
  2297.         if (isHeadMod())
  2298.             return 15;
  2299.         if (isForumModerator())
  2300.             return 10;
  2301.         if (getRights() == 1)
  2302.             return 1;
  2303.         if (isSupporter())
  2304.             return 12;
  2305.         if (isGold())
  2306.             return 17;
  2307.         if (isSilver())
  2308.             return 19;
  2309.         if (isDicer())
  2310.             return 18;
  2311.         if (isLegendary())
  2312.             return 13;
  2313.         if (isExtremeDonator())
  2314.             return 9;
  2315.         if (isDonator())
  2316.             return 8;
  2317.         if (isGraphicDesigner())
  2318.             return 20;
  2319.         if (isIronman())
  2320.             return 4;
  2321.         return getRights();
  2322.     }
  2323.  
  2324.     public MoneyPouch getMoneyPouch() {
  2325.         return pouch;
  2326.     }
  2327.  
  2328.     public int getMoneyPouchValue() {
  2329.         return money;
  2330.     }
  2331.  
  2332.     public int getMovementType() {
  2333.         if (getTemporaryMoveType() != -1)
  2334.             return getTemporaryMoveType();
  2335.         return getRun() ? RUN_MOVE_TYPE : WALK_MOVE_TYPE;
  2336.     }
  2337.  
  2338.     public MusicsManager getMusicsManager() {
  2339.         return musicsManager;
  2340.     }
  2341.  
  2342.     public long getMuted() {
  2343.         return muted;
  2344.     }
  2345.  
  2346.     public Notes getNotes() {
  2347.         return notes;
  2348.     }
  2349.  
  2350.     public int getOverloadDelay() {
  2351.         return overloadDelay;
  2352.     }
  2353.  
  2354.     public List<String> getOwnedObjectManagerKeys() {
  2355.         if (ownedObjectsManagerKeys == null) // temporary
  2356.             ownedObjectsManagerKeys = new LinkedList<String>();
  2357.         return ownedObjectsManagerKeys;
  2358.     }
  2359.  
  2360.     public String getOwner() {
  2361.         return Owner;
  2362.     }
  2363.  
  2364.     public WorldPacketsEncoder getPackets() {
  2365.         return session.getWorldPackets();
  2366.     }
  2367.  
  2368.     public long getPacketsDecoderPing() {
  2369.         return packetsDecoderPing;
  2370.     }
  2371.  
  2372.     public String getPassword() {
  2373.         return password;
  2374.     }
  2375.  
  2376.     public int getPestControlGames() {
  2377.         return pestControlGames;
  2378.     }
  2379.  
  2380.     public int getPestPoints() {
  2381.         return pestPoints;
  2382.     }
  2383.  
  2384.     /**
  2385.      * Gets the pet.
  2386.      *
  2387.      * @return The pet.
  2388.      */
  2389.     public Pet getPet() {
  2390.         return pet;
  2391.     }
  2392.  
  2393.     /**
  2394.      * Gets the petManager.
  2395.      *
  2396.      * @return The petManager.
  2397.      */
  2398.     public PetManager getPetManager() {
  2399.         return petManager;
  2400.     }
  2401.  
  2402.     public int getPkPoints() {
  2403.         return pkPoints;
  2404.     }
  2405.  
  2406.     public long getPoisonImmune() {
  2407.         return poisonImmune;
  2408.     }
  2409.  
  2410.     public long getPolDelay() {
  2411.         return polDelay;
  2412.     }
  2413.  
  2414.     public long getPotDelay() {
  2415.         return potDelay;
  2416.     }
  2417.  
  2418.     public int[] getPouches() {
  2419.         return pouches;
  2420.     }
  2421.  
  2422.     public Prayer getPrayer() {
  2423.         return prayer;
  2424.     }
  2425.  
  2426.     public long getPrayerDelay() {
  2427.         Long teleblock = (Long) getTemporaryAttributtes().get("PrayerBlocked");
  2428.         if (teleblock == null)
  2429.             return 0;
  2430.         return teleblock;
  2431.     }
  2432.  
  2433.     public int getPrestige() {
  2434.         return prestige;
  2435.     }
  2436.  
  2437.     public PriceCheckManager getPriceCheckManager() {
  2438.         return priceCheckManager;
  2439.     }
  2440.  
  2441.     public int getPrivateChatSetup() {
  2442.         return privateChatSetup;
  2443.     }
  2444.  
  2445.     public int getPublicStatus() {
  2446.         return publicStatus;
  2447.     }
  2448.  
  2449.     public int getPvmPoints() {
  2450.         return pvmPoints;
  2451.     }
  2452.  
  2453.     public QuestManager getQuestManager() {
  2454.         return questManager;
  2455.     }
  2456.  
  2457.     @Override
  2458.     public double getRangePrayerMultiplier() {
  2459.         return 0.6;
  2460.     }
  2461.  
  2462.     public String getRecovAnswer() {
  2463.         return recovAnswer;
  2464.     }
  2465.  
  2466.     public String getRecovQuestion() {
  2467.         return recovQuestion;
  2468.     }
  2469.  
  2470.     public String getRegisteredMac() {
  2471.         return registeredMac;
  2472.     }
  2473.  
  2474.     public int getRights() {
  2475.         return rights;
  2476.     }
  2477.  
  2478.     public int getRocktailsCooked() {
  2479.         return rocktailsCooked;
  2480.     }
  2481.  
  2482.     public byte getRunEnergy() {
  2483.         return runEnergy;
  2484.     }
  2485.  
  2486.     /**
  2487.      * @return the runeSpanPoint
  2488.      */
  2489.     public int getRuneSpanPoints() {
  2490.         return runeSpanPoints;
  2491.     }
  2492.  
  2493.     public int getScreenHeight() {
  2494.         return screenHeight;
  2495.     }
  2496.  
  2497.     public int getScreenWidth() {
  2498.         return screenWidth;
  2499.     }
  2500.  
  2501.     public Session getSession() {
  2502.         return session;
  2503.     }
  2504.  
  2505.     @Override
  2506.     public int getSize() {
  2507.         return appearence.getSize();
  2508.     }
  2509.  
  2510.     public Skills getSkills() {
  2511.         return skills;
  2512.     }
  2513.  
  2514.     public int getSkullId() {
  2515.         return skullId;
  2516.     }
  2517.  
  2518.     public int getSlayerPoints() {
  2519.         return slayerPoints;
  2520.     }
  2521.  
  2522.     public int getSpecRestoreTimer() {
  2523.         return specRestoreTimer;
  2524.     }
  2525.  
  2526.     public int getSummoningLeftClickOption() {
  2527.         return summoningLeftClickOption;
  2528.  
  2529.     }
  2530.  
  2531.     public int getTotalKc() {
  2532.         return bandosKc + armadylKc + saradominKc + corpKc + nexKc + blinkKc + pdemonKc + kbdKc + qbdKc + glacorKc
  2533.                 + tdKc + borkKc + hopeKc + aodKc;
  2534.     }
  2535.  
  2536.     public List<Integer> getSwitchItemCache() {
  2537.         return switchItemCache;
  2538.     }
  2539.  
  2540.     /**
  2541.      * @return the task
  2542.      */
  2543.     // public SlayerTask getTask() {
  2544.     // return task;
  2545.     // }
  2546.  
  2547.     public long getTeleBlockDelay() {
  2548.         Long teleblock = (Long) getTemporaryAttributtes().get("TeleBlocked");
  2549.         if (teleblock == null)
  2550.             return 0;
  2551.         return teleblock;
  2552.     }
  2553.  
  2554.     public int getTemporaryMovementType() {
  2555.         return temporaryMovementType;
  2556.     }
  2557.  
  2558.     public int getTemporaryMoveType() {
  2559.         return getTemporaryMovementType();
  2560.     }
  2561.  
  2562.     public Trade getTrade() {
  2563.         return trade;
  2564.     }
  2565.  
  2566.     public int getTradeStatus() {
  2567.         return tradeStatus;
  2568.     }
  2569.  
  2570.     public int getUniquePlayerId() {
  2571.         return uniquePlayerId;
  2572.     }
  2573.  
  2574.     public String getUsername() {
  2575.         return username;
  2576.     }
  2577.  
  2578.     public int getVecnaTimer() {
  2579.         return vecnaTimer;
  2580.     }
  2581.  
  2582.     public int getVotePoints() {
  2583.         return votePoints;
  2584.     }
  2585.  
  2586.     public int getGanodermicFlakes() {
  2587.         return ganodermicFlakes;
  2588.     }
  2589.  
  2590.     @Override
  2591.     public void handleIngoingHit(final Hit hit) {
  2592.         if (hit.getLook() != HitLook.MELEE_DAMAGE && hit.getLook() != HitLook.RANGE_DAMAGE
  2593.                 && hit.getLook() != HitLook.MAGIC_DAMAGE)
  2594.             return;
  2595.         if (invulnerable) {
  2596.             hit.setDamage(0);
  2597.             return;
  2598.         }
  2599.         if (auraManager.usingPenance()) {
  2600.             int amount = (int) (hit.getDamage() * 0.2);
  2601.             if (amount > 0)
  2602.                 prayer.restorePrayer(amount);
  2603.         }
  2604.         Entity source = hit.getSource();
  2605.         if (source == null)
  2606.             return;
  2607.         if (polDelay > Utils.currentTimeMillis())
  2608.             hit.setDamage((int) (hit.getDamage() * 0.5));
  2609.         if (prayer.hasPrayersOn() && hit.getDamage() != 0) {
  2610.             if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2611.                 if (prayer.usingPrayer(0, 17))
  2612.                     hit.setDamage((int) (hit.getDamage() * source.getMagePrayerMultiplier()));
  2613.                 else if (prayer.usingPrayer(1, 7)) {
  2614.                     int deflectedDamage = source instanceof Nex ? 0 : (int) (hit.getDamage() * 0.1);
  2615.                     hit.setDamage((int) (hit.getDamage() * source.getMagePrayerMultiplier()));
  2616.                     if (deflectedDamage > 0) {
  2617.                         source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
  2618.                         setNextGraphics(new Graphics(2228));
  2619.                         setNextAnimation(new Animation(12573));
  2620.                     }
  2621.                 }
  2622.             } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2623.                 if (prayer.usingPrayer(0, 18))
  2624.                     hit.setDamage((int) (hit.getDamage() * source.getRangePrayerMultiplier()));
  2625.                 else if (prayer.usingPrayer(1, 8)) {
  2626.                     int deflectedDamage = source instanceof Nex ? 0 : (int) (hit.getDamage() * 0.1);
  2627.                     hit.setDamage((int) (hit.getDamage() * source.getRangePrayerMultiplier()));
  2628.                     if (deflectedDamage > 0) {
  2629.                         source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
  2630.                         setNextGraphics(new Graphics(2229));
  2631.                         setNextAnimation(new Animation(12573));
  2632.                     }
  2633.                 }
  2634.             } else if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2635.                 if (prayer.usingPrayer(0, 19))
  2636.                     hit.setDamage((int) (hit.getDamage() * source.getMeleePrayerMultiplier()));
  2637.                 else if (prayer.usingPrayer(1, 9)) {
  2638.                     int deflectedDamage = source instanceof Nex ? 0 : (int) (hit.getDamage() * 0.1);
  2639.                     hit.setDamage((int) (hit.getDamage() * source.getMeleePrayerMultiplier()));
  2640.                     if (deflectedDamage > 0) {
  2641.                         source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
  2642.                         setNextGraphics(new Graphics(2230));
  2643.                         setNextAnimation(new Animation(12573));
  2644.                     }
  2645.                 }
  2646.             }
  2647.         }
  2648.         if (hit.getDamage() >= 200) {
  2649.             if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2650.                 int reducedDamage = hit.getDamage()
  2651.                         * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MELEE_BONUS] / 100;
  2652.                 if (reducedDamage > 0) {
  2653.                     hit.setDamage(hit.getDamage() - reducedDamage);
  2654.                     hit.setSoaking(new Hit(source, reducedDamage, HitLook.ABSORB_DAMAGE));
  2655.                 }
  2656.             } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2657.                 int reducedDamage = hit.getDamage()
  2658.                         * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_RANGE_BONUS] / 100;
  2659.                 if (reducedDamage > 0) {
  2660.                     hit.setDamage(hit.getDamage() - reducedDamage);
  2661.                     hit.setSoaking(new Hit(source, reducedDamage, HitLook.ABSORB_DAMAGE));
  2662.                 }
  2663.             } else if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2664.                 int reducedDamage = hit.getDamage()
  2665.                         * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MAGE_BONUS] / 100;
  2666.                 if (reducedDamage > 0) {
  2667.                     hit.setDamage(hit.getDamage() - reducedDamage);
  2668.                     hit.setSoaking(new Hit(source, reducedDamage, HitLook.ABSORB_DAMAGE));
  2669.                 }
  2670.             }
  2671.         }
  2672.         int shieldId = equipment.getShieldId();
  2673.         if (shieldId == 13742 || shieldId == 23699) { // elsyian
  2674.             if (Utils.getRandom(100) <= 70)
  2675.                 hit.setDamage((int) (hit.getDamage() * 0.75));
  2676.         } else if (shieldId == 13740 || shieldId == 23698) { // divine
  2677.             int drain = (int) (Math.ceil(hit.getDamage() * 0.3) / 2);
  2678.             if (prayer.getPrayerpoints() >= drain) {
  2679.                 hit.setDamage((int) (hit.getDamage() * 0.70));
  2680.                 prayer.drainPrayer(drain);
  2681.             }
  2682.         }
  2683.         if (castedVeng && hit.getDamage() >= 4) {
  2684.             castedVeng = false;
  2685.             setNextForceTalk(new ForceTalk("Taste vengeance!"));
  2686.             source.applyHit(new Hit(this, (int) (hit.getDamage() * 0.75), HitLook.REGULAR_DAMAGE));
  2687.         }
  2688.         if (source instanceof Player) {
  2689.             final Player p2 = (Player) source;
  2690.             if (p2.prayer.hasPrayersOn()) {
  2691.                 if (p2.prayer.usingPrayer(0, 24)) { // smite
  2692.                     int drain = hit.getDamage() / 4;
  2693.                     if (drain > 0)
  2694.                         prayer.drainPrayer(drain);
  2695.                 } else {
  2696.                     if (hit.getDamage() == 0)
  2697.                         return;
  2698.                     if (!p2.prayer.isBoostedLeech()) {
  2699.                         if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2700.                             if (p2.prayer.usingPrayer(1, 19)) {
  2701.                                 if (Utils.getRandom(4) == 0) {
  2702.                                     p2.prayer.increaseTurmoilBonus(this);
  2703.                                     p2.prayer.setBoostedLeech(true);
  2704.                                     return;
  2705.                                 }
  2706.                             } else if (p2.prayer.usingPrayer(1, 1)) { // sap att
  2707.                                 if (Utils.getRandom(4) == 0) {
  2708.                                     if (p2.prayer.reachedMax(0)) {
  2709.                                         p2.getPackets().sendGameMessage(
  2710.                                                 "Your opponent has been weakened so much that your sap curse has no effect.",
  2711.                                                 true);
  2712.                                     } else {
  2713.                                         p2.prayer.increaseLeechBonus(0);
  2714.                                         p2.getPackets().sendGameMessage(
  2715.                                                 "Your curse drains Attack from the enemy, boosting your Attack.", true);
  2716.                                     }
  2717.                                     p2.setNextAnimation(new Animation(12569));
  2718.                                     p2.setNextGraphics(new Graphics(2214));
  2719.                                     p2.prayer.setBoostedLeech(true);
  2720.                                     World.sendProjectile(p2, this, 2215, 35, 35, 20, 5, 0, 0);
  2721.                                     WorldTasksManager.schedule(new WorldTask() {
  2722.                                         @Override
  2723.                                         public void run() {
  2724.                                             setNextGraphics(new Graphics(2216));
  2725.                                         }
  2726.                                     }, 1);
  2727.                                     return;
  2728.                                 }
  2729.                             } else {
  2730.                                 if (p2.prayer.usingPrayer(1, 10)) {
  2731.                                     if (Utils.getRandom(7) == 0) {
  2732.                                         if (p2.prayer.reachedMax(3)) {
  2733.                                             p2.getPackets().sendGameMessage(
  2734.                                                     "Your opponent has been weakened so much that your leech curse has no effect.",
  2735.                                                     true);
  2736.                                         } else {
  2737.                                             p2.prayer.increaseLeechBonus(3);
  2738.                                             p2.getPackets().sendGameMessage(
  2739.                                                     "Your curse drains Attack from the enemy, boosting your Attack.",
  2740.                                                     true);
  2741.                                         }
  2742.                                         p2.setNextAnimation(new Animation(12575));
  2743.                                         p2.prayer.setBoostedLeech(true);
  2744.                                         World.sendProjectile(p2, this, 2231, 35, 35, 20, 5, 0, 0);
  2745.                                         WorldTasksManager.schedule(new WorldTask() {
  2746.                                             @Override
  2747.                                             public void run() {
  2748.                                                 setNextGraphics(new Graphics(2232));
  2749.                                             }
  2750.                                         }, 1);
  2751.                                         return;
  2752.                                     }
  2753.                                 }
  2754.                                 if (lendMessage != 0) {
  2755.                                     if (lendMessage == 1)
  2756.                                         getPackets().sendGameMessage(
  2757.                                                 "<col=FF0000>An item you lent out has been added back to your bank.");
  2758.                                     else if (lendMessage == 2)
  2759.                                         getPackets().sendGameMessage(
  2760.                                                 "<col=FF0000>The item you borrowed has been returned to the owner.");
  2761.                                     lendMessage = 0;
  2762.                                 }
  2763.                                 if (p2.prayer.usingPrayer(1, 14)) {
  2764.                                     if (Utils.getRandom(7) == 0) {
  2765.                                         if (p2.prayer.reachedMax(7)) {
  2766.                                             p2.getPackets().sendGameMessage(
  2767.                                                     "Your opponent has been weakened so much that your leech curse has no effect.",
  2768.                                                     true);
  2769.                                         } else {
  2770.                                             p2.prayer.increaseLeechBonus(7);
  2771.                                             p2.getPackets().sendGameMessage(
  2772.                                                     "Your curse drains Strength from the enemy, boosting your Strength.",
  2773.                                                     true);
  2774.                                         }
  2775.                                         p2.setNextAnimation(new Animation(12575));
  2776.                                         p2.prayer.setBoostedLeech(true);
  2777.                                         World.sendProjectile(p2, this, 2248, 35, 35, 20, 5, 0, 0);
  2778.                                         WorldTasksManager.schedule(new WorldTask() {
  2779.                                             @Override
  2780.                                             public void run() {
  2781.                                                 setNextGraphics(new Graphics(2250));
  2782.                                             }
  2783.                                         }, 1);
  2784.                                         return;
  2785.                                     }
  2786.                                 }
  2787.  
  2788.                             }
  2789.                         }
  2790.                         if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2791.                             if (p2.prayer.usingPrayer(1, 2)) { // sap range
  2792.                                 if (Utils.getRandom(4) == 0) {
  2793.                                     if (p2.prayer.reachedMax(1)) {
  2794.                                         p2.getPackets().sendGameMessage(
  2795.                                                 "Your opponent has been weakened so much that your sap curse has no effect.",
  2796.                                                 true);
  2797.                                     } else {
  2798.                                         p2.prayer.increaseLeechBonus(1);
  2799.                                         p2.getPackets().sendGameMessage(
  2800.                                                 "Your curse drains Range from the enemy, boosting your Range.", true);
  2801.                                     }
  2802.                                     p2.setNextAnimation(new Animation(12569));
  2803.                                     p2.setNextGraphics(new Graphics(2217));
  2804.                                     p2.prayer.setBoostedLeech(true);
  2805.                                     World.sendProjectile(p2, this, 2218, 35, 35, 20, 5, 0, 0);
  2806.                                     WorldTasksManager.schedule(new WorldTask() {
  2807.                                         @Override
  2808.                                         public void run() {
  2809.                                             setNextGraphics(new Graphics(2219));
  2810.                                         }
  2811.                                     }, 1);
  2812.                                     return;
  2813.                                 }
  2814.                             } else if (p2.prayer.usingPrayer(1, 11)) {
  2815.                                 if (Utils.getRandom(7) == 0) {
  2816.                                     if (p2.prayer.reachedMax(4)) {
  2817.                                         p2.getPackets().sendGameMessage(
  2818.                                                 "Your opponent has been weakened so much that your leech curse has no effect.",
  2819.                                                 true);
  2820.                                     } else {
  2821.                                         p2.prayer.increaseLeechBonus(4);
  2822.                                         p2.getPackets().sendGameMessage(
  2823.                                                 "Your curse drains Range from the enemy, boosting your Range.", true);
  2824.                                     }
  2825.                                     p2.setNextAnimation(new Animation(12575));
  2826.                                     p2.prayer.setBoostedLeech(true);
  2827.                                     World.sendProjectile(p2, this, 2236, 35, 35, 20, 5, 0, 0);
  2828.                                     WorldTasksManager.schedule(new WorldTask() {
  2829.                                         @Override
  2830.                                         public void run() {
  2831.                                             setNextGraphics(new Graphics(2238));
  2832.                                         }
  2833.                                     });
  2834.                                     return;
  2835.                                 }
  2836.                             }
  2837.                         }
  2838.                         if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2839.                             if (p2.prayer.usingPrayer(1, 3)) { // sap mage
  2840.                                 if (Utils.getRandom(4) == 0) {
  2841.                                     if (p2.prayer.reachedMax(2)) {
  2842.                                         p2.getPackets().sendGameMessage(
  2843.                                                 "Your opponent has been weakened so much that your sap curse has no effect.",
  2844.                                                 true);
  2845.                                     } else {
  2846.                                         p2.prayer.increaseLeechBonus(2);
  2847.                                         p2.getPackets().sendGameMessage(
  2848.                                                 "Your curse drains Magic from the enemy, boosting your Magic.", true);
  2849.                                     }
  2850.                                     p2.setNextAnimation(new Animation(12569));
  2851.                                     p2.setNextGraphics(new Graphics(2220));
  2852.                                     p2.prayer.setBoostedLeech(true);
  2853.                                     World.sendProjectile(p2, this, 2221, 35, 35, 20, 5, 0, 0);
  2854.                                     WorldTasksManager.schedule(new WorldTask() {
  2855.                                         @Override
  2856.                                         public void run() {
  2857.                                             setNextGraphics(new Graphics(2222));
  2858.                                         }
  2859.                                     }, 1);
  2860.                                     return;
  2861.                                 }
  2862.                             } else if (p2.prayer.usingPrayer(1, 12)) {
  2863.                                 if (Utils.getRandom(7) == 0) {
  2864.                                     if (p2.prayer.reachedMax(5)) {
  2865.                                         p2.getPackets().sendGameMessage(
  2866.                                                 "Your opponent has been weakened so much that your leech curse has no effect.",
  2867.                                                 true);
  2868.                                     } else {
  2869.                                         p2.prayer.increaseLeechBonus(5);
  2870.                                         p2.getPackets().sendGameMessage(
  2871.                                                 "Your curse drains Magic from the enemy, boosting your Magic.", true);
  2872.                                     }
  2873.                                     p2.setNextAnimation(new Animation(12575));
  2874.                                     p2.prayer.setBoostedLeech(true);
  2875.                                     World.sendProjectile(p2, this, 2240, 35, 35, 20, 5, 0, 0);
  2876.                                     WorldTasksManager.schedule(new WorldTask() {
  2877.                                         @Override
  2878.                                         public void run() {
  2879.                                             setNextGraphics(new Graphics(2242));
  2880.                                         }
  2881.                                     }, 1);
  2882.                                     return;
  2883.                                 }
  2884.                             }
  2885.                         }
  2886.  
  2887.                         // overall
  2888.  
  2889.                         if (p2.prayer.usingPrayer(1, 13)) { // leech defence
  2890.                             if (Utils.getRandom(10) == 0) {
  2891.                                 if (p2.prayer.reachedMax(6)) {
  2892.                                     p2.getPackets().sendGameMessage(
  2893.                                             "Your opponent has been weakened so much that your leech curse has no effect.",
  2894.                                             true);
  2895.                                 } else {
  2896.                                     p2.prayer.increaseLeechBonus(6);
  2897.                                     p2.getPackets().sendGameMessage(
  2898.                                             "Your curse drains Defence from the enemy, boosting your Defence.", true);
  2899.                                 }
  2900.                                 p2.setNextAnimation(new Animation(12575));
  2901.                                 p2.prayer.setBoostedLeech(true);
  2902.                                 World.sendProjectile(p2, this, 2244, 35, 35, 20, 5, 0, 0);
  2903.                                 WorldTasksManager.schedule(new WorldTask() {
  2904.                                     @Override
  2905.                                     public void run() {
  2906.                                         setNextGraphics(new Graphics(2246));
  2907.                                     }
  2908.                                 }, 1);
  2909.                                 return;
  2910.                             }
  2911.                         }
  2912.  
  2913.                         if (p2.prayer.usingPrayer(1, 15)) {
  2914.                             if (Utils.getRandom(10) == 0) {
  2915.                                 if (getRunEnergy() <= 0) {
  2916.                                     p2.getPackets().sendGameMessage(
  2917.                                             "Your opponent has been weakened so much that your leech curse has no effect.",
  2918.                                             true);
  2919.                                 } else {
  2920.                                     p2.setRunEnergy(p2.getRunEnergy() > 90 ? 100 : p2.getRunEnergy() + 10);
  2921.                                     setRunEnergy(p2.getRunEnergy() > 10 ? getRunEnergy() - 10 : 0);
  2922.                                 }
  2923.                                 p2.setNextAnimation(new Animation(12575));
  2924.                                 p2.prayer.setBoostedLeech(true);
  2925.                                 World.sendProjectile(p2, this, 2256, 35, 35, 20, 5, 0, 0);
  2926.                                 WorldTasksManager.schedule(new WorldTask() {
  2927.                                     @Override
  2928.                                     public void run() {
  2929.                                         setNextGraphics(new Graphics(2258));
  2930.                                     }
  2931.                                 }, 1);
  2932.                                 return;
  2933.                             }
  2934.                         }
  2935.  
  2936.                         if (p2.prayer.usingPrayer(1, 16)) {
  2937.                             if (Utils.getRandom(10) == 0) {
  2938.                                 if (combatDefinitions.getSpecialAttackPercentage() <= 0) {
  2939.                                     p2.getPackets().sendGameMessage(
  2940.                                             "Your opponent has been weakened so much that your leech curse has no effect.",
  2941.                                             true);
  2942.                                 } else {
  2943.                                     p2.combatDefinitions.restoreSpecialAttack();
  2944.                                     combatDefinitions.desecreaseSpecialAttack(10);
  2945.                                 }
  2946.                                 p2.setNextAnimation(new Animation(12575));
  2947.                                 p2.prayer.setBoostedLeech(true);
  2948.                                 World.sendProjectile(p2, this, 2252, 35, 35, 20, 5, 0, 0);
  2949.                                 WorldTasksManager.schedule(new WorldTask() {
  2950.                                     @Override
  2951.                                     public void run() {
  2952.                                         setNextGraphics(new Graphics(2254));
  2953.                                     }
  2954.                                 }, 1);
  2955.                                 return;
  2956.                             }
  2957.                         }
  2958.  
  2959.                         if (p2.prayer.usingPrayer(1, 4)) { // sap spec
  2960.                             if (Utils.getRandom(10) == 0) {
  2961.                                 p2.setNextAnimation(new Animation(12569));
  2962.                                 p2.setNextGraphics(new Graphics(2223));
  2963.                                 p2.prayer.setBoostedLeech(true);
  2964.                                 if (combatDefinitions.getSpecialAttackPercentage() <= 0) {
  2965.                                     p2.getPackets().sendGameMessage(
  2966.                                             "Your opponent has been weakened so much that your sap curse has no effect.",
  2967.                                             true);
  2968.                                 } else {
  2969.                                     combatDefinitions.desecreaseSpecialAttack(10);
  2970.                                 }
  2971.                                 World.sendProjectile(p2, this, 2224, 35, 35, 20, 5, 0, 0);
  2972.                                 WorldTasksManager.schedule(new WorldTask() {
  2973.                                     @Override
  2974.                                     public void run() {
  2975.                                         setNextGraphics(new Graphics(2225));
  2976.                                     }
  2977.                                 }, 1);
  2978.                                 return;
  2979.                             }
  2980.                         }
  2981.                     }
  2982.                 }
  2983.             }
  2984.         } else {
  2985.             NPC n = (NPC) source;
  2986.             if (prayer.usingPrayer(1, 19)) {
  2987.                 if (Utils.getRandom(4) == 0) {
  2988.                     prayer.increaseTurmoilBonus(n);
  2989.                     prayer.setBoostedLeech(true);
  2990.                 }
  2991.             }
  2992.             if (n.getId() == 13448)
  2993.                 sendSoulSplit(hit, n);
  2994.             /*
  2995.              * if (n instanceof Glacor) { Glacor glacor = (Glacor) n; if
  2996.              * (glacor.getEffect() == GlacorEffect.SAPPING) {
  2997.              * this.getPrayer().drainPrayer( (int) Utils.getPercent(10,
  2998.              * this.getPrayer() .getPrayerpoints())); } } else if (n instanceof
  2999.              * SappingGlacyte) { this.getPrayer().drainPrayer( (int)
  3000.              * Utils.getPercent(5, this.getPrayer() .getPrayerpoints())); } } }
  3001.              */}
  3002.     }
  3003.  
  3004.     public boolean hasDisabledYell() {
  3005.         return yellDisabled;
  3006.     }
  3007.  
  3008.     public boolean hasDisplayName() {
  3009.         return displayName != null;
  3010.     }
  3011.  
  3012.     public boolean hasInstantSpecial(final int weaponId) {
  3013.         switch (weaponId) {
  3014.         case 4153:
  3015.         case 15486:
  3016.         case 22207:
  3017.         case 22209:
  3018.         case 22211:
  3019.         case 22213:
  3020.         case 1377:
  3021.         case 13472:
  3022.         case 35:// Excalibur
  3023.         case 8280:
  3024.         case 14632:
  3025.             return true;
  3026.         default:
  3027.             return false;
  3028.         }
  3029.     }
  3030.  
  3031.     public boolean hasLargeSceneView() {
  3032.         return largeSceneView;
  3033.     }
  3034.  
  3035.     public boolean hasRecievedStarter() {
  3036.         return setStarter;
  3037.     }
  3038.  
  3039.     public boolean hasSkull() {
  3040.         return skullDelay > 0;
  3041.     }
  3042.  
  3043.     public boolean hasStarted() {
  3044.         return started;
  3045.     }
  3046.  
  3047.     public boolean hasTalkedtoCook() {
  3048.         return talkedtoCook;
  3049.     }
  3050.  
  3051.     @Override
  3052.     public void heal(int ammount, int extra) {
  3053.         super.heal(ammount, extra);
  3054.         refreshHitPoints();
  3055.     }
  3056.  
  3057.     public boolean hideSofInterface() {
  3058.         // TODO Auto-generated method stub
  3059.         return hideSofInterface;
  3060.     }
  3061.  
  3062.     public void increaseCrucibleHighScore() {
  3063.         crucibleHighScore++;
  3064.     }
  3065.  
  3066.     public void increaseKillCount(Player killed) {
  3067.         if (lastKilled == killed.getUsername()) {
  3068.             sendMessage("You haven't been awarded any pk points for killing; " + killed.getDisplayName() + " twice.");
  3069.             return;
  3070.         }
  3071.         killed.deathCount++;
  3072.         PkRank.checkRank(killed);
  3073.         lastKilled = killed.getUsername();
  3074.         if (killed.getSession().getIP().equals(getSession().getIP()))
  3075.             return;
  3076.         if (isLegend()) {
  3077.             setPkPoints(getPkPoints() + 15);
  3078.         } else if (Wilderness.isAtWild(this)) {
  3079.             setPkPoints(getPkPoints() + 10);
  3080.         } else {
  3081.             setPkPoints(getPkPoints() + 3);
  3082.         }
  3083.         killCount++;
  3084.         sendMessage("<shad=000000><col=ff0000>You have been awarded a pk point for killing; " + killed.getDisplayName()
  3085.                 + ".");
  3086.         PkRank.checkRank(this);
  3087.     }
  3088.  
  3089.     // @SuppressWarnings("null")
  3090.     public void init(Session session, String string, IsaacKeyPair isaacKeyPair) {
  3091.         username = string;
  3092.         this.session = session;
  3093.         this.isaacKeyPair = isaacKeyPair;
  3094.         World.addLobbyPlayer(this);
  3095.         if (Settings.DEBUG) {
  3096.             Logger.log(this, new StringBuilder("Lobby Inited Player: ").append(string).append(", pass: ")
  3097.                     .append(password).toString());
  3098.         }
  3099.     }
  3100.  
  3101.     public boolean isApeAtoll() {
  3102.         return (getX() >= 2693 && getX() <= 2821 && getY() >= 2693 && getY() <= 2817);
  3103.     }
  3104.  
  3105.     public boolean isCanPvp() {
  3106.         return canPvp;
  3107.     }
  3108.  
  3109.     public boolean isCantTrade() {
  3110.         return cantTrade;
  3111.     }
  3112.  
  3113.     public boolean isCastVeng() {
  3114.         return castedVeng;
  3115.     }
  3116.  
  3117.     public boolean isCompletedFightCaves() {
  3118.         return completedFightCaves;
  3119.     }
  3120.  
  3121.     public boolean isCompletedFightKiln() {
  3122.         return completedFightKiln;
  3123.     }
  3124.  
  3125.     public boolean isCompletedRfd() {
  3126.         return completedRfd;
  3127.     }
  3128.  
  3129.     public boolean isDfsActivated() {
  3130.         return dfsActivated;
  3131.     }
  3132.  
  3133.     public boolean isDonator() {
  3134.         return isExtremeDonator() || isLegendary() || isGold() || isSilver() || donator
  3135.                 || donatorTill > Utils.currentTimeMillis();
  3136.     }
  3137.  
  3138.     public boolean isDicer() {
  3139.         return dicer;
  3140.     }
  3141.  
  3142.     public boolean isEquipDisabled() {
  3143.         return disableEquip;
  3144.     }
  3145.  
  3146.     public boolean wearingMasterCape(int id) {
  3147.         if (getEquipment().getCapeId() == id)
  3148.             return true;
  3149.         return false;
  3150.     }
  3151.  
  3152.     public boolean isExtremeDonator() {
  3153.         return isLegendary() || extremeDonator || extremeDonatorTill > Utils.currentTimeMillis();
  3154.     }
  3155.  
  3156.     public boolean isExtremePermDonator() {
  3157.         return extremeDonator;
  3158.     }
  3159.  
  3160.     public boolean isFilterGame() {
  3161.         return filterGame;
  3162.     }
  3163.  
  3164.     public boolean isForceNextMapLoadRefresh() {
  3165.         return forceNextMapLoadRefresh;
  3166.     }
  3167.  
  3168.     public boolean isForumModerator() {
  3169.         return isForumModerator;
  3170.     }
  3171.  
  3172.     public boolean isGotInfernoAdze() {
  3173.         return gotInfernoAdze;
  3174.     }
  3175.  
  3176.     public boolean isGraphicDesigner() {
  3177.         return isGraphicDesigner;
  3178.     }
  3179.  
  3180.     public boolean isHasCutEnoughLogs() {
  3181.         return hasCutEnoughLogs;
  3182.     }
  3183.  
  3184.     public boolean hasFinishedBarrows() {
  3185.         return hasFinishedBarrows;
  3186.     }
  3187.  
  3188.     public boolean isHasCutMoreEnoughLogs() {
  3189.         return hasCutMoreEnoughLogs;
  3190.     }
  3191.  
  3192.     public boolean isHidden() {
  3193.         // TODO Auto-generated method stub
  3194.         return true;
  3195.     }
  3196.  
  3197.     public boolean isHidingWorldMessages() {
  3198.         return hideWorldAnnouncements;
  3199.     }
  3200.  
  3201.     public boolean isInAnimationRoom() {
  3202.         return inAnimationRoom;
  3203.     }
  3204.  
  3205.     public boolean isInDefenderRoom() {
  3206.         return isInDefenderRoom;
  3207.     }
  3208.  
  3209.     public boolean isKalphiteLairEntranceSetted() {
  3210.         return khalphiteLairEntranceSetted;
  3211.     }
  3212.  
  3213.     public boolean isKalphiteLairSetted() {
  3214.         return khalphiteLairSetted;
  3215.     }
  3216.  
  3217.     public boolean isKilledAgrithNaNa() {
  3218.         return agrithNaNa;
  3219.     }
  3220.  
  3221.     public boolean isKilledBork() {
  3222.         return killedBork;
  3223.     }
  3224.  
  3225.     /**
  3226.      * RFD
  3227.      */
  3228.  
  3229.     public boolean isKilledCulinaromancer() {
  3230.         return culinaromancer;
  3231.     }
  3232.  
  3233.     public boolean isKilledDessourt() {
  3234.         return dessourt;
  3235.     }
  3236.  
  3237.     public boolean isKilledFlambeed() {
  3238.         return flamBeed;
  3239.     }
  3240.  
  3241.     public boolean isKilledKaramel() {
  3242.         return karamel;
  3243.     }
  3244.  
  3245.     /**
  3246.      * Gets the killedQueenBlackDragon.
  3247.      *
  3248.      * @return The killedQueenBlackDragon.
  3249.      */
  3250.     public boolean isKilledQueenBlackDragon() {
  3251.         return killedQueenBlackDragon;
  3252.     }
  3253.  
  3254.     public boolean isLocked() {
  3255.         return lockDelay >= Utils.currentTimeMillis();
  3256.     }
  3257.  
  3258.     public boolean isMacBanned() {
  3259.         return macBanned;
  3260.     }
  3261.  
  3262.     public boolean isOldItemsLook() {
  3263.         return oldItemsLook;
  3264.     }
  3265.  
  3266.     public boolean isPermBanned() {
  3267.         return permBanned;
  3268.     }
  3269.  
  3270.     public boolean isPermMuted() {
  3271.         return permMuted;
  3272.     }
  3273.  
  3274.     public boolean isResting() {
  3275.         return resting;
  3276.     }
  3277.  
  3278.     public boolean isRunning() {
  3279.         return running;
  3280.     }
  3281.  
  3282.     public boolean isSpawnsMode() {
  3283.         return spawnsMode;
  3284.     }
  3285.  
  3286.     public boolean isSupporter() {
  3287.         return isSupporter;
  3288.     }
  3289.  
  3290.     public boolean hasAccountPin;
  3291.     public boolean hasEnteredPin;
  3292.     public int accountpin;
  3293.  
  3294.     public int getAccountPin() {
  3295.         return accountpin;
  3296.     }
  3297.  
  3298.     /*
  3299.      * public boolean hasAccountPin() { return hasAccountPin; }
  3300.      */
  3301.  
  3302.     public void setAccountPin(int accountpin) {
  3303.         this.accountpin = accountpin;
  3304.     }
  3305.  
  3306.     public boolean isMod() {
  3307.         return getRights() == 1;
  3308.     }
  3309.  
  3310.     public boolean isTalkedWithMarv() {
  3311.         return talkedWithMarv;
  3312.     }
  3313.  
  3314.     public boolean isTalkedWithVannaka() {
  3315.         return talkedWithVannaka;
  3316.     }
  3317.  
  3318.     public boolean isUpdateMovementType() {
  3319.         return updateMovementType;
  3320.     }
  3321.  
  3322.     public boolean isUsingReportOption() {
  3323.         return reportOption;
  3324.     }
  3325.  
  3326.     public boolean isUsingZenRest() {
  3327.         // TODO Auto-generated method stub
  3328.         return zenRest;
  3329.     }
  3330.  
  3331.     public boolean isLegend() {
  3332.         return Legend;
  3333.     }
  3334.  
  3335.     public boolean isWonFightPits() {
  3336.         return wonFightPits;
  3337.     }
  3338.  
  3339.     public boolean isXpLocked() {
  3340.         return xpLocked;
  3341.     }
  3342.  
  3343.     public boolean isYellOff() {
  3344.         return yellOff;
  3345.     }
  3346.  
  3347.     public void kickPlayerFromFriendsChannel(String name) {
  3348.         if (currentFriendChat == null)
  3349.             return;
  3350.         currentFriendChat.kickPlayerFromChat(this, name);
  3351.     }
  3352.  
  3353.     @Override
  3354.     public void loadMapRegions() {
  3355.         boolean wasAtDynamicRegion = isAtDynamicRegion();
  3356.         super.loadMapRegions();
  3357.         clientLoadedMapRegion = false;
  3358.         if (isAtDynamicRegion()) {
  3359.             getPackets().sendDynamicMapRegion(!started);
  3360.             if (!wasAtDynamicRegion)
  3361.                 localNPCUpdate.reset();
  3362.         } else {
  3363.             getPackets().sendMapRegion(!started);
  3364.             if (wasAtDynamicRegion)
  3365.                 localNPCUpdate.reset();
  3366.         }
  3367.         forceNextMapLoadRefresh = false;
  3368.     }
  3369.  
  3370.     public void lock() {
  3371.         lockDelay = Long.MAX_VALUE;
  3372.     }
  3373.  
  3374.     public void lock(long time) {
  3375.         lockDelay = Utils.currentTimeMillis() + (time * 600);
  3376.     }
  3377.  
  3378.     /**
  3379.      * Logs the player out.
  3380.      *
  3381.      * @param lobby
  3382.      *            If we're logging out to the lobby.
  3383.      */
  3384.     public void logout(boolean lobby) {
  3385.         if (!isRunning())
  3386.             return;
  3387.         long currentTime = Utils.currentTimeMillis();
  3388.         if (getAttackedByDelay() + 10000 > currentTime) {
  3389.             getPackets().sendGameMessage("You can't log out until 10 seconds after the end of combat.");
  3390.             return;
  3391.         }
  3392.         if (getEmotesManager().getNextEmoteEnd() >= currentTime) {
  3393.             sendMessage("You can't log out while performing an emote.");
  3394.             return;
  3395.         }
  3396.         if (lockDelay >= currentTime) {
  3397.             sendMessage("You can't log out while performing an action.");
  3398.             return;
  3399.         }
  3400.         GrinderList.remove(this);
  3401.         if (!isAdministrator()) {
  3402.         //  new Thread(new Highscores(this)).start();
  3403.         //  System.out.println("Saving " + getDisplayName() + " to highscores.");
  3404.             // new Thread(new KCHighscores(this)).start();
  3405.             // System.out.println("Saving " + getDisplayName() + " to killcount
  3406.             // highscores.");
  3407.         }
  3408.         getPackets().sendLogout(lobby && Settings.MANAGMENT_SERVER_ENABLED);
  3409.         setRunning(false);
  3410.     }
  3411.  
  3412.     public static int dayOfWeek() {
  3413.         Calendar cal = Calendar.getInstance();
  3414.         return cal.get(Calendar.DAY_OF_WEEK);
  3415.     }
  3416.  
  3417.     public static boolean isWeekend() {
  3418.         return dayOfWeek() == 1 ? true : dayOfWeek() == 6 ? true : dayOfWeek() == 7 ? true : false;
  3419.     }
  3420.  
  3421.     public int MutePoints;
  3422.  
  3423.     public boolean isAdministrator() {
  3424.         return getRights() == 2 || isOwner() || isForumsAdmin() || isHeadAdmin();
  3425.     }
  3426.  
  3427.     public int getMutePoints() {
  3428.         return MutePoints;
  3429.     }
  3430.  
  3431.     public void setMutePoints(int MutePoints) {
  3432.         this.MutePoints = MutePoints;
  3433.     }
  3434.  
  3435.     public boolean lootshareEnabled() {
  3436.         return lootshareEnabled;
  3437.     }
  3438.  
  3439.     @SuppressWarnings("deprecation")
  3440.     public void makeDonator(int months) {
  3441.         if (donatorTill < Utils.currentTimeMillis())
  3442.             donatorTill = Utils.currentTimeMillis();
  3443.         Date date = new Date(donatorTill);
  3444.         date.setMonth(date.getMonth() + months);
  3445.         donatorTill = date.getTime();
  3446.     }
  3447.  
  3448.     @Override
  3449.     public boolean needMasksUpdate() {
  3450.         return super.needMasksUpdate() || getTemporaryMovementType() != -1 || isUpdateMovementType();
  3451.     }
  3452.  
  3453.     public void ordinanceTimer() {
  3454.         CoresManager.fastExecutor.schedule(new TimerTask() {
  3455.             @Override
  3456.             public void run() {
  3457.                 if (ordinanceTimer > 0)
  3458.                     ordinanceTimer--;
  3459.                 if (ordinanceTimer == 0) {
  3460.                     getPackets().sendGameMessage("<col=FFCC00>You are able to take more items from the ordinance.");
  3461.                     cancel();
  3462.                 }
  3463.             }
  3464.         }, 0, 1);
  3465.     }
  3466.  
  3467.     public void performInstantSpecial(final int weaponId) {
  3468.         int specAmt = PlayerCombat.getSpecialAmmount(weaponId);
  3469.         if (combatDefinitions.hasRingOfVigour())
  3470.             specAmt *= 0.9;
  3471.         if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
  3472.             sendMessage("You don't have enough power left.");
  3473.             combatDefinitions.desecreaseSpecialAttack(0);
  3474.             return;
  3475.         }
  3476.         if (this.getSwitchItemCache().size() > 0) {
  3477.             ButtonHandler.submitSpecialRequest(this);
  3478.             return;
  3479.         }
  3480.         switch (weaponId) {
  3481.         case 4153:
  3482.             combatDefinitions.setInstantAttack(true);
  3483.             combatDefinitions.switchUsingSpecialAttack();
  3484.             Entity target = (Entity) getTemporaryAttributtes().get("last_target");
  3485.             if (target != null && target.getTemporaryAttributtes().get("last_attacker") == this) {
  3486.                 if (!(getActionManager().getAction() instanceof PlayerCombat)
  3487.                         || ((PlayerCombat) getActionManager().getAction()).getTarget() != target) {
  3488.                     getActionManager().setAction(new PlayerCombat(target));
  3489.                 }
  3490.             }
  3491.             gmaulSpecCheapFix(true);
  3492.             break;
  3493.         case 1377:
  3494.         case 13472:
  3495.             setNextAnimation(new Animation(1056));
  3496.             setNextGraphics(new Graphics(246));
  3497.             setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
  3498.             int defence = (int) (skills.getLevelForXp(Skills.DEFENCE) * 0.90D);
  3499.             int attack = (int) (skills.getLevelForXp(Skills.ATTACK) * 0.90D);
  3500.             int range = (int) (skills.getLevelForXp(Skills.RANGE) * 0.90D);
  3501.             int magic = (int) (skills.getLevelForXp(Skills.MAGIC) * 0.90D);
  3502.             int strength = (int) (skills.getLevelForXp(Skills.STRENGTH) * 1.2D);
  3503.             skills.set(Skills.DEFENCE, defence);
  3504.             skills.set(Skills.ATTACK, attack);
  3505.             skills.set(Skills.RANGE, range);
  3506.             skills.set(Skills.MAGIC, magic);
  3507.             skills.set(Skills.STRENGTH, strength);
  3508.             combatDefinitions.desecreaseSpecialAttack(specAmt);
  3509.             break;
  3510.         case 35:// Excalibur
  3511.         case 8280:
  3512.         case 14632:
  3513.             setNextAnimation(new Animation(1168));
  3514.             setNextGraphics(new Graphics(247));
  3515.             final boolean enhanced = weaponId == 14632;
  3516.             skills.set(Skills.DEFENCE, enhanced ? (int) (skills.getLevelForXp(Skills.DEFENCE) * 1.15D)
  3517.                     : (skills.getLevel(Skills.DEFENCE) + 8));
  3518.             WorldTasksManager.schedule(new WorldTask() {
  3519.                 int count = 5;
  3520.  
  3521.                 @Override
  3522.                 public void run() {
  3523.                     if (isDead() || hasFinished() || getHitpoints() >= getMaxHitpoints()) {
  3524.                         stop();
  3525.                         return;
  3526.                     }
  3527.                     heal(enhanced ? 80 : 40);
  3528.                     if (count-- == 0) {
  3529.                         stop();
  3530.                         return;
  3531.                     }
  3532.                 }
  3533.             }, 4, 2);
  3534.             combatDefinitions.desecreaseSpecialAttack(specAmt);
  3535.             break;
  3536.         case 15486:
  3537.         case 22207:
  3538.         case 22209:
  3539.         case 22211:
  3540.         case 22213:
  3541.             setNextAnimation(new Animation(12804));
  3542.             setNextGraphics(new Graphics(2319));// 2320
  3543.             setNextGraphics(new Graphics(2321));
  3544.             addPolDelay(60000);
  3545.             combatDefinitions.desecreaseSpecialAttack(specAmt);
  3546.             break;
  3547.         }
  3548.     }
  3549.  
  3550.     private boolean gmaulSpecCheapFix;
  3551.  
  3552.     public boolean getGmaulSpecCheapFix() {
  3553.         return gmaulSpecCheapFix;
  3554.     }
  3555.  
  3556.     public void gmaulSpecCheapFix(boolean b) {
  3557.         gmaulSpecCheapFix = b;
  3558.     }
  3559.  
  3560.     public void addItemEvent(Runnable addItemEvent) {
  3561.         this.addItemEvent = addItemEvent;
  3562.     }
  3563.  
  3564.     private transient Runnable addItemEvent;
  3565.  
  3566.     @Override
  3567.     public void processEntity() {
  3568.         processLogicPackets();
  3569.         cutscenesManager.process();
  3570.         if (coordsEvent != null && coordsEvent.processEvent(this))
  3571.             coordsEvent = null;
  3572.         if (routeEvent != null && routeEvent.processEvent(this))
  3573.             routeEvent = null;
  3574.         if (addItemEvent != null) {
  3575.             addItemEvent.run();
  3576.             addItemEvent = null;
  3577.         }
  3578.         super.processEntity();
  3579.         if (musicsManager.musicEnded())
  3580.             musicsManager.replayMusic();
  3581.         if (hasSkull()) {
  3582.             skullDelay--;
  3583.             if (!hasSkull())
  3584.                 appearence.generateAppearenceData();
  3585.         }
  3586.         if (polDelay != 0 && polDelay <= Utils.currentTimeMillis()) {
  3587.             getPackets().sendGameMessage(
  3588.                     "The power of the light fades. Your resistance to melee attacks return to normal.");
  3589.             polDelay = 0;
  3590.         }
  3591.         if (overloadDelay > 0) {
  3592.             if (overloadDelay == 1 || isDead()) {
  3593.                 Pots.resetOverLoadEffect(this);
  3594.                 return;
  3595.             } else if ((overloadDelay - 1) % 25 == 0)
  3596.                 Pots.applyOverLoadEffect(this);
  3597.             overloadDelay--;
  3598.         }
  3599.         if (prayerRenewalDelay > 0) {
  3600.             if (prayerRenewalDelay == 1 || isDead()) {
  3601.                 sendMessage("<col=0000FF>Your prayer renewal has ended.");
  3602.                 prayerRenewalDelay = 0;
  3603.                 return;
  3604.             } else {
  3605.                 if (prayerRenewalDelay == 50)
  3606.                     getPackets().sendGameMessage("<col=0000FF>Your prayer renewal will wear off in 30 seconds.");
  3607.                 if (!prayer.hasFullPrayerpoints()) {
  3608.                     getPrayer().restorePrayer(1);
  3609.                     if ((prayerRenewalDelay - 1) % 25 == 0)
  3610.                         setNextGraphics(new Graphics(1295));
  3611.                 }
  3612.             }
  3613.             prayerRenewalDelay--;
  3614.         }
  3615.         if (dfscoolDown > 0) {
  3616.             dfscoolDown--;
  3617.         }
  3618.         if (specRestoreTimer > 0) {
  3619.             specRestoreTimer--;
  3620.         }
  3621.         if (lastBonfire > 0) {
  3622.             lastBonfire--;
  3623.             if (lastBonfire == 500)
  3624.                 getPackets().sendGameMessage(
  3625.                         "<col=ffff00>The health boost you received from stoking a bonfire will run out in 5 minutes.");
  3626.             else if (lastBonfire == 0) {
  3627.                 getPackets().sendGameMessage(
  3628.                         "<col=ff0000>The health boost you received from stoking a bonfire has run out.");
  3629.                 equipment.refreshConfigs(false);
  3630.             }
  3631.         }
  3632.         charges.process();
  3633.         auraManager.process();
  3634.         actionManager.process();
  3635.         prayer.processPrayer();
  3636.         controlerManager.process();
  3637.     }
  3638.  
  3639.     public void processLogicPackets() {
  3640.         LogicPacket packet;
  3641.         while ((packet = logicPackets.poll()) != null)
  3642.             WorldPacketsDecoder.decodeLogicPacket(this, packet);
  3643.     }
  3644.  
  3645.     @Override
  3646.     public void processReceivedHits() {
  3647.         if (lockDelay > Utils.currentTimeMillis())
  3648.             return;
  3649.         super.processReceivedHits();
  3650.     }
  3651.  
  3652.     public void realFinish() {
  3653.         if (hasFinished())
  3654.             return;
  3655.  
  3656.         if (!World.containsLobbyPlayer(username)) {
  3657.             stopAll();
  3658.             cutscenesManager.logout();
  3659.             // controlerManager.logout();
  3660.         }
  3661.         /* ITEM LEDNING */
  3662.         Lend lend = LendingManager.getLend(this);
  3663.         Lend hasLendedOut = LendingManager.getHasLendedItemsOut(this);
  3664.         if (lend != null) {
  3665.             if (isUntillLogout()) {
  3666.                 LendingManager.unLend(lend);
  3667.             }
  3668.         }
  3669.         if (hasLendedOut != null) {
  3670.             if (isUntillLogout()) {
  3671.                 LendingManager.unLend(hasLendedOut);
  3672.             }
  3673.         }
  3674.         /* END OF ITEM LEDNING */
  3675.         setRunning(false);
  3676.         if (!World.containsLobbyPlayer(username)) {
  3677.             friendsIgnores.sendFriendsMyStatus(false);
  3678.         }
  3679.         if (currentFriendChat != null) {
  3680.             currentFriendChat.leaveChat(this, true);
  3681.         }
  3682.         if (getDwarfCannon().hasCannon())
  3683.             getDwarfCannon().pickUpDwarfCannon(0, getDwarfCannon().getObject());
  3684.         if (clanManager != null)
  3685.             clanManager.disconnect(this, false);
  3686.         if (guestClanManager != null)
  3687.             guestClanManager.disconnect(this, true);
  3688.         if (getSlayerManager() != null)
  3689.             getSlayerManager().removePartner(true);
  3690.         if (familiar != null && !familiar.isFinished()) {
  3691.             familiar.dissmissFamiliar(true);
  3692.         } else if (pet != null) {
  3693.             pet.finish();
  3694.         }
  3695.         setFinished(true);
  3696.         session.setDecoder(-1);
  3697.         this.lastLoggedIn = System.currentTimeMillis();
  3698.         SerializableFilesManager.savePlayer(this);
  3699.         if (!World.isUpdating())
  3700.             GrinderList.remove(this);
  3701.         if (World.containsLobbyPlayer(username)) {
  3702.             World.removeLobbyPlayer(this);
  3703.         }
  3704.         World.updateEntityRegion(this);
  3705.         if (World.containsPlayer(username)) {
  3706.             World.removePlayer(this);
  3707.         }
  3708.         if (Settings.DEBUG) {
  3709.             Logger.log(this, "Finished Player: " + username + ", pass: " + password);
  3710.         }
  3711.     }
  3712.  
  3713.     public void refreshAllowChatEffects() {
  3714.         getPackets().sendConfig(171, allowChatEffects ? 0 : 1);
  3715.     }
  3716.  
  3717.     private void refreshFightKilnEntrance() {
  3718.         if (completedFightCaves)
  3719.             getPackets().sendConfigByFile(10838, 1);
  3720.     }
  3721.  
  3722.     public void refreshHitPoints() {
  3723.         getPackets().sendConfigByFile(7198, getHitpoints());
  3724.     }
  3725.  
  3726.     private void refreshKalphiteLair() {
  3727.         if (khalphiteLairSetted)
  3728.             getPackets().sendConfigByFile(7263, 1);
  3729.     }
  3730.  
  3731.     private void refreshKalphiteLairEntrance() {
  3732.         if (khalphiteLairEntranceSetted)
  3733.             getPackets().sendConfigByFile(7262, 1);
  3734.     }
  3735.  
  3736.     public boolean lumby, draynor, port, alkarid, varrock, falador, burth, tav, adrougne, cath, seers, yanille, edge;
  3737.  
  3738.     public void refreshLodestoneNetwork() {
  3739.         getPackets().sendConfigByFile(358, 15); // unlocks bandit camp lodestone
  3740.         getPackets().sendConfigByFile(2448, 190); // unlocks lunar isle
  3741.                                                     // lodestone
  3742.         getPackets().sendConfigByFile(10907, 1); // unlocks lumbridge lodestone
  3743.         // unlocks alkarid lodestone
  3744.         if (alkarid == true) {
  3745.             getPackets().sendConfigByFile(10900, 1);
  3746.         }
  3747.         // unlocks ardougne lodestone
  3748.         if (adrougne == true) {
  3749.             getPackets().sendConfigByFile(10901, 1);
  3750.         }
  3751.         // unlocks burthorpe lodestone
  3752.         if (burth == true) {
  3753.             getPackets().sendConfigByFile(10902, 1);
  3754.         }
  3755.         // unlocks catherbay lodestone
  3756.         if (cath == true) {
  3757.             getPackets().sendConfigByFile(10903, 1);
  3758.         }
  3759.         // unlocks draynor lodestone
  3760.         if (draynor == true) {
  3761.             getPackets().sendConfigByFile(10904, 1);
  3762.         }
  3763.         // unlocks edgeville lodestone
  3764.         if (edge == true) {
  3765.             getPackets().sendConfigByFile(10905, 1);
  3766.         }
  3767.         // unlocks falador lodestone
  3768.         if (falador == true) {
  3769.             getPackets().sendConfigByFile(10906, 1);
  3770.         }
  3771.         // unlocks port sarim lodestone
  3772.         if (port == true) {
  3773.             getPackets().sendConfigByFile(10908, 1);
  3774.         }
  3775.         // unlocks seers village lodestone
  3776.         if (seers == true) {
  3777.             getPackets().sendConfigByFile(10909, 1);
  3778.         }
  3779.         // unlocks taverley lodestone
  3780.         if (tav == true) {
  3781.             getPackets().sendConfigByFile(10910, 1);
  3782.         }
  3783.         // unlocks varrock lodestone
  3784.         if (varrock == true) {
  3785.             getPackets().sendConfigByFile(10911, 1);
  3786.         }
  3787.         // unlocks yanille lodestone
  3788.         if (yanille == true) {
  3789.             getPackets().sendConfigByFile(10912, 1);
  3790.         }
  3791.     }
  3792.  
  3793.     /*private void refreshLodestoneNetworkClosed() {
  3794.         // unlocks bandit camp lodestone
  3795.         getPackets().sendConfigByFile(359, 15); // Nomal Lodestone = 358, 15
  3796.         // unlocks lunar isle lodestone
  3797.         getPackets().sendConfigByFile(2449, 190); // Nomal Lodestone = 2448 190
  3798.         // unlocks alkarid lodestone
  3799.         getPackets().sendConfigByFile(10924, 1); // Nomal Lodestone = 10900
  3800.         // unlocks ardougne lodestone
  3801.         getPackets().sendConfigByFile(10923, 1); // Nomal Lodestone = 10901
  3802.         // unlocks burthorpe lodestone
  3803.         getPackets().sendConfigByFile(10922, 1); // Nomal Lodestone = 10902
  3804.         // unlocks catherbay lodestone
  3805.         getPackets().sendConfigByFile(10921, 1); // Nomal Lodestone = 10903
  3806.         // unlocks draynor lodestone
  3807.         getPackets().sendConfigByFile(10920, 1); // Nomal Lodestone = 10904
  3808.         // unlocks edgeville lodestone
  3809.         getPackets().sendConfigByFile(10910, 1); // Nomal Lodestone = 10905
  3810.         // unlocks falador lodestone
  3811.         getPackets().sendConfigByFile(10919, 1); // Nomal Lodestone = 10906
  3812.         // unlocks lumbridge lodestone
  3813.         getPackets().sendConfigByFile(10907, 1); // Normal Lodestone = 10907
  3814.         // unlocks port sarim lodestone
  3815.         getPackets().sendConfigByFile(10917, 1); // Normal Lodestone = 10908
  3816.         // unlocks seers village lodestone
  3817.         getPackets().sendConfigByFile(10916, 1); //// Normal Lodestone = 10909
  3818.         // unlocks taverley lodestone
  3819.         getPackets().sendConfigByFile(10915, 1); // Normal Lodestone = 10910
  3820.         // unlocks varrock lodestone
  3821.         getPackets().sendConfigByFile(10914, 1); // Normal Lodestone = 10911
  3822.         // unlocks yanille lodestone
  3823.         getPackets().sendConfigByFile(10913, 1); // Normal Lodestone = 10912
  3824.     }
  3825. */
  3826.     public void refreshMoneyPouch() {
  3827.         getPackets().sendRunScript(5560, getMoneyPouch().getTotal());
  3828.     }
  3829.  
  3830.     public void refreshMouseButtons() {
  3831.         getPackets().sendConfig(170, mouseButtons ? 0 : 1);
  3832.     }
  3833.  
  3834.     private transient ClansManager clanManager, guestClanManager;
  3835.  
  3836.     public ClansManager getClanManager() {
  3837.         return clanManager;
  3838.     }
  3839.  
  3840.     public void setClanManager(ClansManager clanManager) {
  3841.         this.clanManager = clanManager;
  3842.     }
  3843.  
  3844.     private String clanName;
  3845.  
  3846.     private int clanChatSetup;
  3847.  
  3848.     public int getClanChatSetup() {
  3849.         return clanChatSetup;
  3850.     }
  3851.  
  3852.     public void setClanChatSetup(int clanChatSetup) {
  3853.         this.clanChatSetup = clanChatSetup;
  3854.     }
  3855.  
  3856.     private int guestChatSetup;
  3857.  
  3858.     public void refreshOtherChatsSetup() {
  3859.         int value = friendChatSetup << 6;
  3860.         getPackets().sendConfig(1438, value);
  3861.         getPackets().sendConfigByFile(3612, clanChatSetup);
  3862.         getPackets().sendConfigByFile(9191, guestChatSetup);
  3863.     }
  3864.  
  3865.     public void kickPlayerFromClanChannel(String name) {
  3866.         if (clanManager == null)
  3867.             return;
  3868.         clanManager.kickPlayerFromChat(this, name);
  3869.     }
  3870.  
  3871.     public void sendClanChannelMessage(ChatMessage message) {
  3872.         if (clanManager == null)
  3873.             return;
  3874.         clanManager.sendMessage(this, message);
  3875.     }
  3876.  
  3877.     public void sendClanChannelQuickMessage(QuickChatMessage message) {
  3878.         if (clanManager == null)
  3879.             return;
  3880.         clanManager.sendQuickMessage(this, message);
  3881.     }
  3882.  
  3883.     public void sendGuestClanChannelMessage(ChatMessage message) {
  3884.         if (guestClanManager == null)
  3885.             return;
  3886.         guestClanManager.sendMessage(this, message);
  3887.     }
  3888.  
  3889.     public void sendGuestClanChannelQuickMessage(QuickChatMessage message) {
  3890.         if (guestClanManager == null)
  3891.             return;
  3892.         guestClanManager.sendQuickMessage(this, message);
  3893.     }
  3894.  
  3895.     private boolean connectedClanChannel;
  3896.  
  3897.     public int ganodermicFlakes;
  3898.  
  3899.     public void refreshPrivateChatSetup() {
  3900.         getPackets().sendConfig(287, privateChatSetup);
  3901.     }
  3902.  
  3903.     public void refreshSpawnedItems() {
  3904.         for (int regionId : getMapRegionsIds()) {
  3905.             List<FloorItem> floorItems = World.getRegion(regionId).getFloorItems();
  3906.             if (floorItems == null)
  3907.                 continue;
  3908.             for (FloorItem item : floorItems) {
  3909.                 if ((item.isInvisible() || !this.getDisplayName().equalsIgnoreCase(item.getOwner())
  3910.                         || item.getTile().getPlane() != getPlane()))
  3911.                     continue;
  3912.                 getPackets().sendRemoveGroundItem(item);
  3913.             }
  3914.         }
  3915.         for (int regionId : getMapRegionsIds()) {
  3916.             List<FloorItem> floorItems = World.getRegion(regionId).getFloorItems();
  3917.             if (floorItems == null)
  3918.                 continue;
  3919.             for (FloorItem item : floorItems) {
  3920.                 if ((item.isInvisible() || !this.getDisplayName().equalsIgnoreCase(item.getOwner())
  3921.                         || item.getTile().getPlane() != getPlane()))
  3922.                     continue;
  3923.                 getPackets().sendGroundItem(item);
  3924.             }
  3925.         }
  3926.     }
  3927.  
  3928.     public void refreshSpawnedObjects() {
  3929.         for (int regionId : getMapRegionsIds()) {
  3930.             List<WorldObject> spawnedObjects = World.getRegion(regionId).getSpawnedObjects();
  3931.             if (spawnedObjects != null) {
  3932.                 for (WorldObject object : spawnedObjects)
  3933.                     if (object.getPlane() == getPlane())
  3934.                         getPackets().sendSpawnedObject(object);
  3935.             }
  3936.             List<WorldObject> removedObjects = World.getRegion(regionId).getRemovedObjects();
  3937.             if (removedObjects != null) {
  3938.                 for (WorldObject object : removedObjects)
  3939.                     if (object.getPlane() == getPlane())
  3940.                         getPackets().sendDestroyObject(object);
  3941.             }
  3942.         }
  3943.     }
  3944.  
  3945.     @Override
  3946.     public void removeHitpoints(Hit hit) {
  3947.         super.removeHitpoints(hit);
  3948.         refreshHitPoints();
  3949.     }
  3950.  
  3951.     public void removeSkull() {
  3952.         skullDelay = -1;
  3953.         appearence.generateAppearenceData();
  3954.     }
  3955.  
  3956.     @Override
  3957.     public void reset() {
  3958.         reset(true);
  3959.     }
  3960.  
  3961.     @Override
  3962.     public void reset(boolean attributes) {
  3963.         super.reset(attributes);
  3964.         refreshHitPoints();
  3965.         hintIconsManager.removeAll();
  3966.         skills.restoreSkills();
  3967.         combatDefinitions.resetSpecialAttack();
  3968.         prayer.reset();
  3969.         combatDefinitions.resetSpells(true);
  3970.         resting = false;
  3971.         lastBonfire = 0;
  3972.         equipment.refreshConfigs(false);
  3973.         skullDelay = 0;
  3974.         foodDelay = 0;
  3975.         potDelay = 0;
  3976.         poisonImmune = 0;
  3977.         fireImmune = 0;
  3978.         castedVeng = false;
  3979.         setDfsActivated(false);
  3980.         dfscoolDown = 0;
  3981.         getEquipment().refreshConfigs(false);
  3982.         if (getOverloadDelay() > 0)
  3983.             Pots.resetOverLoadEffect(this);
  3984.         setRunEnergy(100);
  3985.         removeDamage(this);
  3986.         appearence.generateAppearenceData();
  3987.         if (getFamiliar() != null) {
  3988.             familiar.sendDeath(this);
  3989.             return;
  3990.         }
  3991.     }
  3992.  
  3993.     public void resetBarrows() {
  3994.         hiddenBrother = -1;
  3995.         killedBarrowBrothers = new boolean[7]; // includes new bro for future
  3996.         // use
  3997.         barrowsKillCount = 0;
  3998.     }
  3999.  
  4000.     @Override
  4001.     public void resetMasks() {
  4002.         super.resetMasks();
  4003.         setTemporaryMovementType(-1);
  4004.         setUpdateMovementType(false);
  4005.         if (!clientHasLoadedMapRegion()) {
  4006.             // load objects and items here
  4007.             setClientHasLoadedMapRegion();
  4008.             refreshSpawnedObjects();
  4009.             refreshSpawnedItems();
  4010.         }
  4011.     }
  4012.  
  4013.     @Override
  4014.     public boolean restoreHitPoints() {
  4015.         boolean update = super.restoreHitPoints();
  4016.         if (update) {
  4017.             if (prayer.usingPrayer(0, 9))
  4018.                 super.restoreHitPoints();
  4019.             if (resting)
  4020.                 super.restoreHitPoints();
  4021.             refreshHitPoints();
  4022.         }
  4023.         return update;
  4024.     }
  4025.  
  4026.     public void restoreRunEnergy() {
  4027.         if (getNextRunDirection() == -1 && runEnergy < 100) {
  4028.             runEnergy++;
  4029.             if (resting && runEnergy < 100)
  4030.                 runEnergy++;
  4031.             getPackets().sendRunEnergy();
  4032.         }
  4033.     }
  4034.  
  4035.     /*
  4036.      * public void run() { if (getRights() == 2) for (Player players:
  4037.      * World.getPlayers()) { if (players == null) continue;
  4038.      * players.getPackets().
  4039.      * sendGameMessage("<col=0000FF><img=1> An Administrator has just logged on!<img=1>"
  4040.      * ); } }
  4041.      */
  4042.     @Override
  4043.     public void sendDeath(final Entity source) {
  4044.         if (prayer.hasPrayersOn() && getTemporaryAttributtes().get("startedDuel") != Boolean.TRUE) {
  4045.             if (prayer.usingPrayer(0, 22)) {
  4046.                 setNextGraphics(new Graphics(437));
  4047.                 final Player target = this;
  4048.                 if (isAtMultiArea()) {
  4049.                     for (int regionId : getMapRegionsIds()) {
  4050.                         List<Integer> playersIndexes = World.getRegion(regionId).getPlayerIndexes();
  4051.                         if (playersIndexes != null) {
  4052.                             for (int playerIndex : playersIndexes) {
  4053.                                 Player player = World.getPlayers().get(playerIndex);
  4054.                                 if (player == null || !player.hasStarted() || player.isDead() || player.hasFinished()
  4055.                                         || !player.withinDistance(this, 1) || !player.isCanPvp()
  4056.                                         || !target.getControlerManager().canHit(player))
  4057.                                     continue;
  4058.                                 player.applyHit(new Hit(target,
  4059.                                         Utils.getRandom((int) (skills.getLevelForXp(Skills.PRAYER) * 2.5)),
  4060.                                         HitLook.REGULAR_DAMAGE));
  4061.                             }
  4062.                         }
  4063.                         List<Integer> npcsIndexes = World.getRegion(regionId).getNPCsIndexes();
  4064.                         if (npcsIndexes != null) {
  4065.                             for (int npcIndex : npcsIndexes) {
  4066.                                 NPC npc = World.getNPCs().get(npcIndex);
  4067.                                 if (npc == null || npc.isDead() || npc.hasFinished() || !npc.withinDistance(this, 1)
  4068.                                         || !npc.getDefinitions().hasAttackOption()
  4069.                                         || !target.getControlerManager().canHit(npc))
  4070.                                     continue;
  4071.                                 npc.applyHit(new Hit(target,
  4072.                                         Utils.getRandom((int) (skills.getLevelForXp(Skills.PRAYER) * 2.5)),
  4073.                                         HitLook.REGULAR_DAMAGE));
  4074.                             }
  4075.                         }
  4076.                     }
  4077.                 } else {
  4078.                     if (source != null && source != this && !source.isDead() && !source.hasFinished()
  4079.                             && source.withinDistance(this, 1))
  4080.                         source.applyHit(
  4081.                                 new Hit(target, Utils.getRandom((int) (skills.getLevelForXp(Skills.PRAYER) * 2.5)),
  4082.                                         HitLook.REGULAR_DAMAGE));
  4083.                 }
  4084.                 WorldTasksManager.schedule(new WorldTask() {
  4085.                     @Override
  4086.                     public void run() {
  4087.                         World.sendGraphics(target, new Graphics(438),
  4088.                                 new WorldTile(target.getX() - 1, target.getY(), target.getPlane()));
  4089.                         World.sendGraphics(target, new Graphics(438),
  4090.                                 new WorldTile(target.getX() + 1, target.getY(), target.getPlane()));
  4091.                         World.sendGraphics(target, new Graphics(438),
  4092.                                 new WorldTile(target.getX(), target.getY() - 1, target.getPlane()));
  4093.                         World.sendGraphics(target, new Graphics(438),
  4094.                                 new WorldTile(target.getX(), target.getY() + 1, target.getPlane()));
  4095.                         World.sendGraphics(target, new Graphics(438),
  4096.                                 new WorldTile(target.getX() - 1, target.getY() - 1, target.getPlane()));
  4097.                         World.sendGraphics(target, new Graphics(438),
  4098.                                 new WorldTile(target.getX() - 1, target.getY() + 1, target.getPlane()));
  4099.                         World.sendGraphics(target, new Graphics(438),
  4100.                                 new WorldTile(target.getX() + 1, target.getY() - 1, target.getPlane()));
  4101.                         World.sendGraphics(target, new Graphics(438),
  4102.                                 new WorldTile(target.getX() + 1, target.getY() + 1, target.getPlane()));
  4103.                     }
  4104.                 });
  4105.             } else if (prayer.usingPrayer(1, 17)) {
  4106.                 World.sendProjectile(this, new WorldTile(getX() + 2, getY() + 2, getPlane()), 2260, 24, 0, 41, 35, 30,
  4107.                         0);
  4108.                 World.sendProjectile(this, new WorldTile(getX() + 2, getY(), getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  4109.                 World.sendProjectile(this, new WorldTile(getX() + 2, getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30,
  4110.                         0);
  4111.                 World.sendProjectile(this, new WorldTile(getX() - 2, getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30,
  4112.                         0);
  4113.                 World.sendProjectile(this, new WorldTile(getX() - 2, getY(), getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  4114.                 World.sendProjectile(this, new WorldTile(getX() - 2, getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30,
  4115.                         0);
  4116.  
  4117.                 World.sendProjectile(this, new WorldTile(getX(), getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  4118.                 World.sendProjectile(this, new WorldTile(getX(), getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  4119.                 final Player target = this;
  4120.                 WorldTasksManager.schedule(new WorldTask() {
  4121.                     @Override
  4122.                     public void run() {
  4123.                         setNextGraphics(new Graphics(2259));
  4124.  
  4125.                         if (isAtMultiArea()) {
  4126.                             for (int regionId : getMapRegionsIds()) {
  4127.                                 List<Integer> playersIndexes = World.getRegion(regionId).getPlayerIndexes();
  4128.                                 if (playersIndexes != null) {
  4129.                                     for (int playerIndex : playersIndexes) {
  4130.                                         Player player = World.getPlayers().get(playerIndex);
  4131.                                         if (player == null || !player.hasStarted() || player.isDead()
  4132.                                                 || player.hasFinished() || !player.isCanPvp()
  4133.                                                 || !player.withinDistance(target, 2)
  4134.                                                 || !target.getControlerManager().canHit(player))
  4135.                                             continue;
  4136.                                         player.applyHit(new Hit(target,
  4137.                                                 Utils.getRandom((skills.getLevelForXp(Skills.PRAYER) * 3)),
  4138.                                                 HitLook.REGULAR_DAMAGE));
  4139.                                     }
  4140.                                 }
  4141.                                 List<Integer> npcsIndexes = World.getRegion(regionId).getNPCsIndexes();
  4142.                                 if (npcsIndexes != null) {
  4143.                                     for (int npcIndex : npcsIndexes) {
  4144.                                         NPC npc = World.getNPCs().get(npcIndex);
  4145.                                         if (npc == null || npc.isDead() || npc.hasFinished()
  4146.                                                 || !npc.withinDistance(target, 2)
  4147.                                                 || !npc.getDefinitions().hasAttackOption()
  4148.                                                 || !target.getControlerManager().canHit(npc))
  4149.                                             continue;
  4150.                                         npc.applyHit(new Hit(target,
  4151.                                                 Utils.getRandom((skills.getLevelForXp(Skills.PRAYER) * 3)),
  4152.                                                 HitLook.REGULAR_DAMAGE));
  4153.                                     }
  4154.                                 }
  4155.                             }
  4156.                         } else {
  4157.                             if (source != null && source != target && !source.isDead() && !source.hasFinished()
  4158.                                     && source.withinDistance(target, 2))
  4159.                                 source.applyHit(
  4160.                                         new Hit(target, Utils.getRandom((skills.getLevelForXp(Skills.PRAYER) * 3)),
  4161.                                                 HitLook.REGULAR_DAMAGE));
  4162.                         }
  4163.  
  4164.                         World.sendGraphics(target, new Graphics(2260),
  4165.                                 new WorldTile(getX() + 2, getY() + 2, getPlane()));
  4166.                         World.sendGraphics(target, new Graphics(2260), new WorldTile(getX() + 2, getY(), getPlane()));
  4167.                         World.sendGraphics(target, new Graphics(2260),
  4168.                                 new WorldTile(getX() + 2, getY() - 2, getPlane()));
  4169.  
  4170.                         World.sendGraphics(target, new Graphics(2260),
  4171.                                 new WorldTile(getX() - 2, getY() + 2, getPlane()));
  4172.                         World.sendGraphics(target, new Graphics(2260), new WorldTile(getX() - 2, getY(), getPlane()));
  4173.                         World.sendGraphics(target, new Graphics(2260),
  4174.                                 new WorldTile(getX() - 2, getY() - 2, getPlane()));
  4175.  
  4176.                         World.sendGraphics(target, new Graphics(2260), new WorldTile(getX(), getY() + 2, getPlane()));
  4177.                         World.sendGraphics(target, new Graphics(2260), new WorldTile(getX(), getY() - 2, getPlane()));
  4178.  
  4179.                         World.sendGraphics(target, new Graphics(2260),
  4180.                                 new WorldTile(getX() + 1, getY() + 1, getPlane()));
  4181.                         World.sendGraphics(target, new Graphics(2260),
  4182.                                 new WorldTile(getX() + 1, getY() - 1, getPlane()));
  4183.                         World.sendGraphics(target, new Graphics(2260),
  4184.                                 new WorldTile(getX() - 1, getY() + 1, getPlane()));
  4185.                         World.sendGraphics(target, new Graphics(2260),
  4186.                                 new WorldTile(getX() - 1, getY() - 1, getPlane()));
  4187.                     }
  4188.                 });
  4189.             }
  4190.         }
  4191.         setNextAnimation(new Animation(-1));
  4192.         if (!controlerManager.sendDeath())
  4193.             return;
  4194.         lock();
  4195.         stopAll();
  4196.         if (familiar != null)
  4197.             familiar.sendDeath(this);
  4198.  
  4199.         WorldTasksManager.schedule(new WorldTask() {
  4200.             int loop;
  4201.  
  4202.             @Override
  4203.             public void run() {
  4204.                 if (loop == 0) {
  4205.                     setNextAnimation(new Animation(836));
  4206.                 } else if (loop == 1) {
  4207.                     sendMessage("Oh dear, you have died.");
  4208.                     if (source instanceof Player) {
  4209.                         Player killer = (Player) source;
  4210.                         killer.setAttackedByDelay(4);
  4211.                     }
  4212.                 } else if (loop == 3) {
  4213.                     lock();
  4214.                     reset();
  4215.                     setNextWorldTile(new WorldTile(Settings.RESPAWN_PLAYER_LOCATION));
  4216.                     setNextAnimation(new Animation(-1));
  4217.                     unlock();
  4218.                 } else if (loop == 4) {
  4219.                     getPackets().sendMusicEffect(90);
  4220.                     stop();
  4221.                 }
  4222.                 loop++;
  4223.             }
  4224.         }, 0, 1);
  4225.     }
  4226.  
  4227.     public void sendDefaultPlayersOptions() {
  4228.         getPackets().sendPlayerOption("Follow", 2, false);
  4229.         getPackets().sendPlayerOption("Trade with", 4, false);
  4230.         getPackets().sendPlayerOption("View stats", 5, false);
  4231.         /*
  4232.          * if (getRights() == 1 || getRights() == 2) {
  4233.          * getPackets().sendPlayerOption("<col=FF0000>Mod Panel</col>", 6,
  4234.          * false); }
  4235.          */
  4236.         getPackets().sendPlayerOption("Challenge", 6, false);
  4237.     }
  4238.  
  4239.     public void sendFriendsChannelMessage(ChatMessage message) {
  4240.         if (currentFriendChat == null)
  4241.             return;
  4242.         currentFriendChat.sendMessage(this, message);
  4243.     }
  4244.  
  4245.     public void sendFriendsChannelQuickMessage(QuickChatMessage message) {
  4246.         if (currentFriendChat == null)
  4247.             return;
  4248.         currentFriendChat.sendQuickMessage(this, message);
  4249.     }
  4250.  
  4251.     /*
  4252.      * public boolean hasAccountPin; public boolean hasEnteredPin; public int
  4253.      * accountpin;
  4254.      *
  4255.      * public int getAccountPin() { return accountpin; }
  4256.      *
  4257.      * public void setAccountPin(int accountpin) { this.accountpin = accountpin;
  4258.      * }
  4259.      */
  4260.  
  4261.     public void sendItemsOnDeath(Player killer, int wildernessTimer) {
  4262.         int total = 0;
  4263.         int reqTotal = 300;
  4264.         for (int i = 0; i < 25; i++) {
  4265.             total += getSkills().getLevel(i);
  4266.         }
  4267.         if (total < reqTotal) {
  4268.             return;
  4269.         }
  4270.         if (total < reqTotal) {
  4271.             return;
  4272.         }
  4273.         if (getUsername().equalsIgnoreCase("  "))
  4274.             return;
  4275.         /*
  4276.          * if (Commands.isAllowedToSpawn(this)) return;
  4277.          */
  4278.         if (killer == null) {
  4279.             // System.out.println("Killer was null for " + getUsername());
  4280.             return;
  4281.         }
  4282.         // charges.die();
  4283.         auraManager.removeAura();
  4284.         CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
  4285.         for (int i = 0; i < 14; i++) {
  4286.             if (equipment.getItem(i) != null && equipment.getItem(i).getId() != -1
  4287.                     && equipment.getItem(i).getAmount() != -1)
  4288.                 containedItems.add(new Item(equipment.getItem(i).getId(), equipment.getItem(i).getAmount()));
  4289.         }
  4290.         for (int i = 0; i < 28; i++) {
  4291.             if (inventory.getItem(i) != null && inventory.getItem(i).getId() != -1
  4292.                     && inventory.getItem(i).getAmount() != -1)
  4293.                 containedItems.add(new Item(getInventory().getItem(i).getId(), getInventory().getItem(i).getAmount()));
  4294.         }
  4295.         if (containedItems.isEmpty())
  4296.             return;
  4297.         int keptAmount = 0;
  4298.         if (!(controlerManager.getControler() instanceof CorpBeastControler)) {
  4299.             keptAmount = hasSkull() ? 0 : 3;
  4300.             if (prayer.usingPrayer(0, 10) || prayer.usingPrayer(1, 0))
  4301.                 keptAmount++;
  4302.         }
  4303.         CopyOnWriteArrayList<Item> keptItems = new CopyOnWriteArrayList<Item>();
  4304.         Item lastItem = new Item(1, 1);
  4305.         for (int i = 0; i < keptAmount; i++) {
  4306.             for (Item item : containedItems) {
  4307.                 int price = Prices.getDeathPrice(item);
  4308.                 if (price >= lastItem.getDefinitions().getValue()) {
  4309.                     lastItem = item;
  4310.                 }
  4311.             }
  4312.             keptItems.add(lastItem);
  4313.             containedItems.remove(lastItem);
  4314.             lastItem = new Item(1, 1);
  4315.         }
  4316.         // LENDED ITEMS ON DEATH WILL NOT BE REMOVED
  4317.         for (Item item : containedItems) {
  4318.             if (item.getDefinitions().isLended()) {
  4319.                 keptItems.add(item);
  4320.                 containedItems.remove(item);
  4321.             }
  4322.         }
  4323.         inventory.reset();
  4324.         equipment.reset();
  4325.         for (Item item : keptItems) {
  4326.             getInventory().addItem(item);
  4327.         }
  4328.         for (Item item : containedItems) {
  4329.             charges.death(item);
  4330.             // charges.dust(item);
  4331.         }
  4332.         for (Item item : containedItems) {
  4333.             if (!ItemConstants.isTradeable(item)) {
  4334.                 if (isDonator()) {
  4335.                     // charges.dust(item);
  4336.                     containedItems.remove(item);
  4337.                     getInventory().addItem(item);
  4338.                 } else if (!isDonator()) {
  4339.                     containedItems.remove(item);
  4340.                     World.addGroundItem(item, getLastWorldTile(), this, false, 180, true, false);
  4341.                     continue;
  4342.                 }
  4343.             }
  4344.         }
  4345.         LoggingSystem.logDeath(this, killer, containedItems);
  4346.         DbLogs.logDeath(this, killer, containedItems);
  4347.         for (Item item : containedItems) {
  4348.             World.addGroundItem(item, getLastWorldTile(), killer, false, 180, true, false);
  4349.         }
  4350.         SerializableFilesManager.savePlayer(this);
  4351.     }
  4352.  
  4353.     public boolean isUntillLogout() {
  4354.         return untillLogout;
  4355.     }
  4356.  
  4357.     public void setUntillLogout(boolean untillLogout) {
  4358.         this.untillLogout = untillLogout;
  4359.     }
  4360.  
  4361.     public void sendLobbyConfigs(Player player) {
  4362.         for (int i = 0; i < Utils.DEFAULT_LOBBY_CONFIGS.length; i++) {
  4363.             int val = Utils.DEFAULT_LOBBY_CONFIGS[i];
  4364.             if (val != 0) {
  4365.                 player.getPackets().sendConfig(i, val);
  4366.             }
  4367.         }
  4368.     }
  4369.  
  4370.     public void sendMessage(String message) {
  4371.         getPackets().sendGameMessage(message);
  4372.     }
  4373.  
  4374.     public void sendPublicChatMessage(PublicChatMessage message) {
  4375.         for (int regionId : getMapRegionsIds()) {
  4376.             List<Integer> playersIndexes = World.getRegion(regionId).getPlayerIndexes();
  4377.             if (playersIndexes == null)
  4378.                 continue;
  4379.             for (Integer playerIndex : playersIndexes) {
  4380.                 Player p = World.getPlayers().get(playerIndex);
  4381.                 if (p == null || !p.hasStarted() || p.hasFinished()
  4382.                         || p.getLocalPlayerUpdate().getLocalPlayers()[getIndex()] == null)
  4383.                     continue;
  4384.                 p.getPackets().sendPublicMessage(this, message);
  4385.             }
  4386.         }
  4387.     }
  4388.  
  4389.     public void sendRandomJail(Player p) {
  4390.         p.resetWalkSteps();
  4391.         switch (Utils.getRandom(2)) {
  4392.         case 0:
  4393.             p.setNextWorldTile(new WorldTile(2931, 9698, 0));
  4394.             break;
  4395.         case 1:
  4396.             p.setNextWorldTile(new WorldTile(2931, 9687, 0));
  4397.             break;
  4398.         case 2:
  4399.             p.setNextWorldTile(new WorldTile(2933, 9703, 0));
  4400.             break;
  4401.         }
  4402.     }
  4403.  
  4404.     public void sendRunButtonConfig() {
  4405.         getPackets().sendConfig(173, resting ? 3 : getRun() ? 1 : 0);
  4406.     }
  4407.  
  4408.     public void sendSoulSplit(final Hit hit, final Entity user) {
  4409.         final Player target = this;
  4410.         if (hit.getDamage() > 0)
  4411.             World.sendProjectile(user, this, 2263, 11, 11, 20, 5, 0, 0);
  4412.         user.heal(hit.getDamage() / 5);
  4413.         prayer.drainPrayer(hit.getDamage() / 5);
  4414.         WorldTasksManager.schedule(new WorldTask() {
  4415.             @Override
  4416.             public void run() {
  4417.                 setNextGraphics(new Graphics(2264));
  4418.                 if (hit.getDamage() > 0)
  4419.                     World.sendProjectile(target, user, 2263, 11, 11, 20, 5, 0, 0);
  4420.             }
  4421.         }, 0);
  4422.     }
  4423.  
  4424.     public void sendUnlockedObjectConfigs() {
  4425.         refreshKalphiteLairEntrance();
  4426.         refreshKalphiteLair();
  4427.         refreshLodestoneNetwork();
  4428.         refreshFightKilnEntrance();
  4429.     }
  4430.  
  4431.     public void setAssistStatus(int assistStatus) {
  4432.         this.assistStatus = assistStatus;
  4433.     }
  4434.  
  4435.     public void setBankPin(String bankPinString) {
  4436.     }
  4437.  
  4438.     public void setBanned(long banned) {
  4439.         this.banned = banned;
  4440.     }
  4441.  
  4442.     public void setBarbarianAdvancedLaps(int barbarianAdvancedLaps) {
  4443.         this.barbarianAdvancedLaps = barbarianAdvancedLaps;
  4444.     }
  4445.  
  4446.     public int setBarrowsKillCount(int barrowsKillCount) {
  4447.         return this.barrowsKillCount = barrowsKillCount;
  4448.     }
  4449.  
  4450.     public void setBarsDone(int barsDone) {
  4451.         this.barsDone = barsDone;
  4452.     }
  4453.  
  4454.     public void setCanPvp(boolean canPvp) {
  4455.         this.canPvp = canPvp;
  4456.         appearence.generateAppearenceData();
  4457.         getPackets().sendPlayerOption(canPvp ? "Attack" : "null", 1, true);
  4458.         getPackets().sendPlayerUnderNPCPriority(canPvp);
  4459.     }
  4460.  
  4461.     public void setCantTrade(boolean canTrade) {
  4462.         this.cantTrade = canTrade;
  4463.     }
  4464.  
  4465.     public void setCastVeng(boolean castVeng) {
  4466.         this.castedVeng = castVeng;
  4467.     }
  4468.  
  4469.     public void setClanStatus(int clanStatus) {
  4470.         this.clanStatus = clanStatus;
  4471.     }
  4472.  
  4473.     public void setClientHasLoadedMapRegion() {
  4474.         clientLoadedMapRegion = true;
  4475.     }
  4476.  
  4477.     public void setClientHasntLoadedMapRegion() {
  4478.         clientLoadedMapRegion = false;
  4479.     }
  4480.  
  4481.     public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
  4482.         this.closeInterfacesEvent = closeInterfacesEvent;
  4483.     }
  4484.  
  4485.     public void setClueReward(int clueReward) {
  4486.         this.clueReward = clueReward;
  4487.     }
  4488.  
  4489.     public void setCompletedFightCaves() {
  4490.         if (!completedFightCaves) {
  4491.             completedFightCaves = true;
  4492.             refreshFightKilnEntrance();
  4493.         }
  4494.     }
  4495.  
  4496.     public void setCompletedFightKiln() {
  4497.         completedFightKiln = true;
  4498.     }
  4499.  
  4500.     public void setCompletedRfd() {
  4501.         completedRfd = true;
  4502.     }
  4503.  
  4504.     public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
  4505.         this.completionistCapeCustomized = skillcapeCustomized;
  4506.     }
  4507.  
  4508.     /*
  4509.      * public void setCoordsEvent(CoordsEvent coordsEvent) { this.coordsEvent =
  4510.      * coordsEvent; }
  4511.      */
  4512.  
  4513.     public void setCreationDate(long creationDate) {
  4514.         this.creationDate = creationDate;
  4515.     }
  4516.  
  4517.     public void setCurrentFriendChat(FriendChatsManager currentFriendChat) {
  4518.         this.currentFriendChat = currentFriendChat;
  4519.     }
  4520.  
  4521.     public void setCurrentFriendChatOwner(String currentFriendChatOwner) {
  4522.         this.currentFriendChatOwner = currentFriendChatOwner;
  4523.     }
  4524.  
  4525.     public void setCurrentMac(String currentMac) {
  4526.         this.currentMac = currentMac;
  4527.     }
  4528.  
  4529.     public void setCurrentWorldLobby(int currentWorldLobby) {
  4530.         this.currentWorldLobby = currentWorldLobby;
  4531.     }
  4532.  
  4533.     public void setCustomTitle(String customTitle) {
  4534.         this.customTitle = customTitle;
  4535.     }
  4536.  
  4537.     public int setDeathCount(int deathCount) {
  4538.         return this.deathCount = deathCount;
  4539.     }
  4540.  
  4541.     public void setDefenderRoom(boolean isInDefenderRoom) {
  4542.         this.isInDefenderRoom = isInDefenderRoom;
  4543.     }
  4544.  
  4545.     public void setDfsActivated(boolean dfsActivated) {
  4546.         this.dfsActivated = dfsActivated;
  4547.     }
  4548.  
  4549.     public void setdfscoolDown(int dfscoolDown) {
  4550.         this.dfscoolDown = dfscoolDown;
  4551.     }
  4552.  
  4553.     public void setDisableEquip(boolean equip) {
  4554.         disableEquip = equip;
  4555.     }
  4556.  
  4557.     public void setDisplayMode(int displayMode) {
  4558.         this.displayMode = displayMode;
  4559.     }
  4560.  
  4561.     public void setDisplayName(String displayName) {
  4562.         this.displayName = displayName;
  4563.     }
  4564.  
  4565.     public void setDominionFactor(int dominionFactor) {
  4566.         this.dominionFactor = dominionFactor;
  4567.     }
  4568.  
  4569.     public void setDonator(boolean donator) {
  4570.         this.donator = donator;
  4571.     }
  4572.  
  4573.     public void setDicer(boolean dicer) {
  4574.         this.dicer = dicer;
  4575.     }
  4576.  
  4577.     public void setEasterPoints(int easterPoints) {
  4578.         this.easterPoints = easterPoints;
  4579.     }
  4580.  
  4581.     public void setEmailAttached(String email) {
  4582.         this.email = email;
  4583.     }
  4584.  
  4585.     public void setEnteredBankPin(String enteredPinString) {
  4586.         this.enteredPinString = enteredPinString;
  4587.     }
  4588.  
  4589.     public void setExtremeDonator(boolean extremeDonator) {
  4590.         this.extremeDonator = extremeDonator;
  4591.     }
  4592.  
  4593.     public void setFamiliar(Familiar familiar) {
  4594.         this.familiar = familiar;
  4595.     }
  4596.  
  4597.     public void setFightPitsSkull() {
  4598.         skullDelay = Integer.MAX_VALUE;
  4599.         skullId = 1;
  4600.         appearence.generateAppearenceData();
  4601.     }
  4602.  
  4603.     public void setFilterGame(boolean filterGame) {
  4604.         this.filterGame = filterGame;
  4605.     }
  4606.  
  4607.     public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
  4608.         this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
  4609.     }
  4610.  
  4611.     public void setForumModerator(boolean isForumModerator) {
  4612.         this.isForumModerator = isForumModerator;
  4613.     }
  4614.  
  4615.     public void setFriendChatSetup(int friendChatSetup) {
  4616.         this.friendChatSetup = friendChatSetup;
  4617.     }
  4618.  
  4619.     public void setGnomeAdvancedLaps(int gnomeAdvancedLaps) {
  4620.         this.gnomeAdvancedLaps = gnomeAdvancedLaps;
  4621.     }
  4622.  
  4623.     public void setGotInfernoAdze(boolean gotInfernoAdze) {
  4624.         this.gotInfernoAdze = gotInfernoAdze;
  4625.     }
  4626.  
  4627.     public void setGraphicDesigner(boolean isGraphicDesigner) {
  4628.         this.isGraphicDesigner = isGraphicDesigner;
  4629.     }
  4630.  
  4631.     public void setHasCutEnoughLogs(boolean hasCutEnoughLogs) {
  4632.         this.hasCutEnoughLogs = hasCutEnoughLogs;
  4633.     }
  4634.  
  4635.     private boolean hadEnoughVotes;
  4636.  
  4637.     public boolean hadEnoughVotes() {
  4638.         return hadEnoughVotes;
  4639.     }
  4640.  
  4641.     public void setHadEnoughVotes(boolean hadEnoughVotes) {
  4642.         this.hadEnoughVotes = hadEnoughVotes;
  4643.     }
  4644.  
  4645.     public void setHasFinishedBarrows(boolean hasFinishedBarrows) {
  4646.         this.hasFinishedBarrows = hasFinishedBarrows;
  4647.     }
  4648.  
  4649.     public void setHasCutMoreEnoughLogs(boolean hasCutMoreEnoughLogs) {
  4650.         this.hasCutMoreEnoughLogs = hasCutMoreEnoughLogs;
  4651.     }
  4652.  
  4653.     public void setHiddenBrother(int hiddenBrother) {
  4654.         this.hiddenBrother = hiddenBrother;
  4655.     }
  4656.  
  4657.     public void setHideSofInterface(boolean hideSofInterface) {
  4658.         // TODO Auto-generated method stub
  4659.         this.hideSofInterface = hideSofInterface;
  4660.     }
  4661.  
  4662.     public void setHideWorldMessages(boolean hideWorldAnnouncements) {
  4663.         this.hideWorldAnnouncements = hideWorldAnnouncements;
  4664.     }
  4665.  
  4666.     public void setHpBoostMultiplier(double hpBoostMultiplier) {
  4667.         this.hpBoostMultiplier = hpBoostMultiplier;
  4668.     }
  4669.  
  4670.     public void setInAnimationRoom(boolean inAnimationRoom) {
  4671.         this.inAnimationRoom = inAnimationRoom;
  4672.     }
  4673.  
  4674.     public void setInvulnerable(boolean invulnerable) {
  4675.         this.invulnerable = invulnerable;
  4676.     }
  4677.  
  4678.     public void setIsInLobby(boolean isInLobby) {
  4679.         this.isInLobby = isInLobby;
  4680.     }
  4681.  
  4682.     public void setJailed(long jailed) {
  4683.         this.jailed = jailed;
  4684.     }
  4685.  
  4686.     public void setCoolDown(long cooldown) {
  4687.         this.cooldown = cooldown;
  4688.     }
  4689.  
  4690.     public void setWorldXp(long WorldXp) {
  4691.         this.WorldXp = WorldXp;
  4692.     }
  4693.  
  4694.     public void setKalphiteLair() {
  4695.         khalphiteLairSetted = true;
  4696.         refreshKalphiteLair();
  4697.     }
  4698.  
  4699.     public void setKalphiteLairEntrance() {
  4700.         khalphiteLairEntranceSetted = true;
  4701.         refreshKalphiteLairEntrance();
  4702.     }
  4703.  
  4704.     public int setKillCount(int killCount) {
  4705.         return this.killCount = killCount;
  4706.     }
  4707.  
  4708.     public void setKilledAgrithNaNa(boolean agrithNaNa) {
  4709.         this.agrithNaNa = agrithNaNa;
  4710.     }
  4711.  
  4712.     public void setKilledBork(boolean killedBork) {
  4713.         this.killedBork = killedBork;
  4714.     }
  4715.  
  4716.     public void setKilledCulinaromancer(boolean culinaromancer) {
  4717.         this.culinaromancer = culinaromancer;
  4718.     }
  4719.  
  4720.     public void setKilledDessourt(boolean dessourt) {
  4721.         this.dessourt = dessourt;
  4722.     }
  4723.  
  4724.     public void setKilledFlamBeed(boolean flamBeed) {
  4725.         this.flamBeed = flamBeed;
  4726.     }
  4727.  
  4728.     public void setKilledKaramel(boolean karamel) {
  4729.         this.karamel = karamel;
  4730.     }
  4731.  
  4732.     /**
  4733.      * Sets the killedQueenBlackDragon.
  4734.      *
  4735.      * @param killedQueenBlackDragon
  4736.      *            The killedQueenBlackDragon to set.
  4737.      */
  4738.     public void setKilledQueenBlackDragon(boolean killedQueenBlackDragon) {
  4739.         this.killedQueenBlackDragon = killedQueenBlackDragon;
  4740.     }
  4741.  
  4742.     public void setLargeSceneView(boolean largeSceneView) {
  4743.         this.largeSceneView = largeSceneView;
  4744.     }
  4745.  
  4746.     public void setLastBonfire(int lastBonfire) {
  4747.         this.lastBonfire = lastBonfire;
  4748.     }
  4749.  
  4750.     public void setLastDuelRules(DuelRules duelRules) {
  4751.         this.lastDuelRules = duelRules;
  4752.     }
  4753.  
  4754.     public void setLastIP(String lastIP) {
  4755.         this.lastIP = lastIP;
  4756.     }
  4757.  
  4758.     public void setLastMsg(String lastMsg) {
  4759.         this.lastMsg = lastMsg;
  4760.     }
  4761.  
  4762.     public void setLastPublicMessage(long lastPublicMessage) {
  4763.         this.lastPublicMessage = lastPublicMessage;
  4764.     }
  4765.  
  4766.     public void setLastRequestSQL(long lastRequestSQL) {
  4767.         // TODO Auto-generated method stub
  4768.         this.lastRequestSQL = lastRequestSQL;
  4769.  
  4770.     }
  4771.  
  4772.     public void setLastUsedGodwarsAltar(long l) {
  4773.         // TODO Auto-generated method stub
  4774.  
  4775.     }
  4776.  
  4777.     public void setLastWalked(long lastWalkedMillis) {
  4778.         // TODO Auto-generated method stub
  4779.         this.lastWalkedMillis = lastWalkedMillis;
  4780.     }
  4781.  
  4782.     public void setLoadedLogs(int loadedLogs) {
  4783.         this.loadedLogs = loadedLogs;
  4784.     }
  4785.  
  4786.     public void setLoggedInWorld(int loggedWorld) {
  4787.         this.loggedWorld = loggedWorld;
  4788.     }
  4789.  
  4790.     public void setLogsCut(int logsCut) {
  4791.         this.logsCut = logsCut;
  4792.     }
  4793.  
  4794.     public void setLoyaltyPoints(int Loyaltypoints) {
  4795.         this.Loyaltypoints = Loyaltypoints;
  4796.     }
  4797.  
  4798.     public void setMacBanned(boolean macBanned) {
  4799.         this.macBanned = macBanned;
  4800.     }
  4801.  
  4802.     public void setMagicLogsBurned(int magicLogsBurned) {
  4803.         this.magicLogsBurned = magicLogsBurned;
  4804.     }
  4805.  
  4806.     public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
  4807.         this.maxedCapeCustomized = maxedCapeCustomized;
  4808.     }
  4809.  
  4810.     public void setMoneyPouchValue(int money) {
  4811.         this.money = money;
  4812.     }
  4813.  
  4814.     public void setMuted(long muted) {
  4815.         this.muted = muted;
  4816.     }
  4817.  
  4818.     public void setOverloadDelay(int overloadDelay) {
  4819.         this.overloadDelay = overloadDelay;
  4820.     }
  4821.  
  4822.     public void setOwner(String Owner) {
  4823.         this.Owner = Owner;
  4824.     }
  4825.  
  4826.     public void setPacketsDecoderPing(long packetsDecoderPing) {
  4827.         this.packetsDecoderPing = packetsDecoderPing;
  4828.     }
  4829.  
  4830.     public void setPassword(String password) {
  4831.         this.password = password;
  4832.     }
  4833.  
  4834.     public void setPermBanned(boolean permBanned) {
  4835.         this.permBanned = permBanned;
  4836.     }
  4837.  
  4838.     public void setPermMuted(boolean permMuted) {
  4839.         this.permMuted = permMuted;
  4840.     }
  4841.  
  4842.     public void setPestControlGames(int pestControlGames) {
  4843.         this.pestControlGames = pestControlGames;
  4844.     }
  4845.  
  4846.     public void setPestPoints(int pestPoints) {
  4847.         this.pestPoints = pestPoints;
  4848.     }
  4849.  
  4850.     /**
  4851.      * Sets the pet.
  4852.      *
  4853.      * @param pet
  4854.      *            The pet to set.
  4855.      */
  4856.     public void setPet(Pet pet) {
  4857.         this.pet = pet;
  4858.     }
  4859.  
  4860.     /**
  4861.      * Sets the petManager.
  4862.      *
  4863.      * @param petManager
  4864.      *            The petManager to set.
  4865.      */
  4866.     public void setPetManager(PetManager petManager) {
  4867.         this.petManager = petManager;
  4868.     }
  4869.  
  4870.     public void setPkPoints(int pkPoints) {
  4871.         this.pkPoints = pkPoints;
  4872.     }
  4873.  
  4874.     public void setPolDelay(long delay) {
  4875.         this.polDelay = delay;
  4876.     }
  4877.  
  4878.     public void setPrayerDelay(long teleDelay) {
  4879.         getTemporaryAttributtes().put("PrayerBlocked", teleDelay + Utils.currentTimeMillis());
  4880.         prayer.closeAllPrayers();
  4881.     }
  4882.  
  4883.     public void setPrayerRenewalDelay(int delay) {
  4884.         this.prayerRenewalDelay = delay;
  4885.     }
  4886.  
  4887.     public void setPrestige(int prestige) {
  4888.         this.prestige = prestige;
  4889.     }
  4890.  
  4891.     public void setPrivateChatSetup(int privateChatSetup) {
  4892.         this.privateChatSetup = privateChatSetup;
  4893.     }
  4894.  
  4895.     public void setPublicStatus(int publicStatus) {
  4896.         this.publicStatus = publicStatus;
  4897.     }
  4898.  
  4899.     public void setPvmPoints(int pvmPoints) {
  4900.         this.pvmPoints = pvmPoints;
  4901.     }
  4902.  
  4903.     public void setRecovAnswer(String recovAnswer) {
  4904.         this.recovAnswer = recovAnswer;
  4905.     }
  4906.  
  4907.     public void setRecovQuestion(String recovQuestion) {
  4908.         this.recovQuestion = recovQuestion;
  4909.     }
  4910.  
  4911.     public void setRegisteredMac(String registeredMac) {
  4912.         this.registeredMac = registeredMac;
  4913.     }
  4914.  
  4915.     public void setResting(boolean resting) {
  4916.         this.resting = resting;
  4917.         sendRunButtonConfig();
  4918.  
  4919.         if (customNpcId != -1) {
  4920.             getAppearence().transformIntoNPC(customNpcId);
  4921.         }
  4922.     }
  4923.  
  4924.     public void setRights(int rights) {
  4925.         this.rights = rights;
  4926.     }
  4927.  
  4928.     public void setRocktailsCooked(int rocktailsCooked) {
  4929.         this.rocktailsCooked = rocktailsCooked;
  4930.     }
  4931.  
  4932.     @Override
  4933.     public void setRun(boolean run) {
  4934.         if (run != getRun()) {
  4935.             super.setRun(run);
  4936.             setUpdateMovementType(true);
  4937.             sendRunButtonConfig();
  4938.         }
  4939.     }
  4940.  
  4941.     public void setRunEnergy(int runEnergy) {
  4942.         this.runEnergy = (byte) runEnergy;
  4943.         getPackets().sendRunEnergy();
  4944.     }
  4945.  
  4946.     /**
  4947.      * @param runeSpanPoint
  4948.      *            the runeSpanPoint to set
  4949.      */
  4950.     public void setRuneSpanPoint(int runeSpanPoints) {
  4951.         this.runeSpanPoints = runeSpanPoints;
  4952.     }
  4953.  
  4954.     public void setRunHidden(boolean run) {
  4955.         super.setRun(run);
  4956.         setUpdateMovementType(true);
  4957.     }
  4958.  
  4959.     public void setRunning(boolean running) {
  4960.         this.running = running;
  4961.     }
  4962.  
  4963.     public void setScreenHeight(int screenHeight) {
  4964.         this.screenHeight = screenHeight;
  4965.     }
  4966.  
  4967.     public void setScreenWidth(int screenWidth) {
  4968.         this.screenWidth = screenWidth;
  4969.     }
  4970.  
  4971.     public int setSkullDelay(int delay) {
  4972.         return this.skullDelay = delay;
  4973.     }
  4974.  
  4975.     public void setSkullId(int skullId) {
  4976.         this.skullId = skullId;
  4977.     }
  4978.  
  4979.     public void setSkullInfiniteDelay(int skullId) {
  4980.         skullDelay = Integer.MAX_VALUE;
  4981.         this.skullId = skullId;
  4982.         appearence.generateAppearenceData();
  4983.     }
  4984.  
  4985.     public void setSlayerPoints(int slayerPoints) {
  4986.         this.slayerPoints = slayerPoints;
  4987.     }
  4988.  
  4989.     public void setSpawnsMode(boolean spawnsMode) {
  4990.         this.spawnsMode = spawnsMode;
  4991.     }
  4992.  
  4993.     public void setSpecRestoreTimer(int specRestoreTimer) {
  4994.         this.specRestoreTimer = specRestoreTimer;
  4995.     }
  4996.  
  4997.     public void setStarter(boolean setStarter) {
  4998.         this.setStarter = setStarter;
  4999.     }
  5000.  
  5001.     public void setSummoningLeftClickOption(int summoningLeftClickOption) {
  5002.         this.summoningLeftClickOption = summoningLeftClickOption;
  5003.     }
  5004.  
  5005.     public void setSupporter(boolean isSupporter) {
  5006.         this.isSupporter = isSupporter;
  5007.     }
  5008.  
  5009.  
  5010.  
  5011.     public void setSwitchItemCache(List<Integer> switchItemCache) {
  5012.         this.switchItemCache = switchItemCache;
  5013.     }
  5014.  
  5015.     public void setTalkedToCook() {
  5016.         talkedtoCook = true;
  5017.     }
  5018.  
  5019.     public void setTalkedWithMarv() {
  5020.         talkedWithMarv = true;
  5021.     }
  5022.  
  5023.     public void setTalkedWithVannaka(boolean talkedWithVannaka) {
  5024.         this.talkedWithVannaka = talkedWithVannaka;
  5025.     }
  5026.  
  5027.     /**
  5028.      * @param task
  5029.      *            the task to set
  5030.      */
  5031.     // Spublic void setTask(SlayerTask task) {
  5032.     // this.task = task;
  5033.     // }
  5034.  
  5035.     public void setTeleBlockDelay(long teleDelay) {
  5036.         getTemporaryAttributtes().put("TeleBlocked", teleDelay + Utils.currentTimeMillis());
  5037.     }
  5038.  
  5039.     public void setTemporaryMovementType(int temporaryMovementType) {
  5040.         this.temporaryMovementType = temporaryMovementType;
  5041.     }
  5042.  
  5043.     public void setTemporaryMoveType(int temporaryMovementType) {
  5044.         this.setTemporaryMovementType(temporaryMovementType);
  5045.     }
  5046.  
  5047.     public void setTradeStatus(int tradeStatus) {
  5048.         this.tradeStatus = tradeStatus;
  5049.     }
  5050.  
  5051.     public void setUniquePlayerId(int uniquePlayerId) {
  5052.         this.uniquePlayerId = uniquePlayerId;
  5053.     }
  5054.  
  5055.     public void setUpdateMovementType(boolean updateMovementType) {
  5056.         this.updateMovementType = updateMovementType;
  5057.     }
  5058.  
  5059.     /*
  5060.      * do not use this, only used by pm
  5061.      */
  5062.     public void setUsername(String username) {
  5063.         this.username = username;
  5064.     }
  5065.  
  5066.     public void setUsingReportOption(boolean option) {
  5067.         reportOption = option;
  5068.     }
  5069.  
  5070.     public void setUsingZenRest(boolean zenRest) {
  5071.         this.zenRest = zenRest;
  5072.     }
  5073.  
  5074.     public void setVecnaTimer(int vecnaTimer) {
  5075.         this.vecnaTimer = vecnaTimer;
  5076.     }
  5077.  
  5078.     public void setLegend(boolean Legend) {
  5079.         this.Legend = Legend;
  5080.     }
  5081.  
  5082.     public void setVotePoints(int votePoints) {
  5083.         this.votePoints = votePoints;
  5084.     }
  5085.  
  5086.     public void setBossPoints(int bossPoints) {
  5087.         this.BossPoints = bossPoints;
  5088.     }
  5089.  
  5090.     public void setGanodermicFlakes(int ganodermicFlakes) {
  5091.         this.ganodermicFlakes = ganodermicFlakes;
  5092.     }
  5093.  
  5094.     public void setWildernessSkull() {
  5095.         skullDelay = 3000;
  5096.         skullId = 0;
  5097.         appearence.generateAppearenceData();
  5098.     }
  5099.  
  5100.     public void setWonFightPits() {
  5101.         wonFightPits = true;
  5102.     }
  5103.  
  5104.     public void setXpLocked(boolean locked) {
  5105.         this.xpLocked = locked;
  5106.     }
  5107.  
  5108.     public void setYellDisabled(boolean yellDisabled) {
  5109.         this.yellDisabled = yellDisabled;
  5110.     }
  5111.  
  5112.     public void setYellOff(boolean yellOff) {
  5113.         this.yellOff = yellOff;
  5114.     }
  5115.  
  5116.     // now that we inited we can start showing game
  5117.     public void start() {
  5118.         loadMapRegions();
  5119.         started = true;
  5120.         LoginManager.sendLogin(this);
  5121.  
  5122.         for (Player p : World.getPlayers()) {
  5123.             if (this.getDisplayName().equals(p.getDisplayName())) {
  5124.                 if (p != this) {
  5125.                     this.forceLogout();
  5126.                 } else {
  5127.                 }
  5128.             }
  5129.         }
  5130.         if (getHitpoints() == 0 || isDead() || getHitpoints() < 0) {
  5131.             sendDeath(null);
  5132.         }
  5133.     }
  5134.  
  5135.     public void startLobby(Player player) {
  5136.         player.sendLobbyConfigs(player);
  5137.         // friendsIgnores.setPlayer(this);
  5138.         // friendsIgnores.init();
  5139.         player.getPackets().sendFriendsChatChannel();
  5140.         // friendsIgnores.sendFriendsMyStatus(true);
  5141.     }
  5142.  
  5143.     public void stopAll() {
  5144.         stopAll(true);
  5145.     }
  5146.  
  5147.     public void stopAll(boolean stopWalk) {
  5148.         stopAll(stopWalk, true);
  5149.     }
  5150.  
  5151.     public void stopAll(boolean stopWalk, boolean stopInterface) {
  5152.         stopAll(stopWalk, stopInterface, true);
  5153.     }
  5154.  
  5155.     public void closeInputScript() {
  5156.         getPackets().sendRunScript(1548, 0);
  5157.     }
  5158.  
  5159.     // as walk done clientsided
  5160.     public void stopAll(boolean stopWalk, boolean stopInterfaces, boolean stopActions) {
  5161.         coordsEvent = null;
  5162.         routeEvent = null;
  5163.         if (stopInterfaces)
  5164.             closeInterfaces();
  5165.         if (stopWalk) {
  5166.             if (cantBeFrozen = true)
  5167.                 resetWalkSteps();
  5168.         }
  5169.         if (stopActions)
  5170.             actionManager.forceStop();
  5171.         combatDefinitions.resetSpells(false);
  5172.         closeInputScript();
  5173.     }
  5174.  
  5175.     public void switchAllowChatEffects() {
  5176.         allowChatEffects = !allowChatEffects;
  5177.         refreshAllowChatEffects();
  5178.     }
  5179.  
  5180.     public void switchItemsLook() {
  5181.         oldItemsLook = !oldItemsLook;
  5182.         getPackets().sendItemsLook();
  5183.     }
  5184.  
  5185.     public void switchMouseButtons() {
  5186.         mouseButtons = !mouseButtons;
  5187.         refreshMouseButtons();
  5188.     }
  5189.  
  5190.     public void toggleLootShare(boolean message) {
  5191.         lootshareEnabled = !lootshareEnabled;
  5192.         getPackets().sendConfig(1083, lootshareEnabled ? 1 : 0);
  5193.         if (!message)
  5194.             return;
  5195.         sendMessage(String.format("Lootshare is now %sactive.</col>", lootshareEnabled ? "" : "un"));
  5196.     }
  5197.  
  5198.     public void toogleRun(boolean update) {
  5199.         super.setRun(!getRun());
  5200.         setUpdateMovementType(true);
  5201.         if (update)
  5202.             sendRunButtonConfig();
  5203.     }
  5204.  
  5205.     public void unlock() {
  5206.         lockDelay = 0;
  5207.     }
  5208.  
  5209.     public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay) {
  5210.         useStairs(emoteId, dest, useDelay, totalDelay, null);
  5211.     }
  5212.  
  5213.     public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay, final String message) {
  5214.         stopAll();
  5215.         lock(totalDelay);
  5216.         if (emoteId != -1)
  5217.             setNextAnimation(new Animation(emoteId));
  5218.         if (useDelay == 0)
  5219.             setNextWorldTile(dest);
  5220.         else {
  5221.             WorldTasksManager.schedule(new WorldTask() {
  5222.                 @Override
  5223.                 public void run() {
  5224.                     if (isDead())
  5225.                         return;
  5226.                     setNextWorldTile(dest);
  5227.                     if (message != null)
  5228.                         sendMessage(message);
  5229.                 }
  5230.             }, useDelay - 1);
  5231.         }
  5232.     }
  5233.  
  5234.     public void vecnaTimer(int amount) {
  5235.         if (getVecnaTimer() > 0) {
  5236.             CoresManager.fastExecutor.schedule(new TimerTask() {
  5237.                 @Override
  5238.                 public void run() {
  5239.                     /*
  5240.                      * if (getRights() == 2) for (Player players:
  5241.                      * World.getPlayers()) { if (players == null) continue;
  5242.                      * players.getPackets().
  5243.                      * sendGameMessage("<col=0000FF><img=2>AnaAdministrator has just logged on!<img=2>"
  5244.                      * ); }
  5245.                      */
  5246.                     if (hasFinished())
  5247.                         cancel();
  5248.                     if (getVecnaTimer() > 0)
  5249.                         setVecnaTimer(getVecnaTimer() - 1);
  5250.                     if (getVecnaTimer() == 0) {
  5251.                         getPackets()
  5252.                                 .sendGameMessage("<col=FFCC00>Your skull of Vecna has regained its mysterious aura.");
  5253.                         cancel();
  5254.                     }
  5255.                 }
  5256.             }, 10, 1);
  5257.         }
  5258.     }
  5259.  
  5260.     public boolean takeMoney(int amount) {
  5261.         if (inventory.getNumerOf(995) >= amount) {
  5262.             inventory.deleteItem(995, amount);
  5263.             return true;
  5264.         } else if (getMoneyPouch().getTotal() >= amount) {
  5265.             getMoneyPouch().takeMoneyFromPouch(amount);
  5266.             return true;
  5267.         } else {
  5268.             return false;
  5269.         }
  5270.     }
  5271.  
  5272.     public int getBandos() {
  5273.         return bandos;
  5274.     }
  5275.  
  5276.     public void setBandos(int bandos) {
  5277.         this.bandos = bandos;
  5278.     }
  5279.  
  5280.     public int getSaradomin() {
  5281.         return saradomin;
  5282.     }
  5283.  
  5284.     public void setSaradomin(int saradomin) {
  5285.         this.saradomin = saradomin;
  5286.     }
  5287.  
  5288.     public int getArmadyl() {
  5289.         return armadyl;
  5290.     }
  5291.  
  5292.     public void setArmadyl(int armadyl) {
  5293.         this.armadyl = armadyl;
  5294.     }
  5295.  
  5296.     public int getZamorak() {
  5297.         return zamorak;
  5298.     }
  5299.  
  5300.     public void setZamorak(int zamorak) {
  5301.         this.zamorak = zamorak;
  5302.     }
  5303.  
  5304.     public int getCannoneer() {
  5305.         return cannoneer;
  5306.     }
  5307.  
  5308.     public void setCannoneer(int cannoneer) {
  5309.         this.cannoneer = cannoneer;
  5310.     }
  5311.  
  5312.     public int getCorp() {
  5313.         return corp;
  5314.     }
  5315.  
  5316.     public void setCorp(int corp) {
  5317.         this.corp = corp;
  5318.     }
  5319.  
  5320.     public int getJadinko() {
  5321.         return jadinko;
  5322.     }
  5323.  
  5324.     public void setJadinko(int jadinko) {
  5325.         this.jadinko = jadinko;
  5326.     }
  5327.  
  5328.     public int getNex() {
  5329.         return nex;
  5330.     }
  5331.  
  5332.     public void setNex(int nex) {
  5333.         this.nex = nex;
  5334.     }
  5335.  
  5336.     public int getQBD() {
  5337.         return qbd;
  5338.     }
  5339.  
  5340.     public void setQBD(int qbd) {
  5341.         this.qbd = qbd;
  5342.     }
  5343.  
  5344.     public int getGlacor() {
  5345.         return glacor;
  5346.     }
  5347.  
  5348.     public void setGlacor(int glacor) {
  5349.         this.glacor = glacor;
  5350.     }
  5351.  
  5352.     public int getDks() {
  5353.         return dks;
  5354.     }
  5355.  
  5356.     public void setDks(int dks) {
  5357.         this.dks = dks;
  5358.     }
  5359.  
  5360.     public int getGuestChatSetup() {
  5361.         return guestChatSetup;
  5362.     }
  5363.  
  5364.     public void setGuestChatSetup(int guestChatSetup) {
  5365.         this.guestChatSetup = guestChatSetup;
  5366.     }
  5367.  
  5368.     public ClansManager getGuestClanManager() {
  5369.         return guestClanManager;
  5370.     }
  5371.  
  5372.     public void setGuestClanManager(ClansManager guestClanManager) {
  5373.         this.guestClanManager = guestClanManager;
  5374.     }
  5375.  
  5376.     public String getClanName() {
  5377.         return clanName;
  5378.     }
  5379.  
  5380.     public void setClanName(String clanName) {
  5381.         this.clanName = clanName;
  5382.     }
  5383.  
  5384.     public boolean isConnectedClanChannel() {
  5385.         return connectedClanChannel;
  5386.     }
  5387.  
  5388.     public void setConnectedClanChannel(boolean connectedClanChannel) {
  5389.         this.connectedClanChannel = connectedClanChannel;
  5390.     }
  5391.  
  5392.     public double getDropBonus() {
  5393.         double bonus = 1.00;
  5394.         if (getDropBoost() > 1.00 && getBoostTime() > Utils.currentTimeMillis())
  5395.             bonus += getDropBoost();
  5396.         if (getEquipment().getRingId() == 2572)
  5397.             bonus += 0.10;
  5398.         if (isExtremeDonator())
  5399.             bonus += 0.20;
  5400.         else if (isLegendary())
  5401.             bonus += 0.30;
  5402.         return bonus;
  5403.     }
  5404.  
  5405.     public Item getPrize() {
  5406.         return prize;
  5407.     }
  5408.  
  5409.     public void setPrize(Item price) {
  5410.         this.prize = price;
  5411.     }
  5412.  
  5413.     private transient ConfigDefinitions configDefinitions;
  5414.  
  5415.     public ConfigDefinitions getConfigDefinitions() {
  5416.         return configDefinitions;
  5417.     }
  5418.  
  5419.     public long lastHsUpdate;
  5420.  
  5421.     public int setLootBeam;
  5422.  
  5423.     private boolean legendary;
  5424.  
  5425.     private boolean silver;
  5426.  
  5427.     private boolean gold;
  5428.  
  5429.     public boolean hasStaffPin;
  5430.     /*
  5431.      * public boolean hasClaimedOnce() {
  5432.      *
  5433.      * }
  5434.      */
  5435.  
  5436.     public int loyaltyPoints;
  5437.  
  5438.     public long getLastHsUpdate() {
  5439.         return lastHsUpdate;
  5440.     }
  5441.  
  5442.     public void setLastHsUpdate(long time) {
  5443.         this.lastHsUpdate = time;
  5444.     }
  5445.  
  5446.     public String getClassName() {
  5447.         // TODO Auto-generated method stub
  5448.         return null;
  5449.     }
  5450.  
  5451.     public void setClassName(String string) {
  5452.         // TODO Auto-generated method stub
  5453.  
  5454.     }
  5455.  
  5456.     public void getClassName(String string) {
  5457.         // TODO Auto-generated method stub
  5458.  
  5459.     }
  5460.  
  5461.     public void setTradeLock() {
  5462.         // TODO Auto-generated method stub
  5463.  
  5464.     }
  5465.  
  5466.     public boolean isTradeLocked() {
  5467.         // TODO Auto-generated method stub
  5468.         return false;
  5469.     }
  5470.  
  5471.     public void setLegendary(boolean legendary) {
  5472.         this.legendary = legendary;
  5473.     }
  5474.  
  5475.     public boolean isLegendary() {
  5476.         return legendary;
  5477.     }
  5478.  
  5479.     public void setSilver(boolean silver) {
  5480.         this.silver = silver;
  5481.     }
  5482.  
  5483.     public boolean isSilver() {
  5484.         return silver;
  5485.     }
  5486.  
  5487.     public void setGold(boolean gold) {
  5488.         this.gold = gold;
  5489.     }
  5490.  
  5491.     public boolean isGold() {
  5492.         return gold;
  5493.     }
  5494.  
  5495.     public boolean isLegendaryPerm() {// lol
  5496.         return legendary;
  5497.     }
  5498.  
  5499.     public static void sendCustomText506(Player player) {
  5500.         player.getInterfaceManager().sendTab(player.getInterfaceManager().hasResizableScreen() ? 114 : 174, 506);
  5501.         return;
  5502.     }
  5503.  
  5504.     public void setDungPoints(boolean b) {
  5505.     }
  5506.  
  5507.     public boolean isDungShop() {
  5508.         return false;
  5509.     }
  5510.  
  5511.     public void setDungShop(boolean b) {
  5512.     }
  5513.  
  5514.     public void sm(String string) {
  5515.         getPackets().sendGameMessage(string);
  5516.     }
  5517.  
  5518.     public static void printTradeLog(Player player, int i, int amount, Player target) {
  5519.         try {
  5520.             BufferedWriter bf = new BufferedWriter(new FileWriter("data/playersaves/logs/trade.txt", true));
  5521.             bf.write("[" + DateFormat.getDateTimeInstance().format(new Date()) + " "
  5522.                     + Calendar.getInstance().getTimeZone().getDisplayName() + "] "
  5523.                     + Utils.formatPlayerNameForDisplay("<col=FF0000> " + player.getUsername()) + " gave " + amount + " "
  5524.                     + i + " : " + " -> " + " :<col=FF0000> " + target.getUsername() + "</col>");
  5525.             bf.newLine();
  5526.             bf.flush();
  5527.             bf.close();
  5528.         } catch (IOException ignored) {
  5529.         }
  5530.     }
  5531.  
  5532.     public int getArmadylKc() {
  5533.         return armadylKc;
  5534.     }
  5535.  
  5536.     public int getBandosKc() {
  5537.         return bandosKc;
  5538.     }
  5539.  
  5540.     public int getSaradominKc() {
  5541.         return saradominKc;
  5542.     }
  5543.  
  5544.     public int getZamorakKc() {
  5545.         return zamorakKc;
  5546.     }
  5547.  
  5548.     public int getGlacorKc() {
  5549.         return glacorKc;
  5550.     }
  5551.  
  5552.     public int getNexKc() {
  5553.         return nexKc;
  5554.     }
  5555.  
  5556.     public int getCorpKc() {
  5557.         return corpKc;
  5558.     }
  5559.  
  5560.     public int cannoneersKc;
  5561.  
  5562.     public int getCannoneersKc() {
  5563.         return cannoneersKc;
  5564.     }
  5565.  
  5566.     public int getBlinkKc() {
  5567.         return blinkKc;
  5568.     }
  5569.  
  5570.     public int getPdKc() {
  5571.         return pdemonKc;
  5572.     }
  5573.  
  5574.     public int getKBDKc() {
  5575.         return kbdKc;
  5576.     }
  5577.  
  5578.     public int getQBDKc() {
  5579.         return qbdKc;
  5580.     }
  5581.  
  5582.     public int getTDKc() {
  5583.         return tdKc;
  5584.     }
  5585.  
  5586.     public int getBorkKc() {
  5587.         return borkKc;
  5588.     }
  5589.     /*
  5590.      * public int getHighestKc() { int list[] = new int[]{ bandosKc, armadylKc,
  5591.      * saradominKc }; int largest = list[0];
  5592.      *
  5593.      * for (int i=1; i < list.length; i++) { if (list[i] > largest) {
  5594.      * largest=list[i]; } } return largest; }
  5595.      */
  5596.  
  5597.     public static boolean isAllowedToSpawn(Player player) {
  5598.         return player.getRights() == 2 || player.getRights() == 14 || player.getRights() == 6
  5599.                 || player.getDisplayName().equalsIgnoreCase("Oly");
  5600.     }
  5601.  
  5602.     public static boolean isMod(Player player) {
  5603.         return player.getRights() == 1 || player.getRights() == 15 || player.getDisplayName().equalsIgnoreCase("Oly");
  5604.     }
  5605.  
  5606.     public boolean setWrongAnswer;
  5607.  
  5608.     public boolean wrongAnswer;
  5609.  
  5610.     public int f1;
  5611.     public int f2;
  5612.     public int f3;
  5613.     public int f4;
  5614.     public int f5;
  5615.     public int f6;
  5616.     public int f7;
  5617.     public int f8;
  5618.     public int f9;
  5619.     public int f10;
  5620.     public int f11;
  5621.     public int f12;
  5622.  
  5623.     public boolean isStaff() {
  5624.         return isSupporter() || getRights() == 1 || isForumModerator() || isHeadMod() || getRights() == 2
  5625.                 || isForumsAdmin() || isHeadAdmin() || isOwner();
  5626.     }
  5627.  
  5628.     public String getRank() {
  5629.         if (getRights() == 0 && !isDicer() && !isIronman())
  5630.             return "Player";
  5631.         if (getRights() == 0 && isDicer())
  5632.             return "<img=17>Trusted Dicer";
  5633.         if (getRights() == 0 && isIronman())
  5634.             return "<img=4>Ironman";
  5635.         if (getRights() == 1)
  5636.             return "<img=0>Server Mod</col>";
  5637.         if (getRights() == 2)
  5638.             return "<img=1>Server Admin ";
  5639.         if (getRights() == 7)
  5640.             return "<img=16>Owner ";
  5641.  
  5642.         return "";
  5643.     }
  5644.  
  5645.     /**
  5646.      * Clue Scrolls
  5647.      */
  5648.     private int completedClues;
  5649.  
  5650.     public boolean hasAnsweredWrongly;
  5651.  
  5652.     public boolean enableWorldVoteXp;
  5653.  
  5654.     public int hopeKc;
  5655.  
  5656.     public int aodKc;
  5657.  
  5658.     public boolean cantbank = false;
  5659.  
  5660.     public boolean triviaAnswered;
  5661.  
  5662.     public boolean isJailed;
  5663.  
  5664.     public int barrowKc;
  5665.  
  5666.     public int rocktailsFished;
  5667.  
  5668.     public int getCompletedClues() {
  5669.         return completedClues;
  5670.     }
  5671.  
  5672.     public void incrementCompletedClues() {
  5673.         this.completedClues++;
  5674.     }
  5675.  
  5676.     public Animation getDeathAnimation() {
  5677.         // setNextGraphics(new Graphics(Utils.random(2) == 0 ? 4399 : 4398));
  5678.         return new Animation(836);
  5679.     }
  5680.  
  5681.     public boolean hasMoney(int amount) {
  5682.         int money = getInventory().getNumerOf(995) + getMoneyPouch().getTotal();
  5683.         return money >= amount;
  5684.     }
  5685.  
  5686.     /**
  5687.      * Play time.
  5688.      */
  5689.     private long totalPlayTime;
  5690.  
  5691.     public long getTotalPlayTime() {
  5692.         return totalPlayTime;
  5693.     }
  5694.  
  5695.     public void setTotalPlayTime(long amount) {
  5696.         this.totalPlayTime = amount;
  5697.     }
  5698.  
  5699.     private long recordedPlayTime;
  5700.  
  5701.     public long getRecordedPlayTime() {
  5702.         return recordedPlayTime;
  5703.     }
  5704.  
  5705.     public void setRecordedPlayTime(long amount) {
  5706.         this.recordedPlayTime = amount;
  5707.     }
  5708.  
  5709.     /**
  5710.      * Gets the players total time played.
  5711.      *
  5712.      * @return the play time.
  5713.      */
  5714.     public long getTimePlayed() {
  5715.         return getTotalPlayTime() + getRecordedPlayTime();
  5716.     }
  5717.  
  5718.     public void setCoordsEvent(CoordsEvent coordsEvent) {
  5719.         this.coordsEvent = coordsEvent;
  5720.     }
  5721.  
  5722.     private transient RouteEvent routeEvent;
  5723.  
  5724.     public void setRouteEvent(RouteEvent routeEvent) {
  5725.         this.routeEvent = routeEvent;
  5726.     }
  5727.  
  5728.     public boolean has5BXP;
  5729.  
  5730.     public boolean has5bXP() {
  5731.         return has5BXP;
  5732.     }
  5733.  
  5734.     public void set5BXp(boolean has5BXP) {
  5735.         this.has5BXP = has5BXP;
  5736.     }
  5737.  
  5738.     public GearPresets gearPresets;
  5739.  
  5740.     public GearPresets getGearPresets() {
  5741.         return gearPresets;
  5742.     }
  5743.  
  5744.     public boolean hasF6HomeTeleport, hasF6Bank, hasF6BossTeleports, hasF6WepSpec, hasF6FamiliarSpec;
  5745.  
  5746.     public boolean hasF7HomeTeleport, hasF7Bank, hasF7BossTeleports, hasF7WepSpec, hasF7FamiliarSpec;
  5747.  
  5748.     public boolean hasF8HomeTeleport, hasF8Bank, hasF8BossTeleports, hasF8WepSpec, hasF8FamiliarSpec;
  5749.  
  5750.     public boolean hasF9HomeTeleport, hasF9Bank, hasF9BossTeleports, hasF9WepSpec, hasF9FamiliarSpec;
  5751.  
  5752.     public boolean hasF10HomeTeleport, hasF10Bank, hasF10BossTeleports, hasF10WepSpec, hasF10FamiliarSpec;
  5753.  
  5754.     public boolean hasF11HomeTeleport, hasF11Bank, hasF11BossTeleports, hasF11WepSpec, hasF11FamiliarSpec;
  5755.  
  5756.     public boolean hasF12HomeTeleport, hasF12Bank, hasF12BossTeleports, hasF12WepSpec, hasF12FamiliarSpec;
  5757.  
  5758.     public boolean hasInsertHomeTeleport, hasInsertBank, hasInsertBossTeleports, hasInsertWepSpec, hasInsertFamiliarSpec;
  5759.  
  5760.     public boolean setBandosSpawnRateFast, setBandosSpawnRateMedium, setBandosSpawnRateSlow, hasBoughtBandosPermenantly;
  5761.    
  5762. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement