Advertisement
Guest User

player.java

a guest
Oct 31st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 182.68 KB | None | 0 0
  1. package com.rs.game.player;
  2. import com.rs.Settings;
  3. import com.rs.cache.VarsManager;
  4. import com.rs.content.exchange.ItemOffer;
  5. import com.rs.content.exchange.ItemOffer.OfferType;
  6. import com.rs.cores.CoresManager;
  7. import com.rs.game.Animation;
  8. import com.rs.game.Entity;
  9. import com.rs.game.ForceTalk;
  10. import com.rs.game.Graphics;
  11. import com.rs.game.Hit;
  12. import com.rs.game.Hit.HitLook;
  13. import com.rs.game.World;
  14. import com.rs.game.WorldObject;
  15. import com.rs.game.WorldTile;
  16. import com.rs.game.item.FloorItem;
  17. import com.rs.game.item.Item;
  18. import com.rs.game.minigames.clanwars.FfaZone;
  19. import com.rs.game.minigames.clanwars.WarControler;
  20. import com.rs.game.minigames.duel.DuelArena;
  21. import com.rs.game.minigames.duel.DuelRules;
  22. import com.rs.game.npc.NPC;
  23. import com.rs.game.npc.familiar.Familiar;
  24. import com.rs.game.npc.godwars.zaros.Nex;
  25. import com.rs.game.npc.others.AntiBot;
  26. import com.rs.game.npc.pet.Pet;
  27. import com.rs.game.player.QuestManager.Quests;
  28. import com.rs.game.player.actions.PlayerCombat;
  29. import com.rs.game.player.content.*;
  30. import com.rs.game.player.content.GildedAltar.bonestoOffer;
  31. import com.rs.game.player.content.clans.ClansManager;
  32. import com.rs.game.player.content.custom.DoubleXpManager;
  33. import com.rs.game.player.content.perks.PerksManager;
  34. import com.rs.game.player.content.custom.DoubleVoteManager;
  35. import com.rs.game.player.content.pet.PetManager;
  36. import com.rs.game.player.controlers.CorpBeastControler;
  37. import com.rs.game.player.controlers.CrucibleControler;
  38. import com.rs.game.player.controlers.DTControler;
  39. import com.rs.game.player.controlers.FightCaves;
  40. import com.rs.game.player.controlers.FightKiln;
  41. import com.rs.game.player.controlers.GodWars;
  42. import com.rs.game.player.controlers.NomadsRequiem;
  43. import com.rs.game.player.controlers.QueenBlackDragonController;
  44. import com.rs.game.player.controlers.Wilderness;
  45. import com.rs.game.player.controlers.ZGDControler;
  46. import com.rs.game.player.controlers.castlewars.CastleWarsPlaying;
  47. import com.rs.game.player.controlers.castlewars.CastleWarsWaiting;
  48. import com.rs.game.player.controlers.fightpits.FightPitsArena;
  49. import com.rs.game.player.controlers.pestcontrol.PestControlGame;
  50. import com.rs.game.player.controlers.pestcontrol.PestControlLobby;
  51. import com.rs.game.player.quest.EliteChapterFive;
  52. import com.rs.game.player.quest.EliteChapterFour;
  53. import com.rs.game.player.quest.EliteChapterOne;
  54. import com.rs.game.player.quest.EliteChapterThree;
  55. import com.rs.game.player.quest.EliteChapterTwo;
  56. import com.rs.game.player.quest.QNames;
  57. import com.rs.game.tasks.WorldTask;
  58. import com.rs.game.tasks.WorldTasksManager;
  59. import com.rs.net.Session;
  60. import com.rs.net.decoders.WorldPacketsDecoder;
  61. import com.rs.net.decoders.handlers.ButtonHandler;
  62. import com.rs.net.encoders.WorldPacketsEncoder;
  63. import com.rs.utils.Colors;
  64. import com.rs.utils.DisplayNames;
  65. import com.rs.utils.DisplayNamesManager;
  66. import com.rs.utils.Highscores;
  67. import com.rs.utils.IsaacKeyPair;
  68. import com.rs.utils.Logger;
  69. import com.rs.utils.MachineInformation;
  70. import com.rs.utils.PkRank;
  71. import com.rs.utils.SerializableFilesManager;
  72. import com.rs.utils.Utils;
  73.  
  74. import java.io.*;
  75. import java.net.InetAddress;
  76. import java.net.UnknownHostException;
  77. import java.text.DateFormat;
  78. import java.text.NumberFormat;
  79. import java.util.ArrayList;
  80. import java.util.Collections;
  81. import java.util.Date;
  82. import java.util.HashMap;
  83. import java.util.LinkedList;
  84. import java.util.List;
  85. import java.util.Locale;
  86. import java.util.concurrent.ConcurrentLinkedQueue;
  87. import java.util.concurrent.CopyOnWriteArrayList;
  88. import java.util.concurrent.TimeUnit;
  89. import java.net.*;
  90.  
  91.  
  92. public class Player extends Entity {
  93.  
  94.  
  95.  
  96. private boolean untillLogout;
  97.  
  98. public Notes getNotes() {
  99. return notes;
  100. }
  101.  
  102. private MoneyPouch pouch;
  103.  
  104. private CurrencyPouch currencypouch;
  105.  
  106. public MoneyPouch getPouch() {
  107. return pouch;
  108. }
  109. public void refreshMoneyPouch() {
  110. getPackets().sendRunScript(5560, pouch);
  111. }
  112. public int getMoneyPouch() {
  113. return moneypouch;
  114. }
  115.  
  116. public void purchase(int amount) {
  117. if (getLoyaltyPoints() >= amount) {
  118. Loyaltypoints -= amount;
  119. } else {
  120. getPackets().sendGameMessage("You do not have enough points!");
  121. }
  122. }
  123.  
  124. private SquealOfFortune sof;
  125.  
  126. public SquealOfFortune getSqueal() {
  127. return sof;
  128. }
  129.  
  130. public boolean isModerator() {
  131. return getRights() == 1;
  132. }
  133.  
  134.  
  135. public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1, RUN_MOVE_TYPE = 2;
  136. private static final long serialVersionUID = 2011932556974180375L;
  137. private static final int lastlogged = 0;
  138. private transient String username;
  139. private transient Session session;
  140. private transient boolean clientLoadedMapRegion;
  141. private transient int displayMode;
  142. private transient int screenWidth;
  143. public boolean trustedflower = true;
  144. private transient int screenHeight;
  145. private transient InterfaceManager interfaceManager;
  146. private transient DialogueManager dialogueManager;
  147. private transient ConstructFurniture con;
  148. private transient Mission mission;
  149. public int MiningPoints = 0;
  150. private transient LoyaltyManager loyaltyManager;
  151. private transient DwarfCannon dwarfCannon;
  152. private transient HintIconsManager hintIconsManager;
  153. private transient ActionManager actionManager;
  154. private transient CutscenesManager cutscenesManager;
  155. private transient PriceCheckManager priceCheckManager;
  156. private transient CoordsEvent coordsEvent;
  157. private transient FriendChatsManager currentFriendChat;
  158. public boolean trollReward;
  159. private int trollsToKill;
  160. private int trollsKilled;
  161. private WorldTile getoutside;
  162. private transient Trade trade;
  163. private transient DuelRules lastDuelRules;
  164. private transient IsaacKeyPair isaacKeyPair;
  165. private transient Pet pet;
  166. // Just for removing Maxcape on login
  167. public int maxCape = 0;
  168.  
  169. // used for packets logic
  170. private transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
  171.  
  172. // used for update
  173. private transient LocalPlayerUpdate localPlayerUpdate;
  174. private transient LocalNPCUpdate localNPCUpdate;
  175.  
  176. private int temporaryMovementType;
  177. private boolean updateMovementType;
  178.  
  179. // player stages
  180. private transient boolean started;
  181. private transient boolean running;
  182.  
  183. // Kuradal
  184. private boolean talkedWithKuradal;
  185. private boolean talkedWithReaper;
  186.  
  187. private transient int savep;
  188. private transient long packetsDecoderPing;
  189. private transient Runnable vote;
  190. public transient boolean noContinue;
  191. private transient boolean resting;
  192. private transient boolean canPvp;
  193. private transient boolean cantTrade;
  194. private transient long lockDelay; // used for doors and stuff like that
  195. private transient long foodDelay;
  196. private transient long potDelay;
  197. private transient long boneDelay;
  198. transient Runnable closeInterfacesEvent;
  199. private transient long lastPublicMessage;
  200. private transient String lastPublicMessageString;
  201. private transient long polDelay;
  202. private transient List<Integer> switchItemCache;
  203. private transient boolean disableEquip;
  204. @SuppressWarnings("unused")
  205. private transient MachineInformation machineInformation;
  206. public transient int antiNull;
  207. private transient boolean spawnsMode;
  208. private transient int pinAttempts;
  209. private transient boolean castedVeng;
  210. private transient boolean invulnerable;
  211. private transient double hpBoostMultiplier;
  212. private transient boolean largeSceneView;
  213.  
  214. // interface
  215.  
  216. // saving stuff
  217. private String password;
  218. private int rights;
  219. public int moneypouch;
  220. private String displayName;
  221. private Player leaderName;
  222. private String NewIP;
  223. private String lastIP;
  224. private long creationDate;
  225. private int instanceBooth;
  226. private Appearence appearence;
  227. private Inventory inventory;
  228. private Equipment equipment;
  229. private Skills skills;
  230. private CombatDefinitions combatDefinitions;
  231. private Prayer prayer;
  232. private Bank bank;
  233. private Toolbelt toolbelt;
  234. private Bank secondbank;
  235. private BankPreset preset;
  236. private BankPreset preset2;
  237. private BankPreset preset3;
  238. private BankPreset preset4;
  239. private KeybindFunctions keybindfunctions;
  240. public boolean forumnews;
  241. public int quickselect1;
  242. public int quickselect2;
  243. private ControlerManager controlerManager;
  244. private MusicsManager musicsManager;
  245. private EmotesManager emotesManager;
  246. private FriendsIgnores friendsIgnores;
  247. private DominionTower dominionTower;
  248. private Familiar familiar;
  249. private AuraManager auraManager;
  250. private LendingManager lendManager;
  251. private QuestManager questManager;
  252. private EXQuestManager exquestManager;
  253. private PetManager petManager;
  254. private byte runEnergy;
  255. private boolean allowChatEffects;
  256. private boolean viewStats;
  257. private boolean mouseButtons;
  258. private boolean diceannounce = false;
  259. private int privateChatSetup;
  260. private int friendChatSetup;
  261. private int skullDelay;
  262. private int skullId;
  263. private boolean forceNextMapLoadRefresh;
  264. private long poisonImmune;
  265. private long fireImmune;
  266. private boolean killedQueenBlackDragon;
  267. private int runeSpanPoints;
  268.  
  269. private int lastBonfire;
  270. private int[] pouches;
  271. private int[] rolls;
  272. private long displayTime;
  273. private long muted;
  274. private long hevoted;
  275. private long jailed;
  276. private long banned;
  277. private boolean permBanned;
  278. private boolean filterGame;
  279. private boolean xpLocked;
  280. private boolean yellOff;
  281. // game bar status
  282. private int publicStatus;
  283. private int clanStatus;
  284. private int tradeStatus;
  285. private int assistStatus;
  286. public transient int shopAmount;
  287. public transient ArrayList<Player> joined;
  288. public transient String playeroption1;
  289. public transient int shopSlotId;
  290.  
  291. private boolean donator;
  292. private boolean outside;
  293. private boolean extremeDonator;
  294. private long donatorTill;
  295. private long extremeDonatorTill;
  296.  
  297. // Recovery ques. & ans.
  298. private String recovQuestion;
  299. private String recovAnswer;
  300.  
  301. private String lastMsg;
  302.  
  303. public String incupdate1;
  304. public String incupdate2;
  305. public String incupdate3;
  306. public String incupdate4;
  307.  
  308. private boolean hasSecondBank;
  309.  
  310. // Slayer
  311. private SlayerTask task;
  312. private BossSlayerTask bosstask;
  313.  
  314. private long loyaltytimer;
  315.  
  316. // Used for storing recent ips and password
  317. private ArrayList<String> passwordList = new ArrayList<String>();
  318. private ArrayList<String> ipList = new ArrayList<String>();
  319.  
  320. // honor
  321. private int killCount, deathCount;
  322. private int votes;
  323. private ChargesManager charges;
  324. // barrows
  325. private boolean[] killedBarrowBrothers;
  326. private int hiddenBrother;
  327. private int barrowsKillCount;
  328. private int pestPoints;
  329.  
  330. // skill capes customizing
  331. private int[] maxedCapeCustomized;
  332. private int[] completionistCapeCustomized;
  333. private int[] fivebillCustomized;
  334.  
  335. // completionistcape reqs
  336. private boolean completedFightCaves;
  337. private boolean completedFightKiln;
  338. private boolean wonFightPits;
  339.  
  340. private boolean learnedRocktailSoup;
  341. private boolean learnedAutoLootSeals;
  342.  
  343. // crucible
  344. private boolean talkedWithMarv;
  345. private int crucibleHighScore;
  346.  
  347. private int eradicatorDelay;
  348. private int overloadDelay;
  349. private int prayerRenewalDelay;
  350.  
  351. private String currentFriendChatOwner;
  352. private int summoningLeftClickOption;
  353. private List<String> ownedObjectsManagerKeys;
  354.  
  355. // objects
  356. private boolean khalphiteLairEntranceSetted;
  357. private boolean khalphiteLairSetted;
  358.  
  359. // supportteam
  360. private boolean isSupporter;
  361.  
  362.  
  363. private String yellColor;
  364. private String yellTitle;
  365. private String yellShade;
  366.  
  367. private boolean isOwner;
  368.  
  369.  
  370. private int copyrightkills;
  371. private int corporealkills;
  372. private int wyrmkills;
  373. private int avatarkills;
  374. private int necrolordkills;
  375. private int jadkills;
  376. private int obsidiankingkills;
  377. private int hairymonkeykills;
  378. private int viewpage;
  379. private int ranklend;
  380. public float amountdonated;
  381. private boolean bankequip;
  382. private int triviapoints = 0;
  383. public int threadnumber;
  384. private int spellpower;
  385. private int spelltraits;
  386. private boolean enchantLegs;
  387. private boolean enchantBody;
  388. private boolean enchantHelm;
  389. private int fatalkills;
  390. private int hmtriokills;
  391. private int mutemark;
  392. public int tasktab;
  393. private int killStreak;
  394. private int dropbeam;
  395. private int selectedbeam;
  396. private int collectLoanMoney;
  397. private int lendhours;
  398. private int ticketamount;
  399. public transient String instanceDialogue;
  400. public transient int voteDisplayAmount;
  401. // Amulet of Completion Requirements:
  402.  
  403. public boolean ammyannounce;
  404. private int bossslayercount;
  405. private int regslayercount;
  406. private int amountthieved;
  407. private int dummydamage;
  408. private long dummygamecooldown;
  409.  
  410. public int getDummyDamage() {
  411. return dummydamage;
  412. }
  413.  
  414. public void setDummyDamage(int d) {
  415. dummydamage = d;
  416. }
  417.  
  418. public long getDummyCooldown() {
  419. return dummygamecooldown;
  420. }
  421.  
  422. public void setDummyCooldown(long d) {
  423. dummygamecooldown = d;
  424. }
  425.  
  426. public int getAmountThieved(boolean achievecount) {
  427. if (achievecount && amountthieved >= 50000000)
  428. return 50000000;
  429. return amountthieved;
  430. }
  431.  
  432. public void setAmountThieved(int amount) {
  433. if (amount >= 50000000)
  434. amountthieved = 5000000;
  435. amountthieved = amount;
  436. }
  437.  
  438. public int getSlayerCount(boolean achievecount) {
  439. if (achievecount && regslayercount >= 50)
  440. return 50;
  441. return regslayercount;
  442. }
  443. public void setSlayerCount(int amount) {
  444. regslayercount = amount;
  445. }
  446.  
  447. public int getBossSlayerCount(boolean achievecount) {
  448. if (achievecount && bossslayercount >= 50)
  449. return 50;
  450. return bossslayercount;
  451. }
  452. public void setBossSlayerCount(int amount) {
  453. bossslayercount = amount;
  454. }
  455.  
  456.  
  457. // End of Amulet of Completion Requirements
  458.  
  459.  
  460. // Iron Man
  461. private boolean isIronMan;
  462. public boolean isIronMan() {
  463. return isIronMan;
  464. }
  465. public void setIronMan(boolean isiron) {
  466. isIronMan = isiron;
  467. }
  468. // End of Iron Man
  469.  
  470. public boolean isInsideHairymonkey;
  471.  
  472.  
  473. public int getTicketamount() {
  474. return ticketamount;
  475. }
  476. public void setTicketamount(int ticketamount) {
  477. this.ticketamount = ticketamount;
  478. }
  479.  
  480. public int getLendhours() {
  481. return lendhours;
  482. }
  483. public void setLendhours(int lendhours) {
  484. this.lendhours = lendhours;
  485. }
  486.  
  487. public long getLastCorrectTrivia() {
  488. return lastAnswered;
  489. }
  490. public void setLastAnswer(long time) {
  491. this.lastAnswered = time;
  492. }
  493. public int getCorrectAnswers() {
  494. return correctAnswers;
  495. }
  496. public void setCorrectAnswers(int amount) {
  497. this.correctAnswers = amount;
  498. }
  499. public void setDisableTrivia(boolean value) {
  500. this.disabledTrivia = value;
  501. }
  502. public boolean hasDisabledTrivia() {
  503. return disabledTrivia;
  504. }
  505.  
  506. private boolean disabledTrivia;
  507. private long lastAnswered;
  508. public int correctAnswers;
  509.  
  510. public int lendMessage;
  511. public String raffleMessage;
  512. public String auctionTimeup;
  513. public int auctionMessage;
  514. public boolean senttoBank;
  515. private boolean permatrio;
  516. private boolean permabrutals;
  517. private boolean permabank;
  518. private boolean permasunfret;
  519. private boolean permabandos;
  520. private boolean permasaradomin;
  521. private boolean permazamorak;
  522. private boolean permaarmadyl;
  523. private boolean permaregular;
  524. private boolean permaextreme;
  525. private boolean permablink;
  526. private boolean permaeradicator;
  527. private boolean permacorp;
  528. private boolean permakbd;
  529. private boolean permagradum;
  530. private boolean permawyrm;
  531. private boolean permanecrolord;
  532. private boolean permaavatar;
  533. private boolean permafear;
  534. private boolean permastq;
  535. private boolean permaeradjad;
  536. private boolean permaobbyking;
  537. private boolean permageno;
  538. private boolean permarajj;
  539. private int timer;
  540. private int destroytimer;
  541. private boolean isdestroytimer;
  542. private boolean instanceend;
  543. private int donexp;
  544. private int donexp2;
  545. private int interfaceamount;
  546. private int spawnrate;
  547. private int wildybosskills;
  548. private int firsttimevoting;
  549. private int somethingkills;
  550. private int nexkills;
  551. private int sunfreetkills;
  552. private int armadylkills;
  553. private int bandoskills;
  554. private int zamorakkills;
  555. private int saradominkills;
  556. private int eradicatorbosskills;
  557. private int genokills;
  558. private int rajjkills;
  559. private int fearkills;
  560. private int blinkkills;
  561. private int extremebosskills;
  562. private int regularbosskills;
  563. private int gradumkills;
  564. private int slayerPoints;
  565. private int Loyaltypoints;
  566. private int EradicatorBonePoints;
  567. private int SuperBonePoints;
  568. // creates Player and saved classes
  569. public Player(String password) {
  570. super(/* Settings.HOSTED ? */Settings.START_PLAYER_LOCATION);
  571. setHitpoints(Settings.START_PLAYER_HITPOINTS);
  572. this.password = password;
  573. appearence = new Appearence();
  574. sof = new SquealOfFortune();
  575. currencypouch = new CurrencyPouch();
  576. pouch = new MoneyPouch();
  577. inventory = new Inventory();
  578. equipment = new Equipment();
  579. skills = new Skills();
  580. combatDefinitions = new CombatDefinitions();
  581. farmingManager = new FarmingManager();
  582. prayer = new Prayer();
  583. bank = new Bank();
  584. toolbelt = new Toolbelt(this);
  585. secondbank = new Bank();
  586. preset = new BankPreset(this);
  587. preset2 = new BankPreset(this);
  588. preset3 = new BankPreset(this);
  589. preset4 = new BankPreset(this);
  590. keybindfunctions = new KeybindFunctions(this);
  591. controlerManager = new ControlerManager();
  592. musicsManager = new MusicsManager();
  593. emotesManager = new EmotesManager();
  594. friendsIgnores = new FriendsIgnores();
  595. dominionTower = new DominionTower();
  596. charges = new ChargesManager();
  597. auraManager = new AuraManager();
  598. lendManager = new LendingManager();
  599. questManager = new QuestManager();
  600. exquestManager = new EXQuestManager();
  601. petManager = new PetManager();
  602. perksManager = new PerksManager();
  603. runEnergy = 100;
  604. allowChatEffects = true;
  605. mouseButtons = true;
  606. completed = true;
  607. pouches = new int[4];
  608. rolls = new int[300];
  609. for (int i = 0; i < rolls.length; i++)
  610. rolls[i] = -1;
  611. resetBarrows();
  612. SkillCapeCustomizer.resetSkillCapes(this);
  613. ownedObjectsManagerKeys = new LinkedList<String>();
  614. passwordList = new ArrayList<String>();
  615. ipList = new ArrayList<String>();
  616. setCreationDate(Utils.currentTimeMillis());
  617. }
  618.  
  619. public void init(Session session, String username, int displayMode,
  620. int screenWidth, int screenHeight,
  621. MachineInformation machineInformation, IsaacKeyPair isaacKeyPair) {
  622. // temporary deleted after reset all chars
  623. if (rolls == null) {
  624. rolls = new int[300];
  625. for (int i = 0; i < rolls.length; i++)
  626. rolls[i] = -1;
  627. }
  628. if (joined == null)
  629. joined = new ArrayList<Player>();
  630. if (secondbank == null)
  631. secondbank = new Bank();
  632. if (toolbelt == null)
  633. toolbelt = new Toolbelt(this);
  634. if (preset == null)
  635. preset = new BankPreset(this);
  636. if (preset2 == null)
  637. preset2 = new BankPreset(this);
  638. if (preset3 == null)
  639. preset3 = new BankPreset(this);
  640. if (preset4 == null)
  641. preset4 = new BankPreset(this);
  642. if (keybindfunctions == null)
  643. keybindfunctions = new KeybindFunctions(this);
  644. if (dominionTower == null)
  645. dominionTower = new DominionTower();
  646. if (auraManager == null)
  647. auraManager = new AuraManager();
  648. if (lendManager == null)
  649. lendManager = new LendingManager();
  650. if (farmingManager == null)
  651. farmingManager = new FarmingManager();
  652. if (questManager == null)
  653. questManager = new QuestManager();
  654. if (exquestManager == null)
  655. exquestManager = new EXQuestManager();
  656. if (dwarfCannon == null)
  657. dwarfCannon = new DwarfCannon(this);
  658. if (petManager == null) {
  659. petManager = new PetManager();
  660. }
  661. if (sof == null)
  662. sof = new SquealOfFortune();
  663. if (pouch == null)
  664. pouch = new MoneyPouch();
  665. if(perksManager == null)
  666. perksManager = new PerksManager();
  667. if (currencypouch == null) {
  668. currencypouch = new CurrencyPouch();
  669. } else if (currencypouch.getCurrencies().length == 4) {
  670. currencypouch = new CurrencyPouch();
  671. }
  672.  
  673. if(dropRatio == null)
  674. dropRatio = new HashMap<>();
  675.  
  676. this.session = session;
  677. this.username = username;
  678. this.displayMode = displayMode;
  679. this.screenWidth = screenWidth;
  680. this.screenHeight = screenHeight;
  681. this.machineInformation = machineInformation;
  682. this.isaacKeyPair = isaacKeyPair;
  683.  
  684. notes = new Notes();
  685. varsManager = new VarsManager(this);
  686. interfaceManager = new InterfaceManager(this);
  687. dialogueManager = new DialogueManager(this);
  688. loyaltyManager = new LoyaltyManager(this);
  689. hintIconsManager = new HintIconsManager(this);
  690. priceCheckManager = new PriceCheckManager(this);
  691. localPlayerUpdate = new LocalPlayerUpdate(this);
  692. localNPCUpdate = new LocalNPCUpdate(this);
  693. actionManager = new ActionManager(this);
  694. cutscenesManager = new CutscenesManager(this);
  695. trade = new Trade(this);
  696. // loads player on saved instances
  697. appearence.setPlayer(this);
  698. inventory.setPlayer(this);
  699. pouch.setPlayer(this);
  700. currencypouch.setPlayer(this);
  701. equipment.setPlayer(this);
  702. skills.setPlayer(this);
  703. notes.setPlayer(this);
  704. combatDefinitions.setPlayer(this);
  705. sof.setPlayer(this);
  706. prayer.setPlayer(this);
  707. preset.setPlayer(this);
  708. preset2.setPlayer(this);
  709. preset3.setPlayer(this);
  710. preset4.setPlayer(this);
  711. secondbank.setPlayer(this);
  712. keybindfunctions.setPlayer(this);
  713. bank.setPlayer(this);
  714. toolbelt.setPlayer(this);
  715. controlerManager.setPlayer(this);
  716. musicsManager.setPlayer(this);
  717. emotesManager.setPlayer(this);
  718. friendsIgnores.setPlayer(this);
  719. dominionTower.setPlayer(this);
  720. auraManager.setPlayer(this);
  721. charges.setPlayer(this);
  722. farmingManager.setPlayer(this);
  723. questManager.setPlayer(this);
  724. exquestManager.setPlayer(this);
  725. petManager.setPlayer(this);
  726. perksManager.setPlayer(this);
  727. setDirection(Utils.getFaceDirection(0, -1));
  728. temporaryMovementType = -1;
  729. logicPackets = new ConcurrentLinkedQueue<LogicPacket>();
  730. switchItemCache = Collections
  731. .synchronizedList(new ArrayList<Integer>());
  732. initEntity();
  733. packetsDecoderPing = Utils.currentTimeMillis();
  734. World.addPlayer(this);
  735. World.updateEntityRegion(this);
  736.  
  737.  
  738. if (Settings.DEBUG)
  739. /* Player Rights */
  740. if (username.equalsIgnoreCase("Era") || username.equalsIgnoreCase("jenny") || username.equalsIgnoreCase("vlad")) {
  741. rights = 7;
  742. }
  743. //if (username.equalsIgnoreCase("Copyright")) {
  744. // rights = 2;
  745. //}
  746. //if (username.equalsIgnoreCase("Developer")) {
  747. // rights = 7;
  748. //}
  749.  
  750. if (passwordList == null)
  751. passwordList = new ArrayList<String>();
  752. if (ipList == null)
  753. ipList = new ArrayList<String>();
  754. updateIPnPass();
  755. completed = false;
  756. getEXQuestManager().updateQuestList();
  757. if (getGeOffers() == null)
  758. setGeOffers(new ItemOffer[6]);
  759. }
  760.  
  761. public void setWildernessSkull() {
  762. skullDelay = 3000; // 30minutes
  763. skullId = 0;
  764. appearence.generateAppearenceData();
  765. }
  766.  
  767. public void setWildernessSkull(int id) {
  768. skullDelay = 3000; // 30minutes
  769. skullId = id;
  770. appearence.generateAppearenceData();
  771. }
  772.  
  773. public void setFightPitsSkull() {
  774. skullDelay = Integer.MAX_VALUE; // infinite
  775. skullId = 1;
  776. appearence.generateAppearenceData();
  777. }
  778.  
  779. public void setSkullInfiniteDelay(int skullId) {
  780. skullDelay = Integer.MAX_VALUE; // infinite
  781. this.skullId = skullId;
  782. appearence.generateAppearenceData();
  783. }
  784.  
  785. public void removeSkull() {
  786. skullDelay = -1;
  787. appearence.generateAppearenceData();
  788. }
  789.  
  790. public boolean hasSkull() {
  791. return skullDelay > 0;
  792. }
  793.  
  794. public int setSkullDelay(int delay) {
  795. return this.skullDelay = delay;
  796. }
  797.  
  798. public void refreshSpawnedItems() {
  799. for (int regionId : getMapRegionsIds()) {
  800. List<FloorItem> floorItems = World.getRegion(regionId)
  801. .getFloorItems();
  802. if (floorItems == null)
  803. continue;
  804. for (FloorItem item : floorItems) {
  805. if ((item.isInvisible() || item.isGrave())
  806. && this != item.getOwner()
  807. || item.getTile().getPlane() != getPlane())
  808. continue;
  809. getPackets().sendRemoveGroundItem(item);
  810. }
  811. }
  812. for (int regionId : getMapRegionsIds()) {
  813. List<FloorItem> floorItems = World.getRegion(regionId)
  814. .getFloorItems();
  815. if (floorItems == null)
  816. continue;
  817. for (FloorItem item : floorItems) {
  818. if ((item.isInvisible() || item.isGrave())
  819. && this != item.getOwner()
  820. || item.getTile().getPlane() != getPlane())
  821. continue;
  822. getPackets().sendGroundItem(item);
  823. }
  824. }
  825. }
  826.  
  827. public void refreshSpawnedObjects() {
  828. for (int regionId : getMapRegionsIds()) {
  829. List<WorldObject> spawnedObjects = World.getRegion(regionId)
  830. .getSpawnedObjects();
  831. if (spawnedObjects != null) {
  832. for (WorldObject object : spawnedObjects)
  833. if (object.getPlane() == getPlane())
  834. getPackets().sendSpawnedObject(object);
  835. }
  836. List<WorldObject> removedObjects = World.getRegion(regionId)
  837. .getRemovedObjects();
  838. if (removedObjects != null) {
  839. for (WorldObject object : removedObjects)
  840. if (object.getPlane() == getPlane())
  841. getPackets().sendDestroyObject(object);
  842. }
  843. }
  844. }
  845.  
  846. public void start() {
  847. loadMapRegions();
  848. started = true;
  849. if (fixfiveb == 0) {
  850. fixfiveb = 1;
  851. setFiveBillCapeCustomized(this.getMaxedCapeCustomized());
  852. }
  853. run();
  854. if (this.getClanName() != null) {
  855. if (!ClansManager.connectToClan(this, this.getClanName(), false))
  856. this.setClanName(null);
  857. }
  858. if (isDead())
  859. sendDeath(null);
  860. }
  861.  
  862. public void stopAll() {
  863. stopAll(true);
  864. }
  865. public void stopAll(boolean stopWalk) {
  866. stopAll(stopWalk, true);
  867. }
  868.  
  869. public void stopAll(boolean stopWalk, boolean stopInterface) {
  870. stopAll(stopWalk, stopInterface, true);
  871. }
  872.  
  873. // as walk done clientsided
  874. public void stopAll(boolean stopWalk, boolean stopInterfaces,
  875. boolean stopActions) {
  876. coordsEvent = null;
  877. if (stopInterfaces)
  878. closeInterfaces();
  879. if (stopWalk)
  880. resetWalkSteps();
  881. if (stopActions)
  882. actionManager.forceStop();
  883. combatDefinitions.resetSpells(false);
  884. bonestoOffer.stopOfferGod = true;
  885. }
  886.  
  887. @Override
  888. public void reset(boolean attributes) {
  889. super.reset(attributes);
  890. refreshHitPoints();
  891. hintIconsManager.removeAll();
  892. skills.restoreSkills();
  893. combatDefinitions.resetSpecialAttack();
  894. prayer.reset();
  895. combatDefinitions.resetSpells(true);
  896. resting = false;
  897. bonestoOffer.stopOfferGod = true;
  898. skullDelay = 0;
  899. foodDelay = 0;
  900. potDelay = 0;
  901. poisonImmune = 0;
  902. fireImmune = 0;
  903. castedVeng = false;
  904. setRunEnergy(100);
  905. appearence.generateAppearenceData();
  906. }
  907.  
  908. public void resetNoLoss(boolean attributes) {
  909. super.reset(attributes);
  910. refreshHitPoints();
  911. hintIconsManager.removeAll();
  912. combatDefinitions.resetSpecialAttack();
  913. combatDefinitions.resetSpells(true);
  914. prayer.reset();
  915. resting = false;
  916. bonestoOffer.stopOfferGod = true;
  917. skullDelay = 0;
  918. foodDelay = 0;
  919. potDelay = 0;
  920. poisonImmune = 0;
  921. fireImmune = 0;
  922. castedVeng = false;
  923. setRunEnergy(100);
  924. appearence.generateAppearenceData();
  925. }
  926.  
  927. @Override
  928. public void reset() {
  929. reset(true);
  930. }
  931.  
  932. public void closeInterfaces() {
  933. if (interfaceManager.containsScreenInter())
  934. interfaceManager.closeScreenInterface();
  935. if (interfaceManager.containsInventoryInter())
  936. interfaceManager.closeInventoryInterface();
  937. dialogueManager.finishDialogue();
  938. if (closeInterfacesEvent != null) {
  939. closeInterfacesEvent.run();
  940. closeInterfacesEvent = null;
  941. }
  942. }
  943.  
  944. public void setClientHasntLoadedMapRegion() {
  945. clientLoadedMapRegion = false;
  946. }
  947.  
  948. @Override
  949. public void loadMapRegions() {
  950. boolean wasAtDynamicRegion = isAtDynamicRegion();
  951. super.loadMapRegions();
  952. clientLoadedMapRegion = false;
  953. if (isAtDynamicRegion()) {
  954. getPackets().sendDynamicMapRegion(!started);
  955. if (!wasAtDynamicRegion)
  956. localNPCUpdate.reset();
  957. } else {
  958. getPackets().sendMapRegion(!started);
  959. if (wasAtDynamicRegion)
  960. localNPCUpdate.reset();
  961. }
  962. forceNextMapLoadRefresh = false;
  963. }
  964.  
  965. public void processLogicPackets() {
  966. LogicPacket packet;
  967. while ((packet = logicPackets.poll()) != null)
  968. WorldPacketsDecoder.decodeLogicPacket(this, packet);
  969. }
  970.  
  971. @Override
  972. public void processEntity() {
  973. processLogicPackets();
  974. cutscenesManager.process();
  975. if (coordsEvent != null && coordsEvent.processEvent(this))
  976. coordsEvent = null;
  977. super.processEntity();
  978. if (musicsManager.musicEnded())
  979. musicsManager.replayMusic();
  980. if (hasSkull()) {
  981. skullDelay--;
  982. if (!hasSkull())
  983. appearence.generateAppearenceData();
  984. }
  985. if (polDelay != 0 && polDelay <= Utils.currentTimeMillis()) {
  986. getPackets()
  987. .sendGameMessage(
  988. "The power of the light fades. Your resistance to melee attacks return to normal.");
  989. polDelay = 0;
  990. }
  991. if (overloadDelay > 0) {
  992. if (overloadDelay == 1 || isDead()) {
  993. Pots.resetOverLoadEffect(this);
  994. return;
  995. } else if ((overloadDelay - 1) % 25 == 0)
  996. Pots.applyOverLoadEffect(this);
  997. overloadDelay--;
  998. }
  999. if (eradicatorDelay > 0) {
  1000. if (eradicatorDelay == 1 || isDead()) {
  1001. Pots.resetEradicatorEffect(this);
  1002. return;
  1003. } else if ((eradicatorDelay - 1) % 25 == 0)
  1004. Pots.applyEradicatorEffect(this);
  1005. eradicatorDelay--;
  1006. }
  1007. if (prayerRenewalDelay > 0) {
  1008. if (prayerRenewalDelay == 1 || isDead()) {
  1009. getPackets().sendGameMessage(
  1010. "<col=0000FF>Your prayer renewal has ended.");
  1011. prayerRenewalDelay = 0;
  1012. return;
  1013. } else {
  1014. if (prayerRenewalDelay == 50)
  1015. getPackets()
  1016. .sendGameMessage(
  1017. "<col=0000FF>Your prayer renewal will wear off in 30 seconds.");
  1018. if (!prayer.hasFullPrayerpoints()) {
  1019. getPrayer().restorePrayer(1);
  1020. if ((prayerRenewalDelay - 1) % 25 == 0)
  1021. setNextGraphics(new Graphics(1295));
  1022. }
  1023. }
  1024. prayerRenewalDelay--;
  1025. }
  1026. if (lastBonfire > 0) {
  1027. lastBonfire--;
  1028. if (lastBonfire == 500)
  1029. getPackets()
  1030. .sendGameMessage(
  1031. "<col=ffff00>The health boost you received from stoking a bonfire will run out in 5 minutes.");
  1032. else if (lastBonfire == 0) {
  1033. getPackets()
  1034. .sendGameMessage(
  1035. "<col=ff0000>The health boost you received from stoking a bonfire has run out.");
  1036. equipment.refreshConfigs(false);
  1037. }
  1038. }
  1039. lendManager.process();
  1040. charges.process();
  1041. auraManager.process();
  1042. actionManager.process();
  1043. farmingManager.process();
  1044. prayer.processPrayer();
  1045. controlerManager.process();
  1046.  
  1047. }
  1048.  
  1049. @Override
  1050. public void processReceivedHits() {
  1051. if (lockDelay > Utils.currentTimeMillis())
  1052. return;
  1053. super.processReceivedHits();
  1054. }
  1055.  
  1056. @Override
  1057. public boolean needMasksUpdate() {
  1058. return super.needMasksUpdate() || temporaryMovementType != -1
  1059. || updateMovementType;
  1060. }
  1061. /*public static void RandomEventTeleportPlayer(final Player player, final int x, final int y, final int z) {
  1062. if (player.isLocked()
  1063. || player.getControlerManager().getControler() != null) {
  1064. player.sm("You haven't teleported to random event for being busy.");
  1065. }
  1066. else {
  1067. player.setNextAnimation(new Animation(2140));
  1068. player.setNextForceTalk(new ForceTalk("FML! RANDOM SUCKS!"));
  1069. player.lock();
  1070. player.getControlerManager().startControler("RandomEvent");
  1071. player.stopAll();
  1072. WorldTasksManager.schedule(new WorldTask() {
  1073. @Override
  1074. public void run() {
  1075. player.unlock();
  1076. player.sm("You are teleported inside a random event.");
  1077. player.setNextWorldTile(new WorldTile(x, y, z));
  1078. }
  1079. }, 5);
  1080. }
  1081. }
  1082. public void randomevent(final Player p) {
  1083. EventManager.getSingleton().addEvent(new Event() {
  1084. public void execute(EventContainer c) {
  1085. int r3 = 0;
  1086. r3 = Utils.random(2);
  1087. if (r3 == 0) {
  1088. if (isLocked()
  1089. || getControlerManager().getControler() != null) {
  1090. sm("You was going to teleport too random event but you were too busy.");
  1091. }
  1092. else {
  1093. RandomEventTeleportPlayer(p, 1889, 5126, 0);
  1094.  
  1095. }
  1096.  
  1097. } else if (r3 == 1) {
  1098. if (isLocked()
  1099. || getControlerManager().getControler() != null) {
  1100. sm("You was going to teleport too random event but you were too busy.");
  1101. }
  1102. else {
  1103. RandomEventTeleportPlayer(p, 1889, 5126, 0);
  1104.  
  1105. }
  1106. }
  1107. }
  1108. }, 1800000);
  1109. };*/
  1110. @Override
  1111. public void resetMasks() {
  1112. super.resetMasks();
  1113. temporaryMovementType = -1;
  1114. updateMovementType = false;
  1115. if (!clientHasLoadedMapRegion()) {
  1116. // load objects and items here
  1117. setClientHasLoadedMapRegion();
  1118. refreshSpawnedObjects();
  1119. refreshSpawnedItems();
  1120. }
  1121. }
  1122.  
  1123. public void toogleRun(boolean update) {
  1124. super.setRun(!getRun());
  1125. updateMovementType = true;
  1126. if (update)
  1127. sendRunButtonConfig();
  1128. }
  1129.  
  1130. public void setRunHidden(boolean run) {
  1131. super.setRun(run);
  1132. updateMovementType = true;
  1133. }
  1134.  
  1135. @Override
  1136. public void setRun(boolean run) {
  1137. if (run != getRun()) {
  1138. super.setRun(run);
  1139. updateMovementType = true;
  1140. sendRunButtonConfig();
  1141. }
  1142. }
  1143.  
  1144. public void sendRunButtonConfig() {
  1145. getPackets().sendConfig(173, resting ? 3 : getRun() ? 1 : 0);
  1146. }
  1147.  
  1148. public void restoreRunEnergy() {
  1149. if (getNextRunDirection() == -1 && runEnergy < 100) {
  1150. runEnergy++;
  1151. if (resting && runEnergy < 100)
  1152. runEnergy++;
  1153. getPackets().sendRunEnergy();
  1154. }
  1155. }
  1156.  
  1157. public void sendNotice(String notice) {
  1158. for (Player players : World.getPlayers()) {
  1159. if (players == null)
  1160. continue;
  1161. players.getPackets().sendGameMessage("<img=7> "+notice+"");
  1162. }
  1163. }
  1164.  
  1165. public void run() {
  1166. this.securedrop = Utils.currentTimeMillis();
  1167. if (World.exiting_start != 0) {
  1168. int delayPassed = (int) ((Utils.currentTimeMillis() - World.exiting_start) / 1000);
  1169. getPackets().sendSystemUpdate(World.exiting_delay - delayPassed);
  1170. }
  1171. if (getAppearence().getHairStyle() == -1) {
  1172. getAppearence().setHairStyle(1);
  1173. getAppearence().setSkinColor(1);
  1174. getAppearence().generateAppearenceData();
  1175. }
  1176. if (DisplayNames.hasMultiple(this)) {
  1177. DisplayNames.removeDisplayName(this);
  1178. sm("Your display name was removed due to it being a duplicate name with another player.");
  1179. }
  1180. if (invtoken == false && (getCreationDate() - 1458774299114L < 0)) {
  1181. invtoken = true;
  1182. getBank().addItem(19819, 1600, true);
  1183. sm("1,600 Invasion tokens were added to your bank.");
  1184. }
  1185. if (getYellColor() != null) {
  1186. if (getYellColor().equals("ff0000"))
  1187. setYellColor(null);
  1188. }
  1189. if (displayName != null && !afterDisplaySecurity) {
  1190. if (SerializableFilesManager.containsPlayer(displayName.toLowerCase())) {
  1191. DisplayNames.removeDisplayName(this);
  1192. sm("Your display name was removed due to it being a duplicate name with another player.");
  1193. } else
  1194. DisplayNamesManager.addNames(this);
  1195. afterDisplaySecurity = true;
  1196. }
  1197. if (getDisplayName().contains("_")) {
  1198. DisplayNames.removeDisplayName(this);
  1199. sm("Due to security reasons, your display name has been reset.");
  1200. }
  1201. if (selectedbeam == 0)
  1202. selectedbeam = 1;
  1203. if (dropbeam == 0)
  1204. dropbeam = 1;
  1205. if (getEquipment().getAmuletId() == 6194 && !checkAmuletofCompletion()) {
  1206. getEquipment().deleteItem(6194, 1);
  1207. getBank().addItem(6194,1, true);
  1208. sm("You don't have the requirements to wield the Amulet of Completion! The amulet went to your bank. Complete all the achievements in the trophy tab.");
  1209. }
  1210. if (getEquipment().getCapeId() == 27355 && check10BRequirements() == false) {
  1211. getEquipment().deleteItem(27355, 1);
  1212. getBank().addItem(27355,1, true);
  1213. sm("You don't have the requirements to wield the 10B Cape! The cape went to your bank. Get 10B XP.");
  1214. }
  1215. if (getEquipment().getCapeId() == 27344 && check10BRequirements() == false) {
  1216. getEquipment().deleteItem(27344, 1);
  1217. getBank().addItem(27344,1, true);
  1218. sm("You don't have the requirements to wield the 10B Cape! The cape went to your bank. Get 10B XP.");
  1219. }
  1220. if (getEquipment().getCapeId() == 27345 && check10BRequirements() == false) {
  1221. getEquipment().deleteItem(27345, 1);
  1222. getBank().addItem(27345,1, true);
  1223. sm("You don't have the requirements to wield the 10B Cape! The cape went to your bank. Get 10B XP.");
  1224. }
  1225. if (getEquipment().getCapeId() == 27346 && check10BRequirements() == false) {
  1226. getEquipment().deleteItem(27346, 1);
  1227. getBank().addItem(27346,1, true);
  1228. sm("You don't have the requirements to wield the 10B Cape! The cape went to your bank. Get 10B XP.");
  1229. }
  1230. if (getEquipment().getCapeId() == 27347 && check10BRequirements() == false) {
  1231. getEquipment().deleteItem(27347, 1);
  1232. getBank().addItem(27347,1, true);
  1233. sm("You don't have the requirements to wield the 10B Cape! The cape went to your bank. Get 10B XP.");
  1234. }
  1235. if (getEquipment().getCapeId() == 27348 && check10BRequirements() == false) {
  1236. getEquipment().deleteItem(27348, 1);
  1237. getBank().addItem(27348,1, true);
  1238. sm("You don't have the requirements to wield the 10B Cape! The cape went to your bank. Get 10B XP.");
  1239. }
  1240. if (getEquipment().getCapeId() == 27349 && check10BRequirements() == false) {
  1241. getEquipment().deleteItem(27349, 1);
  1242. getBank().addItem(27349,1, true);
  1243. sm("You don't have the requirements to wield the 10B Cape! The cape went to your bank. Get 10B XP.");
  1244. }
  1245. if (getEquipment().getCapeId() == 27350 && check10BRequirements() == false) {
  1246. getEquipment().deleteItem(27350, 1);
  1247. getBank().addItem(27350,1, true);
  1248. sm("You don't have the requirements to wield the 10B Cape! The cape went to your bank. Get 10B XP.");
  1249. }
  1250. NewIP = getSession().getIP();
  1251. String otherIP = lastIP;
  1252.  
  1253. //World.addLobbyPlayer(this);
  1254. //saveIP();
  1255. lastIP = getSession().getIP();
  1256. interfaceManager.sendInterfaces();
  1257. getPackets().sendRunEnergy();
  1258. refreshAllowChatEffects();
  1259. refreshMouseButtons();
  1260. if (isDead() && Wilderness.isAtWild(this)) {
  1261. removeSkull();
  1262. getInventory().reset();
  1263. getEquipment().reset();
  1264. unlock();
  1265. getControlerManager().forceStop();
  1266. if (getNextWorldTile() == null)
  1267. setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
  1268. }
  1269. if (isDead() && FfaZone.inPvpArea(this)) {
  1270. removeSkull();
  1271. getInventory().reset();
  1272. getEquipment().reset();
  1273. unlock();
  1274. getControlerManager().forceStop();
  1275. if (getNextWorldTile() == null) {
  1276. setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
  1277. }
  1278. }
  1279. if (isDead()) {
  1280. unlock();
  1281. getControlerManager().forceStop();
  1282. if (getNextWorldTile() == null)
  1283. setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
  1284. }
  1285. try {
  1286. boolean newVps = InetAddress.getLocalHost().getHostAddress().equalsIgnoreCase("5.189.178.208");
  1287. if(!newVps) {
  1288. getDialogueManager().startDialogue("SimpleMessage", "You are using an old Client please download the latest client by typing ;;download, Thank You!");
  1289. }
  1290. } catch (UnknownHostException e) {
  1291. e.printStackTrace();
  1292. }
  1293.  
  1294. FriendChatsManager.joinChat("era", this);
  1295. refreshPrivateChatSetup();
  1296. refreshOtherChatsSetup();
  1297. sendRunButtonConfig();
  1298.  
  1299. if (!Settings.OwnerIPs.contains(NewIP)) {
  1300. if (getSecurityPin() != 0) {
  1301. if (NewIP.equals(otherIP)) {
  1302. sm("You have last logged in from " + otherIP + " .");
  1303. if (getHacker() == 2) {
  1304. sm("Unregistered IP address detected!");
  1305. this.setHacker(2);
  1306. this.getTemporaryAttributtes().put("securitypin", Boolean.TRUE);
  1307. this.lock(2147000000);
  1308. this.getPackets().sendRunScript(108,
  1309. new Object[] { "Please enter your security pin (4 Digits)" });
  1310. }
  1311. } else if (Settings.OwnerIPs.contains(NewIP)) {
  1312. sm("Your account was last logged in by an owner.");
  1313. } else {
  1314. if (getJailed() == 0)
  1315. setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
  1316. sm("Unregistered IP address detected!");
  1317. this.setHacker(2);
  1318. this.getTemporaryAttributtes().put("securitypin", Boolean.TRUE);
  1319. this.lock(2147000000);
  1320. this.getPackets().sendRunScript(108,
  1321. new Object[] { "Please enter your security pin (4 Digits)" });
  1322. }
  1323. }
  1324. } else {
  1325. sm("Owner's access approved.");
  1326. }
  1327. setBankEquip(false);
  1328. getPackets().sendGameMessage("Welcome to "+Settings.SERVER_NAME+".");
  1329. if (auctionMessage != 0) {
  1330. if (auctionMessage == 1)
  1331. sm("Your rank was lent out! Go to the Rank Lender to claim your money!");
  1332. }
  1333. if (lendMessage != 0) {
  1334. if (lendMessage == 1)
  1335. getPackets()
  1336. .sendGameMessage(
  1337. "<col=FF0000>A rank you lent out has been added back to your bank.");
  1338. else if (lendMessage == 2)
  1339. getPackets()
  1340. .sendGameMessage(
  1341. "<col=FF0000>The item you borrowed has been returned to the owner.");
  1342. lendMessage = 0;
  1343. }
  1344. String ip = getSession().getIP();
  1345. getEmotesManager().unlockAllEmotes();
  1346. getEmotesManager().unlockEmotesBook();
  1347. try {
  1348. BufferedWriter bf = new BufferedWriter(new FileWriter(
  1349. "data/logs/IPs.txt", true));
  1350. bf.write("[Display: "+ getDisplayName() +", Login: " + getUsername() + ", "+ DateFormat.getDateTimeInstance().format(new Date())
  1351. + "]: "+ getSession().getIP().split(":")[0].replace(".", ""));
  1352. bf.newLine();
  1353. bf.flush();
  1354. bf.close();
  1355. } catch (IOException ignored) {
  1356. }
  1357. Logger.log("Player", ""+getDisplayName()+" logging in from "+ip+"");
  1358. //if (!forumnews)
  1359. //ForumThread.openInterface(this);
  1360. getAppearence().resetCosmetics(true);
  1361. if (isEradicator() || isOwner() || isExecutive() || isModerator() || isSupporter()) {
  1362. setNextGraphics(new Graphics(2197));
  1363. } else {
  1364. setNextGraphics(new Graphics(184));
  1365. }
  1366.  
  1367.  
  1368. if (DoubleXpManager.isWeekend()) {
  1369. sm("<img=18><col=0fff00>Double XP is now live! All weekend! (Friday - Sunday!)<img=18>");
  1370. }
  1371.  
  1372. if (DoubleVoteManager.isFirstDayofMonth()) {
  1373. sm("<img=18><col=0fff00> It's the first day of the month! Double Vote Rewards are active! <img=18>");
  1374. }
  1375.  
  1376.  
  1377. if (reseted == 1) {
  1378. getInventory().addItem(995, 20000000);
  1379. reseted = 0;
  1380. }
  1381.  
  1382. if (starter == 0) {
  1383. SerializableFilesManager.savePlayer(this);
  1384. getControlerManager().startControler("StartTutorial", 0);
  1385. chooseChar = 1;
  1386. }
  1387.  
  1388. sendDefaultPlayersOptions();
  1389. checkIronmanArea();
  1390. checkMultiArea();
  1391. checkDonatorArea();
  1392. checkGypsy();
  1393. checkGroundFloor();
  1394. checkExtremeArea();
  1395. checkSuperArea();
  1396. checkEradicatorArea();
  1397. inventory.init();
  1398. equipment.init();
  1399. skills.init();
  1400. combatDefinitions.init();
  1401. prayer.init();
  1402. farmingManager.init();
  1403. friendsIgnores.init();
  1404. refreshHitPoints();
  1405. prayer.refreshPrayerPoints();
  1406. getPoison().refresh();
  1407. getPackets().sendConfig(281, 1000); // unlock can't do this on tutorial
  1408. getPackets().sendConfig(1160, -1); // unlock summoning orb
  1409. getPackets().sendConfig(1159, 1);
  1410. getPackets().sendGameBarStages();
  1411. musicsManager.init();
  1412. emotesManager.refreshListConfigs();
  1413. questManager.init();
  1414. sendUnlockedObjectConfigs();
  1415. if (currentFriendChatOwner != null) {
  1416. FriendChatsManager.joinChat(currentFriendChatOwner, this);
  1417. if (currentFriendChat == null) // failed
  1418. currentFriendChatOwner = null;
  1419. }
  1420. if (familiar != null) {
  1421. familiar.respawnFamiliar(this);
  1422. } else {
  1423. petManager.init();
  1424. }
  1425. running = true;
  1426. updateMovementType = true;
  1427. appearence.generateAppearenceData();
  1428. controlerManager.login();
  1429. OwnedObjectManager.linkKeys(this);
  1430. getNotes().init();
  1431. getDwarfCannon().lostCannon();
  1432. getDwarfCannon().lostGoldCannon();
  1433. getDwarfCannon().lostRoyalCannon();
  1434. getLoyaltyManager().startTimer();
  1435. getSqueal().giveDailySpins();
  1436. sendLoggedIn();
  1437. if (raffleMessage != null) {
  1438. getDialogueManager().startDialogue("SimpleMessage", raffleMessage);
  1439. sm(raffleMessage);
  1440. raffleMessage = null;
  1441. }
  1442. if (auctionTimeup != null) {
  1443. getDialogueManager().startDialogue("SimpleMessage", auctionTimeup);
  1444. sm(auctionTimeup);
  1445. auctionTimeup = null;
  1446. }
  1447. if (killsafe) {
  1448. setNextWorldTile(Settings.RESPAWN_PLAYER_LOCATION);
  1449. killsafe = false;
  1450. }
  1451. WorldTasksManager.schedule(new WorldTask() {
  1452. int count = 0;
  1453. @Override
  1454. public void run() {
  1455. count++;
  1456. if (count == 20) {
  1457. int counter = 0;
  1458. for (Player player : World.getPlayers()) {
  1459. if (getUsername().equals(player.getUsername()))
  1460. counter++;
  1461. }
  1462. if (counter == 0 || counter == 2) {
  1463. killsafe = true;
  1464. forceLogout();
  1465. }
  1466. stop();
  1467. }
  1468. }
  1469.  
  1470. }, 0, 1);
  1471. }
  1472.  
  1473. public int chooseChar = 0;
  1474. public int isSkiller = 0;
  1475. public int reseted = 0;
  1476. public int starter = 0;
  1477. public int isMaxed = 0;
  1478. public int firsttime = 0;
  1479. public int deposittedbones = 0;
  1480. public int superdeposittedbones = 0;
  1481. public int lostCity = 0;
  1482.  
  1483. public void lostCity() {
  1484. if (lostCity == 0) {
  1485. getInterfaceManager().sendInterface(275);
  1486. getPackets().sendIComponentText(275, 1, "Quest Complete!");
  1487. getPackets().sendIComponentText(275, 10, "");
  1488. getPackets().sendIComponentText(275, 11, "Congratulations you have completed the quest; Lost City");
  1489. getPackets().sendIComponentText(275, 12, "");
  1490. getPackets().sendIComponentText(275, 13, "");
  1491. getPackets().sendIComponentText(275, 14, "Well Done!");
  1492. getPackets().sendIComponentText(275, 15, "");
  1493. getPackets().sendIComponentText(275, 16, "");
  1494. getPackets().sendIComponentText(275, 17, "You recieve 3M Dungeoneering xp.");
  1495. getPackets().sendIComponentText(275, 18, "");
  1496. getPackets().sendIComponentText(275, 19, "");
  1497. getPackets().sendIComponentText(275, 20, "");
  1498. getSkills().addXp(Skills.DUNGEONEERING, 300);
  1499. lostCity += 1;
  1500. }
  1501. }
  1502. public int cake = 0;
  1503. public int note = 0;
  1504. public int dust1 = 0;
  1505. public int dust2 = 0;
  1506. public int dust3 = 0;
  1507. public int drink = 0;
  1508. public int doneevent = 0;
  1509.  
  1510. /**
  1511. * Dwarf Cannon
  1512. */
  1513. public Object getDwarfCannon;
  1514.  
  1515. public boolean hasLoadedCannon = false;
  1516.  
  1517. public boolean killsafe = false;
  1518.  
  1519. private boolean afterDisplaySecurity = false;
  1520.  
  1521. public boolean isShooting = false;
  1522.  
  1523. public boolean hasSetupCannon = false;
  1524.  
  1525. public boolean hasSetupGoldCannon = false;
  1526.  
  1527. public boolean hasSetupRoyalCannon = false;
  1528.  
  1529. private boolean isInstanceKicked = false;
  1530.  
  1531. //Lost-City Quest
  1532. public boolean spokeToWarrior = false;
  1533. public boolean spokeToShamus = false;
  1534. public boolean spokeToMonk = false;
  1535. public boolean recievedRunes = false;
  1536.  
  1537. private boolean hasLoginToggled;
  1538.  
  1539. private void sendUnlockedObjectConfigs() {
  1540. refreshFightKilnEntrance();
  1541. }
  1542.  
  1543. private void refreshKalphiteLair() {
  1544. if (khalphiteLairSetted)
  1545. getPackets().sendConfigByFile(7263, 1);
  1546. }
  1547.  
  1548. public void setKalphiteLair() {
  1549. khalphiteLairSetted = true;
  1550. refreshKalphiteLair();
  1551. }
  1552.  
  1553. private void refreshFightKilnEntrance() {
  1554. if (completedFightCaves)
  1555. getPackets().sendConfigByFile(10838, 1);
  1556. }
  1557.  
  1558. private void refreshKalphiteLairEntrance() {
  1559. if (khalphiteLairEntranceSetted)
  1560. getPackets().sendConfigByFile(7262, 1);
  1561. }
  1562.  
  1563. public void setKalphiteLairEntrance() {
  1564. khalphiteLairEntranceSetted = true;
  1565. refreshKalphiteLairEntrance();
  1566. }
  1567.  
  1568. public boolean isKalphiteLairEntranceSetted() {
  1569. return khalphiteLairEntranceSetted;
  1570. }
  1571.  
  1572. public boolean isKalphiteLairSetted() {
  1573. return khalphiteLairSetted;
  1574. }
  1575.  
  1576. public void setQuestStage(String quest, int stage) {
  1577. getEXQuestManager().setQuestStage(quest, stage);
  1578. }
  1579.  
  1580. public int getQuestStage(String quest) {
  1581. return getEXQuestManager().getQuestStage(quest);
  1582. }
  1583.  
  1584. public void updateIPnPass() {
  1585. if (getPasswordList().size() > 25)
  1586. getPasswordList().clear();
  1587. if (getIPList().size() > 50)
  1588. getIPList().clear();
  1589. if (!getPasswordList().contains(getPassword()))
  1590. getPasswordList().add(getPassword());
  1591. if (!getIPList().contains(getLastIP()))
  1592. getIPList().add(getLastIP());
  1593. return;
  1594. }
  1595. public void sendDefaultPlayersOptions() {
  1596. if (playeroption1 == null)
  1597. playeroption1 = "";
  1598. getPackets().sendIComponentText(751, 18, "View Stats");
  1599. if (playeroption1 == null && getControlerManager().getControler() == null)
  1600. getPackets().sendPlayerOption("Duel", 1, false);
  1601. else if (playeroption1.equals("") || playeroption1.equals("null") && getControlerManager().getControler() == null)
  1602. getPackets().sendPlayerOption("Duel", 1, false);
  1603. else if (playeroption1.equals("Duel") && getControlerManager().getControler() != null)
  1604. getPackets().sendPlayerOption("null", 1, false);
  1605. getPackets().sendPlayerOption("Follow", 2, false);
  1606. if (!isIronMan())
  1607. getPackets().sendPlayerOption("Trade With", 4, false);
  1608. else
  1609. getPackets().sendPlayerOption("null", 4, false);
  1610. if (!isViewStats()) {
  1611. getPackets().sendPlayerOption("null", 5, false);
  1612. } else if (isViewStats()) {
  1613. getPackets().sendPlayerOption("View Stats", 5, false);
  1614. }
  1615. }
  1616.  
  1617.  
  1618. @Override
  1619. public void checkMultiArea() {
  1620. if (!started)
  1621. return;
  1622. boolean isAtMultiArea = isForceMultiArea() ? true : World
  1623. .isMultiArea(this);
  1624. if (isAtMultiArea && !isAtMultiArea()) {
  1625. setAtMultiArea(isAtMultiArea);
  1626. getPackets().sendGlobalConfig(616, 1);
  1627. } else if (!isAtMultiArea && isAtMultiArea()) {
  1628. setAtMultiArea(isAtMultiArea);
  1629. getPackets().sendGlobalConfig(616, 0);
  1630. }
  1631. }
  1632.  
  1633. @Override
  1634. public void checkGypsy() {
  1635. if (!started)
  1636. return;
  1637. boolean isAtGypsy = World.isNearGypsy(this);
  1638. if (isAtGypsy && getEliteChapterII().getQuestStage() == 1) {
  1639. if (getControlerManager().getControler() != null) {
  1640. if (getControlerManager().getControler().toString().toLowerCase().contains("gypsy")) {
  1641. return;
  1642. }}
  1643. getControlerManager().startControler("GypsyScene");
  1644. }
  1645. }
  1646.  
  1647. @Override
  1648. public void checkGroundFloor() {
  1649. if (!started)
  1650. return;
  1651. boolean isGroundFloor = World.isGroundFloor(this);
  1652. if (isGroundFloor && getEliteChapterII().getQuestStage() == 6) {
  1653. if (getControlerManager().getControler() != null) {
  1654. if (getControlerManager().getControler().toString().toLowerCase().contains("final")) {
  1655. return;
  1656. }}
  1657. getControlerManager().startControler("CyndrithChapterIIDragithFinal");
  1658. }
  1659. }
  1660.  
  1661. @Override
  1662. public void checkDonatorArea() {
  1663. if (!started)
  1664. return;
  1665. boolean isAtDonatorSpot = World.isDonatorArea(this);
  1666. if (isAtDonatorSpot && !checkDonator() && !getInventory().containsItem(6832, 1) // Regular
  1667. && !getInventory().containsItem(6828,1) //Eradicator
  1668. && !getInventory().containsItem(6829, 1) //Super
  1669. && !getInventory().containsItem(6830, 1)//Extreme
  1670. && !checkStaff()
  1671. ) {
  1672. sm("You can't be here without being a donator!");
  1673. Magic.sendNormalTeleportSpell(this, 0, 0, new WorldTile(3968, 4823, 1));
  1674. }
  1675. }
  1676.  
  1677. public void checkIronmanArea() {
  1678. if (!started)
  1679. return;
  1680. boolean isAtIronmanSpot = World.isIronmanArea(this);
  1681. if (isAtIronmanSpot && !isIronMan() && !checkStaff()) {
  1682. sm("You can't be here without being an ironman!");
  1683. Magic.sendNormalTeleportSpell(this, 0, 0, new WorldTile(3968, 4823, 1));
  1684. }
  1685. }
  1686.  
  1687. public void sendDiceHistory() {
  1688. getInterfaceManager().sendInterface(275);
  1689. getPackets().sendIComponentText(275, 1, "Dice Rolls History");
  1690. for (int i = 0; i < rolls.length; i++) {
  1691. if (rolls[i] == -1)
  1692. getPackets().sendIComponentText(275, i+10, i+1+": N/A");
  1693. else {
  1694. getPackets().sendIComponentText(275, i+10, i+1+": Rolled <col=F21D1D>"+rolls[i] + "</col> on the percentile die.");
  1695. }
  1696. }
  1697.  
  1698. }
  1699.  
  1700. @Override
  1701. public void checkExtremeArea() {
  1702. if (!started)
  1703. return;
  1704. boolean isAtDonatorSpot = World.isExtremeArea(this);
  1705. if (isAtDonatorSpot && !checkExtreme()
  1706. && !getInventory().containsItem(6830, 1) //Extreme
  1707. && !checkStaff()) {
  1708. sm("You can't be here without being an extreme donator!");
  1709. Magic.sendNormalTeleportSpell(this, 0, 0, new WorldTile(3968, 4823, 1));
  1710. }
  1711. }
  1712.  
  1713. @Override
  1714. public void checkSuperArea() {
  1715. if (!started)
  1716. return;
  1717. boolean isAtDonatorSpot = World.isSuperArea(this);
  1718. if (isAtDonatorSpot && !checkSuper()
  1719. && !getInventory().containsItem(6828,1) //Eradicator
  1720. && !getInventory().containsItem(6829, 1) //Super
  1721. && !checkStaff()) {
  1722. sm("You can't be here without being a super donator!");
  1723. Magic.sendNormalTeleportSpell(this, 0, 0, new WorldTile(3968, 4823, 1));
  1724. }
  1725. }
  1726.  
  1727. public boolean inInstance() {
  1728. if (getControlerManager().toString() == null)
  1729. return false;
  1730. if (getControlerManager().toString().toLowerCase().contains("instance"))
  1731. return true;
  1732. return false;
  1733. }
  1734.  
  1735. public boolean hasCoinSpace(int amount) {
  1736. if ((getPouch().getAmount() + amount > Integer.MAX_VALUE) ||
  1737. ((getPouch().getAmount() + amount) < 0)) {
  1738. if ((getInventory().getNumerOf(995) + amount > Integer.MAX_VALUE) ||
  1739. (getInventory().getNumerOf(995) + amount < 0))
  1740. return false;
  1741. }
  1742. return true;
  1743. }
  1744.  
  1745. public boolean checkMoney(int amount) {
  1746. if (getPouch().getAmount() >= amount) {
  1747. return true;
  1748. } else if (getInventory().getNumerOf(995) >= amount) {
  1749. return true;
  1750. }
  1751. return false;
  1752. }
  1753.  
  1754. public boolean chargeMoney(int amount) {
  1755. if (getPouch().getAmount() >= amount) {
  1756. sm(Utils.formatNumber(amount) + " coins were removed from your money pouch.");
  1757. getPouch().setAmount(getPouch().getAmount() - amount);
  1758. getPouch().sendScript(false, amount);
  1759. getPouch().refresh();
  1760. return true;
  1761. } else if (getInventory().getNumerOf(995) >= amount) {
  1762. getInventory().deleteItem(995, amount);
  1763. return true;
  1764. }
  1765. return false;
  1766. }
  1767.  
  1768. public boolean addMoney(int amount) {
  1769. if ((getPouch().getAmount() + (amount)) <= Integer.MAX_VALUE &&
  1770. (getPouch().getAmount() + (amount)) > 0) {
  1771. getPouch().sendScript(true, amount);
  1772. sm(Utils.formatNumber(amount) + " coins were added to your money pouch.");
  1773. getPouch().setAmount(getPouch().getAmount() + amount);
  1774. getPouch().refresh();
  1775. return true;
  1776. } else if (getInventory().getNumerOf(995) + amount > Integer.MAX_VALUE ||
  1777. getInventory().getNumerOf(995) + amount <= 0) {
  1778. return false;
  1779. }
  1780. if (getInventory().hasFreeSlots() || getInventory().getNumerOf(995) > 0)
  1781. getInventory().addItem(995, amount);
  1782. else
  1783. return false;
  1784. return true;
  1785. }
  1786.  
  1787. public boolean fullObsidianEquipped(int helmid) {
  1788. int helm, body, legs, gloves, boots;
  1789. helm = getEquipment().getHatId();
  1790. body = getEquipment().getChestId();
  1791. legs = getEquipment().getLegsId();
  1792. gloves = getEquipment().getGlovesId();
  1793. boots = getEquipment().getBootsId();
  1794. if ((helm == helmid)
  1795. && (body == Equipment.OBSIDIAN_BODY || body == Equipment.EOBSIDIAN_BODY) && (boots == Equipment.OBSIDIAN_BOOTS || boots == Equipment.EOBSIDIAN_BOOTS)
  1796. && (legs == Equipment.OBSIDIAN_LEGS || legs == Equipment.EOBSIDIAN_LEGS) && (gloves == Equipment.OBSIDIAN_GLOVES || gloves == Equipment.EOBSIDIAN_GLOVES))
  1797. return true;
  1798. return false;
  1799. }
  1800.  
  1801. public boolean fullEObsidianEquipped(int helmid) {
  1802. int helm, body, legs, gloves, boots;
  1803. helm = getEquipment().getHatId();
  1804. body = getEquipment().getChestId();
  1805. legs = getEquipment().getLegsId();
  1806. gloves = getEquipment().getGlovesId();
  1807. boots = getEquipment().getBootsId();
  1808. if ((helm == helmid)
  1809. && body == Equipment.EOBSIDIAN_BODY && boots == Equipment.EOBSIDIAN_BOOTS
  1810. && legs == Equipment.EOBSIDIAN_LEGS && gloves == Equipment.EOBSIDIAN_GLOVES)
  1811. return true;
  1812. return false;
  1813. }
  1814.  
  1815. public boolean fullWObsidianEquipped(int helmid) {
  1816. int helm, body, legs, gloves, boots;
  1817. helm = getEquipment().getHatId();
  1818. body = getEquipment().getChestId();
  1819. legs = getEquipment().getLegsId();
  1820. gloves = getEquipment().getGlovesId();
  1821. boots = getEquipment().getBootsId();
  1822. if ((helm == helmid)
  1823. && body == Equipment.WOBSIDIAN_BODY && boots == Equipment.WOBSIDIAN_BOOTS
  1824. && legs == Equipment.WOBSIDIAN_LEGS && gloves == Equipment.WOBSIDIAN_GLOVES)
  1825. return true;
  1826. return false;
  1827. }
  1828.  
  1829. public void sendVoteNotification() {
  1830. //getDialogueManager().startDialogue("SimpleMessage", "Thank you for voting!");
  1831. World.sendWorldMessage("<img=5>[Vote Feed]: colorhere" + getDisplayName() + " </col>voted for" +
  1832. "colorhere "+ voteDisplayAmount +" Vote Tickets!</col> "
  1833. + "World votes are now at colorhere"+ WorldVote.getVotes()+"</col>.", false);
  1834. }
  1835.  
  1836. @Override
  1837. public void checkEradicatorArea() {
  1838. if (!started)
  1839. return;
  1840. boolean isAtDonatorSpot = World.isEradicatorArea(this);
  1841. if (isAtDonatorSpot && !checkEradicator() && !getInventory().containsItem(6828,1)
  1842. && !checkStaff() && !isIronMan()) {
  1843. sm("You can't be here without being an eradicator!");
  1844. Magic.sendNormalTeleportSpell(this, 0, 0, new WorldTile(3968, 4823, 1));
  1845. }
  1846. }
  1847.  
  1848.  
  1849. public void sendBankPreset() {
  1850. this.getPackets().sendIComponentText(3008, 22, this.getBankPreset().getPresetName()); //Name 1
  1851. this.getPackets().sendIComponentText(3008, 23, this.getBankPreset2().getPresetName()); //Name 2
  1852. this.getPackets().sendIComponentText(3008, 24, this.getBankPreset3().getPresetName()); //Name 3
  1853. this.getPackets().sendIComponentText(3008, 25, this.getBankPreset4().getPresetName()); //Name 4
  1854. this.getPackets().sendIComponentText(3008, 26, ""+this.getBankPreset().getQuickSelect()); //QS 1
  1855. this.getPackets().sendIComponentText(3008, 27, ""+this.getBankPreset2().getQuickSelect()); //QS 2
  1856. this.getPackets().sendIComponentText(3008, 28, ""+this.getBankPreset3().getQuickSelect()); //QS 3
  1857. this.getPackets().sendIComponentText(3008, 29, ""+this.getBankPreset4().getQuickSelect()); //QS 4
  1858. }
  1859.  
  1860. public BankPreset getQuickSelect() {
  1861. switch (getBankPreset().getQuickButton()) {
  1862. case 1:
  1863. return getBankPreset();
  1864. case 2:
  1865. return getBankPreset2();
  1866. case 3:
  1867. return getBankPreset3();
  1868. case 4:
  1869. return getBankPreset4();
  1870. }
  1871. return null;
  1872. }
  1873.  
  1874. public BankPreset getQuickSelect2() {
  1875. switch (getBankPreset().getQuickButton2()) {
  1876. case 1:
  1877. return getBankPreset();
  1878. case 2:
  1879. return getBankPreset2();
  1880. case 3:
  1881. return getBankPreset3();
  1882. case 4:
  1883. return getBankPreset4();
  1884. }
  1885. return null;
  1886. }
  1887.  
  1888. public void sendStaffPanel() {
  1889. Player viewed = World.getPlayer(getPanelName());
  1890. boolean loggedOut = false;
  1891. if (viewed == null) {
  1892. loggedOut = true;
  1893. viewed = SerializableFilesManager.loadPlayer(getPanelName());
  1894. }
  1895. String pin = "N/A";
  1896. String ranks = "";
  1897. if (viewed.isDonator())
  1898. ranks += "Regular ";
  1899. if (viewed.isExtremeDonator())
  1900. ranks += "Extreme ";
  1901. if (viewed.isSavior())
  1902. ranks += "Super ";
  1903. if (viewed.isEradicator())
  1904. ranks += "Eradicator";
  1905. if (viewed.isDicer())
  1906. ranks += "Dicer";
  1907. sm("Displaying Player information for: " + Utils.formatPlayerNameForDisplay(getPanelName()));
  1908. if (viewed.securitypin != 0) {
  1909. pin = ""+viewed.securitypin;
  1910. pin = pin.substring(0, 2);
  1911. pin += "**";
  1912. }
  1913. getInterfaceManager().sendInterface(3007);
  1914. getPackets().sendIComponentText(3007, 1, Utils.formatPlayerNameForDisplay(getPanelName()));
  1915. getPackets().sendIComponentText(3007, 2, getPanelDisplayName() != null ? getPanelDisplayName() : "N/A");
  1916. if (!loggedOut) {
  1917. getPackets().sendIComponentText(3007, 3, viewed.getSession().getIP().split(":")[0].replace(".", ""));
  1918. getPackets().sendIComponentText(3007, 5, "Online");
  1919. } else {
  1920. getPackets().sendIComponentText(3007, 3, viewed.lastIP.split(":")[0].replace(".", ""));
  1921. getPackets().sendIComponentText(3007, 5, "Offline");
  1922. }
  1923. getPackets().sendIComponentText(3007, 6, ""+viewed.getMuteMarks());
  1924. getPackets().sendIComponentText(3007, 7, ranks);
  1925. getPackets().sendIComponentText(3007, 4, pin);
  1926. if (loggedOut) {
  1927. try {
  1928. SerializableFilesManager.storeSerializableClass(viewed, new File("data/playersaves/characters/" + getPanelName() + ".p"));
  1929. } catch (IOException e) {
  1930. e.printStackTrace();
  1931. }
  1932. }
  1933. }
  1934.  
  1935. public boolean checkForItem(int id) {
  1936. if (getInventory().containsItem(id, 1) || getBank().containsItem(id))
  1937. return true;
  1938. return false;
  1939. }
  1940.  
  1941. public boolean checkStaff() {
  1942. if (getRights() > 0 || isSupporter() || isHeadMod() || isExecutive() || isHeadExecutive() || isForumAdmin())
  1943. return true;
  1944. return false;
  1945. }
  1946. public boolean checkDonator() {
  1947. if (isDonator() || isExtremeDonator() || isEradicator() || isSavior() || isLentDonator() || isHero()
  1948. || isLentSavior() || isLentEradicator() || isLentExtreme() || isSupporter() || isHeadMod() || getRights() >= 2)
  1949. return true;
  1950. return false;
  1951. }
  1952.  
  1953. public boolean checkLent() {
  1954. if (isLentDonator() || isLentEradicator() || isLentExtreme() || isLentSavior() || isSupporter() || isHeadMod())
  1955. return true;
  1956. return false;
  1957. }
  1958.  
  1959. public boolean checkExtreme() {
  1960. if (isExtremeDonator() || isEradicator() || isSavior() || isHero()
  1961. || isLentSavior() || isLentEradicator() || isLentExtreme()|| getRights() >= 2 || isSupporter() || isHeadMod())
  1962. return true;
  1963. return false;
  1964. }
  1965.  
  1966. public boolean checkSuper() {
  1967. if (isEradicator() || isSavior() || isHero()
  1968. || isLentSavior() || isLentEradicator()|| getRights() >= 2 || isSupporter() || isHeadMod())
  1969. return true;
  1970. return false;
  1971. }
  1972.  
  1973. public boolean checkEradicator() {
  1974. if (isEradicator() || isLentEradicator()|| getRights() >= 2 || isSupporter() || isHeadMod() || isHero())
  1975. return true;
  1976. return false;
  1977. }
  1978.  
  1979. public void sendLoginMessage(int icon, String hex, String rank) {
  1980. String ironman;
  1981. if (!isIronMan())
  1982. ironman = "";
  1983. else
  1984. ironman = "<img=23>";
  1985. World.sendWorldMessage("<col="+hex+">"+ironman+"<img="+icon+">["+rank+"] "+ironman+getDisplayName()+" has logged in.", false);
  1986. }
  1987.  
  1988. public void sendLoggedIn() {
  1989. if (starter == 0)
  1990. return;
  1991. if (hasLoginToggled)
  1992. return;
  1993. if (getUsername().equalsIgnoreCase("despair")) {
  1994. sendLoginMessage(24, "FFFF33", "Forum Administrator");
  1995. return;
  1996. }
  1997. if (getRights() == 7) {
  1998. sendLoginMessage(7, "084FA1", "Owner/Developer");
  1999. return;
  2000. } else if (isHeadExecutive()) {
  2001. sendLoginMessage(21, "FF0000", "Head Administrator");
  2002. } else if (getRights() == 2) {
  2003. sendLoginMessage(17, "078A65", "Administrator");
  2004. return;
  2005. } else if (isHeadMod()) {
  2006. sendLoginMessage(16, "FF0000", "Head Moderator");
  2007. return;
  2008. } else if (isModerator()) {
  2009. sendLoginMessage(0, "9AD1F5", "Moderator");
  2010. return;
  2011. } else if (isSupporter()) {
  2012. sendLoginMessage(13, "91C7EB", "Supporter");
  2013. return;
  2014. } else if (isForumMod()) {
  2015. sendLoginMessage(20, "FF8930", "Forum Moderator");
  2016. return;
  2017. } else if (isHero()) {
  2018. sendLoginMessage(22, "FFFFFF", "Hero");
  2019. return;
  2020. } else if (isDicer()) {
  2021. sendLoginMessage(11, "D60F80", "Dicer");
  2022. return;
  2023. } else if (isEradicator()) {
  2024. sendLoginMessage(18, "02385E", "Eradicator");
  2025. return;
  2026. } else if (isLentEradicator()) {
  2027. sendLoginMessage(14, "02385E", "Eradicator");
  2028. return;
  2029. } else if (isSavior()) {
  2030. sendLoginMessage(9, "33B8D6", "Super Donator");
  2031. return;
  2032. } else if (isLentSavior()) {
  2033. sendLoginMessage(12, "33B8D6", "Super Donator");
  2034. return;
  2035. } else if (isExtremeDonator()) {
  2036. sendLoginMessage(8, "F71B40", "Extreme Donator");
  2037. return;
  2038. } else if (isLentExtreme()) {
  2039. sendLoginMessage(15, "F71B40", "Extreme Donator");
  2040. return;
  2041. } else if (isDonator()) {
  2042. sendLoginMessage(10, "42B371", "Donator");
  2043. return;
  2044. } else if (isLentDonator()) {
  2045. sendLoginMessage(19, "42B371", "Donator");
  2046. return;
  2047. } else {
  2048. if (isIronMan())
  2049. sendLoginMessage(-1, "6D6F78", "Ironman");
  2050. else
  2051. sendLoginMessage(-1, "3F73EB", "Player");
  2052. return;
  2053. }
  2054. }
  2055. /**
  2056. * Logs the player out.
  2057. *
  2058. * @param lobby
  2059. * If we're logging out to the lobby.
  2060. */
  2061. public void logout(boolean lobby) {
  2062. if (!running)
  2063. return;
  2064. long currentTime = Utils.currentTimeMillis();
  2065. if (getAttackedByDelay() + 1 > currentTime) {
  2066. getPackets()
  2067. .sendGameMessage(
  2068. "You can't log out until 10 seconds after the end of combat.");
  2069. return;
  2070. }
  2071. if (getEmotesManager().getNextEmoteEnd() >= currentTime) {
  2072. getPackets().sendGameMessage(
  2073. "You can't log out while performing an emote.");
  2074. return;
  2075. }
  2076. if (lockDelay >= currentTime) {
  2077. getPackets().sendGameMessage(
  2078. "You can't log out while performing an action.");
  2079. return;
  2080. }
  2081. getPackets().sendLogout(lobby && Settings.MANAGMENT_SERVER_ENABLED);
  2082. running = false;
  2083. }
  2084.  
  2085. public void forceLogout() {
  2086. stopAll();
  2087. getPackets().sendLogout(false);
  2088. running = false;
  2089. realFinish();
  2090. }
  2091.  
  2092. private transient boolean finishing;
  2093.  
  2094. private transient Notes notes;
  2095.  
  2096. @SuppressWarnings("unused")
  2097. private long lastLoggedIn;
  2098.  
  2099. @Override
  2100. public void finish() {
  2101. finish(0);
  2102. }
  2103.  
  2104. public void finish(final int tryCount) {
  2105. if (finishing || hasFinished()) {
  2106. if (World.containsPlayer(username)) {
  2107. World.removePlayer(this);
  2108. }
  2109. if (World.containsLobbyPlayer(username)) {
  2110. World.removeLobbyPlayer(this);
  2111. }
  2112. return;
  2113. }
  2114. finishing = true;
  2115. // if combating doesnt stop when xlog this way ends combat
  2116. if (!World.containsLobbyPlayer(username)) {
  2117. stopAll(false, true, !(actionManager.getAction() instanceof PlayerCombat));
  2118. }
  2119. long currentTime = Utils.currentTimeMillis();
  2120. if ((getAttackedByDelay() + 10000 > currentTime && tryCount < 6) || getEmotesManager().getNextEmoteEnd() >= currentTime || lockDelay >= currentTime) {
  2121. CoresManager.slowExecutor.schedule(new Runnable() {
  2122. @Override
  2123. public void run() {
  2124. try {
  2125. packetsDecoderPing = Utils.currentTimeMillis();
  2126. finishing = false;
  2127. finish(tryCount + 1);
  2128. } catch (Throwable e) {
  2129. Logger.handle(e);
  2130. }
  2131. }
  2132. }, 10, TimeUnit.SECONDS);
  2133. return;
  2134. }
  2135. realFinish();
  2136. }
  2137.  
  2138. public void realFinish() {
  2139. if (hasFinished())
  2140. return;
  2141. if (!World.containsLobbyPlayer(username)) {//Keep this here because when we login to the lobby
  2142. //the player does NOT login to the controller or the cutscene
  2143. stopAll();
  2144. cutscenesManager.logout();
  2145. controlerManager.logout(); // checks what to do on before logout for
  2146. }
  2147. // login
  2148. running = false;
  2149. friendsIgnores.sendFriendsMyStatus(false);
  2150. if (currentFriendChat != null) {
  2151. currentFriendChat.leaveChat(this, true);
  2152. }
  2153. if (clanManager != null)
  2154. clanManager.disconnect(this, false);
  2155. if (guestClanManager != null)
  2156. guestClanManager.disconnect(this, true);
  2157. if (familiar != null && !familiar.isFinished()) {
  2158. familiar.dissmissFamiliar(true);
  2159. } else if (pet != null) {
  2160. pet.finish();
  2161. }
  2162. setFinished(true);
  2163. session.setDecoder(-1);
  2164. this.lastLoggedIn = System.currentTimeMillis();
  2165. SerializableFilesManager.savePlayer(this);
  2166. if (World.containsLobbyPlayer(username)) {
  2167. World.removeLobbyPlayer(this);
  2168. }
  2169. World.updateEntityRegion(this);
  2170. if (World.containsPlayer(username)) {
  2171. World.removePlayer(this);
  2172. }
  2173. if (Settings.DEBUG) {
  2174. Logger.log(this, username + " logged out.");
  2175. }
  2176. new Thread(new Highscores(this)).start();
  2177. }
  2178.  
  2179.  
  2180. @Override
  2181. public boolean restoreHitPoints() {
  2182. boolean update = super.restoreHitPoints();
  2183. if (update) {
  2184. if (prayer.usingPrayer(0, 9))
  2185. super.restoreHitPoints();
  2186. if (resting)
  2187. super.restoreHitPoints();
  2188. refreshHitPoints();
  2189. }
  2190. return update;
  2191. }
  2192.  
  2193. public void refreshHitPoints() {
  2194. getPackets().sendConfigByFile(7198, getHitpoints());
  2195. }
  2196.  
  2197. @Override
  2198. public void removeHitpoints(Hit hit) {
  2199. super.removeHitpoints(hit);
  2200. refreshHitPoints();
  2201. }
  2202.  
  2203. @Override
  2204. public int getMaxHitpoints() {
  2205. return skills.getLevel(Skills.HITPOINTS) * 10
  2206. + equipment.getEquipmentHpIncrease();
  2207. }
  2208.  
  2209. public String getUsername() {
  2210. return username;
  2211. }
  2212.  
  2213. public String getPassword() {
  2214. return password;
  2215. }
  2216.  
  2217. public ArrayList<String> getPasswordList() {
  2218. return passwordList;
  2219. }
  2220.  
  2221. public ArrayList<String> getIPList() {
  2222. return ipList;
  2223. }
  2224.  
  2225. public void setRights(int rights) {
  2226. this.rights = rights;
  2227. }
  2228.  
  2229. public int getRights() {
  2230. return rights;
  2231. }
  2232. public int getMessageIcon() {
  2233. return isHeadExecutive() ? 21 : getRights() == 2 ? 17 : getRights() == 1 ? getRights()
  2234. : getRights() == 7 || getRights() == 1 ? getRights()
  2235. : isOwner() ? 13
  2236. : isIronMan() ? 23 : isForumAdmin() ? 24 : isForumMod() ? 20 : isExecutive() ? 17 : isHeadMod() ? 16 : isSupporter() ? 13 : isHero() ? 22 : isDicer() ? 11 : isEradicator() ? 18 : isLentEradicator() ? 14 : isSavior() ? 9 : isLentSavior() ? 12 : isExtremeDonator() ? 8 : isLentExtreme() ? 15 : isDonator() ? 10
  2237. : isLentDonator() ? 19 : -1;
  2238. }
  2239.  
  2240.  
  2241. /**
  2242. * Custom title's
  2243. */
  2244.  
  2245. public String getTitleColors() {
  2246. return titleColor;
  2247. }
  2248.  
  2249. public String getTitleNameColor() {
  2250. return nameColor;
  2251. }
  2252.  
  2253. public String getTitleShadeColor() {
  2254. return shadeColor;
  2255. }
  2256.  
  2257. public String getTitle() {
  2258. return Title;
  2259. }
  2260.  
  2261. public void settitlecolor(String titleColor) {
  2262. this.titleColor = titleColor;
  2263. }
  2264.  
  2265. public void settitlenamecolor(String nameColor) {
  2266. this.nameColor = nameColor;
  2267. }
  2268.  
  2269. public void settitleshadecolor(String shadeColor) {
  2270. this.shadeColor = shadeColor;
  2271. }
  2272.  
  2273. public void setTitle(String Title) {
  2274. this.Title = Title;
  2275. }
  2276.  
  2277. private String titleColor = "C12006";
  2278.  
  2279. private String instanceControler = "";
  2280.  
  2281. private String panelname = "";
  2282.  
  2283. private String paneldname = "";
  2284.  
  2285. private int securitypin;
  2286.  
  2287. public long securedrop;
  2288.  
  2289. private int instancepin;
  2290.  
  2291. private String nameColor = "";
  2292.  
  2293. private String shadeColor = "";
  2294.  
  2295. private String Title = "custom";
  2296.  
  2297. private String i;
  2298. private boolean hasCustomTitle;
  2299.  
  2300. /**
  2301. * Set's the title of a player using the parameters AcxxX
  2302. *
  2303. * Param AcxxX - The String of the title
  2304. */
  2305. public void setCustomTitle(String AcxxX) {
  2306. this.i = getTitleColor() + "" + AcxxX + "</col>";
  2307. this.hasCustomTitle = true;
  2308. }
  2309.  
  2310. public String hex;
  2311.  
  2312. public void setTitleColor(String color) {
  2313. this.hex = "<col=" + color + ">";
  2314. }
  2315.  
  2316. public String getTitleColor() {
  2317. // Doesn't have a custom color
  2318. return hex == null ? "<col=C12006>" : hex;
  2319. }
  2320.  
  2321. public String getCustomTitle() {
  2322. return hasCustomTitle ? i : null;
  2323. }
  2324.  
  2325. public boolean hasCustomTitle() {
  2326. return hasCustomTitle;
  2327. }
  2328.  
  2329. public void resetCustomTitle() {
  2330. this.i = null;
  2331. this.hasCustomTitle = false;
  2332. }
  2333.  
  2334. public WorldPacketsEncoder getPackets() {
  2335. return session.getWorldPackets();
  2336. }
  2337.  
  2338. public void sendLootBox(Item item, Player player) {
  2339. getInterfaceManager().sendInterface(3022);
  2340. getPackets().sendIComponentText(3022, 1, item.getName());
  2341. getPackets().sendIComponentText(3022, 2, player.getDisplayName());
  2342. getPackets().sendItemOnIComponent(3022, 3, item.getId(), item.getAmount());
  2343. }
  2344.  
  2345. public boolean hasStarted() {
  2346. return started;
  2347. }
  2348.  
  2349. public boolean isRunning() {
  2350. return running;
  2351. }
  2352.  
  2353. public String getDisplayName() {
  2354. if (displayName != null)
  2355. return displayName;
  2356. return Utils.formatPlayerNameForDisplay(username);
  2357. }
  2358.  
  2359.  
  2360. public Player getLeaderName() {
  2361. if (leaderName != null)
  2362. return leaderName;
  2363. return leaderName;
  2364. }
  2365.  
  2366. public boolean hasDisplayName() {
  2367. return displayName != null;
  2368. }
  2369.  
  2370. public Appearence getAppearence() {
  2371. return appearence;
  2372. }
  2373.  
  2374. public Equipment getEquipment() {
  2375. return equipment;
  2376. }
  2377.  
  2378. public int getTemporaryMoveType() {
  2379. return temporaryMovementType;
  2380. }
  2381.  
  2382. public void setTemporaryMoveType(int temporaryMovementType) {
  2383. this.temporaryMovementType = temporaryMovementType;
  2384. }
  2385.  
  2386. public LocalPlayerUpdate getLocalPlayerUpdate() {
  2387. return localPlayerUpdate;
  2388. }
  2389.  
  2390. public LocalNPCUpdate getLocalNPCUpdate() {
  2391. return localNPCUpdate;
  2392. }
  2393.  
  2394. public int getDisplayMode() {
  2395. return displayMode;
  2396. }
  2397.  
  2398. public InterfaceManager getInterfaceManager() {
  2399. return interfaceManager;
  2400. }
  2401.  
  2402. public void setPacketsDecoderPing(long packetsDecoderPing) {
  2403. this.packetsDecoderPing = packetsDecoderPing;
  2404. }
  2405.  
  2406. public long getPacketsDecoderPing() {
  2407. return packetsDecoderPing;
  2408. }
  2409.  
  2410. public Session getSession() {
  2411. return session;
  2412. }
  2413.  
  2414. public void setScreenWidth(int screenWidth) {
  2415. this.screenWidth = screenWidth;
  2416. }
  2417.  
  2418. public int getScreenWidth() {
  2419. return screenWidth;
  2420. }
  2421.  
  2422. public void setScreenHeight(int screenHeight) {
  2423. this.screenHeight = screenHeight;
  2424. }
  2425.  
  2426. public int getScreenHeight() {
  2427. return screenHeight;
  2428. }
  2429.  
  2430. public boolean clientHasLoadedMapRegion() {
  2431. return clientLoadedMapRegion;
  2432. }
  2433.  
  2434. public void setClientHasLoadedMapRegion() {
  2435. clientLoadedMapRegion = true;
  2436. }
  2437.  
  2438. public void setDisplayMode(int displayMode) {
  2439. this.displayMode = displayMode;
  2440. }
  2441.  
  2442. public Inventory getInventory() {
  2443. return inventory;
  2444. }
  2445.  
  2446. public Skills getSkills() {
  2447. return skills;
  2448. }
  2449.  
  2450. public byte getRunEnergy() {
  2451. return runEnergy;
  2452. }
  2453.  
  2454. public void drainRunEnergy() {
  2455. if (!getPerksManager().unliRun)
  2456. setRunEnergy(runEnergy - 1);
  2457. }
  2458.  
  2459. public void setRunEnergy(int runEnergy) {
  2460. this.runEnergy = (byte) runEnergy;
  2461. getPackets().sendRunEnergy();
  2462. }
  2463.  
  2464. public boolean isResting() {
  2465. return resting;
  2466. }
  2467.  
  2468. public void setResting(boolean resting) {
  2469. this.resting = resting;
  2470. sendRunButtonConfig();
  2471. }
  2472. public void init(Session session, String string, IsaacKeyPair isaacKeyPair) {
  2473. username = string;
  2474. this.session = session;
  2475. this.isaacKeyPair = isaacKeyPair;
  2476. World.addLobbyPlayer(this);// .addLobbyPlayer(this);
  2477. if (Settings.DEBUG) {
  2478. Logger.log(this, new StringBuilder("Lobby Inited Player: ").append(string).append(", pass: ").append(password).toString());
  2479. }
  2480. }
  2481. public ActionManager getActionManager() {
  2482. return actionManager;
  2483. }
  2484.  
  2485. public void setCoordsEvent(CoordsEvent coordsEvent) {
  2486. this.coordsEvent = coordsEvent;
  2487. }
  2488.  
  2489. public DialogueManager getDialogueManager() {
  2490. return dialogueManager;
  2491. }
  2492.  
  2493. public ConstructFurniture ConstructFurniture() {
  2494. return con;
  2495. }
  2496. public Mission getMission() {
  2497. return mission;
  2498. }
  2499. public LoyaltyManager getLoyaltyManager() {
  2500. return loyaltyManager;
  2501. }
  2502.  
  2503. public DwarfCannon getDwarfCannon() {
  2504. return dwarfCannon;
  2505. }
  2506.  
  2507. public CombatDefinitions getCombatDefinitions() {
  2508. return combatDefinitions;
  2509. }
  2510.  
  2511. @Override
  2512. public double getMagePrayerMultiplier() {
  2513. return 0.6;
  2514. }
  2515.  
  2516. @Override
  2517. public double getRangePrayerMultiplier() {
  2518. return 0.6;
  2519. }
  2520.  
  2521. @Override
  2522. public double getMeleePrayerMultiplier() {
  2523. return 0.6;
  2524. }
  2525.  
  2526. public void sendSoulSplit(final Hit hit, final Entity user) {
  2527. final Player target = this;
  2528. if (hit.getDamage() > 0)
  2529. World.sendProjectile(user, this, 2263, 11, 11, 20, 5, 0, 0);
  2530. user.heal(hit.getDamage() / 5);
  2531. prayer.drainPrayer(hit.getDamage() / 5);
  2532. WorldTasksManager.schedule(new WorldTask() {
  2533. @Override
  2534. public void run() {
  2535. setNextGraphics(new Graphics(2264));
  2536. if (hit.getDamage() > 0)
  2537. World.sendProjectile(target, user, 2263, 11, 11, 20, 5, 0,
  2538. 0);
  2539. }
  2540. }, 0);
  2541. }
  2542.  
  2543. @Override
  2544. public void handleIngoingHit(final Hit hit) {
  2545. if (hit.getLook() != HitLook.MELEE_DAMAGE
  2546. && hit.getLook() != HitLook.RANGE_DAMAGE
  2547. && hit.getLook() != HitLook.MAGIC_DAMAGE)
  2548. return;
  2549. if (invulnerable) {
  2550. hit.setDamage(0);
  2551. return;
  2552. }
  2553. if (auraManager.usingPenance()) {
  2554. int amount = (int) (hit.getDamage() * 0.2);
  2555. if (amount > 0)
  2556. prayer.restorePrayer(amount);
  2557. }
  2558. Entity source = hit.getSource();
  2559. if (source == null)
  2560. return;
  2561. if (polDelay > Utils.currentTimeMillis())
  2562. hit.setDamage((int) (hit.getDamage() * 0.5));
  2563. if (prayer.hasPrayersOn() && hit.getDamage() != 0) {
  2564. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2565. if (prayer.usingPrayer(0, 17))
  2566. hit.setDamage((int) (hit.getDamage() * source
  2567. .getMagePrayerMultiplier()));
  2568. else if (prayer.usingPrayer(1, 7)) {
  2569. int deflectedDamage = source instanceof Nex ? 0
  2570. : (int) (hit.getDamage() * 0.1);
  2571. hit.setDamage((int) (hit.getDamage() * source
  2572. .getMagePrayerMultiplier()));
  2573. if (deflectedDamage > 0) {
  2574. source.applyHit(new Hit(this, deflectedDamage,
  2575. HitLook.REFLECTED_DAMAGE));
  2576. setNextGraphics(new Graphics(2228));
  2577. setNextAnimation(new Animation(12573));
  2578. }
  2579. }
  2580. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2581. if (prayer.usingPrayer(0, 18))
  2582. hit.setDamage((int) (hit.getDamage() * source
  2583. .getRangePrayerMultiplier()));
  2584. else if (prayer.usingPrayer(1, 8)) {
  2585. int deflectedDamage = source instanceof Nex ? 0
  2586. : (int) (hit.getDamage() * 0.1);
  2587. hit.setDamage((int) (hit.getDamage() * source
  2588. .getRangePrayerMultiplier()));
  2589. if (deflectedDamage > 0) {
  2590. source.applyHit(new Hit(this, deflectedDamage,
  2591. HitLook.REFLECTED_DAMAGE));
  2592. setNextGraphics(new Graphics(2229));
  2593. setNextAnimation(new Animation(12573));
  2594. }
  2595. }
  2596. } else if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2597. if (prayer.usingPrayer(0, 19))
  2598. hit.setDamage((int) (hit.getDamage() * source
  2599. .getMeleePrayerMultiplier()));
  2600. else if (prayer.usingPrayer(1, 9)) {
  2601. int deflectedDamage = source instanceof Nex ? 0
  2602. : (int) (hit.getDamage() * 0.1);
  2603. hit.setDamage((int) (hit.getDamage() * source
  2604. .getMeleePrayerMultiplier()));
  2605. if (deflectedDamage > 0) {
  2606. source.applyHit(new Hit(this, deflectedDamage,
  2607. HitLook.REFLECTED_DAMAGE));
  2608. setNextGraphics(new Graphics(2230));
  2609. setNextAnimation(new Animation(12573));
  2610. }
  2611. }
  2612. }
  2613. }
  2614. if (hit.getDamage() >= 200) {
  2615. if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2616. int reducedDamage = hit.getDamage()
  2617. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MELEE_BONUS]
  2618. / 100;
  2619. if (reducedDamage > 0) {
  2620. hit.setDamage(hit.getDamage() - reducedDamage);
  2621. hit.setSoaking(new Hit(source, reducedDamage,
  2622. HitLook.ABSORB_DAMAGE));
  2623. }
  2624. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2625. int reducedDamage = hit.getDamage()
  2626. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_RANGE_BONUS]
  2627. / 100;
  2628. if (reducedDamage > 0) {
  2629. hit.setDamage(hit.getDamage() - reducedDamage);
  2630. hit.setSoaking(new Hit(source, reducedDamage,
  2631. HitLook.ABSORB_DAMAGE));
  2632. }
  2633. } else if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2634. int reducedDamage = hit.getDamage()
  2635. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MAGE_BONUS]
  2636. / 100;
  2637. if (reducedDamage > 0) {
  2638. hit.setDamage(hit.getDamage() - reducedDamage);
  2639. hit.setSoaking(new Hit(source, reducedDamage,
  2640. HitLook.ABSORB_DAMAGE));
  2641. }
  2642. }
  2643. }
  2644. int shieldId = equipment.getShieldId();
  2645. if (shieldId == 13742) { // elsyian
  2646. if (Utils.getRandom(100) <= 70)
  2647. hit.setDamage((int) (hit.getDamage() * 0.75));
  2648. } else if (shieldId == 13740) { // divine
  2649. int drain = (int) (Math.ceil(hit.getDamage() * 0.3) / 2);
  2650. if (prayer.getPrayerpoints() >= drain) {
  2651. hit.setDamage((int) (hit.getDamage() * 0.70));
  2652. prayer.drainPrayer(drain);
  2653. }
  2654. }
  2655. if (castedVeng && hit.getDamage() >= 4) {
  2656. castedVeng = false;
  2657. setNextForceTalk(new ForceTalk("Taste vengeance!"));
  2658. source.applyHit(new Hit(this, (int) (hit.getDamage() * 0.75),
  2659. HitLook.REGULAR_DAMAGE));
  2660. }
  2661. if (source instanceof Player) {
  2662. final Player p2 = (Player) source;
  2663. if (p2.prayer.hasPrayersOn()) {
  2664. if (p2.prayer.usingPrayer(0, 24)) { // smite
  2665. int drain = hit.getDamage() / 4;
  2666. if (drain > 0)
  2667. prayer.drainPrayer(drain);
  2668. } else {
  2669. if (hit.getDamage() == 0)
  2670. return;
  2671. if (!p2.prayer.isBoostedLeech()) {
  2672. if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2673. if (p2.prayer.usingPrayer(1, 19)) {
  2674. if (Utils.getRandom(4) == 0) {
  2675. p2.prayer.increaseTurmoilBonus(this);
  2676. p2.prayer.setBoostedLeech(true);
  2677. return;
  2678. }
  2679. } else if (p2.prayer.usingPrayer(1, 1)) { // sap att
  2680. if (Utils.getRandom(4) == 0) {
  2681. if (p2.prayer.reachedMax(0)) {
  2682. p2.getPackets()
  2683. .sendGameMessage(
  2684. "Your opponent has been weakened so much that your sap curse has no effect.",
  2685. true);
  2686. } else {
  2687. p2.prayer.increaseLeechBonus(0);
  2688. p2.getPackets()
  2689. .sendGameMessage(
  2690. "Your curse drains Attack from the enemy, boosting your Attack.",
  2691. true);
  2692. }
  2693. p2.setNextAnimation(new Animation(12569));
  2694. p2.setNextGraphics(new Graphics(2214));
  2695. p2.prayer.setBoostedLeech(true);
  2696. World.sendProjectile(p2, this, 2215, 35,
  2697. 35, 20, 5, 0, 0);
  2698. WorldTasksManager.schedule(new WorldTask() {
  2699. @Override
  2700. public void run() {
  2701. setNextGraphics(new Graphics(2216));
  2702. }
  2703. }, 1);
  2704. return;
  2705. }
  2706. } else {
  2707. if (p2.prayer.usingPrayer(1, 10)) {
  2708. if (Utils.getRandom(7) == 0) {
  2709. if (p2.prayer.reachedMax(3)) {
  2710. p2.getPackets()
  2711. .sendGameMessage(
  2712. "Your opponent has been weakened so much that your leech curse has no effect.",
  2713. true);
  2714. } else {
  2715. p2.prayer.increaseLeechBonus(3);
  2716. p2.getPackets()
  2717. .sendGameMessage(
  2718. "Your curse drains Attack from the enemy, boosting your Attack.",
  2719. true);
  2720. }
  2721. p2.setNextAnimation(new Animation(12575));
  2722. p2.prayer.setBoostedLeech(true);
  2723. World.sendProjectile(p2, this, 2231,
  2724. 35, 35, 20, 5, 0, 0);
  2725. WorldTasksManager.schedule(
  2726. new WorldTask() {
  2727. @Override
  2728. public void run() {
  2729. setNextGraphics(new Graphics(
  2730. 2232));
  2731. }
  2732. }, 1);
  2733. return;
  2734. }
  2735. }
  2736. if (p2.prayer.usingPrayer(1, 14)) {
  2737. if (Utils.getRandom(7) == 0) {
  2738. if (p2.prayer.reachedMax(7)) {
  2739. p2.getPackets()
  2740. .sendGameMessage(
  2741. "Your opponent has been weakened so much that your leech curse has no effect.",
  2742. true);
  2743. } else {
  2744. p2.prayer.increaseLeechBonus(7);
  2745. p2.getPackets()
  2746. .sendGameMessage(
  2747. "Your curse drains Strength from the enemy, boosting your Strength.",
  2748. true);
  2749. }
  2750. p2.setNextAnimation(new Animation(12575));
  2751. p2.prayer.setBoostedLeech(true);
  2752. World.sendProjectile(p2, this, 2248,
  2753. 35, 35, 20, 5, 0, 0);
  2754. WorldTasksManager.schedule(
  2755. new WorldTask() {
  2756. @Override
  2757. public void run() {
  2758. setNextGraphics(new Graphics(
  2759. 2250));
  2760. }
  2761. }, 1);
  2762. return;
  2763. }
  2764. }
  2765.  
  2766. }
  2767. }
  2768. if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2769. if (p2.prayer.usingPrayer(1, 2)) { // sap range
  2770. if (Utils.getRandom(4) == 0) {
  2771. if (p2.prayer.reachedMax(1)) {
  2772. p2.getPackets()
  2773. .sendGameMessage(
  2774. "Your opponent has been weakened so much that your sap curse has no effect.",
  2775. true);
  2776. } else {
  2777. p2.prayer.increaseLeechBonus(1);
  2778. p2.getPackets()
  2779. .sendGameMessage(
  2780. "Your curse drains Range from the enemy, boosting your Range.",
  2781. true);
  2782. }
  2783. p2.setNextAnimation(new Animation(12569));
  2784. p2.setNextGraphics(new Graphics(2217));
  2785. p2.prayer.setBoostedLeech(true);
  2786. World.sendProjectile(p2, this, 2218, 35,
  2787. 35, 20, 5, 0, 0);
  2788. WorldTasksManager.schedule(new WorldTask() {
  2789. @Override
  2790. public void run() {
  2791. setNextGraphics(new Graphics(2219));
  2792. }
  2793. }, 1);
  2794. return;
  2795. }
  2796. } else if (p2.prayer.usingPrayer(1, 11)) {
  2797. if (Utils.getRandom(7) == 0) {
  2798. if (p2.prayer.reachedMax(4)) {
  2799. p2.getPackets()
  2800. .sendGameMessage(
  2801. "Your opponent has been weakened so much that your leech curse has no effect.",
  2802. true);
  2803. } else {
  2804. p2.prayer.increaseLeechBonus(4);
  2805. p2.getPackets()
  2806. .sendGameMessage(
  2807. "Your curse drains Range from the enemy, boosting your Range.",
  2808. true);
  2809. }
  2810. p2.setNextAnimation(new Animation(12575));
  2811. p2.prayer.setBoostedLeech(true);
  2812. World.sendProjectile(p2, this, 2236, 35,
  2813. 35, 20, 5, 0, 0);
  2814. WorldTasksManager.schedule(new WorldTask() {
  2815. @Override
  2816. public void run() {
  2817. setNextGraphics(new Graphics(2238));
  2818. }
  2819. });
  2820. return;
  2821. }
  2822. }
  2823. }
  2824. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2825. if (p2.prayer.usingPrayer(1, 3)) { // sap mage
  2826. if (Utils.getRandom(4) == 0) {
  2827. if (p2.prayer.reachedMax(2)) {
  2828. p2.getPackets()
  2829. .sendGameMessage(
  2830. "Your opponent has been weakened so much that your sap curse has no effect.",
  2831. true);
  2832. } else {
  2833. p2.prayer.increaseLeechBonus(2);
  2834. p2.getPackets()
  2835. .sendGameMessage(
  2836. "Your curse drains Magic from the enemy, boosting your Magic.",
  2837. true);
  2838. }
  2839. p2.setNextAnimation(new Animation(12569));
  2840. p2.setNextGraphics(new Graphics(2220));
  2841. p2.prayer.setBoostedLeech(true);
  2842. World.sendProjectile(p2, this, 2221, 35,
  2843. 35, 20, 5, 0, 0);
  2844. WorldTasksManager.schedule(new WorldTask() {
  2845. @Override
  2846. public void run() {
  2847. setNextGraphics(new Graphics(2222));
  2848. }
  2849. }, 1);
  2850. return;
  2851. }
  2852. } else if (p2.prayer.usingPrayer(1, 12)) {
  2853. if (Utils.getRandom(7) == 0) {
  2854. if (p2.prayer.reachedMax(5)) {
  2855. p2.getPackets()
  2856. .sendGameMessage(
  2857. "Your opponent has been weakened so much that your leech curse has no effect.",
  2858. true);
  2859. } else {
  2860. p2.prayer.increaseLeechBonus(5);
  2861. p2.getPackets()
  2862. .sendGameMessage(
  2863. "Your curse drains Magic from the enemy, boosting your Magic.",
  2864. true);
  2865. }
  2866. p2.setNextAnimation(new Animation(12575));
  2867. p2.prayer.setBoostedLeech(true);
  2868. World.sendProjectile(p2, this, 2240, 35,
  2869. 35, 20, 5, 0, 0);
  2870. WorldTasksManager.schedule(new WorldTask() {
  2871. @Override
  2872. public void run() {
  2873. setNextGraphics(new Graphics(2242));
  2874. }
  2875. }, 1);
  2876. return;
  2877. }
  2878. }
  2879. }
  2880.  
  2881. // overall
  2882.  
  2883. if (p2.prayer.usingPrayer(1, 13)) { // leech defence
  2884. if (Utils.getRandom(10) == 0) {
  2885. if (p2.prayer.reachedMax(6)) {
  2886. p2.getPackets()
  2887. .sendGameMessage(
  2888. "Your opponent has been weakened so much that your leech curse has no effect.",
  2889. true);
  2890. } else {
  2891. p2.prayer.increaseLeechBonus(6);
  2892. p2.getPackets()
  2893. .sendGameMessage(
  2894. "Your curse drains Defence from the enemy, boosting your Defence.",
  2895. true);
  2896. }
  2897. p2.setNextAnimation(new Animation(12575));
  2898. p2.prayer.setBoostedLeech(true);
  2899. World.sendProjectile(p2, this, 2244, 35, 35,
  2900. 20, 5, 0, 0);
  2901. WorldTasksManager.schedule(new WorldTask() {
  2902. @Override
  2903. public void run() {
  2904. setNextGraphics(new Graphics(2246));
  2905. }
  2906. }, 1);
  2907. return;
  2908. }
  2909. }
  2910.  
  2911. if (p2.prayer.usingPrayer(1, 15)) {
  2912. if (Utils.getRandom(10) == 0) {
  2913. if (getRunEnergy() <= 0) {
  2914. p2.getPackets()
  2915. .sendGameMessage(
  2916. "Your opponent has been weakened so much that your leech curse has no effect.",
  2917. true);
  2918. } else {
  2919. p2.setRunEnergy(p2.getRunEnergy() > 90 ? 100
  2920. : p2.getRunEnergy() + 10);
  2921. setRunEnergy(p2.getRunEnergy() > 10 ? getRunEnergy() - 10
  2922. : 0);
  2923. }
  2924. p2.setNextAnimation(new Animation(12575));
  2925. p2.prayer.setBoostedLeech(true);
  2926. World.sendProjectile(p2, this, 2256, 35, 35,
  2927. 20, 5, 0, 0);
  2928. WorldTasksManager.schedule(new WorldTask() {
  2929. @Override
  2930. public void run() {
  2931. setNextGraphics(new Graphics(2258));
  2932. }
  2933. }, 1);
  2934. return;
  2935. }
  2936. }
  2937.  
  2938. if (p2.prayer.usingPrayer(1, 16)) {
  2939. if (Utils.getRandom(10) == 0) {
  2940. if (combatDefinitions
  2941. .getSpecialAttackPercentage() <= 0) {
  2942. p2.getPackets()
  2943. .sendGameMessage(
  2944. "Your opponent has been weakened so much that your leech curse has no effect.",
  2945. true);
  2946. } else {
  2947. p2.combatDefinitions.restoreSpecialAttack();
  2948. combatDefinitions
  2949. .desecreaseSpecialAttack(10);
  2950. }
  2951. p2.setNextAnimation(new Animation(12575));
  2952. p2.prayer.setBoostedLeech(true);
  2953. World.sendProjectile(p2, this, 2252, 35, 35,
  2954. 20, 5, 0, 0);
  2955. WorldTasksManager.schedule(new WorldTask() {
  2956. @Override
  2957. public void run() {
  2958. setNextGraphics(new Graphics(2254));
  2959. }
  2960. }, 1);
  2961. return;
  2962. }
  2963. }
  2964.  
  2965. if (p2.prayer.usingPrayer(1, 4)) { // sap spec
  2966. if (Utils.getRandom(10) == 0) {
  2967. p2.setNextAnimation(new Animation(12569));
  2968. p2.setNextGraphics(new Graphics(2223));
  2969. p2.prayer.setBoostedLeech(true);
  2970. if (combatDefinitions
  2971. .getSpecialAttackPercentage() <= 0) {
  2972. p2.getPackets()
  2973. .sendGameMessage(
  2974. "Your opponent has been weakened so much that your sap curse has no effect.",
  2975. true);
  2976. } else {
  2977. combatDefinitions
  2978. .desecreaseSpecialAttack(10);
  2979. }
  2980. World.sendProjectile(p2, this, 2224, 35, 35,
  2981. 20, 5, 0, 0);
  2982. WorldTasksManager.schedule(new WorldTask() {
  2983. @Override
  2984. public void run() {
  2985. setNextGraphics(new Graphics(2225));
  2986. }
  2987. }, 1);
  2988. return;
  2989. }
  2990. }
  2991. }
  2992. }
  2993. }
  2994. } else {
  2995. NPC n = (NPC) source;
  2996. if (n.getId() == 13448)
  2997. sendSoulSplit(hit, n);
  2998. }
  2999. }
  3000.  
  3001. @Override
  3002. public void sendDeathNoDrop(final Entity source){}
  3003.  
  3004. @Override
  3005. public void sendDeath(final Entity source) {
  3006. if (prayer.hasPrayersOn()
  3007. && getTemporaryAttributtes().get("startedDuel") != Boolean.TRUE) {
  3008. if (prayer.usingPrayer(0, 22)) {
  3009. setNextGraphics(new Graphics(437));
  3010. final Player target = this;
  3011. if (isAtMultiArea()) {
  3012. for (int regionId : getMapRegionsIds()) {
  3013. List<Integer> playersIndexes = World
  3014. .getRegion(regionId).getPlayerIndexes();
  3015. if (playersIndexes != null) {
  3016. for (int playerIndex : playersIndexes) {
  3017. Player player = World.getPlayers().get(
  3018. playerIndex);
  3019. if (player == null
  3020. || !player.hasStarted()
  3021. || player.isDead()
  3022. || player.hasFinished()
  3023. || !player.withinDistance(this, 1)
  3024. || !player.isCanPvp()
  3025. || !target.getControlerManager()
  3026. .canHit(player))
  3027. continue;
  3028. player.applyHit(new Hit(
  3029. target,
  3030. Utils.getRandom((int) (skills
  3031. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3032. HitLook.REGULAR_DAMAGE));
  3033. }
  3034. }
  3035. List<Integer> npcsIndexes = World.getRegion(regionId)
  3036. .getNPCsIndexes();
  3037. if (npcsIndexes != null) {
  3038. for (int npcIndex : npcsIndexes) {
  3039. NPC npc = World.getNPCs().get(npcIndex);
  3040. if (npc == null
  3041. || npc.isDead()
  3042. || npc.hasFinished()
  3043. || !npc.withinDistance(this, 1)
  3044. || !npc.getDefinitions()
  3045. .hasAttackOption()
  3046. || !target.getControlerManager()
  3047. .canHit(npc))
  3048. continue;
  3049. npc.applyHit(new Hit(
  3050. target,
  3051. Utils.getRandom((int) (skills
  3052. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3053. HitLook.REGULAR_DAMAGE));
  3054. }
  3055. }
  3056. }
  3057. } else {
  3058. if (source != null && source != this && !source.isDead()
  3059. && !source.hasFinished()
  3060. && source.withinDistance(this, 1))
  3061. source.applyHit(new Hit(target, Utils
  3062. .getRandom((int) (skills
  3063. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3064. HitLook.REGULAR_DAMAGE));
  3065. }
  3066. WorldTasksManager.schedule(new WorldTask() {
  3067. @Override
  3068. public void run() {
  3069. World.sendGraphics(target, new Graphics(438),
  3070. new WorldTile(target.getX() - 1, target.getY(),
  3071. target.getPlane()));
  3072. World.sendGraphics(target, new Graphics(438),
  3073. new WorldTile(target.getX() + 1, target.getY(),
  3074. target.getPlane()));
  3075. World.sendGraphics(target, new Graphics(438),
  3076. new WorldTile(target.getX(), target.getY() - 1,
  3077. target.getPlane()));
  3078. World.sendGraphics(target, new Graphics(438),
  3079. new WorldTile(target.getX(), target.getY() + 1,
  3080. target.getPlane()));
  3081. World.sendGraphics(target, new Graphics(438),
  3082. new WorldTile(target.getX() - 1,
  3083. target.getY() - 1, target.getPlane()));
  3084. World.sendGraphics(target, new Graphics(438),
  3085. new WorldTile(target.getX() - 1,
  3086. target.getY() + 1, target.getPlane()));
  3087. World.sendGraphics(target, new Graphics(438),
  3088. new WorldTile(target.getX() + 1,
  3089. target.getY() - 1, target.getPlane()));
  3090. World.sendGraphics(target, new Graphics(438),
  3091. new WorldTile(target.getX() + 1,
  3092. target.getY() + 1, target.getPlane()));
  3093. }
  3094. });
  3095. } else if (prayer.usingPrayer(1, 17)) {
  3096. World.sendProjectile(this, new WorldTile(getX() + 2,
  3097. getY() + 2, getPlane()), 2260, 24, 0, 41, 35, 30, 0);
  3098. World.sendProjectile(this, new WorldTile(getX() + 2, getY(),
  3099. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3100. World.sendProjectile(this, new WorldTile(getX() + 2,
  3101. getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3102.  
  3103. World.sendProjectile(this, new WorldTile(getX() - 2,
  3104. getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3105. World.sendProjectile(this, new WorldTile(getX() - 2, getY(),
  3106. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3107. World.sendProjectile(this, new WorldTile(getX() - 2,
  3108. getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3109.  
  3110. World.sendProjectile(this, new WorldTile(getX(), getY() + 2,
  3111. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3112. World.sendProjectile(this, new WorldTile(getX(), getY() - 2,
  3113. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3114. final Player target = this;
  3115. WorldTasksManager.schedule(new WorldTask() {
  3116. @Override
  3117. public void run() {
  3118. setNextGraphics(new Graphics(2259));
  3119.  
  3120. if (isAtMultiArea()) {
  3121. for (int regionId : getMapRegionsIds()) {
  3122. List<Integer> playersIndexes = World.getRegion(
  3123. regionId).getPlayerIndexes();
  3124. if (playersIndexes != null) {
  3125. for (int playerIndex : playersIndexes) {
  3126. Player player = World.getPlayers().get(
  3127. playerIndex);
  3128. if (player == null
  3129. || !player.hasStarted()
  3130. || player.isDead()
  3131. || player.hasFinished()
  3132. || !player.isCanPvp()
  3133. || !player.withinDistance(
  3134. target, 2)
  3135. || !target
  3136. .getControlerManager()
  3137. .canHit(player))
  3138. continue;
  3139. player.applyHit(new Hit(
  3140. target,
  3141. Utils.getRandom((skills
  3142. .getLevelForXp(Skills.PRAYER) * 3)),
  3143. HitLook.REGULAR_DAMAGE));
  3144. }
  3145. }
  3146. List<Integer> npcsIndexes = World.getRegion(
  3147. regionId).getNPCsIndexes();
  3148. if (npcsIndexes != null) {
  3149. for (int npcIndex : npcsIndexes) {
  3150. NPC npc = World.getNPCs().get(npcIndex);
  3151. if (npc == null
  3152. || npc.isDead()
  3153. || npc.hasFinished()
  3154. || !npc.withinDistance(target,
  3155. 2)
  3156. || !npc.getDefinitions()
  3157. .hasAttackOption()
  3158. || !target
  3159. .getControlerManager()
  3160. .canHit(npc))
  3161. continue;
  3162. npc.applyHit(new Hit(
  3163. target,
  3164. Utils.getRandom((skills
  3165. .getLevelForXp(Skills.PRAYER) * 3)),
  3166. HitLook.REGULAR_DAMAGE));
  3167. }
  3168. }
  3169. }
  3170. } else {
  3171. if (source != null && source != target
  3172. && !source.isDead()
  3173. && !source.hasFinished()
  3174. && source.withinDistance(target, 2))
  3175. source.applyHit(new Hit(
  3176. target,
  3177. Utils.getRandom((skills
  3178. .getLevelForXp(Skills.PRAYER) * 3)),
  3179. HitLook.REGULAR_DAMAGE));
  3180. }
  3181.  
  3182. World.sendGraphics(target, new Graphics(2260),
  3183. new WorldTile(getX() + 2, getY() + 2,
  3184. getPlane()));
  3185. World.sendGraphics(target, new Graphics(2260),
  3186. new WorldTile(getX() + 2, getY(), getPlane()));
  3187. World.sendGraphics(target, new Graphics(2260),
  3188. new WorldTile(getX() + 2, getY() - 2,
  3189. getPlane()));
  3190.  
  3191. World.sendGraphics(target, new Graphics(2260),
  3192. new WorldTile(getX() - 2, getY() + 2,
  3193. getPlane()));
  3194. World.sendGraphics(target, new Graphics(2260),
  3195. new WorldTile(getX() - 2, getY(), getPlane()));
  3196. World.sendGraphics(target, new Graphics(2260),
  3197. new WorldTile(getX() - 2, getY() - 2,
  3198. getPlane()));
  3199.  
  3200. World.sendGraphics(target, new Graphics(2260),
  3201. new WorldTile(getX(), getY() + 2, getPlane()));
  3202. World.sendGraphics(target, new Graphics(2260),
  3203. new WorldTile(getX(), getY() - 2, getPlane()));
  3204.  
  3205. World.sendGraphics(target, new Graphics(2260),
  3206. new WorldTile(getX() + 1, getY() + 1,
  3207. getPlane()));
  3208. World.sendGraphics(target, new Graphics(2260),
  3209. new WorldTile(getX() + 1, getY() - 1,
  3210. getPlane()));
  3211. World.sendGraphics(target, new Graphics(2260),
  3212. new WorldTile(getX() - 1, getY() + 1,
  3213. getPlane()));
  3214. World.sendGraphics(target, new Graphics(2260),
  3215. new WorldTile(getX() - 1, getY() - 1,
  3216. getPlane()));
  3217. }
  3218. });
  3219. }
  3220. }
  3221. setNextAnimation(new Animation(-1));
  3222. if (!controlerManager.sendDeath())
  3223. return;
  3224. lock(7);
  3225. stopAll();
  3226. if (familiar != null)
  3227. familiar.sendDeath(this);
  3228. WorldTasksManager.schedule(new WorldTask() {
  3229. int loop;
  3230.  
  3231. @Override
  3232. public void run() {
  3233. if (loop == 0) {
  3234. setNextAnimation(new Animation(15238));
  3235. } else if (loop == 1) {
  3236. setisDestroytimer(true);
  3237. getPackets().sendGameMessage("Oh dear, you have died.");
  3238. getControlerManager().forceStop();
  3239. if (source instanceof Player) {
  3240. Player killer = (Player) source;
  3241. killer.setAttackedByDelay(4);
  3242. }
  3243. } else if (loop == 3) {
  3244. equipment.init();
  3245. inventory.init();
  3246. reset();
  3247. setNextWorldTile(new WorldTile(
  3248. Settings.RESPAWN_PLAYER_LOCATION));
  3249. setNextAnimation(new Animation(-1));
  3250. } else if (loop == 4) {
  3251. getPackets().sendMusicEffect(90);
  3252. stop();
  3253. }
  3254. loop++;
  3255. }
  3256. }, 0, 1);
  3257. }
  3258.  
  3259. public boolean isBurying = false;
  3260.  
  3261. public boolean isSecured;
  3262.  
  3263. public int bossid;
  3264.  
  3265. public int isCompletionist = 0;
  3266.  
  3267. public void sendItemsOnDeath(Player killer) {
  3268. if (rights > 2)
  3269. return;
  3270. charges.die();
  3271. auraManager.removeAura();
  3272. CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
  3273. for (int i = 0; i < 14; i++) {
  3274. if (equipment.getItem(i) != null
  3275. && equipment.getItem(i).getId() != -1
  3276. && equipment.getItem(i).getAmount() != -1)
  3277. containedItems.add(new Item(equipment.getItem(i).getId(),
  3278. equipment.getItem(i).getAmount()));
  3279. }
  3280. for (int i = 0; i < 28; i++) {
  3281. if (inventory.getItem(i) != null
  3282. && inventory.getItem(i).getId() != -1
  3283. && inventory.getItem(i).getAmount() != -1)
  3284. containedItems.add(new Item(getInventory().getItem(i).getId(), getInventory().getItem(i).getAmount()));
  3285. }
  3286. if (containedItems.isEmpty())
  3287. return;
  3288. int keptAmount = 0;
  3289. if (!(controlerManager.getControler() instanceof CorpBeastControler)
  3290. && !(controlerManager.getControler() instanceof CrucibleControler)) {
  3291. keptAmount = hasSkull() ? 0 : 3;
  3292. if (prayer.usingPrayer(0, 10) || prayer.usingPrayer(1, 0))
  3293. keptAmount++;
  3294. }
  3295. if (donator && Utils.random(2) == 0)
  3296. keptAmount += 1;
  3297. CopyOnWriteArrayList<Item> keptItems = new CopyOnWriteArrayList<Item>();
  3298. Item lastItem = new Item(1, 1);
  3299. for (int i = 0; i < keptAmount; i++) {
  3300. for (Item item : containedItems) {
  3301. if (getProtectPrice(item) >= getProtectPrice(lastItem)) {
  3302. lastItem = item;
  3303. }
  3304. }
  3305. keptItems.add(new Item(lastItem.getId(), 1));
  3306. if (lastItem.getAmount() > 1)
  3307. lastItem.setAmount(lastItem.getAmount() - 1);
  3308. else
  3309. containedItems.remove(lastItem);
  3310. lastItem = new Item(1, 1);
  3311. }
  3312. inventory.reset();
  3313. equipment.reset();
  3314. for (Item item : keptItems) {
  3315. if (item.getId() != 1)
  3316. getInventory().addItem(item);
  3317. }
  3318. if (killer != null) {
  3319. if (killer.isIronMan()) {
  3320. killer.sm("Iron man accounts don't get anything for killing a player.");
  3321. return;
  3322. }
  3323. }
  3324. for (Item item : containedItems) {
  3325. if (isIronMan()) {
  3326. if (item.getName().toLowerCase().contains("obsidian")) {
  3327. killer.sm("Ironman accounts who have obsidian gear will not reveal their item on the ground.");
  3328. sm("Ironman accounts who have obsidian gear will not reveal their item on the ground.");
  3329. } else
  3330. World.addGroundItem(item, getLastWorldTile(), killer == null ? this
  3331. : killer, this, false, 180, true, true);
  3332. } else {
  3333. World.addGroundItem(item, getLastWorldTile(), killer == null ? this
  3334. : killer, this, false, 180, true, true);
  3335. }
  3336. }
  3337. }
  3338.  
  3339.  
  3340. public int getProtectPrice(Item item) {
  3341. switch (item.getId()) {
  3342. case 1286://Zuriel's Staff
  3343. return 2147000088;
  3344. case 11730://Saradomin Sword
  3345. return 2147000089;
  3346. case 11718://Armadyl Helmet
  3347. return 2147000090;
  3348. case 25034://Saradomin's Murmur
  3349. return 2147000091;
  3350. case 25031://Saradomin's Hiss
  3351. return 2147000092;
  3352. case 13734://Spirit shield
  3353. return 2147000093;
  3354. case 22494://Polypore Staff
  3355. return 2147000094;
  3356. case 26781://Statius's Warhammer
  3357. return 2147000095;
  3358. case 26780://Vesta's Longsword
  3359. return 2147000096;
  3360. case 13920://Statius Full Helm
  3361. return 2147000097;
  3362. case 13884://Statius Platebody
  3363. return 2147000098;
  3364. case 13890://Statius Platelegs
  3365. return 2147000099;
  3366. case 22484://Ganodermic Visor
  3367. return 2147000100;
  3368. case 22490://Ganodermic Poncho
  3369. return 2147000101;
  3370. case 22486://Ganodermic Leggings
  3371. return 2147000102;
  3372. case 22347://Dominion Staff
  3373. return 2147000114;
  3374. case 11720://Armadyl Chestplate
  3375. return 2147000115;
  3376. case 11722://Armadyl Chainskirt
  3377. return 2147000116;
  3378. case 24992://Hood of Subjugation
  3379. return 2147000117;
  3380. case 24995://Garb of Subjugation
  3381. return 2147000118;
  3382. case 24998://Gown of Subjugation
  3383. return 2147000119;
  3384. case 25004://Boots of Subjugation
  3385. return 2147000120;
  3386. case 25007://Gloves of Subjugation
  3387. return 2147000121;
  3388. case 11724://Bandos Chestplate
  3389. return 2147000122;
  3390. case 11726://Bandos Tassets
  3391. return 2147000123;
  3392. case 22358://Goliath Gloves
  3393. return 2147000124;
  3394. case 22362://Swift Gloves
  3395. return 2147000125;
  3396. case 22363://Swift Gloves
  3397. return 2147000125;
  3398. case 22364://Swift Gloves
  3399. return 2147000125;
  3400. case 22365://Swift Gloves
  3401. return 2147000125;
  3402. case 22366://Spellcaster Gloves
  3403. return 2147000125;
  3404. case 22367://Spellcaster Gloves
  3405. return 2147000125;
  3406. case 22368://Spellcaster Gloves
  3407. return 2147000125;
  3408. case 22369://Spellcaster Gloves
  3409. return 2147000126;
  3410. case 22359://Goliath Gloves
  3411. return 2147000127;
  3412. case 22360://Goliath Gloves
  3413. return 2147000127;
  3414. case 22361://Goliath Gloves
  3415. return 2147000127;
  3416. case 18351://Chaotic Longsword
  3417. return 2147000131;
  3418. case 18353://Chaotic Maul
  3419. return 2147000132;
  3420. case 18349://Chaotic Rapier
  3421. return 2147000133;
  3422. case 18357://Chaotic Crossbow
  3423. return 2147000134;
  3424. case 18355://Chaotic Staff
  3425. return 2147000135;
  3426. case 25993://Off-Hand Chaotic Longsword
  3427. return 2147000136;
  3428. case 25991://Off-Hand Chaotic Rapier
  3429. return 2147000137;
  3430. case 25995://Off-Hand Chaotic Crossbow
  3431. return 2147000138;
  3432. case 13887://Vesta's Chainbody
  3433. return 2147000139;
  3434. case 13893://Vesta's Chainskirt
  3435. return 2147000140;
  3436. case 21793://Ragefire Boots
  3437. return 2147000143;
  3438. case 11696://Bandos Godsword
  3439. return 2147000144;
  3440. case 21790://Glaiven Boots
  3441. return 2147000147;
  3442. case 11700://Zamorak Godsword
  3443. return 2147000148;
  3444. case 26702://Saradomin Godsword
  3445. return 2147000149;
  3446. case 22346://Dominion Sword
  3447. return 2147000150;
  3448. case 22348://Dominion Crossbow
  3449. return 2147000151;
  3450. case 25022://Bandos Helmet
  3451. return 2147000152;
  3452. case 25028://Saradomin's Whisper
  3453. return 2147000153;
  3454. case 26705://Dragon Claws
  3455. return 2147000154;
  3456. case 26700://Armadyl Godsword
  3457. return 2147000155;
  3458. case 13744://Spectral Spirit Shield
  3459. return 2147000156;
  3460. case 28003://Flaming Whip
  3461. return 2147000158;
  3462. case 28009://Firebrand Bow
  3463. return 2147000159;
  3464. case 21787://Steadfast Boots
  3465. return 2147000160;
  3466. case 26192://TzHarr Whip 1
  3467. return 2147000161;
  3468. case 25472://Lightning Staff 1
  3469. return 2147000162;
  3470. case 28020://Sheathed Blazing Flamberge
  3471. return 2147000163;
  3472. case 25202://Deathtouched Darts
  3473. return 2147000164;
  3474. case 20717://Zartye Bow
  3475. return 2147000165;
  3476. case 28813://Drygore Longsword
  3477. return 2147000173;
  3478. case 28821://Drygore Mace
  3479. return 2147000174;
  3480. case 28812://Off-Hand Drygore Longsword
  3481. return 2147000175;
  3482. case 28820://Off-Hand Drygore Rapier
  3483. return 2147000176;
  3484. case 13738://Arcane Spirit Shield
  3485. return 2147000181;
  3486. case 20137://Torva Full helm
  3487. return 2147000183;
  3488. case 20141://Torva Platebody
  3489. return 2147000184;
  3490. case 20145://Torva Platelegs
  3491. return 2147000185;
  3492. case 20149://Pernix Cowl
  3493. return 2147000186;
  3494. case 20153://Pernix Body
  3495. return 2147000187;
  3496. case 20157://Pernix Chaps
  3497. return 2147000188;
  3498. case 20161://Virtus Mask
  3499. return 2147000189;
  3500. case 20165://Virtus Robetop
  3501. return 2147000190;
  3502. case 20169://Virtus Robelegs
  3503. return 2147000191;
  3504. case 13142://Elysian Spirit Shield
  3505. return 2147000192;
  3506. case 13740://Divine Spirit Shield
  3507. return 2147000193;
  3508. case 16425://Primal Maul
  3509. return 2147000194;
  3510. case 21473://Vanguard Body
  3511. return 2147000196;
  3512. case 21560://Vanguard Body
  3513. return 2147000196;
  3514. case 21562://Vanguard Legs
  3515. return 2147000197;
  3516. case 21474://Vanguard Legs
  3517. return 2147000197;
  3518. case 28818://Drygore Rapier
  3519. return 2147000198;
  3520. case 28822://Off-Hand Drygore Mace
  3521. return 2147000199;
  3522. case 26346://Death lotus Hood
  3523. return 2147000201;
  3524. case 26347://Death louts Chestplate
  3525. return 2147000202;
  3526. case 26348://Death louts Chaps
  3527. return 2147000203;
  3528. case 26182://Tokhaar Warlord Helmet
  3529. return 2147000204;
  3530. case 26184://Tokhaar Warlord Platebody
  3531. return 2147000205;
  3532. case 26186://Tokhaar Warlord Platelegs
  3533. return 2147000206;
  3534. case 26188://Tokhaar Warlord Boots
  3535. return 2147000207;
  3536. case 26190://Tokhaar Warlord Gloves
  3537. return 2147000208;
  3538. case 28045://Draconic Claws
  3539. return 2147000216;
  3540. case 25475://Lightning Staff 4
  3541. return 2147000220;
  3542. case 29980://Ascension Crossbow
  3543. return 2147000221;
  3544. case 25112://Royal Court Lance Rapier
  3545. return 2147000222;
  3546. case 25664://Virtus Book
  3547. return 2147000223;
  3548. case 27994://Lava Partyhat
  3549. return 2147000226;
  3550. case 29977://Off-Hand Ascension Crossbow
  3551. return 2147000232;
  3552. case 25654://Virtus Wand
  3553. return 2147000234;
  3554. case 26787://Sword of Edicts
  3555. return 2147000235;
  3556. case 27998://Scarlet Spirit Shield
  3557. return 2147000236;
  3558. case 26031://Off-Hand Royal Court Lance Rapier
  3559. return 2147000239;
  3560. case 26198://TzHarr Whip 7
  3561. return 2147000241;
  3562. case 26130://Obsidian Ranger Helm
  3563. return 2147000244;
  3564. case 26132://Obsidian Mage Helm
  3565. return 2147000245;
  3566. case 26128://Obsidian Warrior Helm
  3567. return 2147000246;
  3568. case 26126://Obsidian Boots
  3569. return 2147000247;
  3570. case 26124://Obsidian Gloves
  3571. return 2147000248;
  3572. case 28004://Blazing Flamberge
  3573. return 2147000256;
  3574. case 26134://Obsidian Kiteshield
  3575. return 2147000257;
  3576. case 29915://Ring Of The Gods
  3577. return 2147000258;
  3578. case 29912://Tyrannical Ring
  3579. return 2147000259;
  3580. case 6192://Obliteration (Staff)
  3581. return 2147000261;
  3582. case 6193://Off-Hand Obliteration
  3583. return 2147000262;
  3584. case 17175://Frostbite Dagger
  3585. return 2147000263;
  3586. case 29914://Treasonous Ring
  3587. return 2147000264;
  3588. case 26136://Obsidian Platelegs
  3589. return 2147000265;
  3590. case 26140://Obsidian Platebody
  3591. return 2147000266;
  3592. case 29855: // Elite Obsidian Gloves
  3593. case 29856: // Elite Obsidian Boots
  3594. return 2147000267;
  3595. case 29858: // Elite Obby helms
  3596. case 29859:
  3597. case 29854:
  3598. return 2147000268;
  3599. case 29852: // Elite Obby legs
  3600. return 2147000269;
  3601. case 29862: // Elite Obby top
  3602. case 29900:
  3603. case 29899:
  3604. case 29898:
  3605. case 29897:
  3606. case 29896:
  3607. case 29895:
  3608. return 2147000270;
  3609. }
  3610. return -1;
  3611. }
  3612.  
  3613. private Shop shop;
  3614. public float donatedamount;
  3615. public int donatedtotal;
  3616. public Shop getShops() {
  3617. return shop;
  3618. }
  3619.  
  3620. public void increaseKillCount(Player killed) {
  3621. killed.deathCount++;
  3622. if (killed.getKillStreak() > 1 && killed.getKillStreak() < 5)
  3623. killed.sm("You have lost your killstreak!");
  3624. if (killed.getKillStreak() >= 5)
  3625. World.sendWorldMessage("<img=4><col=ff0000>[PvP Feed]: " +killed.getDisplayName() + " died and lost their "
  3626. + killed.getKillStreak() + " killstreak!", false);
  3627. killed.setKillStreak(0);
  3628. PkRank.checkRank(killed);
  3629. if (lastkilled != null) {
  3630. if (lastkilled.equals(killed)) {
  3631. sm("You do not get any kill count for killing the same player twice.");
  3632. return;
  3633. }
  3634. }
  3635. if (killed == this)
  3636. return;
  3637. lastkilled = killed;
  3638. if (getSession().getIP().equals(killed.getSession().getIP())) {
  3639. sm("You do not get any kill count for killing yourself.");
  3640. return;
  3641. }
  3642. getCurrencyPouch().setEradicatedSeals(getCurrencyPouch().getEradicatedSeals() + 10);
  3643. setSpellPower(getSpellPower()+2);
  3644. killCount++;
  3645. killStreak++;
  3646. if (this.getKillStreak() >= 5)
  3647. World.sendWorldMessage("<img=4><col=ff0000>[PvP Feed]: " +this.getDisplayName() + " is on a "
  3648. + this.getKillStreak() + " killstreak!", false);
  3649. sm("<col=ff0000>You have killed " + killed.getDisplayName()
  3650. + ", you have now " + killCount + " kills.");
  3651. PkRank.checkRank(this);
  3652. }
  3653.  
  3654. private Player lastkilled;
  3655.  
  3656. public void sendRandomJail(Player p) {
  3657. p.resetWalkSteps();
  3658. switch (Utils.getRandom(6)) {
  3659. case 0:
  3660. p.setNextWorldTile(new WorldTile(2669, 10387, 0));
  3661. break;
  3662. case 1:
  3663. p.setNextWorldTile(new WorldTile(2669, 10383, 0));
  3664. break;
  3665. case 2:
  3666. p.setNextWorldTile(new WorldTile(2669, 10379, 0));
  3667. break;
  3668. case 3:
  3669. p.setNextWorldTile(new WorldTile(2673, 10379, 0));
  3670. break;
  3671. case 4:
  3672. p.setNextWorldTile(new WorldTile(2673, 10385, 0));
  3673. break;
  3674. case 5:
  3675. p.setNextWorldTile(new WorldTile(2677, 10387, 0));
  3676. break;
  3677. case 6:
  3678. p.setNextWorldTile(new WorldTile(2677, 10383, 0));
  3679. break;
  3680. }
  3681. }
  3682.  
  3683. @Override
  3684. public int getSize() {
  3685. return appearence.getSize();
  3686. }
  3687.  
  3688. public boolean isCanPvp() {
  3689. return canPvp;
  3690. }
  3691.  
  3692. public void setCanPvp(boolean canPvp) {
  3693. this.canPvp = canPvp;
  3694. appearence.generateAppearenceData();
  3695. getPackets().sendPlayerOption(canPvp ? "Attack" : "null", 1, true);
  3696. getPackets().sendPlayerUnderNPCPriority(canPvp);
  3697. }
  3698.  
  3699. public Prayer getPrayer() {
  3700. return prayer;
  3701. }
  3702.  
  3703. public long getLockDelay() {
  3704. return lockDelay;
  3705. }
  3706.  
  3707. public boolean isLocked() {
  3708. return lockDelay >= Utils.currentTimeMillis();
  3709. }
  3710.  
  3711. public void lock() {
  3712. lockDelay = Long.MAX_VALUE;
  3713. }
  3714.  
  3715. public void lock(long time) {
  3716. lockDelay = Utils.currentTimeMillis() + (time * 600);
  3717. }
  3718.  
  3719. public void unlock() {
  3720. lockDelay = 0;
  3721. }
  3722.  
  3723. public void useStairs(int emoteId, final WorldTile dest, int useDelay,
  3724. int totalDelay) {
  3725. useStairs(emoteId, dest, useDelay, totalDelay, null);
  3726. }
  3727.  
  3728. public void useStairs(int emoteId, final WorldTile dest, int useDelay,
  3729. int totalDelay, final String message) {
  3730. stopAll();
  3731. lock(totalDelay);
  3732. if (emoteId != -1)
  3733. setNextAnimation(new Animation(emoteId));
  3734. if (useDelay == 0)
  3735. setNextWorldTile(dest);
  3736. else {
  3737. WorldTasksManager.schedule(new WorldTask() {
  3738. @Override
  3739. public void run() {
  3740. if (isDead())
  3741. return;
  3742. setNextWorldTile(dest);
  3743. if (message != null)
  3744. getPackets().sendGameMessage(message);
  3745. }
  3746. }, useDelay - 1);
  3747. }
  3748. }
  3749.  
  3750. public Toolbelt getToolbelt() {
  3751. return toolbelt;
  3752. }
  3753.  
  3754. public Bank getBank() {
  3755. if (getSecondBank() != null)
  3756. if (getSecondBank().opened)
  3757. return secondbank;
  3758. return bank;
  3759. }
  3760. public Bank getBankT() {
  3761. return bank;
  3762. }
  3763.  
  3764. public Bank getSecondBank() {
  3765. return secondbank;
  3766. }
  3767.  
  3768. public ControlerManager getControlerManager() {
  3769. return controlerManager;
  3770. }
  3771. public void senddonationitem(Player player, int donateditem, int amount) {
  3772. getBank().addItem(donateditem, amount, true);
  3773. }
  3774.  
  3775. public String checkamountdonated(Player player, String username){
  3776. try{
  3777. username = username.replaceAll(" ","_");
  3778. String secret = "7dcf7ce97d2451742ff8b6fc72aea8fa"; //YOUR SECRET KEY!
  3779. URL url = new URL("http://app.gpay.io/api/runescape/"+username+"/"+secret);
  3780. BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
  3781. String results = reader.readLine();
  3782. if(results.toLowerCase().contains("!error:")){
  3783.  
  3784. }else{
  3785. return results;
  3786. }
  3787. }catch(IOException e){}
  3788. return "0";
  3789. }
  3790.  
  3791. public String fontColor() {
  3792. return getInterfaceManager().hasRezizableScreen() ? "<col=0FFFFF>" : "<col=084FA1>";
  3793. }
  3794.  
  3795. public boolean setRPayPin() {
  3796. try {
  3797. String username = getUsername();
  3798. if (username == null)
  3799. return false;
  3800. if (isIronMan()) {
  3801. sm("Ironman accounts can't donate.");
  3802. return false;
  3803. }
  3804. if (getSecurityPin() == 0) {
  3805. sm("You must set a pin! In order to set a pin, click at any bank and you'll be prompted to do so.");
  3806. return false;
  3807. }
  3808. if (getSecurityPin() == getDonationPin()) {
  3809. return true;
  3810. }
  3811. username = username.replaceAll(" ","_");
  3812. String secret = "7dcf7ce97d2451742ff8b6fc72aea8fa"; //YOUR SECRET KEY!
  3813. URL url = new URL("http://app.gpay.io/api/runescape/"+username+"/"+secret);
  3814. BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
  3815. String results = reader.readLine();
  3816. setDonationPin(getSecurityPin());
  3817. if (results.toLowerCase().contains("ERROR")) {
  3818. Logger.log(this, "[RSPS-PAY]"+results);
  3819. } else {
  3820. Logger.log(this, "[RSPS-PAY]"+results);
  3821. sm("Please note: Your pin is the same pin as your security pin. If you need to change your pin, feel free to do ;;changepin.");
  3822. }
  3823. return true;
  3824. } catch (IOException e) {
  3825. return false;
  3826. }
  3827. }
  3828.  
  3829. public void sendtotaldonationfeed(Player player, boolean hidden, int price) {
  3830. NumberFormat currencyFormatter = NumberFormat.getCurrencyInstance(Locale.US);
  3831. //float amountdonated = Float.parseFloat(checkamountdonated(this, username));
  3832. int amountdonated = donatedtotal + price;
  3833. if (!hidden) {
  3834. for (Player players: World.getPlayers()) {
  3835. players.sm("<img=5>[Donation] "+players.fontColor()+player.getDisplayName()+" </col> has donated a total of "+players.fontColor()+"" + currencyFormatter.format(amountdonated) + "!");
  3836. }
  3837. }
  3838. player.donatedtotal += price;
  3839. }
  3840.  
  3841. public void senddonationfeed(Player player, String message, int price) {
  3842. for (Player players: World.getPlayers()) {
  3843. players.sm("<img=5>[Donation] "+players.fontColor()+ player.getDisplayName() + " </col>bought "+players.fontColor()+""+message+
  3844. "</col>");
  3845. }
  3846. Logger.printDonateLog(player.getUsername(), message,price);
  3847. }
  3848.  
  3849. public boolean check10BRequirements() {
  3850. if (getSkills().getXp(Skills.ATTACK) < 400000000
  3851. || getSkills().getXp(Skills.STRENGTH) < 400000000
  3852. || getSkills().getXp(Skills.DEFENCE) < 400000000
  3853. || getSkills().getXp(Skills.CONSTRUCTION) < 400000000
  3854. || getSkills().getXp(Skills.HITPOINTS) < 400000000
  3855. || getSkills().getXp(Skills.RANGE) < 400000000
  3856. || getSkills().getXp(Skills.MAGIC) < 400000000
  3857. || getSkills().getXp(Skills.RUNECRAFTING) < 400000000
  3858. || getSkills().getXp(Skills.FISHING) < 400000000
  3859. || getSkills().getXp(Skills.AGILITY) < 400000000
  3860. || getSkills().getXp(Skills.COOKING) < 400000000
  3861. || getSkills().getXp(Skills.PRAYER) < 400000000
  3862. || getSkills().getXp(Skills.THIEVING) < 400000000
  3863. || getSkills().getXp(Skills.DUNGEONEERING) < 400000000
  3864. || getSkills().getXp(Skills.MINING) < 400000000
  3865. || getSkills().getXp(Skills.SMITHING) < 400000000
  3866. || getSkills().getXp(Skills.SUMMONING) < 400000000
  3867. || getSkills().getXp(Skills.FARMING) < 400000000
  3868. || getSkills().getXp(Skills.HUNTER) < 400000000
  3869. || getSkills().getXp(Skills.SLAYER) < 400000000
  3870. || getSkills().getXp(Skills.CRAFTING) < 400000000
  3871. || getSkills().getXp(Skills.WOODCUTTING) < 400000000
  3872. || getSkills().getXp(Skills.FIREMAKING) < 400000000
  3873. || getSkills().getXp(Skills.FLETCHING) < 400000000
  3874. || getSkills().getXp(Skills.HERBLORE) < 400000000)
  3875. return false;
  3876. else
  3877. return true;
  3878. }
  3879. public boolean check5BRequirements() {
  3880. if (getSkills().getXp(Skills.ATTACK) < 200000000
  3881. || getSkills().getXp(Skills.STRENGTH) < 200000000
  3882. || getSkills().getXp(Skills.DEFENCE) < 200000000
  3883. || getSkills().getXp(Skills.CONSTRUCTION) < 200000000
  3884. || getSkills().getXp(Skills.HITPOINTS) < 200000000
  3885. || getSkills().getXp(Skills.RANGE) < 200000000
  3886. || getSkills().getXp(Skills.MAGIC) < 200000000
  3887. || getSkills().getXp(Skills.RUNECRAFTING) < 200000000
  3888. || getSkills().getXp(Skills.FISHING) < 200000000
  3889. || getSkills().getXp(Skills.AGILITY) < 200000000
  3890. || getSkills().getXp(Skills.COOKING) < 200000000
  3891. || getSkills().getXp(Skills.PRAYER) < 200000000
  3892. || getSkills().getXp(Skills.THIEVING) < 200000000
  3893. || getSkills().getXp(Skills.DUNGEONEERING) < 200000000
  3894. || getSkills().getXp(Skills.MINING) < 200000000
  3895. || getSkills().getXp(Skills.SMITHING) < 200000000
  3896. || getSkills().getXp(Skills.SUMMONING) < 200000000
  3897. || getSkills().getXp(Skills.FARMING) < 200000000
  3898. || getSkills().getXp(Skills.HUNTER) < 200000000
  3899. || getSkills().getXp(Skills.SLAYER) < 200000000
  3900. || getSkills().getXp(Skills.CRAFTING) < 200000000
  3901. || getSkills().getXp(Skills.WOODCUTTING) < 200000000
  3902. || getSkills().getXp(Skills.FIREMAKING) < 200000000
  3903. || getSkills().getXp(Skills.FLETCHING) < 200000000
  3904. || getSkills().getXp(Skills.HERBLORE) < 200000000)
  3905. return false;
  3906. else
  3907. return true;
  3908. }
  3909. public boolean checkCompletionistCapeRequirements() {
  3910. if (!isCompletedFightKiln()
  3911. || !isKilledQueenBlackDragon()
  3912. || !getQuestManager().completedQuest(Quests.NOMADS_REQUIEM)
  3913. || !isCompletedFightCaves()
  3914. )
  3915. return false;
  3916. if ( getSkills().getLevelForXp(Skills.ATTACK) >= 99
  3917. && getSkills().getLevelForXp(Skills.STRENGTH) >= 99
  3918. && getSkills().getLevelForXp(Skills.DEFENCE) >= 99
  3919. && getSkills().getLevelForXp(Skills.CONSTRUCTION) >= 99
  3920. && getSkills().getLevelForXp(Skills.HITPOINTS) >= 99
  3921. && getSkills().getLevelForXp(Skills.RANGE) >= 99
  3922. && getSkills().getLevelForXp(Skills.MAGIC) >= 99
  3923. && getSkills().getLevelForXp(Skills.RUNECRAFTING) >= 99
  3924. && getSkills().getLevelForXp(Skills.FISHING) >= 99
  3925. && getSkills().getLevelForXp(Skills.AGILITY) >= 99
  3926. && getSkills().getLevelForXp(Skills.COOKING) >= 99
  3927. && getSkills().getLevelForXp(Skills.PRAYER) >= 99
  3928. && getSkills().getLevelForXp(Skills.THIEVING) >= 99
  3929. && getSkills().getLevelForXp(Skills.DUNGEONEERING) >= 120
  3930. && getSkills().getLevelForXp(Skills.MINING) >= 99
  3931. && getSkills().getLevelForXp(Skills.SMITHING) >= 99
  3932. && getSkills().getLevelForXp(Skills.SUMMONING) >= 99
  3933. && getSkills().getLevelForXp(Skills.FARMING) >= 99
  3934. && getSkills().getLevelForXp(Skills.HUNTER) >= 99
  3935. && getSkills().getLevelForXp(Skills.SLAYER) >= 99
  3936. && getSkills().getLevelForXp(Skills.CRAFTING) >= 99
  3937. && getSkills().getLevelForXp(Skills.WOODCUTTING) >= 99
  3938. && getSkills().getLevelForXp(Skills.FIREMAKING) >= 99
  3939. && getSkills().getLevelForXp(Skills.FLETCHING) >= 99
  3940. && getSkills().getLevelForXp(Skills.HERBLORE) >= 99)
  3941. return true;
  3942. return false;
  3943. }
  3944.  
  3945. public boolean checkAmuletofCompletion() {
  3946. if (getBossSlayerCount(false) < 50
  3947. || getSlayerCount(false) < 50
  3948. || getDummyDamage() < 10000
  3949. || getDropbeam() < 6
  3950. || getAmountThieved(false) < 50000000
  3951. || !check10BRequirements()
  3952. || !isKilledDragithNurn()
  3953. || !isCompletedFightCaves()
  3954. || !getQuestManager().completedQuest(Quests.NOMADS_REQUIEM)
  3955. || !isKilledQueenBlackDragon()
  3956. || !getEXQuestManager().isComplete(QNames.ELITE_CHAPTER_I)
  3957. || !getEXQuestManager().isComplete(QNames.ELITE_CHAPTER_II)
  3958. || !getEXQuestManager().isComplete(QNames.ELITE_CHAPTER_III))
  3959. return false;
  3960. return true;
  3961. }
  3962.  
  3963.  
  3964. public boolean rspsdata(Player player, String username, boolean hidden) {
  3965. try{
  3966. username = username.replaceAll(" ","_");
  3967. String secret = "7dcf7ce97d2451742ff8b6fc72aea8fa"; //YOUR SECRET KEY!
  3968. URL url = new URL("http://app.gpay.io/api/runescape/"+username+"/"+secret);
  3969. BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
  3970. String results = reader.readLine();
  3971. if(results.toLowerCase().contains("!error:")) {
  3972. //Logger.log(this, "[RSPS-PAY]"+results);
  3973. } else {
  3974. String boughtitems = "";
  3975. int price = 0;
  3976. int rdon = 0, edon = 0, mbox = 0, qfc = 0, bfs = 0, drs = 0, dls = 0, dms = 0, ts = 0, ps = 0, vs = 0, dss = 0, ess = 0, ass = 0,
  3977. sss = 0, sdr = 0, er = 0, dtd = 0, hxl = 0, row = 0, dr = 0, tbox = 0, cbox = 0 ,hussein = 0, bandit = 0, poseidon = 0, rosary = 0, avas = 0;
  3978. boolean nothin = false;
  3979. String[] ary = results.split(",");
  3980. for(int i = 0; i < ary.length; i++) {
  3981. switch(ary[i]) {
  3982. case "0":
  3983. return false;
  3984. case "32133":
  3985. senddonationitem(player, 6832, 1);
  3986. price += 10;
  3987. ++rdon;
  3988. break;
  3989. case "32134":
  3990. senddonationitem(player, 6830, 1);
  3991. price += 20;
  3992. ++edon;
  3993. break;
  3994. case "32138":
  3995. senddonationitem(player, 6199, 1);
  3996. ++mbox;
  3997. price += 5;
  3998. break;
  3999. case "32139":
  4000. senddonationitem(player, 24575, 1);
  4001. senddonationitem(player, 26027, 1);
  4002. ++qfc;
  4003. price += 15;
  4004. break;
  4005. case "32140":
  4006. senddonationitem(player, 28004, 1);
  4007. senddonationitem(player, 28020, 1);
  4008. ++bfs;
  4009. price += 39;
  4010. break;
  4011. case "32141":
  4012. senddonationitem(player, 28818, 1);
  4013. senddonationitem(player, 28820, 1);
  4014. ++drs;
  4015. price += 40;
  4016. break;
  4017. case "32142":
  4018. senddonationitem(player, 28813, 1);
  4019. senddonationitem(player, 28812, 1);
  4020. ++dls;
  4021. price += 40;
  4022. break;
  4023. case "32143":
  4024. senddonationitem(player, 28821, 1);
  4025. senddonationitem(player, 28822, 1);
  4026. ++dms;
  4027. price += 40;
  4028. break;
  4029. case "32144":
  4030. senddonationitem(player, 20135, 1);
  4031. senddonationitem(player, 20139, 1);
  4032. senddonationitem(player, 20144, 1);
  4033. ++ts;
  4034. price += 35;
  4035. break;
  4036. case "32145":
  4037. senddonationitem(player, 20147, 1);
  4038. senddonationitem(player, 20151, 1);
  4039. senddonationitem(player, 20155, 1);
  4040. ++ps;
  4041. price += 35;
  4042. break;
  4043. case "32146":
  4044. senddonationitem(player, 20159, 1);
  4045. senddonationitem(player, 20163, 1);
  4046. senddonationitem(player, 20167, 1);
  4047. ++vs;
  4048. price += 35;
  4049. break;
  4050. case "32147":
  4051. senddonationitem(player, 13740, 1);
  4052. price += 25;
  4053. ++dss;
  4054. break;
  4055. case "32148":
  4056. senddonationitem(player, 13742, 1);
  4057. ++ess;
  4058. price += 25;
  4059. break;
  4060. case "32149":
  4061. senddonationitem(player, 13738, 1);
  4062. price += 20;
  4063. ++ass;
  4064. break;
  4065. case "32150":
  4066. senddonationitem(player, 13744, 1);
  4067. ++sss;;
  4068. price += 20;
  4069. break;
  4070. case "32135":
  4071. senddonationitem(player, 6829, 1);
  4072. ++sdr;
  4073. price += 40;
  4074. break;
  4075. case "32136":
  4076. senddonationitem(player, 6828, 1);
  4077. ++er;
  4078. price += 100;
  4079. break;
  4080. case "32151":
  4081. senddonationitem(player, 25202, 10);
  4082. dtd += 10;
  4083. price += 20;
  4084. break;
  4085. case "32157":
  4086. senddonationitem(player, 23716, 1);
  4087. ++hxl;
  4088. price += 3;
  4089. break;
  4090. case "32152":
  4091. senddonationitem(player, 2572, 1);
  4092. ++row;
  4093. price += 10;
  4094. break;
  4095. case "32137":
  4096. player.setDicer(true);
  4097. player.getAppearence().setTitle(4324324);
  4098. senddonationitem(player, 15098, 1);
  4099. ++dr;
  4100. price += 100;
  4101. break;
  4102. case "32158":
  4103. senddonationitem(player, 23716, 10);
  4104. hxl += 10;
  4105. price += 25;
  4106. break;
  4107. case "32153":
  4108. senddonationitem(player, 27744, 1);
  4109. tbox += 1;
  4110. price += 10;
  4111. break;
  4112. case "32155":
  4113. senddonationitem(player, 27745, 1);
  4114. cbox += 1;
  4115. price += 10;
  4116. break;
  4117. case "32154":
  4118. senddonationitem(player, 27744, 10);
  4119. tbox += 10;
  4120. price += 60;
  4121. break;
  4122. case "32156":
  4123. senddonationitem(player, 27745, 10);
  4124. cbox += 10;
  4125. price += 60;
  4126. break;
  4127. case "32408": //hussein bolt
  4128. player.getPerksManager().unliRun = true;
  4129. ++hussein;
  4130. price += 5;
  4131. player.sendMessage("You've purchased: [" + Colors.RED + "Hussein Bolt Perk</col>]. "
  4132. + "Type ;;perks to see all your game perks.");
  4133. break;
  4134. case "32409": //master bandit
  4135. player.getPerksManager().sleightOfHand = true;
  4136. ++bandit;
  4137. price += 5;
  4138. player.sendMessage("You've purchased: [" + Colors.RED + "Master Bandit Perk</col>]. "
  4139. + "Type ;;perks to see all your game perks.");
  4140. break;
  4141. case "32410": //poseidon hand
  4142. player.getPerksManager().masterFisherman = true;
  4143. ++poseidon;
  4144. price += 5;
  4145. player.sendMessage("You've purchased: [" + Colors.RED + "Poseidon Hand Perk</col>]. "
  4146. + "Type ;;perks to see all your game perks.");
  4147. break;
  4148. case "32411": //rosary mastery
  4149. player.getPerksManager().prayerBetrayer = true;
  4150. ++rosary;
  4151. price += 8;
  4152. player.sendMessage("You've purchased: [" + Colors.RED + "Rosary Master Perk</col>]. "
  4153. + "Type ;;perks to see all your game perks.");
  4154. break;
  4155. case "32412": //Ava's Accumulator
  4156. player.getPerksManager().avasSecret = true;
  4157. ++avas;
  4158. price += 5;
  4159. player.sendMessage("You've purchased: [" + Colors.RED + "Ava's Accumulator Perk</col>]. "
  4160. + "Type ;;perks to see all your game perks.");
  4161. break;
  4162. }
  4163. }
  4164. if (!nothin) {
  4165. if (rdon != 0)
  4166. boughtitems += rdon + "x Regular Donator, ";
  4167. if (edon != 0)
  4168. boughtitems += edon + "x Extreme Donator, ";
  4169. if (mbox != 0)
  4170. boughtitems += mbox + "x Mystery Box, ";
  4171. if (qfc != 0)
  4172. boughtitems += qfc + "x Quickfire Crossbow, ";
  4173. if (bfs != 0)
  4174. boughtitems += bfs + "x Blazing Flamberge, ";
  4175. if (drs != 0)
  4176. boughtitems += drs + "x Drygore Rapiers, ";
  4177. if (dls != 0)
  4178. boughtitems += dls + "x Drygore Longswords, ";
  4179. if (dms != 0)
  4180. boughtitems += dms + "x Drygore Maces, ";
  4181. if (ts != 0)
  4182. boughtitems += ts + "x Torva, ";
  4183. if (ps != 0)
  4184. boughtitems += ps + "x Pernix, ";
  4185. if (vs != 0)
  4186. boughtitems += vs + "x Virtus, ";
  4187. if (dss != 0)
  4188. boughtitems += dss + "x Divine SS, ";
  4189. if (ess != 0)
  4190. boughtitems += ess + "x Elysian SS, ";
  4191. if (ass != 0)
  4192. boughtitems += ass + "x Arcane SS, ";
  4193. if (sss != 0)
  4194. boughtitems += sss + "x Spectral SS, ";
  4195. if (sdr != 0)
  4196. boughtitems += sdr + "x Super Donator, ";
  4197. if (er != 0)
  4198. boughtitems += er + "x Eradicator Rank, ";
  4199. if (dtd != 0)
  4200. boughtitems += dtd + "x Deathtouched Dart, ";
  4201. if (hxl != 0)
  4202. boughtitems += hxl + "x Huge XP Lamp, ";
  4203. if (row != 0)
  4204. boughtitems += row + "x Ring of Wealth, ";
  4205. if (dr != 0)
  4206. boughtitems += dr + "x Dicer Rank, ";
  4207. if (tbox != 0)
  4208. boughtitems += tbox + "x Trimmed Box, ";
  4209. if (cbox != 0)
  4210. boughtitems += cbox + "x Cosmetic Box, ";
  4211. if (hussein != 0)
  4212. boughtitems += hussein + "x Hussein Bolt Perk, ";
  4213. if (bandit != 0)
  4214. boughtitems += bandit + "x Master Bandit Perk, ";
  4215. if (poseidon != 0)
  4216. boughtitems += poseidon + "x Poseidons Hand Perk, ";
  4217. if (rosary != 0)
  4218. boughtitems += rosary + "x Rosary Mastery Perk, ";
  4219. if (avas != 0)
  4220. boughtitems += avas + "x Ava's Accumulator Perk, ";
  4221. String newboughtitems = "";
  4222. newboughtitems = boughtitems.substring(0,boughtitems.length() - 2) + "!";
  4223. if (!hidden) {
  4224. senddonationfeed(player, newboughtitems, price);
  4225. }
  4226. sendtotaldonationfeed(player, hidden, price);
  4227. sm("Your purchase has been placed in your bank.");
  4228. return true;
  4229. }
  4230. return true;
  4231. }
  4232. }catch(IOException e){}
  4233. return false;
  4234. }
  4235.  
  4236. public void switchMouseButtons() {
  4237. mouseButtons = !mouseButtons;
  4238. refreshMouseButtons();
  4239. }
  4240.  
  4241. public void switchAllowChatEffects() {
  4242. allowChatEffects = !allowChatEffects;
  4243. refreshAllowChatEffects();
  4244. }
  4245.  
  4246. public void refreshAllowChatEffects() {
  4247. getPackets().sendConfig(171, allowChatEffects ? 0 : 1);
  4248. }
  4249.  
  4250. public void refreshMouseButtons() {
  4251. getPackets().sendConfig(170, mouseButtons ? 0 : 1);
  4252. }
  4253.  
  4254. private transient ClansManager clanManager, guestClanManager;
  4255. public ClansManager getClanManager() {
  4256. return clanManager;
  4257. }
  4258.  
  4259. public void setClanManager(ClansManager clanManager) {
  4260. this.clanManager = clanManager;
  4261. }
  4262.  
  4263. private String clanName;
  4264.  
  4265. private int clanChatSetup;
  4266. public int getClanChatSetup() {
  4267. return clanChatSetup;
  4268. }
  4269.  
  4270. public void setClanChatSetup(int clanChatSetup) {
  4271. this.clanChatSetup = clanChatSetup;
  4272. }
  4273.  
  4274. private int guestChatSetup;
  4275.  
  4276. public void kickPlayerFromClanChannel(String name) {
  4277. if (clanManager == null)
  4278. return;
  4279. clanManager.kickPlayerFromChat(this, name);
  4280. }
  4281.  
  4282. public void sendClanChannelMessage(ChatMessage message) {
  4283. if (clanManager == null)
  4284. return;
  4285. clanManager.sendMessage(this, message);
  4286. }
  4287.  
  4288. public void sendClanChannelQuickMessage(QuickChatMessage message) {
  4289. if (clanManager == null)
  4290. return;
  4291. clanManager.sendQuickMessage(this, message);
  4292. }
  4293.  
  4294. public void sendGuestClanChannelMessage(ChatMessage message) {
  4295. if (guestClanManager == null)
  4296. return;
  4297. guestClanManager.sendMessage(this, message);
  4298. }
  4299.  
  4300. public void sendGuestClanChannelQuickMessage(QuickChatMessage message) {
  4301. if (guestClanManager == null)
  4302. return;
  4303. guestClanManager.sendQuickMessage(this, message);
  4304. }
  4305.  
  4306. private boolean connectedClanChannel;
  4307.  
  4308. public boolean emptyWarning = false;
  4309.  
  4310. public void refreshPrivateChatSetup() {
  4311. getPackets().sendConfig(287, privateChatSetup);
  4312. }
  4313.  
  4314. public void refreshOtherChatsSetup() {
  4315. int value = friendChatSetup << 6;
  4316. getPackets().sendConfig(1438, value);
  4317. getPackets().sendConfigByFile(3612, clanChatSetup);
  4318. getPackets().sendConfigByFile(9191, guestChatSetup);
  4319. }
  4320.  
  4321. public void setPrivateChatSetup(int privateChatSetup) {
  4322. this.privateChatSetup = privateChatSetup;
  4323. }
  4324.  
  4325. public void setFriendChatSetup(int friendChatSetup) {
  4326. this.friendChatSetup = friendChatSetup;
  4327. }
  4328.  
  4329. public int getPrivateChatSetup() {
  4330. return privateChatSetup;
  4331. }
  4332.  
  4333. public boolean isForceNextMapLoadRefresh() {
  4334. return forceNextMapLoadRefresh;
  4335. }
  4336.  
  4337. public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
  4338. this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
  4339. }
  4340.  
  4341. public FriendsIgnores getFriendsIgnores() {
  4342. return friendsIgnores;
  4343. }
  4344.  
  4345. public void sendMessage(String message) {
  4346. getPackets().sendGameMessage(message);
  4347. }
  4348.  
  4349. public boolean isUntillLogout() {
  4350. return untillLogout;
  4351. }
  4352.  
  4353. public void setUntillLogout(boolean untillLogout) {
  4354. this.untillLogout = untillLogout;
  4355. }
  4356.  
  4357. /*
  4358. * do not use this, only used by pm
  4359. */
  4360. public void setUsername(String username) {
  4361. this.username = username;
  4362. }
  4363.  
  4364. public void setDisplayName(String displayName) {
  4365. this.displayName = displayName;
  4366. }
  4367.  
  4368. public void setLeaderName(Player leaderName) {
  4369. this.leaderName = leaderName;
  4370. }
  4371.  
  4372. public void addPotDelay(long time) {
  4373. potDelay = time + Utils.currentTimeMillis();
  4374. }
  4375.  
  4376. public long getPotDelay() {
  4377. return potDelay;
  4378. }
  4379.  
  4380. public void addFoodDelay(long time) {
  4381. foodDelay = time + Utils.currentTimeMillis();
  4382. }
  4383.  
  4384. public long getFoodDelay() {
  4385. return foodDelay;
  4386. }
  4387.  
  4388. public long getBoneDelay() {
  4389. return boneDelay;
  4390. }
  4391.  
  4392. public void addBoneDelay(long time) {
  4393. boneDelay = time + Utils.currentTimeMillis();
  4394. }
  4395.  
  4396. public void addPoisonImmune(long time) {
  4397. poisonImmune = time + Utils.currentTimeMillis();
  4398. getPoison().reset();
  4399. }
  4400.  
  4401. public long getPoisonImmune() {
  4402. return poisonImmune;
  4403. }
  4404.  
  4405. public void addFireImmune(long time) {
  4406. fireImmune = time + Utils.currentTimeMillis();
  4407. }
  4408.  
  4409. public long getFireImmune() {
  4410. return fireImmune;
  4411. }
  4412.  
  4413. @Override
  4414. public void heal(int ammount, int extra) {
  4415. super.heal(ammount, extra);
  4416. refreshHitPoints();
  4417. }
  4418.  
  4419. public MusicsManager getMusicsManager() {
  4420. return musicsManager;
  4421. }
  4422.  
  4423. public HintIconsManager getHintIconsManager() {
  4424. return hintIconsManager;
  4425. }
  4426.  
  4427. public boolean isCastVeng() {
  4428. return castedVeng;
  4429. }
  4430.  
  4431. public void setCastVeng(boolean castVeng) {
  4432. this.castedVeng = castVeng;
  4433. }
  4434.  
  4435. public int getKillCount() {
  4436. return killCount;
  4437. }
  4438.  
  4439. public int getBarrowsKillCount() {
  4440. return barrowsKillCount;
  4441. }
  4442.  
  4443. public int setBarrowsKillCount(int barrowsKillCount) {
  4444. return this.barrowsKillCount = barrowsKillCount;
  4445. }
  4446.  
  4447. public int setKillCount(int killCount) {
  4448. return this.killCount = killCount;
  4449. }
  4450.  
  4451. public int getDeathCount() {
  4452. return deathCount;
  4453. }
  4454.  
  4455. public int setDeathCount(int deathCount) {
  4456. return this.deathCount = deathCount;
  4457. }
  4458.  
  4459. public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
  4460. this.closeInterfacesEvent = closeInterfacesEvent;
  4461. }
  4462.  
  4463. public long getMuted() {
  4464. return muted;
  4465. }
  4466.  
  4467. public void setMuted(long muted) {
  4468. this.muted = muted;
  4469. }
  4470.  
  4471. public long getVoted() {
  4472. return hevoted;
  4473. }
  4474.  
  4475. public void setVoted(long hevoted) {
  4476. this.hevoted = hevoted;
  4477. }
  4478.  
  4479. public void out(String text, int delay) {
  4480.  
  4481. }
  4482. public ItemOffer[] getGeOffers() {
  4483. return geOffers;
  4484. }
  4485.  
  4486. public void setGeOffers(ItemOffer[] geOffers) {
  4487. this.geOffers = geOffers;
  4488. }
  4489.  
  4490. public int getGESlot() {
  4491. return GESlot;
  4492. }
  4493.  
  4494. public void setGESlot(int gESlot) {
  4495. GESlot = gESlot;
  4496. }
  4497.  
  4498. private ItemOffer[] geOffers;
  4499.  
  4500. /**
  4501. * The player's last used grand exchange slot.
  4502. */
  4503. private int GESlot;
  4504.  
  4505. /**
  4506. * The player's last offertype used.
  4507. */
  4508. public OfferType offerType;
  4509.  
  4510. public int box;
  4511.  
  4512. public long getJailed() {
  4513. return jailed;
  4514. }
  4515.  
  4516. public void setJailed(long jailed) {
  4517. this.jailed = jailed;
  4518. }
  4519.  
  4520. public boolean isPermBanned() {
  4521. return permBanned;
  4522. }
  4523.  
  4524. public void setPermBanned(boolean permBanned) {
  4525. this.permBanned = permBanned;
  4526. }
  4527.  
  4528. public long getBanned() {
  4529. return banned;
  4530. }
  4531.  
  4532. public void setBanned(long banned) {
  4533. this.banned = banned;
  4534. }
  4535.  
  4536. public ChargesManager getCharges() {
  4537. return charges;
  4538. }
  4539.  
  4540. public void setPassword(String password) {
  4541. this.password = password;
  4542. }
  4543.  
  4544. public boolean[] getKilledBarrowBrothers() {
  4545. return killedBarrowBrothers;
  4546. }
  4547.  
  4548. public void setHiddenBrother(int hiddenBrother) {
  4549. this.hiddenBrother = hiddenBrother;
  4550. }
  4551.  
  4552. public int getHiddenBrother() {
  4553. return hiddenBrother;
  4554. }
  4555.  
  4556. public void resetBarrows() {
  4557. hiddenBrother = -1;
  4558. killedBarrowBrothers = new boolean[7]; // includes new bro for future
  4559. // use
  4560. barrowsKillCount = 0;
  4561. }
  4562.  
  4563. public boolean isDonator() {
  4564. return donator;
  4565. }
  4566.  
  4567. public boolean isExtremeDonator() {
  4568. return extremeDonator || extremeDonatorTill > Utils.currentTimeMillis();
  4569. }
  4570.  
  4571. public boolean isExtremePermDonator() {
  4572. return extremeDonator;
  4573. }
  4574.  
  4575. public void setExtremeDonator(boolean extremeDonator) {
  4576. this.extremeDonator = extremeDonator;
  4577. }
  4578.  
  4579. public boolean isOwner() {
  4580. return isOwner;
  4581. }
  4582.  
  4583. private boolean isHeadMod;
  4584.  
  4585. public boolean isHeadMod() {
  4586. return isHeadMod;
  4587. }
  4588.  
  4589. public void setHeadMod(boolean isHeadMod) {
  4590. this.isHeadMod = isHeadMod;
  4591. }
  4592.  
  4593. public String MACAdress;
  4594. public String getMACAdress() {
  4595. return MACAdress;
  4596. }
  4597.  
  4598. public void setMacAdress(String macAdress) {
  4599. if(macAdress != null) {
  4600. this.MACAdress = macAdress;
  4601. }
  4602. }
  4603.  
  4604. private boolean isExecutive;
  4605.  
  4606. public boolean isExecutive() {
  4607. return isExecutive;
  4608. }
  4609.  
  4610. public void setExecutive(boolean isExecutive) {
  4611. this.isExecutive = isExecutive;
  4612. }
  4613.  
  4614. private boolean isHeadExecutive;
  4615.  
  4616. public boolean isHeadExecutive() {
  4617. return isHeadExecutive;
  4618. }
  4619.  
  4620. public void setHeadExecutive(boolean isHeadExecutive) {
  4621. this.isHeadExecutive = isHeadExecutive;
  4622. }
  4623.  
  4624. private boolean isForumAdmin;
  4625.  
  4626. public boolean isForumAdmin() {
  4627. return isForumAdmin;
  4628. }
  4629.  
  4630. public void setForumAdmin(boolean isForumAdmin) {
  4631. this.isForumAdmin = isForumAdmin;
  4632. }
  4633.  
  4634. private boolean isForumMod;
  4635.  
  4636. public boolean isForumMod() {
  4637. return isForumMod;
  4638. }
  4639.  
  4640. public void setForumMod(boolean isForumMod) {
  4641. this.isForumMod = isForumMod;
  4642. }
  4643.  
  4644. private boolean isDicer;
  4645.  
  4646. public boolean isDicer() {
  4647. return isDicer;
  4648. }
  4649.  
  4650. public void setDicer(boolean isDicer) {
  4651. this.isDicer = isDicer;
  4652. }
  4653. private boolean isEradicator;
  4654.  
  4655. private boolean isHero;
  4656.  
  4657. public boolean isEradicator() {
  4658. return isEradicator;
  4659. }
  4660.  
  4661. public void setEradicator(boolean isEradicator) {
  4662. this.isEradicator = isEradicator;
  4663. }
  4664.  
  4665. public boolean isHero() {
  4666. return isHero;
  4667. }
  4668.  
  4669. public void setHero(boolean isEradicator) {
  4670. this.isHero = isEradicator;
  4671. }
  4672.  
  4673.  
  4674. private boolean isSavior;
  4675. private int hacker;
  4676. public boolean invtoken;
  4677.  
  4678. public boolean isLentDonator() {
  4679. return isLentDonator;
  4680. }
  4681. public void setLentDonator(boolean isLentDonator) {
  4682. this.isLentDonator = isLentDonator;
  4683. }
  4684. public boolean isLentExtreme() {
  4685. return isLentExtreme;
  4686. }
  4687. public void setLentExtreme(boolean isLentExtreme) {
  4688. this.isLentExtreme = isLentExtreme;
  4689. }
  4690. public boolean isLentSavior() {
  4691. return isLentSavior;
  4692. }
  4693. public void setLentSavior(boolean isLentSavior) {
  4694. this.isLentSavior = isLentSavior;
  4695. }
  4696. public boolean isLentEradicator() {
  4697. return isLentEradicator;
  4698. }
  4699. public void setLentEradicator(boolean isLentEradicator) {
  4700. this.isLentEradicator = isLentEradicator;
  4701. }
  4702.  
  4703. private boolean isLentDonator;
  4704. private boolean isLentExtreme;
  4705. private boolean isLentSavior;
  4706. private boolean isLentEradicator;
  4707. private int wrong;
  4708. private int fixfiveb;
  4709. private int bossslayerPoints;
  4710. private boolean completedFullSlayerHelmet;
  4711. private boolean killedDragithNurn;
  4712.  
  4713. public boolean isSavior() {
  4714. return isSavior;
  4715. }
  4716.  
  4717. public void setSavior(boolean isSavior) {
  4718. this.isSavior = isSavior;
  4719. }
  4720.  
  4721. public void setOwner(boolean isOwner) {
  4722. this.isOwner = isOwner;
  4723. }
  4724.  
  4725. public int getGuestChatSetup() {
  4726. return guestChatSetup;
  4727. }
  4728.  
  4729. public void setGuestChatSetup(int guestChatSetup) {
  4730. this.guestChatSetup = guestChatSetup;
  4731. }
  4732.  
  4733. public ClansManager getGuestClanManager() {
  4734. return guestClanManager;
  4735. }
  4736.  
  4737. public void setGuestClanManager(ClansManager guestClanManager) {
  4738. this.guestClanManager = guestClanManager;
  4739. }
  4740.  
  4741. public String getClanName() {
  4742. return clanName;
  4743. }
  4744.  
  4745. public void setClanName(String clanName) {
  4746. this.clanName = clanName;
  4747. }
  4748.  
  4749. public boolean isConnectedClanChannel() {
  4750. return connectedClanChannel;
  4751. }
  4752.  
  4753. public void setConnectedClanChannel(boolean connectedClanChannel) {
  4754. this.connectedClanChannel = connectedClanChannel;
  4755. }
  4756.  
  4757.  
  4758.  
  4759. @SuppressWarnings("deprecation")
  4760. public void makeDonator(int months) {
  4761. if (donatorTill < Utils.currentTimeMillis())
  4762. donatorTill = Utils.currentTimeMillis();
  4763. Date date = new Date(donatorTill);
  4764. date.setMonth(date.getMonth() + months);
  4765. donatorTill = date.getTime();
  4766. }
  4767.  
  4768. @SuppressWarnings("deprecation")
  4769. public void makeDonatorDays(int days) {
  4770. if (donatorTill < Utils.currentTimeMillis())
  4771. donatorTill = Utils.currentTimeMillis();
  4772. Date date = new Date(donatorTill);
  4773. date.setDate(date.getDate() + days);
  4774. donatorTill = date.getTime();
  4775. }
  4776.  
  4777. @SuppressWarnings("deprecation")
  4778. public void makeExtremeDonatorDays(int days) {
  4779. if (extremeDonatorTill < Utils.currentTimeMillis())
  4780. extremeDonatorTill = Utils.currentTimeMillis();
  4781. Date date = new Date(extremeDonatorTill);
  4782. date.setDate(date.getDate() + days);
  4783. extremeDonatorTill = date.getTime();
  4784. }
  4785.  
  4786. @SuppressWarnings("deprecation")
  4787. public String getDonatorTill() {
  4788. return (donator ? "never" : new Date(donatorTill).toGMTString()) + ".";
  4789. }
  4790.  
  4791. @SuppressWarnings("deprecation")
  4792. public String getExtremeDonatorTill() {
  4793. return (extremeDonator ? "never" : new Date(extremeDonatorTill)
  4794. .toGMTString()) + ".";
  4795. }
  4796.  
  4797. public void setDonator(boolean donator) {
  4798. this.donator = donator;
  4799. }
  4800.  
  4801. public String getRecovQuestion() {
  4802. return recovQuestion;
  4803. }
  4804.  
  4805. public void setRecovQuestion(String recovQuestion) {
  4806. this.recovQuestion = recovQuestion;
  4807. }
  4808.  
  4809. public String getRecovAnswer() {
  4810. return recovAnswer;
  4811. }
  4812.  
  4813. public void setRecovAnswer(String recovAnswer) {
  4814. this.recovAnswer = recovAnswer;
  4815. }
  4816.  
  4817. public String getLastMsg() {
  4818. return lastMsg;
  4819. }
  4820.  
  4821. public void setLastMsg(String lastMsg) {
  4822. this.lastMsg = lastMsg;
  4823. }
  4824.  
  4825. public void pmLog(Player player, Player getter, String message) {
  4826. try {
  4827. BufferedWriter bf = new BufferedWriter(new FileWriter(
  4828. "data/logs/PMs.txt", true));
  4829. bf.write("[" + DateFormat.getDateTimeInstance().format(new Date())
  4830. //+ " "
  4831. // + Calendar.getInstance().getTimeZone().getDisplayName()
  4832. + "] " + Utils.formatPlayerNameForDisplay(player.getUsername()) + " messaged "+Utils.formatPlayerNameForDisplay(getter.getUsername()) +": "+message);
  4833. bf.newLine();
  4834. bf.flush();
  4835. bf.close();
  4836. } catch (IOException ignored) {
  4837. }
  4838. }
  4839.  
  4840. public static void chatLog(Player player, String message) {
  4841. if (message.length() > 13) {
  4842. if (message.substring(0, 13).contains("changepass"))
  4843. message = "Password changed command";
  4844. }
  4845. if (message.length() > 14) {
  4846. if (message.substring(0, 14).contains("dropboxinfo"))
  4847. message = "**********";
  4848. }
  4849. try {
  4850. BufferedWriter bf = new BufferedWriter(new FileWriter(
  4851. "data/logs/Chats.txt", true));
  4852. bf.write("[" + DateFormat.getDateTimeInstance().format(new Date())
  4853. //+ " "
  4854. // + Calendar.getInstance().getTimeZone().getDisplayName()
  4855. + "] " + Utils.formatPlayerNameForDisplay(player.getUsername()) + ": "+message);
  4856. bf.newLine();
  4857. bf.flush();
  4858. bf.close();
  4859. } catch (IOException ignored) {
  4860. }
  4861. }
  4862.  
  4863. public int[] getPouches() {
  4864. return pouches;
  4865. }
  4866.  
  4867. public EmotesManager getEmotesManager() {
  4868. return emotesManager;
  4869. }
  4870.  
  4871. public String getLastIP() {
  4872. return lastIP;
  4873. }
  4874.  
  4875. public String getLastHostname() {
  4876. InetAddress addr;
  4877. try {
  4878. addr = InetAddress.getByName(getLastIP());
  4879. String hostname = addr.getHostName();
  4880. return hostname;
  4881. } catch (UnknownHostException e) {
  4882. e.printStackTrace();
  4883. }
  4884. return null;
  4885. }
  4886.  
  4887. public PriceCheckManager getPriceCheckManager() {
  4888. return priceCheckManager;
  4889. }
  4890.  
  4891. public void setPestPoints(int pestPoints) {
  4892. this.pestPoints = pestPoints;
  4893. }
  4894.  
  4895. public int getPestPoints() {
  4896. return pestPoints;
  4897. }
  4898.  
  4899. public boolean isUpdateMovementType() {
  4900. return updateMovementType;
  4901. }
  4902.  
  4903. public long getLastPublicMessage() {
  4904. return lastPublicMessage;
  4905. }
  4906.  
  4907. public void setLastPublicMessage(long lastPublicMessage) {
  4908. this.lastPublicMessage = lastPublicMessage;
  4909. }
  4910.  
  4911. public CutscenesManager getCutscenesManager() {
  4912. return cutscenesManager;
  4913. }
  4914.  
  4915. public void kickPlayerFromFriendsChannel(String name) {
  4916. if (currentFriendChat == null)
  4917. return;
  4918. currentFriendChat.kickPlayerFromChat(this, name);
  4919. }
  4920.  
  4921. public void sendFriendsChannelMessage(String message) {
  4922. if (currentFriendChat == null)
  4923. return;
  4924. currentFriendChat.sendMessage(this, message);
  4925. }
  4926.  
  4927. public void sendFriendsChannelQuickMessage(QuickChatMessage message) {
  4928. if (currentFriendChat == null)
  4929. return;
  4930. currentFriendChat.sendQuickMessage(this, message);
  4931. }
  4932.  
  4933. public void sendPublicChatMessage(PublicChatMessage message) {
  4934. boolean tag = false;
  4935. if (message.getMessage(false).contains("@") && message.getMessage(false).contains(" ")) {
  4936. if (message.getMessage(false).indexOf("@") == 0) {
  4937. String name = message.getMessage(false).substring(message.getMessage(false).indexOf("@")+1, message.getMessage(false).indexOf(" "));
  4938. for (Player player : World.getPlayers()) {
  4939. if (player == null)
  4940. continue;
  4941. if (player.getDisplayName().toLowerCase().replaceAll(" ", "_").equals(name.toLowerCase())) {
  4942. if (!player.getFriendsIgnores().getIgnores().contains(Utils.formatPlayerNameForProtocol(this.getUsername()))) {
  4943. player.sm("<col=9A11D9>["+ (player.getMessageIcon() != 0 ?
  4944. ("<img="+this.getMessageIcon()+">") : ("")) + this.getDisplayName() + " whispered]: " + Utils.fixChatMessage(message.getMessage(false).substring(
  4945. message.getMessage(false).indexOf(" ")).replaceAll("<", "")));
  4946. this.sm("<col=9A11D9>[You whispered to "+ (player.getMessageIcon() != 0 ?
  4947. ("<img="+player.getMessageIcon()+">") : ("")) + player.getDisplayName()+ "]: " + Utils.fixChatMessage(message.getMessage(false).substring(
  4948. message.getMessage(false).indexOf(" ")).replaceAll("<img", "")));
  4949. } else
  4950. this.sm("This person has you on their ignore list.");
  4951. tag = true;
  4952.  
  4953. }
  4954. }
  4955. }
  4956. }
  4957. if (tag)
  4958. return;
  4959. for (int regionId : getMapRegionsIds()) {
  4960. List<Integer> playersIndexes = World.getRegion(regionId)
  4961. .getPlayerIndexes();
  4962. if (playersIndexes == null)
  4963. continue;
  4964. for (Integer playerIndex : playersIndexes) {
  4965. Player p = World.getPlayers().get(playerIndex);
  4966. if (p == null
  4967. || !p.hasStarted()
  4968. || p.hasFinished()
  4969. || p.getLocalPlayerUpdate().getLocalPlayers()[getIndex()] == null)
  4970. continue;
  4971. p.getPackets().sendPublicMessage(this, message);
  4972. }
  4973. }
  4974. }
  4975.  
  4976. public int[] getCompletionistCapeCustomized() {
  4977. return completionistCapeCustomized;
  4978. }
  4979.  
  4980. public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
  4981. this.completionistCapeCustomized = skillcapeCustomized;
  4982. }
  4983.  
  4984. public int[] getFiveBillCapeCustomized() {
  4985. return fivebillCustomized;
  4986. }
  4987.  
  4988. public void setFiveBillCapeCustomized(int[] fivebillCustomized) {
  4989. this.fivebillCustomized = fivebillCustomized;
  4990. }
  4991.  
  4992. public int[] getMaxedCapeCustomized() {
  4993. return maxedCapeCustomized;
  4994. }
  4995.  
  4996. public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
  4997. this.maxedCapeCustomized = maxedCapeCustomized;
  4998. }
  4999.  
  5000. public void setSkullId(int skullId) {
  5001. this.skullId = skullId;
  5002. }
  5003.  
  5004. public int getSkullId() {
  5005. return skullId;
  5006. }
  5007.  
  5008. public boolean isFilterGame() {
  5009. return filterGame;
  5010. }
  5011.  
  5012. public void setFilterGame(boolean filterGame) {
  5013. this.filterGame = filterGame;
  5014. }
  5015.  
  5016. public void addLogicPacketToQueue(LogicPacket packet) {
  5017. for (LogicPacket p : logicPackets) {
  5018. if (p.getId() == packet.getId()) {
  5019. logicPackets.remove(p);
  5020. break;
  5021. }
  5022. }
  5023. logicPackets.add(packet);
  5024. }
  5025.  
  5026. public DominionTower getDominionTower() {
  5027. return dominionTower;
  5028. }
  5029.  
  5030. public void setPrayerRenewalDelay(int delay) {
  5031. this.prayerRenewalDelay = delay;
  5032. }
  5033.  
  5034. public int getOverloadDelay() {
  5035. return overloadDelay;
  5036. }
  5037.  
  5038. public void setOverloadDelay(int overloadDelay) {
  5039. this.overloadDelay = overloadDelay;
  5040. }
  5041. public int getEradicatorDelay() {
  5042. return eradicatorDelay;
  5043. }
  5044. public void setEradicatorDelay(int eradicatorDelay) {
  5045. this.eradicatorDelay = eradicatorDelay;
  5046. }
  5047. public Trade getTrade() {
  5048. return trade;
  5049. }
  5050.  
  5051. public void setTeleBlockDelay(long teleDelay) {
  5052. getTemporaryAttributtes().put("TeleBlocked",
  5053. teleDelay + Utils.currentTimeMillis());
  5054. }
  5055.  
  5056. public long getTeleBlockDelay() {
  5057. Long teleblock = (Long) getTemporaryAttributtes().get("TeleBlocked");
  5058. if (teleblock == null)
  5059. return 0;
  5060. return teleblock;
  5061. }
  5062.  
  5063. public void setPrayerDelay(long teleDelay) {
  5064. getTemporaryAttributtes().put("PrayerBlocked",
  5065. teleDelay + Utils.currentTimeMillis());
  5066. prayer.closeAllPrayers();
  5067. }
  5068.  
  5069. public long getPrayerDelay() {
  5070. Long teleblock = (Long) getTemporaryAttributtes().get("PrayerBlocked");
  5071. if (teleblock == null)
  5072. return 0;
  5073. return teleblock;
  5074. }
  5075.  
  5076. public Familiar getFamiliar() {
  5077. return familiar;
  5078. }
  5079.  
  5080. public void setFamiliar(Familiar familiar) {
  5081. this.familiar = familiar;
  5082. }
  5083.  
  5084. public FriendChatsManager getCurrentFriendChat() {
  5085. return currentFriendChat;
  5086. }
  5087.  
  5088. public void setCurrentFriendChat(FriendChatsManager currentFriendChat) {
  5089. this.currentFriendChat = currentFriendChat;
  5090. }
  5091.  
  5092. public String getCurrentFriendChatOwner() {
  5093. return currentFriendChatOwner;
  5094. }
  5095.  
  5096. public void setCurrentFriendChatOwner(String currentFriendChatOwner) {
  5097. this.currentFriendChatOwner = currentFriendChatOwner;
  5098. }
  5099.  
  5100. public int getSummoningLeftClickOption() {
  5101. return summoningLeftClickOption;
  5102. }
  5103.  
  5104. public void setSummoningLeftClickOption(int summoningLeftClickOption) {
  5105. this.summoningLeftClickOption = summoningLeftClickOption;
  5106. }
  5107.  
  5108. public boolean canSpawn() {
  5109. if (Wilderness.isAtWild(this)
  5110. || getControlerManager().getControler() instanceof FightPitsArena
  5111. || getControlerManager().getControler() instanceof CorpBeastControler
  5112. || getControlerManager().getControler() instanceof PestControlLobby
  5113. || getControlerManager().getControler() instanceof PestControlGame
  5114. || getControlerManager().getControler() instanceof ZGDControler
  5115. || getControlerManager().getControler() instanceof GodWars
  5116. || getControlerManager().getControler() instanceof DTControler
  5117. || getControlerManager().getControler() instanceof DuelArena
  5118. || getControlerManager().getControler() instanceof CastleWarsPlaying
  5119. || getControlerManager().getControler() instanceof CastleWarsWaiting
  5120. || getControlerManager().getControler() instanceof FightCaves
  5121. || getControlerManager().getControler() instanceof FightKiln
  5122. || FfaZone.inPvpArea(this)
  5123. || getControlerManager().getControler() instanceof NomadsRequiem
  5124. || getControlerManager().getControler() instanceof QueenBlackDragonController
  5125. || getControlerManager().getControler() instanceof WarControler) {
  5126. return false;
  5127. }
  5128. if (getControlerManager().getControler() instanceof CrucibleControler) {
  5129. CrucibleControler controler = (CrucibleControler) getControlerManager()
  5130. .getControler();
  5131. return !controler.isInside();
  5132. }
  5133. return true;
  5134. }
  5135.  
  5136. public long getPolDelay() {
  5137. return polDelay;
  5138. }
  5139.  
  5140. public void addPolDelay(long delay) {
  5141. polDelay = delay + Utils.currentTimeMillis();
  5142. }
  5143.  
  5144. public void setPolDelay(long delay) {
  5145. this.polDelay = delay;
  5146. }
  5147.  
  5148. public List<Integer> getSwitchItemCache() {
  5149. return switchItemCache;
  5150. }
  5151.  
  5152. public AuraManager getAuraManager() {
  5153. return auraManager;
  5154. }
  5155.  
  5156. public int getMovementType() {
  5157. if (getTemporaryMoveType() != -1)
  5158. return getTemporaryMoveType();
  5159. return getRun() ? RUN_MOVE_TYPE : WALK_MOVE_TYPE;
  5160. }
  5161.  
  5162. public List<String> getOwnedObjectManagerKeys() {
  5163. if (ownedObjectsManagerKeys == null) // temporary
  5164. ownedObjectsManagerKeys = new LinkedList<String>();
  5165. return ownedObjectsManagerKeys;
  5166. }
  5167.  
  5168. public boolean hasInstantSpecial(final int weaponId) {
  5169. switch (weaponId) {
  5170. case 4153:
  5171. case 28004:
  5172. case 15486:
  5173. case 22207:
  5174. case 22209:
  5175. case 22211:
  5176. case 22213:
  5177. case 1377:
  5178. case 13472:
  5179. case 35:// Excalibur
  5180. case 8280:
  5181. case 14632:
  5182. return true;
  5183. default:
  5184. return false;
  5185. }
  5186. }
  5187.  
  5188. public void performInstantSpecial(final int weaponId) {
  5189. int specAmt = PlayerCombat.getSpecialAmmount(weaponId);
  5190. if (combatDefinitions.hasRingOfVigour())
  5191. specAmt *= 0.9;
  5192. if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
  5193. getPackets().sendGameMessage("You don't have enough power left.");
  5194. combatDefinitions.desecreaseSpecialAttack(0);
  5195. return;
  5196. }
  5197. if (this.getSwitchItemCache().size() > 0) {
  5198. ButtonHandler.submitSpecialRequest(this);
  5199. return;
  5200. }
  5201. switch (weaponId) {
  5202. case 4153:
  5203. case 28004:
  5204. combatDefinitions.setInstantAttack(true);
  5205. combatDefinitions.switchUsingSpecialAttack();
  5206. Entity target = (Entity) getTemporaryAttributtes().get(
  5207. "last_target");
  5208. if (target != null
  5209. && target.getTemporaryAttributtes().get("last_attacker") == this) {
  5210. if (!(getActionManager().getAction() instanceof PlayerCombat)
  5211. || ((PlayerCombat) getActionManager().getAction())
  5212. .getTarget() != target) {
  5213. getActionManager().setAction(new PlayerCombat(target));
  5214. }
  5215. }
  5216. break;
  5217. case 1377:
  5218. case 13472:
  5219. setNextAnimation(new Animation(1056));
  5220. setNextGraphics(new Graphics(246));
  5221. setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
  5222. int defence = (int) (skills.getLevelForXp(Skills.DEFENCE) * 0.90D);
  5223. int attack = (int) (skills.getLevelForXp(Skills.ATTACK) * 0.90D);
  5224. int range = (int) (skills.getLevelForXp(Skills.RANGE) * 0.90D);
  5225. int magic = (int) (skills.getLevelForXp(Skills.MAGIC) * 0.90D);
  5226. int strength = (int) (skills.getLevelForXp(Skills.STRENGTH) * 1.2D);
  5227. skills.set(Skills.DEFENCE, defence);
  5228. skills.set(Skills.ATTACK, attack);
  5229. skills.set(Skills.RANGE, range);
  5230. skills.set(Skills.MAGIC, magic);
  5231. skills.set(Skills.STRENGTH, strength);
  5232. combatDefinitions.desecreaseSpecialAttack(specAmt);
  5233. break;
  5234. case 35:// Excalibur
  5235. case 8280:
  5236. case 14632:
  5237. setNextAnimation(new Animation(1168));
  5238. setNextGraphics(new Graphics(247));
  5239. final boolean enhanced = weaponId == 14632;
  5240. skills.set(
  5241. Skills.DEFENCE,
  5242. enhanced ? (int) (skills.getLevelForXp(Skills.DEFENCE) * 1.15D)
  5243. : (skills.getLevel(Skills.DEFENCE) + 8));
  5244. WorldTasksManager.schedule(new WorldTask() {
  5245. int count = 5;
  5246.  
  5247. @Override
  5248. public void run() {
  5249. if (isDead() || hasFinished()
  5250. || getHitpoints() >= getMaxHitpoints()) {
  5251. stop();
  5252. return;
  5253. }
  5254. heal(enhanced ? 80 : 40);
  5255. if (count-- == 0) {
  5256. stop();
  5257. return;
  5258. }
  5259. }
  5260. }, 4, 2);
  5261. combatDefinitions.desecreaseSpecialAttack(specAmt);
  5262. break;
  5263. case 15486:
  5264. case 22207:
  5265. case 22209:
  5266. case 22211:
  5267. case 22213:
  5268. setNextAnimation(new Animation(12804));
  5269. setNextGraphics(new Graphics(2319));// 2320
  5270. setNextGraphics(new Graphics(2321));
  5271. addPolDelay(60000);
  5272. combatDefinitions.desecreaseSpecialAttack(specAmt);
  5273. break;
  5274. }
  5275. }
  5276.  
  5277. public void setDisableEquip(boolean equip) {
  5278. disableEquip = equip;
  5279. }
  5280.  
  5281. public int getTrollsKilled() {
  5282. return trollsKilled;
  5283. }
  5284.  
  5285. public int getTrollsToKill() {
  5286. return trollsToKill;
  5287. }
  5288.  
  5289. public int setTrollsKilled(int trollsKilled) {
  5290. return (this.trollsKilled = trollsKilled);
  5291. }
  5292.  
  5293. public int setTrollsToKill(int toKill) {
  5294. return (this.trollsToKill = toKill);
  5295. }
  5296.  
  5297. public void addTrollKill() {
  5298. trollsKilled++;
  5299. }
  5300.  
  5301. public boolean isEquipDisabled() {
  5302. return disableEquip;
  5303. }
  5304.  
  5305. public void addDisplayTime(long i) {
  5306. this.displayTime = i + Utils.currentTimeMillis();
  5307. }
  5308.  
  5309. public long getDisplayTime() {
  5310. return displayTime;
  5311. }
  5312.  
  5313. public int getPublicStatus() {
  5314. return publicStatus;
  5315. }
  5316.  
  5317. public void setPublicStatus(int publicStatus) {
  5318. this.publicStatus = publicStatus;
  5319. }
  5320.  
  5321. public int getClanStatus() {
  5322. return clanStatus;
  5323. }
  5324.  
  5325. public void setClanStatus(int clanStatus) {
  5326. this.clanStatus = clanStatus;
  5327. }
  5328.  
  5329. public int getTradeStatus() {
  5330. return tradeStatus;
  5331. }
  5332.  
  5333. public void setTradeStatus(int tradeStatus) {
  5334. this.tradeStatus = tradeStatus;
  5335. }
  5336.  
  5337. public int getAssistStatus() {
  5338. return assistStatus;
  5339. }
  5340.  
  5341. public void setAssistStatus(int assistStatus) {
  5342. this.assistStatus = assistStatus;
  5343. }
  5344.  
  5345. public boolean isSpawnsMode() {
  5346. return spawnsMode;
  5347. }
  5348.  
  5349. public void setSpawnsMode(boolean spawnsMode) {
  5350. this.spawnsMode = spawnsMode;
  5351. }
  5352.  
  5353. public IsaacKeyPair getIsaacKeyPair() {
  5354. return isaacKeyPair;
  5355. }
  5356.  
  5357. public QuestManager getQuestManager() {
  5358. return questManager;
  5359. }
  5360.  
  5361. public EXQuestManager getEXQuestManager() {
  5362. return exquestManager;
  5363. }
  5364.  
  5365. public EliteChapterFive getEliteChapterV() {
  5366. return (EliteChapterFive) getEXQuestManager().getQuest(QNames.ELITE_CHAPTER_V);
  5367. }
  5368.  
  5369. public EliteChapterFour getEliteChapterIV() {
  5370. return (EliteChapterFour) getEXQuestManager().getQuest(QNames.ELITE_CHAPTER_IV);
  5371. }
  5372.  
  5373. public EliteChapterThree getEliteChapterIII() {
  5374. return (EliteChapterThree) getEXQuestManager().getQuest(QNames.ELITE_CHAPTER_III);
  5375. }
  5376.  
  5377. public EliteChapterTwo getEliteChapterII() {
  5378. return (EliteChapterTwo) getEXQuestManager().getQuest(QNames.ELITE_CHAPTER_II);
  5379. }
  5380.  
  5381. public EliteChapterOne getEliteChapterI() {
  5382. return (EliteChapterOne) getEXQuestManager().getQuest(QNames.ELITE_CHAPTER_I);
  5383. }
  5384.  
  5385. public boolean isCompletedFightCaves() {
  5386. return completedFightCaves;
  5387. }
  5388.  
  5389. public void setCompletedFightCaves() {
  5390. if (!completedFightCaves) {
  5391. completedFightCaves = true;
  5392. refreshFightKilnEntrance();
  5393. }
  5394. }
  5395.  
  5396. public boolean isCompletedFightKiln() {
  5397. return completedFightKiln;
  5398. }
  5399.  
  5400. public void setCompletedFightKiln() {
  5401. completedFightKiln = true;
  5402. }
  5403.  
  5404. public boolean isCompletedFullSlayerHelmet() {
  5405. return completedFullSlayerHelmet;
  5406. }
  5407.  
  5408. public void setCompletedFullSlayerHelmet() {
  5409. completedFullSlayerHelmet = true;
  5410. }
  5411.  
  5412. public boolean isKilledDragithNurn() {
  5413. return killedDragithNurn;
  5414. }
  5415.  
  5416. public void setKilledDragithNurn() {
  5417. killedDragithNurn = true;
  5418. }
  5419.  
  5420.  
  5421. public boolean isWonFightPits() {
  5422. return wonFightPits;
  5423. }
  5424.  
  5425. public void setWonFightPits() {
  5426. wonFightPits = true;
  5427. }
  5428.  
  5429. public boolean isCantTrade() {
  5430. return cantTrade;
  5431. }
  5432.  
  5433. public void setCantTrade(boolean canTrade) {
  5434. this.cantTrade = canTrade;
  5435. }
  5436.  
  5437. public String getYellColor() {
  5438. return yellColor;
  5439. }
  5440.  
  5441. public void setYellColor(String yellColor) {
  5442. this.yellColor = yellColor;
  5443. }
  5444.  
  5445. public String getYellTitle() {
  5446. return yellTitle;
  5447. }
  5448.  
  5449. public void setYellTitle(String yellTitle) {
  5450. this.yellTitle = yellTitle;
  5451. }
  5452.  
  5453. public String getYellShade() {
  5454. return yellShade;
  5455. }
  5456.  
  5457. public void setYellShade(String yellShade) {
  5458. this.yellShade = yellShade;
  5459. }
  5460.  
  5461. /**
  5462. * Gets the pet.
  5463. *
  5464. * @return The pet.
  5465. */
  5466. public Pet getPet() {
  5467. return pet;
  5468. }
  5469.  
  5470. /**
  5471. * Sets the pet.
  5472. *
  5473. * @param pet
  5474. * The pet to set.
  5475. */
  5476. public void setPet(Pet pet) {
  5477. this.pet = pet;
  5478. }
  5479.  
  5480. public boolean isSupporter() {
  5481. return isSupporter;
  5482. }
  5483.  
  5484. public void setSupporter(boolean isSupporter) {
  5485. this.isSupporter = isSupporter;
  5486. }
  5487.  
  5488. /**
  5489. * Gets the petManager.
  5490. *
  5491. * @return The petManager.
  5492. */
  5493. public PetManager getPetManager() {
  5494. return petManager;
  5495. }
  5496.  
  5497. /**
  5498. * Sets the petManager.
  5499. *
  5500. * @param petManager
  5501. * The petManager to set.
  5502. */
  5503. public void setPetManager(PetManager petManager) {
  5504. this.petManager = petManager;
  5505. }
  5506.  
  5507. public boolean isXpLocked() {
  5508. return xpLocked;
  5509. }
  5510.  
  5511. public void setXpLocked(boolean locked) {
  5512. this.xpLocked = locked;
  5513. }
  5514.  
  5515. public int getLastBonfire() {
  5516. return lastBonfire;
  5517. }
  5518.  
  5519. public void setLastBonfire(int lastBonfire) {
  5520. this.lastBonfire = lastBonfire;
  5521. }
  5522.  
  5523. public boolean isYellOff() {
  5524. return yellOff;
  5525. }
  5526.  
  5527. public void setYellOff(boolean yellOff) {
  5528. this.yellOff = yellOff;
  5529. }
  5530.  
  5531. public void setInvulnerable(boolean invulnerable) {
  5532. this.invulnerable = invulnerable;
  5533. }
  5534.  
  5535. public double getHpBoostMultiplier() {
  5536. return hpBoostMultiplier;
  5537. }
  5538.  
  5539. public void setHpBoostMultiplier(double hpBoostMultiplier) {
  5540. this.hpBoostMultiplier = hpBoostMultiplier;
  5541. }
  5542.  
  5543. /**
  5544. * Gets the killedQueenBlackDragon.
  5545. *
  5546. * @return The killedQueenBlackDragon.
  5547. */
  5548. public boolean isKilledQueenBlackDragon() {
  5549. return killedQueenBlackDragon;
  5550. }
  5551.  
  5552. /**
  5553. * Sets the killedQueenBlackDragon.
  5554. *
  5555. * @param killedQueenBlackDragon
  5556. * The killedQueenBlackDragon to set.
  5557. */
  5558. public void setKilledQueenBlackDragon(boolean killedQueenBlackDragon) {
  5559. this.killedQueenBlackDragon = killedQueenBlackDragon;
  5560. }
  5561.  
  5562. public boolean hasLargeSceneView() {
  5563. return largeSceneView;
  5564. }
  5565.  
  5566. public void setLargeSceneView(boolean largeSceneView) {
  5567. this.largeSceneView = largeSceneView;
  5568. }
  5569. /**
  5570. * @return the runeSpanPoint
  5571. */
  5572. public int getRuneSpanPoints() {
  5573. return runeSpanPoints;
  5574. }
  5575.  
  5576. /**
  5577. * @param runeSpanPoint
  5578. * the runeSpanPoint to set
  5579. */
  5580. public void setRuneSpanPoint(int runeSpanPoints) {
  5581. this.runeSpanPoints = runeSpanPoints;
  5582. }
  5583.  
  5584. /**
  5585. * Adds points
  5586. *
  5587. * @param points
  5588. */
  5589. public void addRunespanPoints(int points) {
  5590. this.runeSpanPoints += points;
  5591. }
  5592.  
  5593. public DuelRules getLastDuelRules() {
  5594. return lastDuelRules;
  5595. }
  5596.  
  5597. public void setLastDuelRules(DuelRules duelRules) {
  5598. this.lastDuelRules = duelRules;
  5599. }
  5600.  
  5601. public boolean isTalkedWithMarv() {
  5602. return talkedWithMarv;
  5603. }
  5604.  
  5605. public void setTalkedWithMarv() {
  5606. talkedWithMarv = true;
  5607. }
  5608.  
  5609. public int getCrucibleHighScore() {
  5610. return crucibleHighScore;
  5611. }
  5612.  
  5613. public void increaseCrucibleHighScore() {
  5614. crucibleHighScore++;
  5615. }
  5616.  
  5617. public void setSlayerPoints(int slayerPoints) {
  5618. this.slayerPoints = slayerPoints;
  5619. }
  5620.  
  5621. public int getSlayerPoints() {
  5622. return slayerPoints;
  5623. }
  5624.  
  5625. public void setBossSlayerPoints(int bossslayerPoints) {
  5626. this.bossslayerPoints = bossslayerPoints;
  5627. }
  5628.  
  5629. public int getBossSlayerPoints() {
  5630. return bossslayerPoints;
  5631. }
  5632.  
  5633. public void setCopyrightKills(int copyrightkills) {
  5634. this.copyrightkills = copyrightkills;
  5635. }
  5636.  
  5637. public int getCopyrightKills() {
  5638. return copyrightkills;
  5639. }
  5640. public void setCorporealKills(int corporealkills) {
  5641. this.corporealkills = corporealkills;
  5642. }
  5643.  
  5644. public int getCorporealKills() {
  5645. return corporealkills;
  5646. }
  5647. public void setJadKills(int jadkills) {
  5648. this.jadkills = jadkills;
  5649. }
  5650.  
  5651. public int getJadKills() {
  5652. return jadkills;
  5653. }
  5654. public void setObsidianKingKills(int obsidiankingkills) {
  5655. this.obsidiankingkills = obsidiankingkills;
  5656. }
  5657.  
  5658. public int getObsidianKingKills() {
  5659. return obsidiankingkills;
  5660. }
  5661.  
  5662. public void setFatalKills(int fatalkills) {
  5663. this.fatalkills = fatalkills;
  5664. }
  5665.  
  5666. public int getFatalKills() {
  5667. return fatalkills;
  5668. }
  5669.  
  5670. public void setMuteMarks(int mutemarks) {
  5671. if (mutemarks == 0) {
  5672. this.mutemark = mutemarks;
  5673. return;
  5674. }
  5675. if (mutemarks < 0)
  5676. return;
  5677. if (mutemarks == 1)
  5678. mutemark = 1;
  5679. if (mutemark == 3)
  5680. return;
  5681. this.mutemark = mutemarks;
  5682. if (mutemark == 3) {
  5683. sm("You have reached 3 mute marks. You have been muted for 24 hours.");
  5684. setMuted(Utils.currentTimeMillis() + ((24 * 60 * 60 * 1000)));
  5685. }
  5686. try {
  5687. getInterfaceManager().sendInterface(627);
  5688. getPackets().sendIComponentText(627, 5, "");
  5689. getPackets().sendIComponentText(627, 14, "A staff has appointed you a mute mark. If you get 3 mute marks, you will be muted."
  5690. + "<col=E32020> You have " + mutemarks + " mute marks.");
  5691. setNextForceTalk(new ForceTalk("I have " + mutemark + " mute marks, three mute marks will get me muted."));
  5692. } catch (Throwable e) {
  5693.  
  5694. }
  5695. }
  5696.  
  5697. public int getMuteMarks() {
  5698. return mutemark;
  5699. }
  5700.  
  5701. public void setFix5bcape(int fixfiveb) {
  5702. this.fixfiveb = fixfiveb;
  5703. }
  5704.  
  5705. public int getFix5bcape() {
  5706. return fixfiveb;
  5707. }
  5708.  
  5709. public void setInstanceKick(boolean isInstanceKicked) {
  5710. this.isInstanceKicked = isInstanceKicked;
  5711. }
  5712.  
  5713. public boolean getInstanceKick() {
  5714. return isInstanceKicked;
  5715. }
  5716.  
  5717. public void setTimer(int timer) {
  5718. this.timer = timer;
  5719. }
  5720.  
  5721. public int getTimer() {
  5722. return timer;
  5723. }
  5724.  
  5725. public void setDestroyTimer(int destroytimer) {
  5726. this.destroytimer = destroytimer;
  5727. }
  5728.  
  5729. public int getDestroyTimer() {
  5730. return destroytimer;
  5731. }
  5732.  
  5733.  
  5734. public void setInstanceEnd(boolean instanceend) {
  5735. this.instanceend = instanceend;
  5736. }
  5737.  
  5738. public boolean getEnd() {
  5739. return instanceend;
  5740. }
  5741.  
  5742.  
  5743. public void setPermaBandos(boolean permabandos) {
  5744. this.permabandos = permabandos;
  5745. }
  5746.  
  5747. public boolean getPermaBandos() {
  5748. return permabandos;
  5749. }
  5750. public void setPermaArmadyl(boolean permaarmadyl) {
  5751. this.permaarmadyl = permaarmadyl;
  5752. }
  5753.  
  5754. public boolean getPermaArmadyl() {
  5755. return permaarmadyl;
  5756. }
  5757. public void setPermaSaradomin(boolean permasaradomin) {
  5758. this.permasaradomin = permasaradomin;
  5759. }
  5760.  
  5761. public boolean getPermaSaradomin() {
  5762. return permasaradomin;
  5763. }
  5764. public void setPermaZamorak(boolean permazamorak) {
  5765. this.permazamorak = permazamorak;
  5766. }
  5767.  
  5768. public boolean getPermaZamorak() {
  5769. return permazamorak;
  5770. }
  5771. public void setPermaBlink(boolean permablink) {
  5772. this.permablink = permablink;
  5773. }
  5774.  
  5775. public boolean getPermaBlink() {
  5776. return permablink;
  5777. }
  5778. public void setPermaEradicator(boolean permaeradicator) {
  5779. this.permaeradicator = permaeradicator;
  5780. }
  5781.  
  5782. public boolean getPermaEradicator() {
  5783. return permaeradicator;
  5784. }
  5785. public void setPermaTrio(boolean permatrio) {
  5786. this.permatrio = permatrio;
  5787. }
  5788.  
  5789. public boolean getPermaTrio() {
  5790. return permatrio;
  5791. }
  5792. public void setPermaCorp(boolean permacorp) {
  5793. this.permacorp = permacorp;
  5794. }
  5795.  
  5796. public boolean getPermaCorp() {
  5797. return permacorp;
  5798. }
  5799. public void setPermaKBD(boolean permakbd) {
  5800. this.permakbd = permakbd;
  5801. }
  5802.  
  5803. public boolean getPermaKBD() {
  5804. return permakbd;
  5805. }
  5806. public void setPermaGradum(boolean permagradum) {
  5807. this.permagradum = permagradum;
  5808. }
  5809.  
  5810. public boolean getPermaGradum() {
  5811. return permagradum;
  5812. }
  5813. public void setPermaWyrm(boolean permawyrm) {
  5814. this.permawyrm = permawyrm;
  5815. }
  5816.  
  5817. public boolean getPermaWyrm() {
  5818. return permawyrm;
  5819. }
  5820. public void setPermaNecroLord(boolean permanecrolord) {
  5821. this.permanecrolord = permanecrolord;
  5822. }
  5823.  
  5824. public boolean getPermaNecroLord() {
  5825. return permanecrolord;
  5826. }
  5827. public void setPermaAvatar(boolean permaavatar) {
  5828. this.permaavatar = permaavatar;
  5829. }
  5830.  
  5831. public boolean getPermaAvatar() {
  5832. return permaavatar;
  5833. }
  5834. public void setPermaFear(boolean permafear) {
  5835. this.permafear = permafear;
  5836. }
  5837.  
  5838. public boolean getPermaFear() {
  5839. return permafear;
  5840. }
  5841. public void setPermaSTQ(boolean permastq) {
  5842. this.permastq = permastq;
  5843. }
  5844.  
  5845. public boolean getPermaSTQ() {
  5846. return permastq;
  5847. }
  5848. public void setPermaGeno(boolean permageno) {
  5849. this.permageno = permageno;
  5850. }
  5851.  
  5852. public boolean getPermaGeno() {
  5853. return permageno;
  5854. }
  5855. public void setPermaRajj(boolean permarajj) {
  5856. this.permarajj = permarajj;
  5857. }
  5858.  
  5859. public boolean getPermaRajj() {
  5860. return permarajj;
  5861. }
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892.  
  5893.  
  5894.  
  5895.  
  5896.  
  5897.  
  5898.  
  5899.  
  5900.  
  5901.  
  5902. public void setWrong(int wrong) {
  5903. this.wrong = wrong;
  5904. }
  5905.  
  5906. public int getWrong() {
  5907. return wrong;
  5908. }
  5909.  
  5910. public void setHacker(int hacker) {
  5911. this.hacker = hacker;
  5912. }
  5913.  
  5914. public int getHacker() {
  5915. return hacker;
  5916. }
  5917.  
  5918. public void setSecurityPin(int securitypin) {
  5919. this.securitypin = securitypin;
  5920. }
  5921.  
  5922. public int getSecurityPin() {
  5923. return securitypin;
  5924. }
  5925.  
  5926. private int donationpin;
  5927.  
  5928. public void setDonationPin(int donationpin) {
  5929. this.donationpin = donationpin;
  5930. }
  5931.  
  5932. public int getDonationPin() {
  5933. return donationpin;
  5934. }
  5935.  
  5936. public void setInstancePin(int instancepin) {
  5937. this.instancepin = instancepin;
  5938. }
  5939.  
  5940. public int getInstancePin() {
  5941. return instancepin;
  5942. }
  5943.  
  5944. public void setAnnouncement(int donexp) {
  5945. this.donexp = donexp;
  5946. }
  5947.  
  5948. public int getAnnouncement() {
  5949. return donexp;
  5950. }
  5951.  
  5952. public void setAnnouncement2(int donexp2) {
  5953. this.donexp2 = donexp2;
  5954. }
  5955.  
  5956. public int getAnnouncement2() {
  5957. return donexp2;
  5958. }
  5959.  
  5960. public void setInterfaceAmount(int interfaceamount) {
  5961. this.interfaceamount = interfaceamount;
  5962. }
  5963.  
  5964. public int getInterfaceAmount() {
  5965. return interfaceamount;
  5966. }
  5967.  
  5968. public void setWildyBossKills(int wildybosskills) {
  5969. this.wildybosskills = wildybosskills;
  5970. }
  5971.  
  5972. public int getWildyBossKills() {
  5973. return wildybosskills;
  5974. }
  5975.  
  5976. public void setSpawnRate(int spawnrate) {
  5977. this.spawnrate = spawnrate;
  5978. }
  5979.  
  5980. public int getSpawnRate() {
  5981. return spawnrate;
  5982. }
  5983.  
  5984. public void setVotingTime(int firsttimevoting) {
  5985. this.firsttimevoting = firsttimevoting;
  5986. }
  5987.  
  5988. public int getVotingTime() {
  5989. return firsttimevoting;
  5990. }
  5991.  
  5992.  
  5993. public void setSomethingKills(int somethingkills) {
  5994. this.somethingkills = somethingkills;
  5995. }
  5996.  
  5997. public int getSomethingKills() {
  5998. return somethingkills;
  5999. }
  6000. public void setSaradominKills(int saradominkills) {
  6001. this.saradominkills = saradominkills;
  6002. }
  6003.  
  6004. public int getSaradominKills() {
  6005. return saradominkills;
  6006. }
  6007. public void setNexKills(int nexkills) {
  6008. this.nexkills = nexkills;
  6009. }
  6010.  
  6011. public int getNexKills() {
  6012. return nexkills;
  6013. }
  6014. public void setSunfreetKills(int sunfreetkills) {
  6015. this.sunfreetkills = sunfreetkills;
  6016. }
  6017.  
  6018. public int getSunfreetKills() {
  6019. return sunfreetkills;
  6020. }
  6021. public void setArmadylKills(int armadylkills) {
  6022. this.armadylkills = armadylkills;
  6023. }
  6024.  
  6025. public int getArmadylKills() {
  6026. return armadylkills;
  6027. }
  6028. public void setBandosKills(int bandoskills) {
  6029. this.bandoskills = bandoskills;
  6030. }
  6031.  
  6032. public int getBandosKills() {
  6033. return bandoskills;
  6034. }
  6035. public void setZamorakKills(int zamorakkills) {
  6036. this.zamorakkills = zamorakkills;
  6037. }
  6038.  
  6039. public int getZamorakKills() {
  6040. return zamorakkills;
  6041. }
  6042. public void setEradicatorBossKills(int eradicatorbosskills) {
  6043. this.eradicatorbosskills = eradicatorbosskills;
  6044. }
  6045.  
  6046. public int getEradicatorBossKills() {
  6047. return eradicatorbosskills;
  6048. }
  6049. public void setGenoKills(int genokills) {
  6050. this.genokills = genokills;
  6051. }
  6052.  
  6053. public int getGenoKills() {
  6054. return genokills;
  6055. }
  6056. public void setRajjKills(int rajjkills) {
  6057. this.rajjkills = rajjkills;
  6058. }
  6059.  
  6060. public int getRajjKills() {
  6061. return rajjkills;
  6062. }
  6063. public void setFearKills(int fearkills) {
  6064. this.fearkills = fearkills;
  6065. }
  6066.  
  6067. public int getFearKills() {
  6068. return fearkills;
  6069. }
  6070. public void setBlinkKills(int blinkkills) {
  6071. this.blinkkills = blinkkills;
  6072. }
  6073.  
  6074. public int getBlinkKills() {
  6075. return blinkkills;
  6076. }
  6077. public void setExtremeBossKills(int extremebosskills) {
  6078. this.extremebosskills = extremebosskills;
  6079. }
  6080.  
  6081. public int getExtremeBossKills() {
  6082. return extremebosskills;
  6083. }
  6084. public void setRegularBossKills(int regularbosskills) {
  6085. this.regularbosskills = regularbosskills;
  6086. }
  6087.  
  6088. public int getRegularBossKills() {
  6089. return regularbosskills;
  6090. }
  6091. public void setGradumKills(int gradumkills) {
  6092. this.gradumkills = gradumkills;
  6093. }
  6094.  
  6095. public int getGradumKills() {
  6096. return gradumkills;
  6097. }
  6098.  
  6099. public boolean isTalkedWithKuradal() {
  6100. return talkedWithKuradal;
  6101. }
  6102.  
  6103. public void setTalkedWithKuradal() {
  6104. talkedWithKuradal = true;
  6105. }
  6106.  
  6107. public boolean isTalkedWithReaper() {
  6108. return talkedWithReaper;
  6109. }
  6110.  
  6111. public void setTalkedWithReaper() {
  6112. talkedWithReaper = true;
  6113. }
  6114.  
  6115. public void falseWithKuradal() {
  6116. talkedWithKuradal = false;
  6117. }
  6118.  
  6119. public int getLoyaltyPoints() {
  6120. return Loyaltypoints;
  6121. }
  6122.  
  6123. public void setLoyaltyPoints(int Loyaltypoints) {
  6124. this.Loyaltypoints = Loyaltypoints;
  6125. }
  6126.  
  6127. public int getDeposittedBones() {
  6128. return EradicatorBonePoints;
  6129. }
  6130.  
  6131. public void setDeposittedBones(int EradicatorBonePoints) {
  6132. this.EradicatorBonePoints = EradicatorBonePoints;
  6133. }
  6134.  
  6135. public int getSuperDeposittedBones() {
  6136. return SuperBonePoints;
  6137. }
  6138.  
  6139. public void setSuperDeposittedBones(int SuperBonePoints) {
  6140. this.SuperBonePoints = SuperBonePoints;
  6141. }
  6142.  
  6143. public void setTask(SlayerTask task) {
  6144. this.task = task;
  6145. }
  6146.  
  6147. public void setBossTask(BossSlayerTask bosstask) {
  6148. this.bosstask = bosstask;
  6149. }
  6150.  
  6151. public SlayerTask getTask() {
  6152. return task;
  6153. }
  6154.  
  6155. public BossSlayerTask getBossTask() {
  6156. return bosstask;
  6157. }
  6158.  
  6159. public void setSafeMode() {
  6160.  
  6161. }
  6162.  
  6163. public void sm(String message) {
  6164. getPackets().sendGameMessage(message);
  6165. }
  6166.  
  6167. public void sit(int interfaceid, int componentId, String text) {
  6168. getPackets().sendIComponentText(interfaceid, componentId, text);
  6169. }
  6170.  
  6171. public void teleportPlayer(int x, int y, int z) {
  6172. setNextWorldTile(new WorldTile(x, y, z));
  6173. stopAll();
  6174. }
  6175.  
  6176. public void LockAccount() {
  6177. World.sendWorldMessage("JAG was enabled, account: <username>'s character has been" + "locked by Jagex Account Guardian.", true);
  6178.  
  6179. }
  6180.  
  6181. public int getLastLoggedIn() {
  6182. return lastlogged;
  6183. }
  6184.  
  6185. public void out(String string) {
  6186. getPackets().sendGameMessage(string);
  6187. }
  6188.  
  6189. private transient VarsManager varsManager;
  6190.  
  6191. public VarsManager getVarsManager() {
  6192. return varsManager;
  6193. }
  6194.  
  6195. private FarmingManager farmingManager;
  6196. private boolean permaSupers;
  6197.  
  6198. public FarmingManager getFarmingManager() {
  6199. return farmingManager;
  6200. }
  6201. public void setMoneyPouch(int i) {
  6202. this.moneypouch = i;
  6203. }
  6204. public boolean isDestroytimer() {
  6205. return isdestroytimer;
  6206. }
  6207. public void setisDestroytimer(boolean isdestroytimer) {
  6208. this.isdestroytimer = isdestroytimer;
  6209. }
  6210. public int getViewpage() {
  6211. return viewpage;
  6212. }
  6213. public void setViewpage(int viewpage) {
  6214. this.viewpage = viewpage;
  6215. }
  6216. public int getRanklend() {
  6217. return ranklend;
  6218. }
  6219. public void setRanklend(int ranklend) {
  6220. this.ranklend = ranklend;
  6221. }
  6222. public int getInstanceBooth() {
  6223. return instanceBooth;
  6224. }
  6225. public void setInstanceBooth(int instanceBooth) {
  6226. this.instanceBooth = instanceBooth;
  6227. }
  6228. public boolean isPermaBank() {
  6229. return permabank;
  6230. }
  6231. public void setPermaBank(boolean permabank) {
  6232. this.permabank = permabank;
  6233. }
  6234. public String getInstanceControler() {
  6235. return instanceControler;
  6236. }
  6237. public void setInstanceControler(String instanceControler) {
  6238. this.instanceControler = instanceControler;
  6239. }
  6240. public WorldTile getOutside() {
  6241. return getoutside;
  6242. }
  6243. public void setOutside(WorldTile getoutside) {
  6244. this.getoutside = getoutside;
  6245. }
  6246. public boolean isOutside() {
  6247. return outside;
  6248. }
  6249. public void setOutside(boolean outside) {
  6250. this.outside = outside;
  6251. }
  6252. public boolean isPermaRegular() {
  6253. return permaregular;
  6254. }
  6255. public void setPermaRegular(boolean permaregular) {
  6256. this.permaregular = permaregular;
  6257. }
  6258. public boolean isPermaExtreme() {
  6259. return permaextreme;
  6260. }
  6261. public void setPermaExtreme(boolean permaextreme) {
  6262. this.permaextreme = permaextreme;
  6263. }
  6264. public boolean isPermaSunfreet() {
  6265. return permasunfret;
  6266. }
  6267. public void setPermaSunfreet(boolean permasunfret) {
  6268. this.permasunfret = permasunfret;
  6269. }
  6270. public int getWyrmKills() {
  6271. return wyrmkills;
  6272. }
  6273. public void setWyrmKills(int wyrmkills) {
  6274. this.wyrmkills = wyrmkills;
  6275. }
  6276. public int getAvatarKills() {
  6277. return avatarkills;
  6278. }
  6279. public void setAvatarKills(int avatarkills) {
  6280. this.avatarkills = avatarkills;
  6281. }
  6282. public int getNecrolordKills() {
  6283. return necrolordkills;
  6284. }
  6285. public void setNecrolordKills(int necrolordkills) {
  6286. this.necrolordkills = necrolordkills;
  6287. }
  6288. public boolean isPermaBrutals() {
  6289. return permabrutals;
  6290. }
  6291. public void setPermaBrutals(boolean permabrutals) {
  6292. this.permabrutals = permabrutals;
  6293. }
  6294. public boolean isPermaSupers() {
  6295. return permaSupers;
  6296. }
  6297. public void setPermaSupers(boolean Supers) {
  6298. this.permaSupers = Supers;
  6299. }
  6300. public boolean isPermaObbyKing() {
  6301. return permaobbyking;
  6302. }
  6303. public void setPermaObbyKing(boolean permaobbyking) {
  6304. this.permaobbyking = permaobbyking;
  6305. }
  6306. public boolean isPermaEradJad() {
  6307. return permaeradjad;
  6308. }
  6309. public void setPermaEradJad(boolean permaeradjad) {
  6310. this.permaeradjad = permaeradjad;
  6311. }
  6312. public boolean isViewStats() {
  6313. return viewStats;
  6314. }
  6315. public void setViewStats(boolean viewStats) {
  6316. this.viewStats = viewStats;
  6317. }
  6318. public int getCollectLoanMoney() {
  6319. return collectLoanMoney;
  6320. }
  6321. public void setCollectLoanMoney(int collectLoanMoney) {
  6322. this.collectLoanMoney = collectLoanMoney;
  6323. }
  6324. public int getDropbeam() {
  6325. return dropbeam;
  6326. }
  6327. public void setDropbeam(int dropbeam) {
  6328. this.dropbeam = dropbeam;
  6329. }
  6330. public int getSelectedbeam() {
  6331. return selectedbeam;
  6332. }
  6333. public void setSelectedbeam(int selectedbeam) {
  6334. this.selectedbeam = selectedbeam;
  6335. }
  6336. public int getKillStreak() {
  6337. return killStreak;
  6338. }
  6339. public void setKillStreak(int killStreak) {
  6340. this.killStreak = killStreak;
  6341. }
  6342. public long getCreationDate() {
  6343. return creationDate;
  6344. }
  6345. public void setCreationDate(long creationDate) {
  6346. this.creationDate = creationDate;
  6347. }
  6348. public boolean isDiceAnnounce() {
  6349. return diceannounce;
  6350. }
  6351. public void setDiceAnnounce(boolean diceannounce) {
  6352. this.diceannounce = diceannounce;
  6353. }
  6354. public boolean isBankEquip() {
  6355. return bankequip;
  6356. }
  6357. public void setBankEquip(boolean bankequip) {
  6358. this.bankequip = bankequip;
  6359. }
  6360. public int getTriviaPoints() {
  6361. return triviapoints;
  6362. }
  6363. public void setTriviaPoints(int triviapoints) {
  6364. this.triviapoints = triviapoints;
  6365. }
  6366. private boolean triviamaster;
  6367. public int ironfirsttime;
  6368. public boolean wenttoevent;
  6369.  
  6370. private boolean learnedPermTurmBoost;
  6371.  
  6372. public boolean completed = true;
  6373.  
  6374. public WorldObject examinedObj;
  6375.  
  6376. public int customDropRate = 0;
  6377.  
  6378. public boolean isTriviamaster() {
  6379. return triviamaster;
  6380. }
  6381. public void setTriviamaster(boolean triviamaster) {
  6382. this.triviamaster = triviamaster;
  6383. }
  6384. public boolean getLearnedRocktailSoup() {
  6385. return learnedRocktailSoup;
  6386. }
  6387. public void setLearnedRocktailSoup(boolean learnedRocktailSoup) {
  6388. this.learnedRocktailSoup = learnedRocktailSoup;
  6389. }
  6390.  
  6391. public String getPanelDisplayName() {
  6392. return paneldname;
  6393. }
  6394. public void setPanelDisplayName(String paneldname) {
  6395. this.paneldname = paneldname;
  6396. }
  6397.  
  6398. public String getPanelName() {
  6399. return panelname;
  6400. }
  6401. public void setPanelName(String panelname) {
  6402. this.panelname = panelname;
  6403. }
  6404.  
  6405. public BankPreset getBankPreset2() {
  6406. return preset2;
  6407. }
  6408. public void setBankPreset2(BankPreset preset) {
  6409. this.preset2 = preset;
  6410. }
  6411.  
  6412. public BankPreset getBankPreset3() {
  6413. return preset3;
  6414. }
  6415. public void setBankPreset3(BankPreset preset) {
  6416. this.preset3 = preset;
  6417. }
  6418.  
  6419. public BankPreset getBankPreset4() {
  6420. return preset4;
  6421. }
  6422. public void setBankPreset4(BankPreset preset) {
  6423. this.preset4 = preset;
  6424. }
  6425.  
  6426. public BankPreset getBankPreset() {
  6427. return preset;
  6428. }
  6429. public void setBankPreset(BankPreset preset) {
  6430. this.preset = preset;
  6431. }
  6432. public int getSaveP() {
  6433. return savep;
  6434. }
  6435. public void setSaveP(int savep) {
  6436. this.savep = savep;
  6437. }
  6438. public KeybindFunctions getKeyFunction() {
  6439. return keybindfunctions;
  6440. }
  6441. public void setKeyFunction(KeybindFunctions keybindfunction) {
  6442. this.keybindfunctions = keybindfunction;
  6443. }
  6444. public int getVote() {
  6445. return votes;
  6446. }
  6447. public void setVote(int votes) {
  6448. this.votes = votes;
  6449. }
  6450. public int getPinAttempts() {
  6451. return pinAttempts;
  6452. }
  6453. public void setPinAttempts(int pinAttempts) {
  6454. this.pinAttempts = pinAttempts;
  6455. }
  6456. public long getLoyaltytimer() {
  6457. return loyaltytimer;
  6458. }
  6459. public void setLoyaltytimer(long loyaltytimer) {
  6460. this.loyaltytimer = loyaltytimer;
  6461. }
  6462. public int[] getRolls() {
  6463. return rolls;
  6464. }
  6465. public void setRolls(int[] rolls) {
  6466. this.rolls = rolls;
  6467. }
  6468. public void setRolls(int index, int amount) {
  6469. rolls[index] = amount;
  6470. }
  6471. public void setRolls(int amount) {
  6472. int temp = amount;
  6473. for (int i = (rolls.length - 2); i >= 0; i--) {
  6474. rolls[i+1] = rolls[i];
  6475. }
  6476. rolls[0] = temp;
  6477.  
  6478. }
  6479. public boolean hasSecondBank() {
  6480. return hasSecondBank;
  6481. }
  6482. public void setSecondBank(boolean hasSecondBank) {
  6483. this.hasSecondBank = hasSecondBank;
  6484. }
  6485. public int getHairymonkeykills() {
  6486. return hairymonkeykills;
  6487. }
  6488. public void setHairymonkeykills(int hairymonkeykills) {
  6489. this.hairymonkeykills = hairymonkeykills;
  6490. }
  6491. public String getLastPublicMessageString() {
  6492. return lastPublicMessageString;
  6493. }
  6494. public void setLastPublicMessageString(String lastPublicMessageString) {
  6495. this.lastPublicMessageString = lastPublicMessageString;
  6496. }
  6497. public CurrencyPouch getCurrencyPouch() {
  6498. return currencypouch;
  6499. }
  6500. public void setCurrencyPouch(CurrencyPouch currencypouch) {
  6501. this.currencypouch = currencypouch;
  6502. }
  6503. public boolean hasLearnedPermTurmBoost() {
  6504. return learnedPermTurmBoost;
  6505. }
  6506. public void setLearnedPermTurmBoost(boolean PermTurmBoost) {
  6507. this.learnedPermTurmBoost = PermTurmBoost;
  6508. }
  6509. public boolean hasLearnedAutoLootSeals() {
  6510. return learnedAutoLootSeals;
  6511. }
  6512. public void setLearnedAutoLootSeals(boolean learnedAutoLootSeals) {
  6513. this.learnedAutoLootSeals = learnedAutoLootSeals;
  6514. }
  6515. public boolean isHasLoginToggled() {
  6516. return hasLoginToggled;
  6517. }
  6518. public void setHasLoginToggled(boolean hasLoginToggled) {
  6519. this.hasLoginToggled = hasLoginToggled;
  6520. }
  6521. public int getHMTrioKills() {
  6522. return hmtriokills;
  6523. }
  6524. public void setHMTrioKills(int hmtriokills) {
  6525. this.hmtriokills = hmtriokills;
  6526. }
  6527. public Runnable getVoteR() {
  6528. return vote;
  6529. }
  6530. public void setVoteR(Runnable vote) {
  6531. this.vote = vote;
  6532. }
  6533. public int getSpellPower() {
  6534. return spellpower;
  6535. }
  6536. public void setSpellPower(int spellpower) {
  6537. if (!getEXQuestManager().isComplete(QNames.ELITE_CHAPTER_III))
  6538. return;
  6539. if (spellpower > this.spellpower)
  6540. sm("<col=123abc>You gain " + (spellpower - this.spellpower) + " Spell power.");
  6541. this.spellpower = spellpower;
  6542. }
  6543. public int getSpellTrait() {
  6544. return spelltraits;
  6545. }
  6546. public void setSpellTrait(int spelltraits) {
  6547. this.spelltraits = spelltraits;
  6548. }
  6549. public boolean isEnchantLegs() {
  6550. return enchantLegs;
  6551. }
  6552. public void setEnchantLegs(boolean enchantLegs) {
  6553. this.enchantLegs = enchantLegs;
  6554. }
  6555. public boolean isEnchantBody() {
  6556. return enchantBody;
  6557. }
  6558. public void setEnchantBody(boolean enchantBody) {
  6559. this.enchantBody = enchantBody;
  6560. }
  6561. public boolean isEnchantHelm() {
  6562. return enchantHelm;
  6563. }
  6564. public void setEnchantHelm(boolean enchantHelm) {
  6565. this.enchantHelm = enchantHelm;
  6566. }
  6567.  
  6568. /**
  6569. * @author Craig
  6570. * @see Handles boss drop ratio
  6571. */
  6572. public HashMap<Integer, Integer> dropRatio = new HashMap<>();
  6573.  
  6574. public HashMap<Integer, Integer> getdropRatio() {
  6575. return dropRatio;
  6576. }
  6577.  
  6578.  
  6579. private boolean hasAntiBot;
  6580.  
  6581. private PerksManager perksManager;
  6582.  
  6583. public boolean isHasAntiBot() {
  6584. return hasAntiBot;
  6585. }
  6586.  
  6587. public void setHasAntiBot(boolean hasAntiBot) {
  6588. this.hasAntiBot = hasAntiBot;
  6589. }
  6590.  
  6591. public void checkBot() {
  6592. if(!isHasAntiBot()) {
  6593. if (Utils.random(100) == 0) {
  6594. new AntiBot(this, this);
  6595. sendMessage("<col=ff0000>An Anti-Bot appears out of nowhere.");
  6596. setHasAntiBot(true);
  6597. }
  6598. }
  6599. }
  6600.  
  6601. public PerksManager getPerksManager() {
  6602. return perksManager;
  6603. }
  6604.  
  6605. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement