Guest User

Untitled

a guest
May 20th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 151.29 KB | None | 0 0
  1. package com.rs.game.player;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Arrays;
  5. import java.util.Collections;
  6. import java.net.*;
  7. import java.io.*;
  8. import java.util.HashMap;
  9. import java.util.LinkedList;
  10. import java.util.List;
  11. import java.util.Map;
  12. import java.util.concurrent.ConcurrentLinkedQueue;
  13. import java.util.concurrent.TimeUnit;
  14.  
  15. import org.jboss.netty.channel.ChannelFuture;
  16. import org.jboss.netty.channel.ChannelFutureListener;
  17.  
  18. import com.rs.GameLauncher;
  19. import com.rs.Settings;
  20. import com.rs.cache.loaders.ObjectDefinitions;
  21. import com.rs.executor.GameExecutorManager;
  22. import com.rs.executor.PlayerHandlerThread;
  23. import com.rs.executor.WorldThread;
  24. import com.rs.game.Animation;
  25. import com.rs.game.EffectsManager.Effect;
  26. import com.rs.game.EffectsManager.EffectType;
  27. import com.rs.game.Entity;
  28. import com.rs.game.ForceTalk;
  29. import com.rs.game.Graphics;
  30. import com.rs.game.Highscores;
  31. import com.rs.game.HighscoresEasy;
  32. import com.rs.game.HighscoresIronMan;
  33. import com.rs.game.HighscoresNormal;
  34. import com.rs.game.Hit;
  35. import com.rs.game.Hit.HitLook;
  36. import com.rs.game.Projectile;
  37. import com.rs.game.Region;
  38. import com.rs.game.TemporaryAtributtes.Key;
  39. import com.rs.game.World;
  40. import com.rs.game.WorldObject;
  41. import com.rs.game.WorldTile;
  42. import com.rs.game.item.FloorItem;
  43. import com.rs.game.item.Item;
  44. import com.rs.game.map.bossInstance.InstanceSettings;
  45. import com.rs.game.minigames.WarriorsGuild;
  46. import com.rs.game.minigames.clanwars.WarControler;
  47. import com.rs.game.minigames.duel.DuelRules;
  48. import com.rs.game.minigames.stealingcreation.StealingCreationController;
  49. import com.rs.game.minigames.stealingcreation.StealingCreationLobbyController;
  50. import com.rs.game.npc.NPC;
  51. import com.rs.game.npc.familiar.Familiar;
  52. import com.rs.game.npc.others.GraveStone;
  53. import com.rs.game.npc.others.MirrorBackSpider;
  54. import com.rs.game.npc.others.Pet;
  55. import com.rs.game.player.actions.PlayerCombatNew;
  56. import com.rs.game.player.content.CoalBag;
  57. import com.rs.game.player.content.Combat;
  58. import com.rs.game.player.content.FriendsChat;
  59. import com.rs.game.player.content.ItemRemover;
  60. import com.rs.game.player.content.Magic;
  61. import com.rs.game.player.content.Notes;
  62. import com.rs.game.player.content.PrayerBooks;
  63. import com.rs.game.player.content.Prestige;
  64. import com.rs.game.player.content.ReaperAssignment;
  65. import com.rs.game.player.content.SkillCapeCustomizer;
  66. import com.rs.game.player.content.clans.ClansManager;
  67. import com.rs.game.player.content.construction.House;
  68. import com.rs.game.player.content.grandExchange.GrandExchange;
  69. import com.rs.game.player.content.pet.PetManager;
  70. import com.rs.game.player.controllers.Controller;
  71. import com.rs.game.player.controllers.DTControler;
  72. import com.rs.game.player.controllers.FightCaves;
  73. import com.rs.game.player.controllers.FightKiln;
  74. import com.rs.game.player.controllers.GodWars;
  75. import com.rs.game.player.controllers.NomadsRequiem;
  76. import com.rs.game.player.controllers.QueenBlackDragonController;
  77. import com.rs.game.player.controllers.Wilderness;
  78. import com.rs.game.player.controllers.ZGDControler;
  79. import com.rs.game.player.controllers.bossInstance.BossInstanceController;
  80. import com.rs.game.player.controllers.castlewars.CastleWarsPlaying;
  81. import com.rs.game.player.controllers.castlewars.CastleWarsWaiting;
  82. import com.rs.game.player.controllers.events.DeathEvent;
  83. import com.rs.game.player.controllers.pestcontrol.PestControlGame;
  84. import com.rs.game.player.controllers.pestcontrol.PestControlLobby;
  85. import com.rs.game.tasks.WorldTask;
  86. import com.rs.game.tasks.WorldTasksManager;
  87. import com.rs.login.account.Account;
  88. import com.rs.net.Session;
  89. import com.rs.net.decoders.WorldPacketsDecoder;
  90. import com.rs.net.decoders.handlers.ButtonHandler;
  91. import com.rs.net.encoders.WorldPacketsEncoder;
  92. import com.rs.utils.ILayoutDefaults;
  93. import com.rs.utils.IsaacKeyPair;
  94. import com.rs.utils.Logger;
  95. import com.rs.utils.MachineInformation;
  96. import com.rs.utils.Utils;
  97.  
  98. public class Player extends Entity {
  99.  
  100. public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1, RUN_MOVE_TYPE = 2;
  101.  
  102. private static final long serialVersionUID = 2011932556974180375L;
  103.  
  104. public boolean KarateFletching = false;
  105.  
  106. // transient stuff
  107. private transient String username;
  108. private transient Session session;
  109. private transient long clientLoadedMapRegion;
  110. private transient int displayMode;
  111. private transient int screenWidth;
  112. private transient int screenHeight;
  113. private transient InterfaceManager interfaceManager;
  114. private transient DialogueManager dialogueManager;
  115. private transient HintIconsManager hintIconsManager;
  116. private transient ActionManager actionManager;
  117. private transient CutscenesManager cutscenesManager;
  118. private transient PriceCheckManager priceCheckManager;
  119. private transient RouteEvent routeEvent;
  120. private transient FriendsIgnores friendsIgnores;
  121. private transient FriendsChat currentFriendsChat;
  122. private transient ClansManager clanManager, guestClanManager;
  123. private transient boolean lootShare;
  124. private transient Trade trade;
  125. private transient DuelRules duelRules;
  126. private transient IsaacKeyPair isaacKeyPair;
  127. private transient Pet pet;
  128. private transient VarsManager varsManager;
  129.  
  130. // used for packets logic
  131. private transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
  132.  
  133. // used for update
  134. private transient LocalPlayerUpdate localPlayerUpdate;
  135. private transient LocalNPCUpdate localNPCUpdate;
  136.  
  137. //AraxxiKills
  138. public int araxxikills;
  139. //Vorago
  140. public boolean defeatedVorago;
  141. public boolean talkedtoVorago;
  142. public boolean accChallenge;
  143. public boolean isSiphoningRago;
  144.  
  145. //reaper
  146. private ReaperAssignment reaperAssignment;
  147. protected int taskPoints;
  148. public int reaperPoints;
  149. public int rerolls;
  150. public int bossKills;
  151. public boolean bossTaskCompleted;
  152. public boolean didFirstReaper;
  153. public int tasksDone;
  154. public boolean purchasedPet;
  155.  
  156.  
  157. //slayerhelms
  158. public boolean helmetUpgrade1;
  159. public boolean helmetUpgrade2;
  160. public boolean helmetUpgrade3;
  161.  
  162. //adminrest
  163. public long itemsTimer;
  164.  
  165. //ironman
  166. public boolean isIronMan;
  167. public boolean toggleIron;
  168.  
  169. //cosmeticunlock
  170. public int cosmeticPoint;
  171.  
  172. //dungsmuggle
  173. public int warningCount;
  174. public boolean warned;
  175. public long warningTimer;
  176.  
  177.  
  178. //totalDonated
  179. public int totalDonated;
  180.  
  181. //rise of the six
  182. public boolean disrupted;
  183. public boolean inRots;
  184. public boolean isBinded;
  185. public boolean guthanBleed;
  186.  
  187. //desertheat
  188.  
  189. public boolean inNardah;
  190. private boolean inDesert;
  191. public boolean inPollnivneach;
  192. public boolean inSophanem;
  193. public int waterCharges;
  194.  
  195. //ectofuntus
  196. public int unclaimedEctoTokens;
  197. public boolean bonesGrinded;
  198. public int boneType;
  199.  
  200. //magicstall
  201. public int magicIncrement;
  202.  
  203. //donator ranks
  204. public String Regular = "";
  205. public String Donator = "[Donator]";
  206. public String SuperDonator = "[Super Donator]";
  207. public String ExtremeDonator = "[Extreme Donator]";
  208. public String LegendaryDonator = "[Legendary Donator]";
  209. public String OneAboveAll = "[One Above All]";
  210.  
  211. //playertile
  212. public boolean isAtSafeZone;
  213.  
  214.  
  215. // player stages
  216. private transient boolean started;
  217. private transient boolean running;
  218. private transient boolean runAfterLoad;
  219. private transient boolean lobby;
  220.  
  221. private transient int resting;
  222. private transient boolean canPvp;
  223. private transient boolean cantTrade;
  224. private transient boolean cantWalk;
  225. private transient long lockDelay; // used for doors and stuff like that
  226. private transient long foodDelay;
  227. private transient long potDelay;
  228. private transient Runnable closeInterfacesEvent;
  229. private transient long lastPublicMessage;
  230. private transient List<Integer> switchItemCache;
  231. private transient boolean disableEquip;
  232. private transient MachineInformation machineInformation;
  233. private transient boolean castedVeng;
  234. private transient boolean invulnerable;
  235. private transient double hpBoostMultiplier;
  236. private transient boolean largeSceneView;
  237. private transient int cannonBalls;
  238. private transient String lastPlayerKill;
  239. private transient String lastPlayerMAC;
  240. private transient boolean refreshClanIcon;
  241.  
  242. // stuff received from login server
  243. private transient String displayName;
  244. private transient String email;
  245.  
  246. private transient int rights;
  247. private transient int messageIcon;
  248. private boolean donator;
  249. private boolean superDonator;
  250. private boolean extremeDonator;
  251. private boolean assistantDeveloper;
  252. private boolean legendaryDonator;
  253. private boolean theOneAboveAll;
  254. private transient boolean isSupporter;
  255. private transient boolean isGraphicDesigner;
  256. private transient boolean muted;
  257. private transient long lastVote;
  258.  
  259. // saving stuff
  260. private Appearence appearence;
  261. private Inventory inventory;
  262. private MoneyPouch moneyPouch;
  263. private Equipment equipment;
  264. private Skills skills;
  265. private CombatDefinitions combatDefinitions;
  266. private CoalBag coalBag;
  267. private Prayer prayer;
  268. private Bank bank;
  269. private ControlerManager controlerManager;
  270. private MusicsManager musicsManager;
  271. private EmotesManager emotesManager;
  272. private Notes notes;
  273. private Toolbelt toolbelt;
  274. private DominionTower dominionTower;
  275. private Familiar familiar;
  276. private FarmingManager farmingManager;
  277. private AuraManager auraManager;
  278. private QuestManager questManager;
  279. private PetManager petManager;
  280. private GrandExchangeManager geManager;
  281. private SlayerManager slayerManager;
  282. private SquealOfFortune squealOfFortune;
  283. private TreasureTrailsManager treasureTrailsManager;
  284. private CoalTrucksManager coalTrucksManager;
  285. private DungManager dungManager;
  286. private House house;
  287. private ActionBar actionbar;
  288. private DoomsayerManager doomsayerManager;
  289. private TimersManager timersManager;
  290. private PlayerExamineManager playerExamineManager;
  291. private CosmeticsManager cosmeticsManager;
  292. private byte runEnergy;
  293. private int[] subMenus; // used by interface menu
  294.  
  295. // rs settings old
  296. private boolean allowChatEffects;
  297. private boolean acceptAid;
  298. private boolean rightClickReporting;
  299. private boolean mouseButtons;
  300. private boolean profanityFilter;
  301.  
  302. private boolean votingXP;
  303. //AraxxiClaim
  304. private boolean canClaim;
  305.  
  306. //Prifddinas
  307. public boolean canEnterPrifdinnas;
  308. public boolean isInPrifdinnas;
  309. public boolean isInHefin;
  310. public boolean isInMeilyr;
  311. public boolean isInAmlodd;
  312. public boolean isInCrwys;
  313. public boolean isInCadarn;
  314. public boolean isInTrahaearn;
  315. public boolean isInIowerth;
  316. public boolean isInIthell;
  317.  
  318. // rs settings
  319. private boolean lockInterfaceCustomization;
  320. private boolean hideTitleBarsWhenLocked;
  321. private boolean slimHeaders;
  322. private boolean clickThroughtChatboxes;
  323. private boolean targetReticules;
  324. private boolean alwaysShowTargetInformation;
  325. private boolean legacyMode;
  326. private boolean splitPrivateChat;
  327. private boolean makeXProgressWindow;
  328. private boolean serverOwner;
  329. private boolean serverMod;
  330. private boolean serverAdmin;
  331. private boolean hideFamiliarOptions;
  332. private boolean guidanceSystemHints;
  333. private boolean toogleQuickChat;
  334. private boolean lockZoom;
  335. private boolean rs3Camera;
  336. private boolean taskCompletePopup;
  337. private boolean taskInformationWindow;
  338. private boolean tooglePlayerNotification;
  339. private boolean toogleAbilityCooldownTimer;
  340. private boolean skillTargetBasedXPPopup;
  341. private boolean toggleBuffTimers;
  342. private byte utcClock;
  343.  
  344. //perks
  345. private boolean avaBypass;
  346. private boolean onTheGo;
  347. private boolean godwarsBypass;
  348. private boolean masterSmith;
  349.  
  350. //divination
  351. public boolean HarvestingEnriched;
  352. public boolean createdFlickeringBoon;
  353. public boolean createdBrightBoon;
  354. public boolean createdGlowingBoon;
  355. public boolean createdSparklingBoon;
  356. public boolean createdGleamingBoon;
  357. public boolean createdVibrantBoon;
  358. public boolean createdLustrousBoon;
  359. public boolean createdBrilliantBoon;
  360. public boolean createdRadiantBoon;
  361. public boolean createdLuminousBoon;
  362. public boolean createdIncandescentBoon;
  363.  
  364.  
  365. //Donationranktoggle
  366. public boolean toggleDonator;
  367. public long displayTimer;
  368. //Lootbeam
  369. public int donation;
  370. public int setLootBeam;
  371. // rs3 chat settings
  372. private boolean alwaysOnChatMode;
  373.  
  374. private int privateChatSetup;
  375. private int friendChatSetup;
  376. private int clanChatSetup;
  377. private int guestChatSetup;
  378. private int skullDelay;
  379. private int skullId;
  380.  
  381. private int loginCount;
  382. private boolean forceNextMapLoadRefresh;
  383. private boolean killedQueenBlackDragon;
  384. private int runeSpanPoints;
  385. private int pestPoints;
  386. private int stealingCreationPoints;
  387. private int favorPoints;
  388. private double[] warriorPoints;
  389. private boolean[] prayerBook;
  390. private int previousLodestone;
  391. private boolean instantSwitchToLegacy;
  392. //expert capes
  393. private boolean craftedArtisan;
  394. private boolean craftedCombatant;
  395. private boolean craftedGatherer;
  396. private boolean craftedSupport;
  397.  
  398. //bankcommandlimits
  399. private boolean isFightingAraxxor;
  400. private boolean isFightingVorago;
  401. // shop
  402. private boolean verboseShopDisplayMode;
  403.  
  404. private long lastStarSprite;
  405. private long lastBork;
  406.  
  407. private int[] pouches;
  408.  
  409. // game bar status
  410. private int gameStatus;
  411. private int publicStatus;
  412. private int personalStatus;
  413. private int clanStatus;
  414. private int tradeStatus;
  415. private int assistStatus;
  416. private int friendsChatStatus;
  417.  
  418. // honor
  419. private int killCount, deathCount;
  420. private long lastArtefactTime;
  421.  
  422. private ChargesManager charges;
  423. // barrows
  424. private boolean[] killedBarrowBrothers;
  425. private int hiddenBrother;
  426. private int barrowsKillCount;
  427. // strongholdofsecurity rewards
  428. private boolean[] shosRewards;
  429. private boolean killedLostCityTree;
  430. //slayercorruption
  431. private boolean corruptedSlayer;
  432.  
  433. // skill capes customizing
  434. private int[] maxedCapeCustomized;
  435. private int[] completionistCapeCustomized;
  436.  
  437.  
  438. // completionistcape reqs
  439. private boolean completedFightCaves;
  440. private boolean completedFightKiln;
  441. private boolean wonFightPits;
  442. private boolean completedStealingCreation;
  443. private boolean capturedCastleWarsFlag;
  444. private int receivedCompletionistCape;
  445. private boolean killedWildyWyrm;
  446. private boolean foundShootingStar;
  447.  
  448. // starter
  449. boolean finishedStarterGuide;
  450. boolean canEnterStartPortal;
  451.  
  452. // trimmed compcape
  453. private int finishedCastleWars;
  454. private int finishedStealingCreations;
  455.  
  456. // crucible
  457. private boolean talkedWithMarv;
  458. private int crucibleHighScore;
  459.  
  460. private int ecoClearStage;
  461.  
  462. // gravestone
  463. private int graveStone;
  464.  
  465. private String lastFriendsChat;
  466. private int lastFriendsChatRank = -1;
  467. private String clanName;// , guestClanChat;
  468. private boolean connectedClanChannel;
  469. private boolean isOwner;
  470. private int summoningLeftClickOption;
  471. private transient boolean pouchFilter;
  472. private List<String> ownedObjectsManagerKeys;
  473. //bonds
  474. private int bonds;
  475. private long xptimer;
  476. /**
  477. * Objects
  478. */
  479. //prestige
  480. private transient Prestige prestige;
  481. private int prestigeLevel;
  482. private boolean trueHardMode;
  483.  
  484. //QuestPoints
  485. public int questPoints;
  486.  
  487. //Cover of Darkness
  488. private boolean CoDComplete;
  489. private boolean startedCoverofDarkness;
  490. private boolean coverIntro;
  491. public int energyCount;
  492. private boolean nightMode;
  493. private boolean ingridientsSearch;
  494. private boolean canSleep;
  495. private boolean knowsHowToOpen;
  496. private boolean hasFixedBust;
  497. private boolean hasKilledBoss;
  498. private boolean part7;
  499. private boolean part8;
  500.  
  501. //Demands of Monarchy
  502. private boolean roaldDemands;
  503. private boolean killedDragith;
  504. private boolean finishedFather;
  505. private boolean canFightCaptain;
  506. private boolean beginSearch;
  507. private boolean collectedParts;
  508. private boolean prayedFor;
  509. private boolean DOMComplete;
  510. // kalphite
  511. private boolean khalphiteLairEntranceSetted;
  512. private boolean khalphiteLairSetted;
  513. private boolean kalphitetunnel;
  514.  
  515.  
  516. //hefin
  517. public int currentId;
  518.  
  519. //coalbag
  520. private int coalBagAmount;
  521.  
  522. // kalphiteking
  523. private boolean khalphiteKingEntranceSetted;
  524. private boolean khalphiteKingSetted;
  525.  
  526. //lootvalue
  527. public int lootValue;
  528.  
  529.  
  530. //clues
  531. public int cluenoreward;
  532. // red sandstone
  533. private int redStoneCount;
  534. private long redStoneDelay;
  535.  
  536. private boolean xpLocked;
  537. private boolean yellOff;
  538.  
  539. private String yellColor = "ff0000";
  540. private boolean oldItemsLook; // selects whenever to play with old or new
  541. // items visual
  542.  
  543. // old voting variables
  544. @SuppressWarnings("unused")
  545. private long voted;
  546. private int votes;
  547. @SuppressWarnings("unused")
  548. private int votePoints;
  549. private boolean enteredDonatorZone;
  550.  
  551. private String lastGameIp;
  552. private String lastGameMAC;
  553. private transient boolean masterLogin;
  554. private long lastGameLogin;
  555.  
  556. private int xpRateMode;
  557.  
  558. private long onlineTime;
  559.  
  560. private String lastBossInstanceKey;
  561. private InstanceSettings lastBossInstanceSettings;
  562.  
  563. // new nsi system
  564. private Map<Integer, Integer> iLayoutVars;
  565.  
  566. // creates Player and saved classes
  567. public Player() {
  568. super(Settings.NEW_PLAYER_LOCATION);
  569. super.setHitpoints(Settings.START_PLAYER_HITPOINTS);
  570. appearence = new Appearence();
  571. inventory = new Inventory();
  572. moneyPouch = new MoneyPouch();
  573. equipment = new Equipment();
  574. skills = new Skills();
  575. combatDefinitions = new CombatDefinitions();
  576. coalBag = new CoalBag(this);
  577. prayer = new Prayer();
  578. bank = new Bank();
  579. controlerManager = new ControlerManager();
  580. musicsManager = new MusicsManager();
  581. emotesManager = new EmotesManager();
  582. notes = new Notes();
  583. toolbelt = new Toolbelt();
  584. dominionTower = new DominionTower();
  585. charges = new ChargesManager();
  586. auraManager = new AuraManager();
  587. questManager = new QuestManager();
  588. petManager = new PetManager();
  589. farmingManager = new FarmingManager();
  590. geManager = new GrandExchangeManager();
  591. slayerManager = new SlayerManager();
  592. squealOfFortune = new SquealOfFortune();
  593. treasureTrailsManager = new TreasureTrailsManager();
  594. coalTrucksManager = new CoalTrucksManager();
  595. dungManager = new DungManager();
  596. house = new House();
  597. actionbar = new ActionBar();
  598. doomsayerManager = new DoomsayerManager();
  599. timersManager = new TimersManager();
  600. playerExamineManager = new PlayerExamineManager();
  601. cosmeticsManager = new CosmeticsManager();
  602. runEnergy = 100;
  603. allowChatEffects = true;
  604. mouseButtons = true;
  605. profanityFilter = true;
  606. guidanceSystemHints = true;
  607. toogleQuickChat = true;
  608. makeXProgressWindow = true;
  609. taskInformationWindow = true;
  610. rs3Camera = true;
  611. targetReticules = true;
  612. alwaysShowTargetInformation = true;
  613. toggleBuffTimers = true;
  614. utcClock = 1;
  615. pouches = new int[4];
  616. resetBarrows();
  617. shosRewards = new boolean[4];
  618. warriorPoints = new double[6];
  619. subMenus = new int[9];
  620. prayerBook = new boolean[PrayerBooks.BOOKS.length];
  621. SkillCapeCustomizer.resetSkillCapes(this);
  622. ownedObjectsManagerKeys = new LinkedList<String>();
  623. resetILayoutVars();
  624. setEcoClearStage(10);
  625. }
  626.  
  627. public void init(Session session, boolean lobby, String username, String displayName, String lastGameMAC,
  628. String email, int rights, int messageIcon, boolean masterLogin, boolean donator, boolean extremeDonator,
  629. boolean support, boolean gfxDesigner, boolean muted, long lastVote, int displayMode, int screenWidth,
  630. int screenHeight, MachineInformation machineInformation, IsaacKeyPair isaacKeyPair) {
  631. // temporary deleted after reset all chars
  632. if (doomsayerManager == null)
  633. doomsayerManager = new DoomsayerManager();
  634. if (timersManager == null)
  635. timersManager = new TimersManager();
  636. if (playerExamineManager == null)
  637. playerExamineManager = new PlayerExamineManager();
  638. if (cosmeticsManager == null)
  639. cosmeticsManager = new CosmeticsManager();
  640. if (prestige == null)
  641. prestige = new Prestige();
  642. if (coalBag == null) {
  643. coalBag = new CoalBag(this);
  644. }
  645.  
  646. this.session = session;
  647. this.lobby = lobby;
  648. this.username = username;
  649. this.displayName = displayName;
  650. this.email = email;
  651. this.rights = rights;
  652. this.masterLogin = masterLogin;
  653. this.messageIcon = messageIcon;
  654. this.isSupporter = support;
  655. this.isGraphicDesigner = gfxDesigner;
  656. this.muted = muted;
  657. this.lastVote = lastVote;
  658. this.lastGameMAC = lastGameMAC;
  659. this.displayMode = displayMode;
  660. this.screenWidth = screenWidth;
  661. this.screenHeight = screenHeight;
  662. this.machineInformation = machineInformation;
  663. this.isaacKeyPair = isaacKeyPair;
  664. this.inRots = false;
  665.  
  666. interfaceManager = new InterfaceManager(this);
  667. dialogueManager = new DialogueManager(this);
  668. hintIconsManager = new HintIconsManager(this);
  669. priceCheckManager = new PriceCheckManager(this);
  670. localPlayerUpdate = new LocalPlayerUpdate(this);
  671. localNPCUpdate = new LocalNPCUpdate(this);
  672. actionManager = new ActionManager(this);
  673. cutscenesManager = new CutscenesManager(this);
  674. trade = new Trade(this);
  675. varsManager = new VarsManager(this);
  676. friendsIgnores = new FriendsIgnores(this);
  677. // loads player on saved instances
  678. appearence.setPlayer(this);
  679. inventory.setPlayer(this);
  680. moneyPouch.setPlayer(this);
  681. equipment.setPlayer(this);
  682. prestige.setPlayer(this);
  683. skills.setPlayer(this);
  684. combatDefinitions.setPlayer(this);
  685. prayer.setPlayer(this);
  686. bank.setPlayer(this);
  687. controlerManager.setPlayer(this);
  688. musicsManager.setPlayer(this);
  689. emotesManager.setPlayer(this);
  690. notes.setPlayer(this);
  691. toolbelt.setPlayer(this);
  692. dominionTower.setPlayer(this);
  693. auraManager.setPlayer(this);
  694. charges.setPlayer(this);
  695. questManager.setPlayer(this);
  696. petManager.setPlayer(this);
  697. house.setPlayer(this);
  698. actionbar.setPlayer(this);
  699. doomsayerManager.setPlayer(this);
  700. timersManager.setPlayer(this);
  701. playerExamineManager.setPlayer(this);
  702. cosmeticsManager.setPlayer(this);
  703. farmingManager.setPlayer(this);
  704. geManager.setPlayer(this);
  705. slayerManager.setPlayer(this);
  706. squealOfFortune.setPlayer(this);
  707. treasureTrailsManager.setPlayer(this);
  708. coalTrucksManager.setPlayer(this);
  709. dungManager.setPlayer(this);
  710. initEntity(); // generates hash thats why
  711. if (!lobby) {
  712. setDirection(Utils.getAngle(0, -1));
  713. logicPackets = new ConcurrentLinkedQueue<LogicPacket>();
  714. switchItemCache = Collections.synchronizedList(new ArrayList<Integer>());
  715. World.addPlayer(this);
  716. World.updateEntityRegion(this);
  717. } else {
  718. World.addLobbyPlayer(this);
  719. }
  720. if (Settings.DEBUG)
  721. Logger.log(this, "Initiated player: " + username);
  722.  
  723. }
  724.  
  725. public void setWildernessSkull() {
  726. skullDelay = 3000; // 30minutes
  727. skullId = 0;
  728. appearence.generateIconsData();
  729. }
  730.  
  731.  
  732. public boolean getVoteXp(){
  733. return votingXP;
  734. }
  735.  
  736. public void setVoteXp(){
  737. this.votingXP = true;
  738. }
  739.  
  740. public void removeVoteXp(){
  741. this.votingXP = false;
  742. }
  743.  
  744.  
  745. public void setFightPitsSkull() {
  746. skullDelay = Integer.MAX_VALUE; // infinite
  747. skullId = 1;
  748. appearence.generateIconsData();
  749. }
  750.  
  751. public void setSkullInfiniteDelay(int skullId) {
  752. skullDelay = Integer.MAX_VALUE; // infinite
  753. this.skullId = skullId;
  754. appearence.generateIconsData();
  755. }
  756.  
  757. public void removeSkull() {
  758. skullDelay = -1;
  759. appearence.generateIconsData();
  760. }
  761.  
  762. public boolean hasSkull() {
  763. return skullDelay > 0;
  764. }
  765.  
  766. public int setSkullDelay(int delay) {
  767. return this.skullDelay = delay;
  768. }
  769.  
  770. public void completeReset() {
  771. bank = new Bank();
  772. bank.setPlayer(this);
  773. equipment.reset();
  774. inventory.reset();
  775. moneyPouch.setCoinsAmount(0);
  776. actionbar = new ActionBar();
  777. actionbar.setPlayer(this);
  778. for (int skill = 0; skill < 25; skill++) {
  779. skills.setXp(skill, 0);
  780. skills.set(skill, 1);
  781. }
  782. skills.init();
  783. }
  784.  
  785. public void refreshSpawnedItems() {
  786. for (int regionId : getMapRegionsIds()) {
  787. List<FloorItem> floorItems = World.getRegion(regionId).getGroundItems();
  788. if (floorItems == null)
  789. continue;
  790. for (FloorItem item : floorItems) {
  791. if (item.isInvisible() && (item.hasOwner() && !getUsername().equals(item.getOwner())))
  792. continue;
  793. getPackets().sendRemoveGroundItem(item);
  794. }
  795. }
  796. for (int regionId : getMapRegionsIds()) {
  797. List<FloorItem> floorItems = World.getRegion(regionId).getGroundItems();
  798. if (floorItems == null)
  799. continue;
  800. for (FloorItem item : floorItems) {
  801. if ((item.isInvisible()) && (item.hasOwner() && !getUsername().equals(item.getOwner())))
  802. continue;
  803. getPackets().sendGroundItem(item);
  804. }
  805. }
  806. }
  807.  
  808. public void refreshSpawnedObjects() {
  809. for (int regionId : getMapRegionsIds()) {
  810. List<WorldObject> removedObjects = World.getRegion(regionId).getRemovedOriginalObjects();
  811. for (WorldObject object : removedObjects)
  812. getPackets().sendRemoveObject(object);
  813. List<WorldObject> spawnedObjects = World.getRegion(regionId).getSpawnedObjects();
  814. for (WorldObject object : spawnedObjects)
  815. getPackets().sendAddObject(object);
  816. }
  817. }
  818.  
  819. // now that we inited we can start showing game
  820. public void start() {
  821. Logger.globalLog(username, session.getIP(), new String(" has logged in."));
  822. loadMapRegions();
  823. started = true;
  824. run();
  825. }
  826.  
  827.  
  828. public boolean kalphiteTunnel(){
  829. return kalphitetunnel;
  830. }
  831.  
  832. public void startLobby() {
  833. started = true;
  834. sendLobbyVars();
  835. runLobby();
  836. // fix to stuck cuz ofv ars dumping
  837. // if(getRights() == 2)
  838. // resetILayoutVars();
  839. }
  840.  
  841. public void runLobby() {
  842.  
  843. interfaceManager.sendInterfaces();
  844.  
  845. if (GameLauncher.delayedShutdownStart != 0) {
  846. int delayPassed = (int) ((Utils.currentTimeMillis() - GameLauncher.delayedShutdownStart) / 1000);
  847. getPackets().sendSystemUpdate(GameLauncher.delayedShutdownDelay - delayPassed, true);
  848. }
  849.  
  850. friendsIgnores = new FriendsIgnores(this);
  851.  
  852. if (lastFriendsChat != null) {
  853. FriendsChat.requestJoin(this, lastFriendsChat);
  854. lastFriendsChat = null;
  855. }
  856. if (clanName != null) {
  857. if (!ClansManager.connectToClan(this, clanName, false))
  858. clanName = null;
  859. }
  860.  
  861. /*
  862. * friendsIgnores.init(); if (currentFriendChatOwner != null) {
  863. * FriendChatsManager.joinChat(currentFriendChatOwner, this); if
  864. * (currentFriendChat == null) // failed currentFriendChatOwner = null;
  865. * } // connect to current clan if (clanName != null) { if
  866. * (!ClansManager.connectToClan(this, clanName, false)) clanName = null;
  867. * }
  868. */
  869.  
  870. }
  871.  
  872. private void sendLobbyVars() {
  873. getPackets().refreshLobbyInformation();
  874. // black screen if those not enabled
  875.  
  876. getVarsManager().sendVar(1751, 6757431); // x
  877. getVarsManager().sendVar(1752, 6766321);// y
  878.  
  879. getVarsManager().sendVar(1753, 225);
  880. getVarsManager().sendVar(1754, 69);
  881.  
  882. // 1 - normal login. 2 ask for email(+ reason in varbit 16465)
  883. getVarsManager().sendVarBit(16464, 1);
  884.  
  885. getVarsManager().sendVarBit(16465, 0);
  886.  
  887. getPackets().sendCSVarInteger(3905, -1);// Enables banner clicking &
  888. // middle banner
  889. getPackets().sendCSVarInteger(4266, 0);// Treasure chest key amount
  890. getPackets().sendCSVarInteger(4267, 0);// Treasure chest heart amount
  891. getPackets().sendCSVarInteger(4263, -1);// Enables Treasure trail banner
  892. getPackets().sendCSVarInteger(4264, -1);// Boss pets display
  893. getPackets().sendCSVarInteger(4265, -1);// Enables second right banner
  894. getPackets().sendCSVarInteger(4660, 0);// Loyalty Points
  895. getPackets().sendCSVarInteger(4659, 0);// Runecoins
  896.  
  897. getPackets().sendCSVarString(2508, displayName);
  898. // script_10012
  899.  
  900. }
  901.  
  902. public void stopAll() {
  903. stopAll(true);
  904. }
  905.  
  906. public void stopAll(boolean stopWalk) {
  907. stopAll(stopWalk, true);
  908. }
  909.  
  910. public void stopAll(boolean stopWalk, boolean stopInterface) {
  911. stopAll(stopWalk, stopInterface, true);
  912. }
  913.  
  914. // as walk done clientsided
  915. public void stopAll(boolean stopWalk, boolean stopInterfaces, boolean stopActions) {
  916. routeEvent = null;
  917. if (stopInterfaces)
  918. closeInterfaces();
  919. if (stopWalk && !cantWalk)
  920. resetWalkSteps();
  921. if (stopActions)
  922. actionManager.forceStop();
  923. combatDefinitions.resetSpells(false);
  924. }
  925.  
  926. @Override
  927. public void setHitpoints(int hitpoints) {
  928. super.setHitpoints(hitpoints);
  929. refreshHitPoints();
  930. }
  931.  
  932. @Override
  933. public void reset(boolean attributes) {
  934. super.reset(attributes);
  935. hintIconsManager.removeAll();
  936. skills.restoreSkills();
  937. combatDefinitions.resetSpecialAttack();
  938. prayer.reset();
  939. combatDefinitions.resetSpells(false);
  940. resting = 0;
  941. skullDelay = 0;
  942. foodDelay = 0;
  943. potDelay = 0;
  944. castedVeng = false;
  945. cantWalk = false;
  946. setRunEnergy(100);
  947. appearence.generateAppearenceData();
  948. appearence.generateIconsData();
  949. }
  950.  
  951. @Override
  952. public void reset() {
  953. reset(true);
  954. }
  955.  
  956. public void closeInterfaces() {
  957. if (interfaceManager.containsScreenInterface())
  958. interfaceManager.removeCentralInterface();
  959. if (interfaceManager.containsBankInterface())
  960. interfaceManager.removeBankInterface();
  961. if (interfaceManager.containsInventoryInter())
  962. interfaceManager.removeInventoryInterface();
  963. if (interfaceManager.containsInputTextInterface())
  964. interfaceManager.removeInputTextInterface();
  965. if (interfaceManager.containsWorldMapInterface())
  966. interfaceManager.removeWorldMapInterface();
  967. dialogueManager.finishDialogue();
  968. if (closeInterfacesEvent != null) {
  969. closeInterfacesEvent.run();
  970. closeInterfacesEvent = null;
  971. }
  972. }
  973.  
  974. public void setClientHasntLoadedMapRegion() {
  975. clientLoadedMapRegion = Utils.currentWorldCycle() + 30;
  976. }
  977.  
  978. @Override
  979. public void loadMapRegions() {
  980. boolean wasAtDynamicRegion = isAtDynamicRegion();
  981. super.loadMapRegions();
  982. setClientHasntLoadedMapRegion();
  983. if (isAtDynamicRegion()) {
  984. getPackets().sendDynamicGameScene(!started);
  985. if (!wasAtDynamicRegion)
  986. localNPCUpdate.reset();
  987. } else {
  988. getPackets().sendGameScene(!started);
  989. if (wasAtDynamicRegion)
  990. localNPCUpdate.reset();
  991. }
  992. forceNextMapLoadRefresh = false;
  993. }
  994.  
  995. public void addAdrenalineBar() {
  996. if (getNextHitBars().isEmpty())
  997. getNextHitBars().add(new AdrenalineHitBar(this));
  998. }
  999.  
  1000. public void processLogicPackets() {
  1001. LogicPacket packet;
  1002. while ((packet = logicPackets.poll()) != null)
  1003. WorldPacketsDecoder.decodeLogicPacket(this, packet);
  1004. }
  1005.  
  1006. public void processProjectiles() {
  1007.  
  1008. for (int regionId : getMapRegionsIds()) {
  1009. Region region = World.getRegion(regionId);
  1010. for (Projectile projectile : region.getProjectiles()) {
  1011.  
  1012. int fromSizeX, fromSizeY;
  1013. if (projectile.getFrom() instanceof Entity)
  1014. fromSizeX = fromSizeY = ((Entity) projectile.getFrom()).getSize();
  1015. else if (projectile.getFrom() instanceof WorldObject) {
  1016. ObjectDefinitions defs = ((WorldObject) projectile.getFrom()).getDefinitions();
  1017. fromSizeX = defs.getSizeX();
  1018. fromSizeY = defs.getSizeY();
  1019. } else
  1020. fromSizeX = fromSizeY = 1;
  1021. int toSizeX, toSizeY;
  1022. if (projectile.getTo() instanceof Entity)
  1023. toSizeX = toSizeY = ((Entity) projectile.getTo()).getSize();
  1024. else if (projectile.getTo() instanceof WorldObject) {
  1025. ObjectDefinitions defs = ((WorldObject) projectile.getTo()).getDefinitions();
  1026. toSizeX = defs.getSizeX();
  1027. toSizeY = defs.getSizeY();
  1028. } else
  1029. toSizeX = toSizeY = 1;
  1030.  
  1031. getPackets().sendProjectileNew(projectile.getFrom(), fromSizeX, fromSizeY, projectile.getTo(), toSizeX,
  1032. toSizeY, projectile.getFrom() instanceof Entity ? (Entity) projectile.getFrom() : null,
  1033. projectile.getTo() instanceof Entity ? (Entity) projectile.getTo() : null,
  1034. projectile.isAdjustFlyingHeight(), projectile.isAdjustSenderHeight(),
  1035. projectile.getSenderBodyPart(), projectile.getGraphicId(), projectile.getStartHeight(),
  1036. projectile.getEndHeight(), projectile.getStartTime(), projectile.getEndTime(),
  1037. projectile.getSlope(), projectile.getAngle(), 0);
  1038. }
  1039. }
  1040. }
  1041.  
  1042. @Override
  1043. public void processEntityUpdate() {
  1044. super.processEntityUpdate();
  1045. }
  1046.  
  1047. @Override
  1048. public void processEntity() {
  1049. processLogicPackets();
  1050. // actionbar.processQueuedShortcut();
  1051. actionManager.process();
  1052. if (routeEvent != null && routeEvent.processEvent(this))
  1053. routeEvent = null;
  1054. super.processEntity();
  1055. charges.process();
  1056. auraManager.process();
  1057. timersManager.process();
  1058. prayer.processPrayer();
  1059. controlerManager.process();
  1060. farmingManager.process();
  1061. cutscenesManager.process();
  1062. if (isDead())
  1063. return;
  1064. if (musicsManager.musicEnded())
  1065. musicsManager.replayMusic();
  1066. if (hasSkull()) {
  1067. skullDelay--;
  1068. if (!hasSkull())
  1069. appearence.generateAppearenceData();
  1070. }
  1071. getCombatDefinitions().processCombatStance();
  1072. }
  1073.  
  1074. @Override
  1075. public void processReceivedHits() {
  1076. if (isLocked())
  1077. return;
  1078. super.processReceivedHits();
  1079. }
  1080.  
  1081. @Override
  1082. public void applyHit(Hit hit) {
  1083. Entity source = hit.getSource();
  1084. if (source != this && source instanceof Player && !isCanPvp())
  1085. return;
  1086. super.applyHit(hit);
  1087. }
  1088.  
  1089. @Override
  1090. public void resetMasks() {
  1091. super.resetMasks();
  1092. /*
  1093. * if (!clientHasLoadedMapRegion()) { // load objects and items here
  1094. * setClientHasLoadedMapRegion(); refreshSpawnedObjects();
  1095. * refreshSpawnedItems(); }
  1096. */
  1097. }
  1098.  
  1099. public void toogleRun(boolean update) {
  1100. super.setRun(!getRun());
  1101. if (update)
  1102. sendRunButtonConfig();
  1103. }
  1104.  
  1105. public void setRunHidden(boolean run) {
  1106. super.setRun(run);
  1107. }
  1108.  
  1109. @Override
  1110. public void setRun(boolean run) {
  1111. if (run != getRun()) {
  1112. super.setRun(run);
  1113. sendRunButtonConfig();
  1114. }
  1115. }
  1116.  
  1117. public void sendRunButtonConfig() {
  1118. getVarsManager().sendVar(463, resting == 1 ? 3 : resting == 2 ? 4 : getRun() ? 1 : 0);
  1119. }
  1120.  
  1121. public void restoreRunEnergy() {
  1122. if (getNextRunDirection() != -1 || runEnergy >= 100)
  1123. return;
  1124. runEnergy++;
  1125. getPackets().sendRunEnergy();
  1126. }
  1127.  
  1128. /*
  1129. * notice this may end up not being called if player dcs at same time he
  1130. * logs in use it just for stuff that cant be sent right away
  1131. */
  1132. public void runAfterLoad() {
  1133. interfaceManager.refreshInterface(true);
  1134. skills.sendCombatLevel();
  1135. runAfterLoad = true;
  1136. }
  1137.  
  1138. public void run() {
  1139. if (!masterLogin)
  1140. lastGameIp = getSession().getIP();
  1141. lastGameLogin = Utils.currentTimeMillis();
  1142. loginCount += 1;
  1143. // welcomeScreen = true;
  1144. refreshInterfaceVars();
  1145. interfaceManager.sendInterfaces();
  1146.  
  1147. // getInterfaceManager().setScreenInterface(false, 96, 1225);
  1148. // getPackets().sendIComponentText(1225, 5, "You last logged in from:
  1149. // "+(this.getLastIP() == null ? "Nowhere" : this.getLastIP()));
  1150. // getPackets().sendIComponentText(1225, 21, Settings.LASTEST_UPDATE);
  1151. // getPackets().sendIComponentText(1225, 22, ("You are playing with " +
  1152. // (isOldItemsLook() ? "old" : "new") + " item looks. Type
  1153. // ::switchitemslook if you wish to switch."));
  1154.  
  1155. // interfaceManager.removeScreenInterfaceBG();
  1156. if (GameLauncher.delayedShutdownStart != 0) {
  1157. int delayPassed = (int) ((Utils.currentTimeMillis() - GameLauncher.delayedShutdownStart) / 1000);
  1158. getPackets().sendSystemUpdate(GameLauncher.delayedShutdownDelay - delayPassed, false);
  1159. }
  1160.  
  1161.  
  1162.  
  1163. /*
  1164. * if (hasEmailRestrictions() && controlerManager.getControler() == null
  1165. * && !cutscenesManager.hasCutscene()) {
  1166. * getInterfaceManager().setScreenInterface(false, 96, 329);
  1167. * getPackets().sendIComponentText(329, 14,
  1168. * "<col=CD0000>Warning! Protect your account now!");//Title
  1169. * getPackets().sendIComponentText(329, 45, "");
  1170. * getPackets().sendIComponentText(329, 46, "");
  1171. * getPackets().sendIComponentText(329, 47,
  1172. * "Register an e-mail now in order to receive:");
  1173. * getPackets().sendIComponentText(329, 48, "* Unrestricted bank space"
  1174. * ); getPackets().sendIComponentText(329, 49,
  1175. * "* Daily squeal of fortune spins");
  1176. * getPackets().sendIComponentText(329, 50,
  1177. * "* Protect your account from identity theft");
  1178. *
  1179. * getPackets().sendIComponentText(329, 44, "Protect me now!");//Second
  1180. * button if (isDonator()) { getPackets().sendHideIComponent(329, 0,
  1181. * true); } else getPackets().sendIComponentText(329, 15,
  1182. * "Upgrade rank!");//Second Button }
  1183. */
  1184. getPackets().sendRunEnergy();
  1185. getPackets().sendItemsLook();
  1186.  
  1187. refreshAllowChatEffects();
  1188. refreshAcceptAid();
  1189. refreshRightClickReporting();
  1190. refreshMouseButtons();
  1191. refreshHideFamiliarOptions();
  1192. refreshGuidanceSystemHints();
  1193. refreshToogleQuickChat();
  1194. refreshProfanityFilter();
  1195. refreshLockZoom();
  1196. refreshCameraType();
  1197. refreshChatsSetup();
  1198. sendRunButtonConfig();
  1199. Familiar.refreshDefaultPetOptions(this);
  1200. getPackets().sendGameMessage("Welcome to " + Settings.SERVER_NAME + ".");
  1201. getPackets().sendGameMessage(Settings.LATEST_UPDATE);
  1202. sendDefaultPlayersOptions();
  1203. inventory.init();
  1204. moneyPouch.init();
  1205. equipment.checkItems();
  1206. equipment.init();
  1207. bank.init();
  1208. skills.init();
  1209. combatDefinitions.init();
  1210. prayer.init();
  1211. refreshHitPoints();
  1212. warriorCheck();
  1213. prayer.refreshPrayerPoints();
  1214. getVarsManager().sendVar(1295, 1000); // unlock cant do this under // tutorial for chat
  1215. getVarsManager().sendVarBit(20940, 120); // unlocks new tut
  1216. getPackets().sendGameBarStages();
  1217. musicsManager.init();
  1218. emotesManager.init();
  1219. questManager.init();
  1220. notes.init();
  1221. house.init();
  1222. actionbar.init();
  1223. doomsayerManager.init();
  1224. timersManager.init();
  1225. playerExamineManager.init();
  1226. cosmeticsManager.init();
  1227. farmingManager.init();
  1228. toolbelt.init();
  1229. geManager.init();
  1230. coalTrucksManager.init();
  1231. refreshBuffs();
  1232. ItemRemover.check(this);
  1233. sendUnlockedObjectConfigs();
  1234. appearence.generateAppearenceData();
  1235.  
  1236.  
  1237. friendsIgnores.initialize();
  1238. if (lastFriendsChat != null) {
  1239. FriendsChat.requestJoin(this, lastFriendsChat);
  1240. lastFriendsChat = null;
  1241. }
  1242. if (clanName != null) {
  1243. if (!ClansManager.connectToClan(this, clanName, false))
  1244. clanName = null;
  1245. }
  1246.  
  1247.  
  1248.  
  1249.  
  1250. /*
  1251. * friendsIgnores.init(); if (currentFriendChatOwner != null) {
  1252. * FriendChatsManager.joinChat(currentFriendChatOwner, this); if
  1253. * (currentFriendChat == null) // failed currentFriendChatOwner = null;
  1254. * } // connect to current clan if (clanName != null) { if
  1255. * (!ClansManager.connectToClan(this, clanName, false)) clanName = null;
  1256. * }
  1257. */
  1258. if (Skills.isWeekend()){
  1259. getPackets().sendGameMessage("Double Xp Weekend is Active!");
  1260. }
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266. if (familiar != null)
  1267. familiar.respawnFamiliar(this);
  1268. else
  1269. petManager.init();
  1270. running = true;
  1271. appearence.generateAppearenceData();
  1272. appearence.generateIconsData();
  1273. controlerManager.login(); // checks what to do on login after welcome
  1274. OwnedObjectManager.linkKeys(this);
  1275. GraveStone.linkPlayer(this);
  1276. // screen
  1277. if (machineInformation != null)
  1278. machineInformation.sendSuggestions(this);
  1279.  
  1280. squealOfFortune.giveDailySpins();
  1281.  
  1282. if (isDead())
  1283. sendDeath(null);
  1284.  
  1285. }
  1286.  
  1287. private void sendUnlockedObjectConfigs() {
  1288. refreshKalphiteLairEntrance();
  1289. refreshKalphiteLair();
  1290. refreshLodestoneNetwork();
  1291. refreshFightKilnEntrance();
  1292. refreshLairofTarnRazorlorEntrance();
  1293. refreshKalphiteKingEntrance();
  1294. refreshTreeofJadinko();
  1295. }
  1296.  
  1297. private void refreshTreeofJadinko() {
  1298. getVarsManager().sendVar(9513, 1);
  1299. }
  1300.  
  1301. private void refreshLairofTarnRazorlorEntrance() {
  1302. getVarsManager().sendVar(382, 11);
  1303. }
  1304.  
  1305. private void refreshLodestoneNetwork() {
  1306. getVarsManager().sendVar(3, -1); // unlocks all lodestone teleports
  1307. getVarsManager().sendVarBit(9482, 15); // bandit lodestone, desert
  1308. // treasure q
  1309. getVarsManager().sendVarBit(10236, 190); // lunar isle lodestone,
  1310. // diplomacy q
  1311. }
  1312.  
  1313. private void refreshKalphiteLair() {
  1314. if (khalphiteLairSetted)
  1315. getVarsManager().sendVarBit(16280, 1);
  1316. }
  1317.  
  1318. public void setKalphiteLair() {
  1319. khalphiteLairSetted = true;
  1320. refreshKalphiteLair();
  1321. }
  1322.  
  1323. private void refreshFightKilnEntrance() {
  1324. if (completedFightCaves)
  1325. getVarsManager().sendVarBit(3910, 1);
  1326. }
  1327.  
  1328. private void refreshKalphiteLairEntrance() {
  1329. if (khalphiteLairEntranceSetted)
  1330. getVarsManager().sendVarBit(16281, 1);
  1331. }
  1332.  
  1333. public void setKalphiteLairEntrance() {
  1334. khalphiteLairEntranceSetted = true;
  1335. refreshKalphiteLairEntrance();
  1336. }
  1337.  
  1338. public boolean isKalphiteLairEntranceSetted() {
  1339. return khalphiteLairEntranceSetted;
  1340. }
  1341.  
  1342. public boolean isKalphiteLairSetted() {
  1343. return khalphiteLairSetted;
  1344. }
  1345.  
  1346.  
  1347. public void setKalphiteKing() {
  1348. khalphiteKingEntranceSetted = true;
  1349. refreshKalphiteLair();
  1350. }
  1351.  
  1352.  
  1353. private void refreshKalphiteKingEntrance() {
  1354. if (khalphiteKingEntranceSetted)
  1355. getVarsManager().sendVarBit(17711, 1);
  1356. }
  1357.  
  1358.  
  1359. public boolean isKalphiteKingSetted() {
  1360. return khalphiteKingEntranceSetted;
  1361. }
  1362.  
  1363. public void sendDefaultPlayersOptions() {
  1364. getPackets().sendPlayerOption("Follow", 2, false);
  1365. getPackets().sendPlayerOption("Trade with", 4, false);
  1366. if (assistStatus != 2)
  1367. sendAssistOption();
  1368. getPackets().sendPlayerOption("Examine", 6, false);
  1369. }
  1370.  
  1371. public void sendAssistOption() {
  1372. getPackets().sendPlayerOption(assistStatus == 2 ? "null" : "Req Assist", 5, false);
  1373. }
  1374.  
  1375. /**
  1376. * Logs the player out.
  1377. *
  1378. * @param lobby
  1379. * If we're logging out to the lobby.
  1380. */
  1381. public void logout(boolean lobby) {
  1382. if (!running || !started)
  1383. return;
  1384. long currentTime = Utils.currentTimeMillis();
  1385. if (getAttackedByDelay() + 10000 > currentTime) {
  1386. getPackets().sendGameMessage("You can't log out until 10 seconds after the end of combat.");
  1387. return;
  1388. }
  1389. if (getEmotesManager().getNextEmoteEnd() >= currentTime) {
  1390. getPackets().sendGameMessage("You can't log out while performing an emote.");
  1391. return;
  1392. }
  1393. if (isLocked()) {
  1394. getPackets().sendGameMessage("You can't log out while performing an action.");
  1395. return;
  1396. }
  1397. disconnect(false, lobby);
  1398. }
  1399.  
  1400. public void disconnect(boolean immediate, boolean lobby) {
  1401. immediateFinish = immediate;
  1402. ChannelFuture future = getPackets().sendLogout(lobby);
  1403. if (isLobby() || immediate) { // worldthread does this anyway, so just
  1404. // need to send packet for normal logout
  1405. if (future == null)
  1406. getSession().getChannel().close();
  1407. else
  1408. future.addListener(ChannelFutureListener.CLOSE);
  1409. }
  1410. }
  1411.  
  1412. private transient boolean immediateFinish;
  1413. private transient boolean finishing;
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423. @Override
  1424. public void finish() {
  1425. finish(0);
  1426. }
  1427.  
  1428. public boolean isFinishing() {
  1429. return finishing;
  1430. }
  1431.  
  1432. public void finish(final int tryCount) {
  1433. if (finishing || hasFinished())
  1434. return;
  1435. finishing = true;
  1436. if (lobby) {
  1437. finishLobby();
  1438. return;
  1439. }
  1440. // if combating doesnt stop when xlog this way ends combat
  1441. stopAll(false, true, !(actionManager.getAction() instanceof PlayerCombatNew));
  1442.  
  1443. if (!immediateFinish && ((isDead() || isUnderCombat() || isLocked() || getEmotesManager().isDoingEmote()))
  1444. && tryCount < 4) {
  1445. GameExecutorManager.slowExecutor.schedule(new Runnable() {
  1446. @Override
  1447. public void run() {
  1448. try {
  1449. finishing = false;
  1450. finish(tryCount + 1);
  1451. } catch (Throwable e) {
  1452. Logger.handle(e);
  1453. }
  1454. }
  1455. }, 10, TimeUnit.SECONDS);
  1456. return;
  1457. }
  1458. realFinish();
  1459. }
  1460.  
  1461. public void finishLobby() {
  1462. if (hasFinished())
  1463. return;
  1464. /*
  1465. * friendsIgnores.sendFriendsMyStatus(false); if (currentFriendChat !=
  1466. * null) currentFriendChat.leaveChat(this, true); if (clanManager !=
  1467. * null) clanManager.disconnect(this, false);
  1468. */
  1469. if (currentFriendsChat != null)
  1470. FriendsChat.detach(this);
  1471. if (clanManager != null)
  1472. clanManager.disconnect(this, false);
  1473. setFinished(true);
  1474. session.getChannel().close();
  1475. PlayerHandlerThread.addLogout(this);
  1476. World.removeLobbyPlayer(this);
  1477. if (Settings.DEBUG)
  1478. Logger.log(this, "Finished Lobby Player: " + username);
  1479. }
  1480.  
  1481. public void realFinish() {
  1482. if (hasFinished())
  1483. return;
  1484. Logger.globalLog(username, session.getIP(), new String(" has logged out."));
  1485. // login
  1486. running = false;
  1487. stopAll();
  1488. onlineTime += getSessionTime();
  1489. cutscenesManager.logout();
  1490. controlerManager.logout(); // checks what to do on before logout for
  1491. house.finish();
  1492. dungManager.finish();
  1493. inDesert = false;
  1494. inSophanem = false;
  1495. inNardah = false;
  1496. inPollnivneach = false;
  1497. GrandExchange.unlinkOffers(this);
  1498.  
  1499. if (getXpRateMode() == 1 && getRights() <= 1){
  1500. new Thread(new Highscores(this)).start();
  1501. }
  1502. else if (getXpRateMode() == 2 && getRights() <= 1){
  1503. new Thread(new HighscoresNormal(this)).start();
  1504. }
  1505. else if (getXpRateMode() == 3 && getRights() <= 1){
  1506. new Thread(new HighscoresEasy(this)).start();
  1507. }
  1508. else if (getXpRateMode() == 5 && getRights() <= 1){
  1509. new Thread(new HighscoresIronMan(this)).start();
  1510. }
  1511.  
  1512.  
  1513.  
  1514. /*
  1515. * friendsIgnores.sendFriendsMyStatus(false); if (currentFriendChat !=
  1516. * null) currentFriendChat.leaveChat(this, true); if (clanManager !=
  1517. * null) clanManager.disconnect(this, false); if (guestClanManager !=
  1518. * null) guestClanManager.disconnect(this, true);
  1519. */
  1520. if (currentFriendsChat != null)
  1521. FriendsChat.detach(this);
  1522. if (clanManager != null)
  1523. clanManager.disconnect(this, false);
  1524. if (guestClanManager != null)
  1525. guestClanManager.disconnect(this, true);
  1526. if (familiar != null && !familiar.isFinished())
  1527. familiar.dissmissFamiliar(true);
  1528. else if (pet != null)
  1529. pet.finish();
  1530. if (slayerManager.getSocialPlayer() != null)
  1531. slayerManager.resetSocialGroup(true);
  1532. if (getNextWorldTile() != null)
  1533. setLocation(getNextWorldTile());
  1534. setFinished(true);
  1535. session.getChannel().close();
  1536. PlayerHandlerThread.addLogout(this);
  1537. World.updateEntityRegion(this);
  1538. World.removePlayer(this);
  1539. if (Settings.DEBUG)
  1540. Logger.log(this, "Finished Player: " + username);
  1541. }
  1542.  
  1543. public void refreshHitPoints() {
  1544. if (getVarsManager().sendVarBit(1668, getHitpoints()))
  1545. updateBuffs();
  1546. }
  1547.  
  1548. @Override
  1549. public int getMaxHitpoints() {
  1550. if (skills.getLevel(Skills.HITPOINTS) >= 100){
  1551. return 99 * 100 + equipment.getEquipmentHpIncrease();
  1552. }
  1553.  
  1554. return skills.getLevel(Skills.HITPOINTS) * 100 + equipment.getEquipmentHpIncrease();
  1555.  
  1556. }
  1557.  
  1558. public String getUsername() {
  1559. return username;
  1560. }
  1561.  
  1562. @Override
  1563. public void processHit(Hit hit) {
  1564. if (appearence.isHidden())
  1565. return;
  1566. super.processHit(hit);
  1567. }
  1568.  
  1569. public int getRights() {
  1570. return rights;
  1571. }
  1572.  
  1573. public void setAvaBypass(){
  1574. this.avaBypass = true;
  1575. }
  1576.  
  1577. public boolean getAvaBypass(){
  1578. return avaBypass;
  1579. }
  1580.  
  1581.  
  1582. public void setOnTheGo(){
  1583. this.onTheGo = true;
  1584. }
  1585.  
  1586. public void resetOnTheGo(){
  1587. this.onTheGo = false;
  1588. }
  1589.  
  1590. public boolean getOnTheGo(){
  1591. return onTheGo;
  1592. }
  1593.  
  1594.  
  1595. public void setGodwarsBypass(){
  1596. this.godwarsBypass = true;
  1597. }
  1598.  
  1599. public boolean getGodwarsbypass(){
  1600. return godwarsBypass;
  1601. }
  1602.  
  1603.  
  1604.  
  1605. public void setRights(int rights) {
  1606. this.rights = rights;
  1607. }
  1608.  
  1609.  
  1610. public int getMessageIcon() {
  1611. return getRights() == 2 || getRights() == 1 ? getRights(): isDonator() ? 9 : isSuperDonator() ? 9 : isExtremeDonator() ? 9 : isLegendaryDonator() ? 9 : isOneAboveAll() ? 9 :getRights();
  1612. }
  1613.  
  1614. public void setMessageIcon(int icon) {
  1615. this.messageIcon = icon;
  1616. }
  1617.  
  1618. public WorldPacketsEncoder getPackets() {
  1619. return session.getWorldPackets();
  1620. }
  1621.  
  1622. public boolean hasStarted() {
  1623. return started;
  1624. }
  1625.  
  1626. public boolean isRunning() {
  1627. return running;
  1628. }
  1629.  
  1630. public String getEmail() {
  1631. return email;
  1632. }
  1633.  
  1634.  
  1635.  
  1636. public String rankName(){
  1637. if (isDonator()){
  1638. return Donator;
  1639. }
  1640. else if (isSuperDonator()){
  1641. return SuperDonator;
  1642. }
  1643. else if (isExtremeDonator()){
  1644. return ExtremeDonator;
  1645. }
  1646. else if (isLegendaryDonator()){
  1647. return LegendaryDonator;
  1648. }
  1649. else if (isOneAboveAll()){
  1650. return OneAboveAll;
  1651. }
  1652. return Regular;
  1653. }
  1654.  
  1655.  
  1656. public String getDisplayNameNoRank(){
  1657. return displayName;
  1658. }
  1659.  
  1660. public String getDisplayName(){
  1661. return displayName;
  1662. }
  1663.  
  1664.  
  1665. public String getDisplayNameRank() {
  1666.  
  1667. GameExecutorManager.slowExecutor.schedule(new Runnable() {
  1668. @Override
  1669. public void run() {
  1670. try {
  1671. getAppearence().generateAppearenceData();
  1672. } catch (Throwable e) {
  1673. Logger.handle(e);
  1674. }
  1675. }
  1676. }, 1, TimeUnit.SECONDS);
  1677.  
  1678. if (isIronMan() && isToggleIron()){
  1679. return "<col=bdbdbd><img=11>Ironman</col> " + displayName;
  1680. }
  1681. if (isAssistantDeveloper()){
  1682. return "<col=3055ba>Assistant Dev</col> " + displayName;
  1683. }
  1684.  
  1685.  
  1686. if (getRights() == 2 && getUsername().equalsIgnoreCase("jas")){
  1687. return "<col=e3e507>Owner</col> " + displayName;
  1688. }
  1689.  
  1690. if (getRights() == 2 ){
  1691. return "<col=CD0000>Administrator</col> " + displayName;
  1692. }
  1693.  
  1694. else if (getRights() == 3){
  1695. return "<img=1><col=1fc74c>Administrator</col> " + displayName;
  1696. }
  1697.  
  1698. else if (getRights() == 4){
  1699. return "<img=1><col=2a3ed6>Developer</col> " + displayName;
  1700. }
  1701.  
  1702. else if (getRights() == 1){
  1703. return "<col=79727a>Moderator</col> " + displayName;
  1704. }
  1705.  
  1706.  
  1707. else if (isDonator() && isToggleDonator() && isIronMan()){
  1708. return "<img=11><img=9><col=2bd8d4> Iron Donator</col> " + displayName + "";
  1709. }
  1710.  
  1711. else if (isSuperDonator() && isToggleDonator() && isIronMan()){
  1712. return "<img=11><img=9><col=20db52> Super Iron Donator</col> " + displayName + "";
  1713. }
  1714. else if (isExtremeDonator() && isToggleDonator() && isIronMan()){
  1715. return "<img=11><img=9><col=d2b81b> Extreme Iron Donator</col> " + displayName + "";
  1716. }
  1717. else if (isLegendaryDonator() && isToggleDonator() && isIronMan()){
  1718. return "<img=11><img=9><col=c13333> Legendary Iron Donator</col> " + displayName + "";
  1719. }
  1720. else if (isOneAboveAll() && isToggleDonator() && isIronMan()){
  1721. return "<img=11><img=9><col=9a26b0> One Above All Iron</col> " + displayName + "";
  1722. }
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728. else if (isDonator() && isToggleDonator()){
  1729. return "<img=9><col=2bd8d4>Donator</col> " + displayName + "";
  1730. }
  1731.  
  1732. else if (isSuperDonator() && isToggleDonator()){
  1733. return "<img=9><col=20db52>Super Donator</col> " + displayName + "";
  1734. }
  1735. else if (isExtremeDonator() && isToggleDonator()){
  1736. return "<img=9><col=d2b81b>Extreme Donator</col> " + displayName + "";
  1737. }
  1738. else if (isLegendaryDonator() && isToggleDonator()){
  1739. return "<img=9><col=c13333>Legendary Donator</col> " + displayName + "";
  1740. }
  1741. else if (isOneAboveAll() && isToggleDonator()){
  1742. return "<img=9><col=9a26b0>One Above All</col> " + displayName + "";
  1743. }
  1744.  
  1745. else
  1746.  
  1747.  
  1748.  
  1749. return displayName;
  1750. }
  1751.  
  1752.  
  1753.  
  1754. public boolean isToggleIron(){
  1755. return toggleIron;
  1756. }
  1757.  
  1758. public void setToggleIron(boolean toggleIron){
  1759. this.toggleIron = toggleIron;
  1760. }
  1761.  
  1762. public boolean isToggleDonator(){
  1763. return toggleDonator;
  1764. }
  1765.  
  1766. public void setToggleDonator(boolean toggleDonator){
  1767. this.toggleDonator = toggleDonator;
  1768. }
  1769.  
  1770. public void setDisplayName(String newName) {
  1771. this.displayName = newName;
  1772. getAppearence().generateAppearenceData();
  1773. }
  1774.  
  1775. public Appearence getAppearence() {
  1776. return appearence;
  1777. }
  1778.  
  1779. public Equipment getEquipment() {
  1780. return equipment;
  1781. }
  1782.  
  1783. public LocalPlayerUpdate getLocalPlayerUpdate() {
  1784. return localPlayerUpdate;
  1785. }
  1786.  
  1787. public LocalNPCUpdate getLocalNPCUpdate() {
  1788. return localNPCUpdate;
  1789. }
  1790.  
  1791. public int getDisplayMode() {
  1792. return displayMode;
  1793. }
  1794.  
  1795. public InterfaceManager getInterfaceManager() {
  1796. return interfaceManager;
  1797. }
  1798.  
  1799. public Session getSession() {
  1800. return session;
  1801. }
  1802.  
  1803. public void setScreenWidth(int screenWidth) {
  1804. this.screenWidth = screenWidth;
  1805. }
  1806.  
  1807. public int getScreenWidth() {
  1808. return screenWidth;
  1809. }
  1810.  
  1811. public void setScreenHeight(int screenHeight) {
  1812. this.screenHeight = screenHeight;
  1813. }
  1814.  
  1815. public int getScreenHeight() {
  1816. return screenHeight;
  1817. }
  1818.  
  1819. public boolean clientHasLoadedMapRegion() {
  1820. return clientLoadedMapRegion < Utils.currentWorldCycle();
  1821. }
  1822.  
  1823. public void setClientHasLoadedMapRegion() {
  1824. clientLoadedMapRegion = -1;
  1825. }
  1826.  
  1827. public boolean clientHasLoadedMapRegionFinished() {
  1828. return clientLoadedMapRegion == -1;
  1829. }
  1830.  
  1831. public void setDisplayMode(int displayMode) {
  1832. this.displayMode = displayMode;
  1833. }
  1834.  
  1835. public Inventory getInventory() {
  1836. return inventory;
  1837. }
  1838.  
  1839. public Skills getSkills() {
  1840. return skills;
  1841. }
  1842.  
  1843. public byte getRunEnergy() {
  1844. return runEnergy;
  1845. }
  1846.  
  1847. public double getWeight() {
  1848. return inventory.getInventoryWeight() + equipment.getEquipmentWeight();
  1849. }
  1850.  
  1851. public void drainRunEnergy() {
  1852. if (dungManager.isInside())
  1853. return;
  1854. setRunEnergy(runEnergy - 1);
  1855. }
  1856.  
  1857. public void setRunEnergy(int runEnergy) {
  1858. if (runEnergy == this.runEnergy)
  1859. return;
  1860. if (runEnergy < 0)
  1861. runEnergy = 0;
  1862. else if (runEnergy > 100)
  1863. runEnergy = 100;
  1864. this.runEnergy = (byte) runEnergy;
  1865. getPackets().sendRunEnergy();
  1866. }
  1867.  
  1868. public boolean isResting() {
  1869. return resting > 0;
  1870. }
  1871.  
  1872. public void setResting(int resting) {
  1873. this.resting = resting;
  1874. sendRunButtonConfig();
  1875. }
  1876.  
  1877. public ActionManager getActionManager() {
  1878. return actionManager;
  1879. }
  1880.  
  1881. public void setRouteEvent(RouteEvent routeEvent) {
  1882. this.routeEvent = routeEvent;
  1883. }
  1884.  
  1885. public DialogueManager getDialogueManager() {
  1886. return dialogueManager;
  1887. }
  1888.  
  1889. public CombatDefinitions getCombatDefinitions() {
  1890. return combatDefinitions;
  1891. }
  1892.  
  1893. @Override
  1894. public double getMagePrayerMultiplier() {
  1895. return 0.6;
  1896. }
  1897.  
  1898. @Override
  1899. public double getRangePrayerMultiplier() {
  1900. return 0.6;
  1901. }
  1902.  
  1903. @Override
  1904. public double getMeleePrayerMultiplier() {
  1905. if (Utils.random(5) == 0 && Combat.fullVeracsEquipped(this))
  1906. return 1.0;
  1907. return 0.6;
  1908. }
  1909.  
  1910. @Override
  1911. public void handleIngoingHit(final Hit hit) {
  1912. if (hit.getLook() == HitLook.REGULAR_DAMAGE) {
  1913. if (getEffectsManager().hasActiveEffect(EffectType.REFLECT))
  1914. hit.setDamage(0);
  1915. return;
  1916. }
  1917. if (hit.getLook() != HitLook.MELEE_DAMAGE && hit.getLook() != HitLook.RANGE_DAMAGE
  1918. && hit.getLook() != HitLook.MAGIC_DAMAGE)
  1919. return;
  1920. if (invulnerable) {
  1921. hit.setDamage(0);
  1922. return;
  1923. }
  1924. if (auraManager.usingPenance()) {
  1925. int amount = (int) (hit.getDamage() * 0.05);
  1926. if (amount > 0)
  1927. prayer.restorePrayer(amount);
  1928. }
  1929. final Entity source = hit.getSource();
  1930. if (source == null)
  1931. return;
  1932. if (getEffectsManager().hasActiveEffect(EffectType.VESTA_IMMUNITY)) {
  1933. if (equipment.getWeaponId() != 13905 && equipment.getWeaponId() != 13907)
  1934. getEffectsManager().removeEffect(EffectType.VESTA_IMMUNITY);
  1935. else {
  1936. int damage = (int) (hit.getDamage() * 0.5);
  1937. hit.setDamage(damage);
  1938. source.applyHit(new Hit(Player.this, damage, HitLook.REFLECTED_DAMAGE));
  1939. }
  1940. } else if (getEffectsManager().hasActiveEffect(EffectType.MIRRORBACK_SPIDER)) {
  1941. Effect e = getEffectsManager().getEffectForType(EffectType.MIRRORBACK_SPIDER);
  1942. if (e != null) {
  1943. MirrorBackSpider spider = (MirrorBackSpider) e.getArguments()[0];
  1944. if (spider.isDead())
  1945. getEffectsManager().removeEffect(e.getType());
  1946. else {
  1947. int damage = (int) (hit.getDamage() * 0.5);
  1948. hit.setDamage(damage);
  1949. Hit reflectedHit = new Hit(this, damage, HitLook.REFLECTED_DAMAGE);
  1950. spider.applyHit(reflectedHit);
  1951. source.applyHit(reflectedHit);
  1952. }
  1953. }
  1954. } else if (getEffectsManager().hasActiveEffect(EffectType.REFLECT)) {
  1955. int damage = (int) (hit.getDamage() * 0.5);
  1956. hit.setDamage(damage);
  1957. source.applyHit(new Hit(Player.this, damage, HitLook.REFLECTED_DAMAGE));
  1958. } else if (getEffectsManager().hasActiveEffect(EffectType.BARRICADE))
  1959. hit.setDamage(0);
  1960. if (getEffectsManager().hasActiveEffect(EffectType.DEBILITATE))
  1961. hit.setDamage((int) (hit.getDamage() * 0.50));
  1962. if (getEffectsManager().hasActiveEffect(EffectType.IMMORTALITY))
  1963. hit.setDamage((int) (hit.getDamage() * 0.75));
  1964. if (getEffectsManager().hasActiveEffect(EffectType.STAFF_OF_LIGHT)) {
  1965. Item staff = equipment.getItem(Equipment.SLOT_WEAPON);
  1966. if (staff == null || !staff.getName().equals("Staff of light"))
  1967. getEffectsManager().removeEffect(EffectType.STAFF_OF_LIGHT);
  1968. else {
  1969. if (hit.getLook() == HitLook.MELEE_DAMAGE)
  1970. hit.setDamage((int) (hit.getDamage() * 0.5));
  1971. }
  1972. }
  1973. if (getEffectsManager().hasActiveEffect(EffectType.BERSERK))
  1974. hit.setDamage((int) (hit.getDamage() * 1.5));
  1975. if (getEffectsManager().hasActiveEffect(EffectType.RESONANCE)) {
  1976. int damage = hit.getDamage();
  1977. if (damage > 1) {
  1978. hit.setDamage(1);
  1979. heal(damage, 0, 0, true);
  1980. getEffectsManager().removeEffect(EffectType.RESONANCE);
  1981. }
  1982. }
  1983. Effect revengeEffect = getEffectsManager().getEffectForType(EffectType.REVENGE);
  1984. if (revengeEffect != null) {
  1985. if (hit.getDamage() > 0) {
  1986. double nextDmgMultiplier = (double) revengeEffect.getArguments()[0] + 0.10;
  1987. revengeEffect.getArguments()[0] = nextDmgMultiplier > 2.0 ? 2.0 : nextDmgMultiplier;
  1988. }
  1989. }
  1990. if (prayer.hasPrayersOn() && hit.getDamage() != 0) {
  1991. if (source instanceof Familiar) {
  1992. Familiar fam = (Familiar) source;
  1993. if (!fam.hasSpecialOn())
  1994. return;
  1995. Player owner = fam.getOwner();
  1996. if (owner == null)
  1997. return;
  1998. if (prayer.usingPrayer(0, 10))
  1999. hit.setDamage((int) (hit.getDamage() * 0.5));
  2000. else if (prayer.usingPrayer(1, 10)) {
  2001. hit.setDamage((int) (hit.getDamage() * 0.5));
  2002. if (getEquipment().getAmuletId() == 31877 && getCharges().getCharges(31877) > 1){
  2003. hit.setDamage((int) (hit.getDamage() * 0.9));
  2004. }
  2005. int deflectedDamage = (int) (hit.getDamage() * 0.1);
  2006. if (deflectedDamage > 0) {
  2007. owner.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
  2008. setNextGraphics(new Graphics(2227));
  2009. setNextAnimationNoPriority(new Animation(12573));
  2010. }
  2011. }
  2012. } else {
  2013. boolean isPvPReducation = source instanceof Player;
  2014. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2015. if (prayer.usingPrayer(0, 11)) {
  2016. hit.setDamage((int) (hit.getDamage() * (getEffectsManager().hasActiveEffect(EffectType.DEVOTION)
  2017. ? isPvPReducation ? 0.25 : 0.0 : source.getMagePrayerMultiplier())));
  2018. if (hit.getDamage() == 0)
  2019. hit.setDamage(1);
  2020. } else if (prayer.usingPrayer(1, 11)) {
  2021. int deflectedDamage = (int) (hit.getDamage() * 0.1);
  2022. hit.setDamage((int) (hit.getDamage() * (getEffectsManager().hasActiveEffect(EffectType.DEVOTION)
  2023. ? isPvPReducation ? 0.25 : 0.0 : source.getMagePrayerMultiplier())));
  2024. if (hit.getDamage() == 0)
  2025. hit.setDamage(1);
  2026. if (deflectedDamage > 0 && prayer.canReflect(source)) {
  2027. source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
  2028. setNextGraphics(new Graphics(2228));
  2029. setNextAnimationNoPriority(new Animation(12573));
  2030. }
  2031. }
  2032. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2033. if (prayer.usingPrayer(0, 12)) {
  2034. hit.setDamage((int) (hit.getDamage() * (getEffectsManager().hasActiveEffect(EffectType.DEVOTION)
  2035. ? isPvPReducation ? 0.25 : 0.0 : source.getRangePrayerMultiplier())));
  2036. if (hit.getDamage() == 0)
  2037. hit.setDamage(1);
  2038. } else if (prayer.usingPrayer(1, 12)) {
  2039. int deflectedDamage = (int) (hit.getDamage() * 0.1);
  2040. hit.setDamage((int) (hit.getDamage() * (getEffectsManager().hasActiveEffect(EffectType.DEVOTION)
  2041. ? isPvPReducation ? 0.25 : 0.0 : source.getRangePrayerMultiplier())));
  2042. if (hit.getDamage() == 0)
  2043. hit.setDamage(1);
  2044. if (deflectedDamage > 0 && prayer.canReflect(source)) {
  2045. source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
  2046. setNextGraphics(new Graphics(2229));
  2047. setNextAnimationNoPriority(new Animation(12573));
  2048. }
  2049. }
  2050. } else if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2051. if (prayer.usingPrayer(0, 13)) {
  2052. hit.setDamage((int) (hit.getDamage() * (getEffectsManager().hasActiveEffect(EffectType.DEVOTION)
  2053. ? isPvPReducation ? 0.25 : 0.0 : source.getMeleePrayerMultiplier())));
  2054. if (hit.getDamage() == 0)
  2055. hit.setDamage(1);
  2056. } else if (prayer.usingPrayer(1, 13)) {
  2057. int deflectedDamage = (int) (hit.getDamage() * 0.1);
  2058. hit.setDamage((int) (hit.getDamage() * (getEffectsManager().hasActiveEffect(EffectType.DEVOTION)
  2059. ? isPvPReducation ? 0.25 : 0.0 : source.getMeleePrayerMultiplier())));
  2060. if (hit.getDamage() == 0)
  2061. hit.setDamage(1);
  2062. if (deflectedDamage > 0 && prayer.canReflect(source)) {
  2063. source.applyHit(new Hit(this, deflectedDamage, HitLook.REFLECTED_DAMAGE));
  2064. setNextGraphics(new Graphics(2230));
  2065. setNextAnimationNoPriority(new Animation(12573));
  2066. }
  2067. }
  2068. }
  2069. }
  2070. }
  2071. int shieldId = equipment.getShieldId();
  2072. if (shieldId == 13740 || shieldId == 23698 || shieldId == 13742 || shieldId == 23699 || shieldId == 13738
  2073. || shieldId == 23697) { // divine, eylsian, and arcane
  2074. int drain = (int) (Math.ceil(hit.getDamage() * 0.06));
  2075. if (prayer.getPrayerpoints() >= drain) {
  2076. hit.setDamage((int) (hit.getDamage() * 0.70));
  2077. prayer.drainPrayer(drain);
  2078. }
  2079. }
  2080.  
  2081. if (hit.getLook() == HitLook.MELEE_DAMAGE || hit.getLook() == HitLook.RANGE_DAMAGE || hit.getLook() == HitLook.MELEE_DAMAGE ){
  2082. int random = Utils.random(1, 150);
  2083. int defenceLevel = getSkills().getLevel(Skills.DEFENCE);
  2084. if (getSkills().getLevel(Skills.DEFENCE) > 99){
  2085. defenceLevel = 99;
  2086. }
  2087. int chanceBlock = Utils.random(1 + defenceLevel) / 10;
  2088.  
  2089. if (random <= chanceBlock){
  2090. hit.setDamage(0);
  2091. return;
  2092. }
  2093.  
  2094.  
  2095.  
  2096. }
  2097.  
  2098. //MELEE_TYPE = 0, RANGE_TYPE = 1, MAGIC_TYPE = 2, ALL_TYPE = 3;
  2099. //Damage Armour Increase
  2100.  
  2101.  
  2102.  
  2103. //MELEE_TYPE = 0, RANGE_TYPE = 1, MAGIC_TYPE = 2, ALL_TYPE = 3;
  2104. //Damage Armour Reduction
  2105.  
  2106. int weaknessType = this.getCombatDefinitions().getWeaknessType();
  2107. if (weaknessType == 0 && hit.getLook() == HitLook.MELEE_DAMAGE){
  2108. int damage = hit.getDamage() + 350;
  2109. hit.setDamage(damage);
  2110. return;
  2111. }
  2112. if (weaknessType == 1 && hit.getLook() == HitLook.RANGE_DAMAGE){
  2113. int damage = hit.getDamage() + 350;
  2114. hit.setDamage(damage);
  2115. return;
  2116. }
  2117. if (weaknessType == 2 && hit.getLook() == HitLook.MAGIC_DAMAGE){
  2118. int damage = hit.getDamage() + 350;
  2119. hit.setDamage(damage);
  2120. return;
  2121. }
  2122.  
  2123. if (weaknessType == 3){
  2124. int damage = hit.getDamage();
  2125. hit.setDamage(damage);
  2126. return;
  2127. }
  2128.  
  2129.  
  2130.  
  2131. //MELEE_TYPE = 0, RANGE_TYPE = 1, MAGIC_TYPE = 2, ALL_TYPE = 3;
  2132.  
  2133. //ExtraArmor - TODO
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139. if (hit.getLook() == HitLook.MELEE_DAMAGE){
  2140. int ArmourRating = getCombatDefinitions().getStats()[CombatDefinitions.ARMOR] / 10;
  2141. int DefenceRating = getCombatDefinitions().getDefenceArmor() / 10;
  2142. int OverallRating = (ArmourRating + DefenceRating);
  2143. int calculatedHit = hit.getDamage() * (OverallRating / 25 / 80) / 3;
  2144. int reducedHit = calculatedHit / 5;
  2145. int newHit = hit.getDamage() - reducedHit;
  2146. hit.setDamage(newHit);
  2147.  
  2148. return;
  2149.  
  2150. }
  2151.  
  2152. if (hit.getLook() == HitLook.RANGE_DAMAGE){
  2153. int ArmourRating = getCombatDefinitions().getStats()[CombatDefinitions.ARMOR] / 10;
  2154. int DefenceRating = getCombatDefinitions().getDefenceArmor() / 10;
  2155. int OverallRating = (ArmourRating + DefenceRating);
  2156. int calculatedHit = hit.getDamage() * (OverallRating / 25 / 80) / 3;
  2157. int reducedHit = calculatedHit / 5;
  2158. int newHit = hit.getDamage() - reducedHit;
  2159. hit.setDamage(newHit);
  2160.  
  2161. return;
  2162.  
  2163. }
  2164.  
  2165. if (hit.getLook() == HitLook.MAGIC_DAMAGE){
  2166. int ArmourRating = getCombatDefinitions().getStats()[CombatDefinitions.ARMOR] / 10;
  2167. int DefenceRating = getCombatDefinitions().getDefenceArmor() / 10;
  2168. int OverallRating = (ArmourRating + DefenceRating);
  2169. int calculatedHit = hit.getDamage() * (OverallRating / 25 / 80) / 3;
  2170. int reducedHit = calculatedHit / 5;
  2171. int newHit = hit.getDamage() - reducedHit;
  2172. hit.setDamage(newHit);
  2173.  
  2174. return;
  2175.  
  2176. }
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183. if (castedVeng && hit.getDamage() >= 4) {
  2184. castedVeng = false;
  2185. setNextForceTalk(new ForceTalk("Taste vengeance!"));
  2186. WorldTasksManager.schedule(new WorldTask() {
  2187.  
  2188. @Override
  2189. public void run() {
  2190. source.applyHit(new Hit(Player.this, (int) (hit.getDamage() * 0.75), HitLook.REGULAR_DAMAGE));
  2191. }
  2192. });
  2193. }
  2194. getControlerManager().processIngoingHit(hit);
  2195. if (source instanceof Player) {
  2196. ((Player) source).getPrayer().handleHitPrayers(this, hit);
  2197. ((Player) source).getControlerManager().processIncommingHit(hit, this);
  2198. }
  2199.  
  2200. }
  2201.  
  2202. @Override
  2203. public void removeHitpoints(final Hit hit) {
  2204. super.removeHitpoints(hit);
  2205. if (isDead())
  2206. return;
  2207. if (getEquipment().getRingId() == 2550) {
  2208. if (hit.getSource() != null && hit.getSource() != this && hit.getDamage() > 0
  2209. && (hit.getLook() == HitLook.MELEE_DAMAGE || hit.getLook() == HitLook.RANGE_DAMAGE
  2210. || hit.getLook() == HitLook.MAGIC_DAMAGE)) {
  2211. WorldTasksManager.schedule(new WorldTask() {
  2212. @Override
  2213. public void run() {
  2214. hit.getSource().applyHit(new Hit(Player.this, (int) (Math.ceil(hit.getDamage() * 0.01) * 10),
  2215. HitLook.REGULAR_DAMAGE));
  2216. }
  2217. });
  2218. }
  2219. }
  2220. if (getPrayer().hasPrayersOn()) {
  2221. if (getPrayer().usingPrayer(0, 15) && (getHitpoints() < getMaxHitpoints() * 0.1)) {
  2222. setNextGraphics(new Graphics(436));
  2223. setHitpoints((int) (getHitpoints() + getSkills().getLevelForXp(Skills.PRAYER) * 2.5));
  2224. getSkills().set(Skills.PRAYER, 0);
  2225. getPrayer().setPrayerpoints(0);
  2226. }
  2227. }
  2228. if (getEquipment().getAmuletId() == 11090 && getHitpoints() <= getMaxHitpoints() * 0.2) {// priority
  2229. // over
  2230. // ring
  2231. // of
  2232. // life
  2233. heal((int) (getMaxHitpoints() * 0.3));
  2234. getEquipment().deleteItem(11090, 1);
  2235. getAppearence().generateAppearenceData();
  2236. resetReceivedHits();
  2237. getPackets().sendGameMessage("Your pheonix necklace heals you, but is destroyed in the process.");
  2238. } else if (getEquipment().getAmuletId() != 11090 && getEquipment().getRingId() == 11090
  2239. && getHitpoints() <= getMaxHitpoints() * 0.1) {
  2240. Magic.sendNormalTeleportSpell(this, 1, 0, DeathEvent.getRespawnHub(this));
  2241. getEquipment().deleteItem(11090, 1);
  2242. resetReceivedHits();
  2243. getPackets().sendGameMessage("Your ring of life saves you, but is destroyed in the process.");
  2244. }
  2245. }
  2246.  
  2247.  
  2248.  
  2249.  
  2250. @Override
  2251. public void sendDeath(final Entity source) {
  2252. inDesert = false;
  2253. inSophanem = false;
  2254. inNardah = false;
  2255. inPollnivneach = false;
  2256. if (getEffectsManager().hasActiveEffect(EffectType.IMMORTALITY)) {
  2257. resetReceivedHits();
  2258. setHitpoints((int) (getMaxHitpoints() * 0.40));
  2259. setNextAnimation(new Animation(18119));
  2260. setNextGraphics(new Graphics(3630));
  2261. World.sendGraphics(this, new Graphics(3631, 0, 0, getDirection(), true), this);
  2262. getEffectsManager().removeEffect(EffectType.IMMORTALITY);
  2263. return;
  2264. }
  2265. if (prayer.hasPrayersOn() && getTemporaryAttributtes().get("startedDuel") != Boolean.TRUE) {
  2266. if (prayer.usingPrayer(0, 14)) {
  2267. setNextGraphics(new Graphics(437));
  2268. final Player target = this;
  2269.  
  2270. for (int regionId : getMapRegionsIds()) {
  2271. List<Integer> playersIndexes = World.getRegion(regionId).getPlayerIndexes();
  2272. if (playersIndexes != null) {
  2273. for (int playerIndex : playersIndexes) {
  2274. Player player = World.getPlayers().get(playerIndex);
  2275. if (player == null || !player.hasStarted() || player.isDead() || player.hasFinished()
  2276. || !player.withinDistance(this, 1) || !player.isCanPvp()
  2277. || !target.getControlerManager().canHit(player))
  2278. continue;
  2279. player.applyHit(
  2280. new Hit(target, Utils.random((int) (skills.getLevelForXp(Skills.PRAYER) * 2.5)),
  2281. HitLook.REGULAR_DAMAGE));
  2282. }
  2283. }
  2284. List<Integer> npcsIndexes = World.getRegion(regionId).getNPCsIndexes();
  2285. if (npcsIndexes != null) {
  2286. for (int npcIndex : npcsIndexes) {
  2287. NPC npc = World.getNPCs().get(npcIndex);
  2288. if (npc == null || npc.isDead() || npc.hasFinished() || !npc.withinDistance(this, 1)
  2289. || !npc.getDefinitions().hasAttackOption()
  2290. || !target.getControlerManager().canHit(npc))
  2291. continue;
  2292. npc.applyHit(
  2293. new Hit(target, Utils.random((int) (skills.getLevelForXp(Skills.PRAYER) * 25.00)),
  2294. HitLook.REGULAR_DAMAGE));
  2295. }
  2296. }
  2297. }
  2298.  
  2299. WorldTasksManager.schedule(new WorldTask() {
  2300. @Override
  2301. public void run() {
  2302. World.sendGraphics(target, new Graphics(438),
  2303. new WorldTile(target.getX() - 1, target.getY(), target.getPlane()));
  2304. World.sendGraphics(target, new Graphics(438),
  2305. new WorldTile(target.getX() + 1, target.getY(), target.getPlane()));
  2306. World.sendGraphics(target, new Graphics(438),
  2307. new WorldTile(target.getX(), target.getY() - 1, target.getPlane()));
  2308. World.sendGraphics(target, new Graphics(438),
  2309. new WorldTile(target.getX(), target.getY() + 1, target.getPlane()));
  2310. World.sendGraphics(target, new Graphics(438),
  2311. new WorldTile(target.getX() - 1, target.getY() - 1, target.getPlane()));
  2312. World.sendGraphics(target, new Graphics(438),
  2313. new WorldTile(target.getX() - 1, target.getY() + 1, target.getPlane()));
  2314. World.sendGraphics(target, new Graphics(438),
  2315. new WorldTile(target.getX() + 1, target.getY() - 1, target.getPlane()));
  2316. World.sendGraphics(target, new Graphics(438),
  2317. new WorldTile(target.getX() + 1, target.getY() + 1, target.getPlane()));
  2318. }
  2319. });
  2320. } else if (prayer.usingPrayer(1, 23)) {
  2321. World.sendProjectile(this, new WorldTile(getX() + 2, getY() + 2, getPlane()), 2261, 24, 0, 41, 35, 30,
  2322. 0);
  2323. World.sendProjectile(this, new WorldTile(getX() + 2, getY(), getPlane()), 2261, 41, 0, 41, 35, 30, 0);
  2324. World.sendProjectile(this, new WorldTile(getX() + 2, getY() - 2, getPlane()), 2261, 41, 0, 41, 35, 30,
  2325. 0);
  2326.  
  2327. World.sendProjectile(this, new WorldTile(getX() - 2, getY() + 2, getPlane()), 2261, 41, 0, 41, 35, 30,
  2328. 0);
  2329. World.sendProjectile(this, new WorldTile(getX() - 2, getY(), getPlane()), 2261, 41, 0, 41, 35, 30, 0);
  2330. World.sendProjectile(this, new WorldTile(getX() - 2, getY() - 2, getPlane()), 2261, 41, 0, 41, 35, 30,
  2331. 0);
  2332.  
  2333. World.sendProjectile(this, new WorldTile(getX(), getY() + 2, getPlane()), 2261, 41, 0, 41, 35, 30, 0);
  2334. World.sendProjectile(this, new WorldTile(getX(), getY() - 2, getPlane()), 2261, 41, 0, 41, 35, 30, 0);
  2335. final Player target = this;
  2336. WorldTasksManager.schedule(new WorldTask() {
  2337. @Override
  2338. public void run() {
  2339. setNextGraphics(new Graphics(2259));
  2340.  
  2341. for (int regionId : getMapRegionsIds()) {
  2342. List<Integer> playersIndexes = World.getRegion(regionId).getPlayerIndexes();
  2343. if (playersIndexes != null) {
  2344. for (int playerIndex : playersIndexes) {
  2345. Player player = World.getPlayers().get(playerIndex);
  2346. if (player == null || !player.hasStarted() || player.isDead()
  2347. || player.hasFinished() || !player.isCanPvp()
  2348. || !player.withinDistance(target, 2)
  2349. || !target.getControlerManager().canHit(player))
  2350. continue;
  2351. player.applyHit(new Hit(target,
  2352. (int) Utils.random((skills.getLevelForXp(Skills.PRAYER) * 25.00)),
  2353. HitLook.REGULAR_DAMAGE));
  2354. }
  2355. }
  2356. List<Integer> npcsIndexes = World.getRegion(regionId).getNPCsIndexes();
  2357. if (npcsIndexes != null) {
  2358. for (int npcIndex : npcsIndexes) {
  2359. NPC npc = World.getNPCs().get(npcIndex);
  2360. if (npc == null || npc.isDead() || npc.hasFinished()
  2361. || !npc.withinDistance(target, 2) || !npc.getDefinitions().hasAttackOption()
  2362. || !target.getControlerManager().canHit(npc))
  2363. continue;
  2364. npc.applyHit(new Hit(target,
  2365. (int) Utils.random((skills.getLevelForXp(Skills.PRAYER) * 25.00)),
  2366. HitLook.REGULAR_DAMAGE));
  2367. }
  2368. }
  2369. }
  2370.  
  2371. World.sendGraphics(target, new Graphics(2260),
  2372. new WorldTile(getX() + 2, getY() + 2, getPlane()));
  2373. World.sendGraphics(target, new Graphics(2260), new WorldTile(getX() + 2, getY(), getPlane()));
  2374. World.sendGraphics(target, new Graphics(2260),
  2375. new WorldTile(getX() + 2, getY() - 2, getPlane()));
  2376.  
  2377. World.sendGraphics(target, new Graphics(2260),
  2378. new WorldTile(getX() - 2, getY() + 2, getPlane()));
  2379. World.sendGraphics(target, new Graphics(2260), new WorldTile(getX() - 2, getY(), getPlane()));
  2380. World.sendGraphics(target, new Graphics(2260),
  2381. new WorldTile(getX() - 2, getY() - 2, getPlane()));
  2382.  
  2383. World.sendGraphics(target, new Graphics(2260), new WorldTile(getX(), getY() + 2, getPlane()));
  2384. World.sendGraphics(target, new Graphics(2260), new WorldTile(getX(), getY() - 2, getPlane()));
  2385.  
  2386. World.sendGraphics(target, new Graphics(2260),
  2387. new WorldTile(getX() + 1, getY() + 1, getPlane()));
  2388. World.sendGraphics(target, new Graphics(2260),
  2389. new WorldTile(getX() + 1, getY() - 1, getPlane()));
  2390. World.sendGraphics(target, new Graphics(2260),
  2391. new WorldTile(getX() - 1, getY() + 1, getPlane()));
  2392. World.sendGraphics(target, new Graphics(2260),
  2393. new WorldTile(getX() - 1, getY() - 1, getPlane()));
  2394. }
  2395. });
  2396. }
  2397. }
  2398. setNextAnimation(new Animation(-1));
  2399. if (!controlerManager.sendDeath())
  2400. return;
  2401. lock(8);
  2402. stopAll();
  2403. if (familiar != null)
  2404. familiar.sendDeath(this);
  2405. final WorldTile deathTile = new WorldTile(this);
  2406. WorldTasksManager.schedule(new WorldTask() {
  2407. int loop;
  2408.  
  2409. @Override
  2410. public void run() {
  2411. if (loop == 0) {
  2412. setNextAnimation(getDeathAnimation());
  2413. } else if (loop == 1) {
  2414. getPackets().sendGameMessage("Oh dear, you have died.");
  2415. } else if (loop == 3) {
  2416. controlerManager.startControler("DeathEvent", deathTile, hasSkull());
  2417. } else if (loop == 4) {
  2418. getMusicsManager().playMusicEffect(MusicsManager.DEATH_MUSIC_EFFECT);
  2419. stop();
  2420. }
  2421. loop++;
  2422. }
  2423. }, 0, 1);
  2424. }
  2425.  
  2426. public void sendItemsOnDeath(Player killer, boolean dropItems, boolean dropLostItems) {
  2427. Integer[][] slots = GraveStone.getItemSlotsKeptOnDeath(this, true, dropItems, getPrayer().isProtectingItem());
  2428. sendItemsOnDeath(killer, getLastWorldTile(), new WorldTile(this), true, slots, dropLostItems);
  2429. }
  2430.  
  2431. /*
  2432. * default items on death, now only used for wilderness
  2433. */
  2434. public void sendItemsOnDeath(Player killer, boolean dropItems) {
  2435. sendItemsOnDeath(killer, dropItems, true);
  2436. }
  2437.  
  2438. /*
  2439. * default items on death, now only used for wilderness
  2440. */
  2441. public void sendItemsOnDeath(Player killer) {
  2442. sendItemsOnDeath(killer, hasSkull());
  2443. }
  2444.  
  2445. public void sendItemsOnDeath(Player killer, WorldTile deathTile, WorldTile respawnTile, boolean wilderness,
  2446. Integer[][] slots, boolean dropLostItems) {
  2447. /*
  2448. * if ((((killer != null && killer.getRights() == 2) || getRights() ==
  2449. * 2) && Settings.HOSTED) || hasFinished()) return;
  2450. */
  2451. if (Settings.HOSTED) {
  2452. if (getRights() >= 3 || hasFinished())
  2453. return;
  2454. if (killer != null) {
  2455. if (killer.getRights() >= 2)
  2456. return;
  2457. }
  2458. }
  2459. if (getRights() >= 0 && wilderness == false){
  2460. return;
  2461. }
  2462.  
  2463. charges.die(slots[1], slots[3]); // degrades droped and lost items only
  2464. auraManager.removeAura();
  2465. Item[][] items = GraveStone.getItemsKeptOnDeath(this, slots);
  2466. inventory.reset();
  2467. equipment.reset();
  2468. appearence.generateAppearenceData();
  2469. for (Item item : items[0])
  2470. inventory.addItemDrop(item.getId(), item.getAmount(), respawnTile);
  2471. if (dropLostItems) {
  2472. if (items[1].length != 0) {
  2473. if (wilderness) {
  2474. if (!isBeginningAccount())
  2475. for (Item item : items[1])
  2476. World.addGroundItem(item, deathTile, killer == null ? this : killer, true, 60,
  2477. killer == null ? 1 : 0);
  2478. } else
  2479. new GraveStone(this, deathTile, items[1]);
  2480. }
  2481.  
  2482. }
  2483. if (killer != null)
  2484. Logger.globalLog(username, session.getIP(),
  2485. new String(killer.getUsername() + " has killed " + username + " with the ip: "
  2486. + killer.getSession().getIP() + " items are as follows:"
  2487. + Arrays.toString(items[1]).replace("null,", "") + " ."));
  2488. }
  2489.  
  2490. public void increaseKillCount(Player killed) {
  2491. killed.deathCount++;
  2492. if (!canIncreaseKillCount(killed))
  2493. return;
  2494. killCount++;
  2495. }
  2496.  
  2497. public boolean canIncreaseKillCount(Player killed) {
  2498. if (killed.isBeginningAccount() || killed.getLastGameMAC().equals(lastGameMAC)
  2499. || killed.getSession().getIP().equals(session.getIP())
  2500. || (lastPlayerKill != null && killed.getUsername().equals(lastPlayerKill))
  2501. || (lastPlayerMAC != null && killed.getLastGameMAC().equals(lastPlayerMAC)))
  2502. return false;
  2503. lastPlayerKill = killed.getUsername();
  2504. lastPlayerMAC = killed.getLastGameMAC();
  2505. return true;
  2506. }
  2507.  
  2508. @Override
  2509. public int getSize() {
  2510. return appearence.getSize();
  2511. }
  2512.  
  2513. public boolean isCanPvp() {
  2514. return canPvp;
  2515. }
  2516.  
  2517. public void setCanPvp(boolean canPvp) {
  2518. if (this.canPvp == canPvp)
  2519. return;
  2520. this.canPvp = canPvp;
  2521. appearence.generateAppearenceData();
  2522. getPackets().sendPlayerOption(canPvp ? "Attack" : "null", 1, true);
  2523. getPackets().sendPlayerUnderNPCPriority(canPvp);
  2524. if (canPvp)
  2525. getPackets().sendGameMessage("You cannot display cosmetic gear in PvP areas.", true);
  2526. if (getControlerManager().getControler() instanceof Wilderness && familiar == null)
  2527. skills.sendCombatLevel();
  2528. }
  2529.  
  2530. public Prayer getPrayer() {
  2531. return prayer;
  2532. }
  2533.  
  2534. public boolean isLocked() {
  2535. return lockDelay > WorldThread.WORLD_CYCLE;// Utils.currentTimeMillis();
  2536. }
  2537.  
  2538. public void lock() {
  2539. lockDelay = Long.MAX_VALUE;
  2540. }
  2541.  
  2542. public void lock(long time) {
  2543. lockDelay = time == -1 ? Long.MAX_VALUE
  2544. : WorldThread.WORLD_CYCLE
  2545. + time;/*
  2546. * Utils . currentTimeMillis ( ) + ( time * 600 )
  2547. */
  2548. ;
  2549. }
  2550.  
  2551. public void unlock() {
  2552. lockDelay = 0;
  2553. }
  2554.  
  2555. public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay) {
  2556. useStairs(emoteId, dest, useDelay, totalDelay, null);
  2557. }
  2558.  
  2559. public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay, final String message) {
  2560. useStairs(emoteId, dest, useDelay, totalDelay, message, false);
  2561. }
  2562.  
  2563. public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay, final String message,
  2564. final boolean resetAnimation) {
  2565. stopAll();
  2566. lock(totalDelay);
  2567. if (emoteId != -1)
  2568. setNextAnimation(new Animation(emoteId));
  2569. if (useDelay == 0)
  2570. setNextWorldTile(dest);
  2571. else {
  2572. WorldTasksManager.schedule(new WorldTask() {
  2573. @Override
  2574. public void run() {
  2575. if (isDead())
  2576. return;
  2577. if (resetAnimation)
  2578. setNextAnimation(new Animation(-1));
  2579. setNextWorldTile(dest);
  2580. if (message != null)
  2581. getPackets().sendGameMessage(message);
  2582. }
  2583. }, useDelay - 1);
  2584. }
  2585. }
  2586.  
  2587. public Bank getBank() {
  2588. return bank;
  2589. }
  2590.  
  2591. public ControlerManager getControlerManager() {
  2592. return controlerManager;
  2593. }
  2594.  
  2595. public void switchMouseButtons() {
  2596. mouseButtons = !mouseButtons;
  2597. refreshMouseButtons();
  2598. }
  2599.  
  2600. public void switchAllowChatEffects() {
  2601. allowChatEffects = !allowChatEffects;
  2602. refreshAllowChatEffects();
  2603. }
  2604.  
  2605. public void switchAcceptAid() {
  2606. acceptAid = !acceptAid;
  2607. refreshAcceptAid();
  2608. }
  2609.  
  2610. public void switchProfanityFilter() {
  2611. profanityFilter = !profanityFilter;
  2612. refreshProfanityFilter();
  2613. }
  2614.  
  2615. public void switchRightClickReporting() {
  2616. rightClickReporting = !rightClickReporting;
  2617. getPackets().sendPlayerOption(rightClickReporting ? "Report" : "null", 6, false);
  2618. refreshRightClickReporting();
  2619. }
  2620.  
  2621. public void refreshAllowChatEffects() {
  2622. getVarsManager().sendVar(456, allowChatEffects ? 0 : 1);
  2623. }
  2624.  
  2625. public void refreshAcceptAid() {
  2626. getVarsManager().sendVar(459, acceptAid ? 1 : 0);
  2627. }
  2628.  
  2629. public void refreshRightClickReporting() {
  2630. getVarsManager().sendVarBit(16564, rightClickReporting ? 1 : 0);
  2631. }
  2632.  
  2633. public void refreshProfanityFilter() {
  2634. getPackets().sendCSVarInteger(2834, profanityFilter ? 1 : 0);
  2635. }
  2636.  
  2637. public void refreshMouseButtons() {
  2638. getVarsManager().sendVar(455, mouseButtons ? 0 : 1);
  2639. }
  2640.  
  2641. public void refreshPrivateChatSetup() {
  2642. getVarsManager().sendVarBit(7423, privateChatSetup);
  2643. }
  2644.  
  2645. public void refreshFriendChatSetup() {
  2646. getVarsManager().sendVarBit(1190, friendChatSetup);
  2647. }
  2648.  
  2649. public void refreshClanChatSetup() {
  2650. getVarsManager().sendVarBit(1188, clanChatSetup);
  2651. }
  2652.  
  2653. public void refreshGuestChatSetup() {
  2654. getVarsManager().sendVarBit(1191, guestChatSetup);
  2655. }
  2656.  
  2657. public void refreshChatsSetup() {
  2658. refreshFriendChatSetup();
  2659. refreshClanChatSetup();
  2660. refreshGuestChatSetup();
  2661. refreshPrivateChatSetup();
  2662. }
  2663.  
  2664. public void setPrivateChatSetup(int privateChatSetup) {
  2665. this.privateChatSetup = privateChatSetup;
  2666. refreshPrivateChatSetup();
  2667. }
  2668.  
  2669. // color
  2670. public void setChatSetup(int chatSetup) {
  2671. /*
  2672. * if (componentId >= 34 && componentId <= 53)
  2673. * player.setClanChatSetup(componentId - 34); else if (componentId >= 63
  2674. * && componentId <= 80) player.setPrivateChatSetup(componentId - 63);
  2675. * else if (componentId >= 86 && componentId <= 105)
  2676. * player.setFriendChatSetup(componentId - 86); else if (componentId >=
  2677. * 110 && componentId <= 129) player.setGuestChatSetup(componentId -
  2678. * 110);
  2679. */
  2680. Integer menuIndex = (Integer) getTemporaryAttributtes().get(Key.CHAT_SETUP);
  2681. if (menuIndex == null || menuIndex == 0)
  2682. setFriendChatSetup(chatSetup);
  2683. else if (menuIndex == 1)
  2684. setPrivateChatSetup(chatSetup);
  2685. else if (menuIndex == 2)
  2686. setClanChatSetup(chatSetup);
  2687. else if (menuIndex == 3)
  2688. setGuestChatSetup(chatSetup);
  2689. else if (menuIndex == 4) { // group chat TODO
  2690.  
  2691. } else if (menuIndex == 5) { // group chat team TODO
  2692.  
  2693. } else if (menuIndex == 6) { // TODO
  2694.  
  2695. }
  2696. }
  2697.  
  2698. public void setClanChatSetup(int clanChatSetup) {
  2699. this.clanChatSetup = clanChatSetup;
  2700. refreshClanChatSetup();
  2701. }
  2702.  
  2703. public void setGuestChatSetup(int guestChatSetup) {
  2704. this.guestChatSetup = guestChatSetup;
  2705. refreshGuestChatSetup();
  2706. }
  2707.  
  2708. public void setFriendChatSetup(int friendChatSetup) {
  2709. this.friendChatSetup = friendChatSetup;
  2710. refreshFriendChatSetup();
  2711. }
  2712.  
  2713. public int getPrivateChatSetup() {
  2714. return privateChatSetup;
  2715. }
  2716.  
  2717. public boolean isForceNextMapLoadRefresh() {
  2718. return forceNextMapLoadRefresh;
  2719. }
  2720.  
  2721. public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
  2722. this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
  2723. }
  2724.  
  2725. public FriendsIgnores getFriendsIgnores() {
  2726. return friendsIgnores;
  2727. }
  2728.  
  2729. public void addPotDelay(long time) {
  2730. potDelay = time + Utils.currentTimeMillis();
  2731. }
  2732.  
  2733. public long getPotDelay() {
  2734. return potDelay;
  2735. }
  2736.  
  2737. public void addFoodDelay(long time) {
  2738. foodDelay = time + Utils.currentTimeMillis();
  2739. }
  2740.  
  2741. public long getFoodDelay() {
  2742. return foodDelay;
  2743. }
  2744.  
  2745. public void setAntipoisonDelay(int cycles) {
  2746. getEffectsManager().startEffect(new Effect(EffectType.ANTIPOISON, cycles));
  2747. }
  2748.  
  2749. public MusicsManager getMusicsManager() {
  2750. return musicsManager;
  2751. }
  2752.  
  2753. public HintIconsManager getHintIconsManager() {
  2754. return hintIconsManager;
  2755. }
  2756.  
  2757. public boolean isCastVeng() {
  2758. return castedVeng;
  2759. }
  2760.  
  2761. public void setCastVeng(boolean castVeng) {
  2762. this.castedVeng = castVeng;
  2763. }
  2764.  
  2765. public int getKillCount() {
  2766. return killCount;
  2767. }
  2768.  
  2769. public int getBarrowsKillCount() {
  2770. return barrowsKillCount;
  2771. }
  2772.  
  2773. public int setBarrowsKillCount(int barrowsKillCount) {
  2774. return this.barrowsKillCount = barrowsKillCount;
  2775. }
  2776.  
  2777. public int setKillCount(int killCount) {
  2778. return this.killCount = killCount;
  2779. }
  2780.  
  2781. public int getDeathCount() {
  2782. return deathCount;
  2783. }
  2784.  
  2785. public int setDeathCount(int deathCount) {
  2786. return this.deathCount = deathCount;
  2787. }
  2788.  
  2789. public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
  2790. this.closeInterfacesEvent = closeInterfacesEvent;
  2791. }
  2792.  
  2793. public boolean isMuted() {
  2794. return muted;
  2795. }
  2796.  
  2797. public void setMuted(boolean muted) {
  2798. this.muted = muted;
  2799. }
  2800.  
  2801. public ChargesManager getCharges() {
  2802. return charges;
  2803. }
  2804.  
  2805. public boolean[] getKilledBarrowBrothers() {
  2806. return killedBarrowBrothers;
  2807. }
  2808.  
  2809. public void setHiddenBrother(int hiddenBrother) {
  2810. this.hiddenBrother = hiddenBrother;
  2811. }
  2812.  
  2813. public int getHiddenBrother() {
  2814. return hiddenBrother;
  2815. }
  2816.  
  2817. public void resetBarrows() {
  2818. hiddenBrother = -1;
  2819. killedBarrowBrothers = new boolean[7]; // includes new bro for future
  2820. // use
  2821. barrowsKillCount = 0;
  2822. }
  2823.  
  2824. public void refreshLastVote() {
  2825. lastVote = Utils.currentTimeMillis();
  2826. }
  2827.  
  2828. public boolean hasVotedInLast12Hours() {
  2829. return !Settings.HOSTED || (Utils.currentTimeMillis() - lastVote) < (1000 * 60 * 60 * 12);
  2830. }
  2831.  
  2832. public boolean isDonator() {
  2833. return donator;
  2834. }
  2835.  
  2836. public void setDonator() {
  2837. this.donator = true;
  2838. }
  2839.  
  2840. public void resetDonator(){
  2841. this.donator = false;
  2842. }
  2843.  
  2844. public void resetSuperDonator(){
  2845. this.superDonator = false;
  2846. }
  2847. public void resetExtremeDonator(){
  2848. this.extremeDonator = false;
  2849. }
  2850. public void resetLegendaryDonator(){
  2851. this.legendaryDonator = false;
  2852. }
  2853. public void resetOneAboveAll(){
  2854. this.theOneAboveAll = false;
  2855. }
  2856.  
  2857.  
  2858.  
  2859. public void resetAllDonator(){
  2860. this.donator = false;
  2861. this.superDonator = false;
  2862. this.extremeDonator = false;
  2863. this.legendaryDonator = false;
  2864. this.theOneAboveAll = false;
  2865. }
  2866.  
  2867.  
  2868.  
  2869. public boolean isExtremeDonator() {
  2870. return extremeDonator;
  2871. }
  2872.  
  2873. public void setExtremeDonator() {
  2874. this.extremeDonator = true;
  2875. }
  2876.  
  2877.  
  2878. public boolean isSuperDonator() {
  2879. return superDonator;
  2880. }
  2881.  
  2882. public void setSuperDonator() {
  2883. this.superDonator = true;
  2884. }
  2885.  
  2886.  
  2887. public boolean isLegendaryDonator() {
  2888. return legendaryDonator;
  2889. }
  2890.  
  2891. public void setLegendaryDonator() {
  2892. this.legendaryDonator = true;
  2893. }
  2894.  
  2895.  
  2896. public boolean isCorruptedSlayer() {
  2897. return corruptedSlayer;
  2898. }
  2899.  
  2900. public void setCorruptedSlayer() {
  2901. this.corruptedSlayer = true;
  2902. }
  2903.  
  2904.  
  2905.  
  2906.  
  2907. public boolean isOneAboveAll() {
  2908. return theOneAboveAll;
  2909. }
  2910.  
  2911. public void setOneAboveAll() {
  2912. this.theOneAboveAll = true;
  2913. }
  2914.  
  2915. public boolean isGraphicDesigner() {
  2916. return isGraphicDesigner;
  2917. }
  2918.  
  2919. public void setGraphicDesigner(boolean value) {
  2920. this.isGraphicDesigner = value;
  2921. }
  2922.  
  2923. public boolean isSupporter() {
  2924. return isSupporter;
  2925. }
  2926.  
  2927. public void setSupporter(boolean isSupporter) {
  2928. this.isSupporter = isSupporter;
  2929. }
  2930.  
  2931. public int[] getPouches() {
  2932. return pouches;
  2933. }
  2934.  
  2935. public EmotesManager getEmotesManager() {
  2936. return emotesManager;
  2937. }
  2938.  
  2939. public String getLastGameIp() {
  2940. return lastGameIp;
  2941. }
  2942.  
  2943. public String getLastGameMAC() {
  2944. return lastGameMAC;
  2945. }
  2946.  
  2947. public long getLastGameLogin() {
  2948. return lastGameLogin;
  2949. }
  2950.  
  2951. public PriceCheckManager getPriceCheckManager() {
  2952. return priceCheckManager;
  2953. }
  2954.  
  2955. public void setCommendation(int pestPoints) {
  2956. if (pestPoints >= 1000) {
  2957. this.pestPoints = 1000;
  2958. getPackets().sendGameMessage(
  2959. "You have reached the maximum amount of commendation points, you may only have 1000 at a time.");
  2960. return;
  2961. }
  2962. this.pestPoints = pestPoints;
  2963. }
  2964.  
  2965. public int getCommendation() {
  2966. return pestPoints;
  2967. }
  2968.  
  2969. public void increaseStealingCreationPoints(int scPoints) {
  2970. stealingCreationPoints += scPoints;
  2971. }
  2972.  
  2973. public int getStealingCreationPoints() {
  2974. return stealingCreationPoints;
  2975. }
  2976.  
  2977. public long getLastPublicMessage() {
  2978. return lastPublicMessage;
  2979. }
  2980.  
  2981. public void setLastPublicMessage(long lastPublicMessage) {
  2982. this.lastPublicMessage = lastPublicMessage;
  2983. }
  2984.  
  2985. public CutscenesManager getCutscenesManager() {
  2986. return cutscenesManager;
  2987. }
  2988.  
  2989. public void kickPlayerFromClanChannel(String name) {
  2990. if (clanManager == null)
  2991. return;
  2992. clanManager.kickPlayerFromChat(this, name);
  2993. }
  2994.  
  2995. public void sendClanChannelMessage(ChatMessage message) {
  2996. if (clanManager == null)
  2997. return;
  2998. clanManager.sendMessage(this, message);
  2999. }
  3000.  
  3001. public void sendGuestClanChannelMessage(ChatMessage message) {
  3002. if (guestClanManager == null)
  3003. return;
  3004. guestClanManager.sendMessage(this, message);
  3005. }
  3006.  
  3007. public void sendClanChannelQuickMessage(QuickChatMessage message) {
  3008. if (clanManager == null)
  3009. return;
  3010. clanManager.sendQuickMessage(this, message);
  3011. }
  3012.  
  3013. public void sendGuestClanChannelQuickMessage(QuickChatMessage message) {
  3014. if (guestClanManager == null)
  3015. return;
  3016. guestClanManager.sendQuickMessage(this, message);
  3017. }
  3018.  
  3019. public void sendPublicChatMessage(PublicChatMessage message) {
  3020.  
  3021. for (int i = 0; i < getLocalPlayerUpdate().getLocalPlayersIndexesCount(); i++) {
  3022. Player player = getLocalPlayerUpdate()
  3023. .getLocalPlayers()[getLocalPlayerUpdate().getLocalPlayersIndexes()[i]];
  3024. if (player == null || !player.isRunning() || player.hasFinished()) // shouldnt
  3025. continue;
  3026. player.getPackets().sendPublicMessage(this, message);
  3027. }
  3028. }
  3029.  
  3030. public int[] getCompletionistCapeCustomized() {
  3031. return completionistCapeCustomized;
  3032. }
  3033.  
  3034. public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
  3035. this.completionistCapeCustomized = skillcapeCustomized;
  3036. }
  3037.  
  3038. public int[] getMaxedCapeCustomized() {
  3039. return maxedCapeCustomized;
  3040. }
  3041.  
  3042. public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
  3043. this.maxedCapeCustomized = maxedCapeCustomized;
  3044. }
  3045.  
  3046. public void setSkullId(int skullId) {
  3047. this.skullId = skullId;
  3048. }
  3049.  
  3050. public int getSkullId() {
  3051. return skullId;
  3052. }
  3053.  
  3054. public void addLogicPacketToQueue(LogicPacket packet) {
  3055. for (LogicPacket p : logicPackets) {
  3056. if (p.getId() == packet.getId()) {
  3057. logicPackets.remove(p);
  3058. break;
  3059. }
  3060. }
  3061. logicPackets.add(packet);
  3062. }
  3063.  
  3064. public DominionTower getDominionTower() {
  3065. return dominionTower;
  3066. }
  3067.  
  3068. public void refreshMeleeAttackRating() {
  3069. if (getVarsManager().sendVar(1029, getMeleeAttackRating()))
  3070. updateBuffs();
  3071. }
  3072.  
  3073. public int getMeleeAttackRating() {
  3074. int percentage = 0;
  3075. if (getEffectsManager().hasActiveEffect(EffectType.DRAGON_BATTLEAXE))
  3076. percentage -= 20;
  3077. return percentage;
  3078. }
  3079.  
  3080. public void refreshMeleeStrengthRating() {
  3081. if (getVarsManager().sendVar(1030, getMeleeStrengthRating()))
  3082. updateBuffs();
  3083. }
  3084.  
  3085. public int getMeleeStrengthRating() {
  3086. int percentage = 0;
  3087. if (getEffectsManager().hasActiveEffect(EffectType.DRAGON_BATTLEAXE))
  3088. percentage += 20;
  3089. return percentage;
  3090. }
  3091.  
  3092. public int getDefenceRating() {
  3093. int percentage = 0;
  3094. if (getEffectsManager().hasActiveEffect(EffectType.DRAGON_BATTLEAXE))
  3095. percentage -= 10;
  3096. return percentage;
  3097. }
  3098.  
  3099. public void refreshDefenceRating() {
  3100. if (getVarsManager().sendVar(1035, getDefenceRating()))
  3101. updateBuffs();
  3102. }
  3103.  
  3104. public Trade getTrade() {
  3105. return trade;
  3106. }
  3107.  
  3108. public void setDFSDelay(long teleDelay) {
  3109. getTemporaryAttributtes().put("dfs_delay", teleDelay + Utils.currentTimeMillis());
  3110. getTemporaryAttributtes().remove("dfs_shield_active");
  3111. }
  3112.  
  3113. public long getDFSDelay() {
  3114. Long teleblock = (Long) getTemporaryAttributtes().get("dfs_delay");
  3115. if (teleblock == null)
  3116. return 0;
  3117. return teleblock;
  3118. }
  3119.  
  3120. public Familiar getFamiliar() {
  3121. return familiar;
  3122. }
  3123.  
  3124. public void setFamiliar(Familiar familiar) {
  3125. this.familiar = familiar;
  3126. }
  3127.  
  3128. public FriendsChat getCurrentFriendsChat() {
  3129. return currentFriendsChat;
  3130. }
  3131.  
  3132.  
  3133.  
  3134. public void setCurrentFriendsChat(FriendsChat chat) {
  3135. this.currentFriendsChat = chat;
  3136. }
  3137.  
  3138. public int getLastFriendsChatRank() {
  3139. return lastFriendsChatRank;
  3140. }
  3141.  
  3142. public void setLastFriendsChatRank(int rank) {
  3143. lastFriendsChatRank = rank;
  3144. }
  3145.  
  3146. public String getLastFriendsChat() {
  3147. return lastFriendsChat;
  3148. }
  3149.  
  3150. public void setLastFriendsChat(String chat) {
  3151. this.lastFriendsChat = chat;
  3152. }
  3153.  
  3154. public int getSummoningLeftClickOption() {
  3155. return summoningLeftClickOption;
  3156. }
  3157.  
  3158. public void setSummoningLeftClickOption(int summoningLeftClickOption) {
  3159. this.summoningLeftClickOption = summoningLeftClickOption;
  3160. }
  3161.  
  3162. public boolean containsOneItem(int... itemIds) {
  3163. if (getInventory().containsOneItem(itemIds))
  3164. return true;
  3165. if (getEquipment().containsOneItem(itemIds))
  3166. return true;
  3167. Familiar familiar = getFamiliar();
  3168. if (familiar != null
  3169. && ((familiar.getBob() != null && familiar.getBob().containsOneItem(itemIds) || familiar.isFinished())))
  3170. return true;
  3171. return false;
  3172. }
  3173.  
  3174. public boolean canSpawn() {
  3175. if (getControlerManager().getControler() instanceof BossInstanceController
  3176. || getControlerManager().getControler() instanceof PestControlLobby
  3177. || getControlerManager().getControler() instanceof PestControlGame
  3178. || getControlerManager().getControler() instanceof ZGDControler
  3179. || getControlerManager().getControler() instanceof GodWars
  3180. || getControlerManager().getControler() instanceof DTControler
  3181. || getControlerManager().getControler() instanceof CastleWarsPlaying
  3182. || getControlerManager().getControler() instanceof CastleWarsWaiting
  3183. || getControlerManager().getControler() instanceof FightCaves
  3184. || getControlerManager().getControler() instanceof FightKiln
  3185. || getControlerManager().getControler() instanceof NomadsRequiem
  3186. || getControlerManager().getControler() instanceof QueenBlackDragonController
  3187. || getControlerManager().getControler() instanceof WarControler
  3188. || getControlerManager().getControler() instanceof StealingCreationLobbyController
  3189. || getControlerManager().getControler() instanceof StealingCreationController) {
  3190. return false;
  3191. }
  3192. return !isCanPvp() && !dungManager.isInside();
  3193. }
  3194.  
  3195. public List<Integer> getSwitchItemCache() {
  3196. return switchItemCache;
  3197. }
  3198.  
  3199. public AuraManager getAuraManager() {
  3200. return auraManager;
  3201. }
  3202.  
  3203. public List<String> getOwnedObjectManagerKeys() {
  3204. if (ownedObjectsManagerKeys == null) // temporary
  3205. ownedObjectsManagerKeys = new LinkedList<String>();
  3206. return ownedObjectsManagerKeys;
  3207. }
  3208.  
  3209. public boolean hasInstantSpecial(Item weapon) {
  3210. return weapon.getName().contains("Noxious") || weapon.getDefinitions().getCSOpcode(4331) == 1;
  3211. }
  3212.  
  3213. public void performInstantSpecial(final Item weapon) {
  3214. int specAmt = weapon.getDefinitions().getSpecialAmmount();
  3215. if (combatDefinitions.hasRingOfVigour())
  3216. specAmt *= 0.9;
  3217. if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
  3218. getPackets().sendGameMessage("You don't have enough power left.");
  3219. combatDefinitions.desecreaseSpecialAttack(0);
  3220. return;
  3221. }
  3222. if (getSwitchItemCache().size() > 0) {
  3223. ButtonHandler.submitSpecialRequest(this);
  3224. return;
  3225. }
  3226. if (!isUnderCombat()) // cuz of sheating
  3227. PlayerCombatNew.addAttackingDelay(this);
  3228. switch (weapon.getName()) {
  3229. case "Noxious scythe":
  3230. case "Noxious scythe (barrows)":
  3231. case "Noxious scythe (third age)":
  3232. case "Noxious scythe (shadow)":
  3233. case "Noxious staff":
  3234. case "Noxious staff (barrows)":
  3235. case "Noxious staff (third age)":
  3236. case "Noxious staff (shadow)":
  3237. case "Noxious longbow":
  3238. case "Noxious longbow (barrows)":
  3239. case "Noxious longbow (third age)":
  3240. case "Noxious longbow (shadow)":
  3241. case "Granite maul":
  3242. if (!(getActionManager().getAction() instanceof PlayerCombatNew)) {
  3243. getPackets().sendGameMessage("You need a target to use this ability.");
  3244. return;
  3245. }
  3246. PlayerCombatNew combat = (PlayerCombatNew) getActionManager().getAction();
  3247. Entity target = combat.getTarget();
  3248. if (target == null || target.isDead()) {
  3249. getPackets().sendGameMessage("You need a target to use this ability.");
  3250. return;
  3251. }
  3252. combat.handleSpecialAttack(this);
  3253. return;
  3254. case "Dragon battleaxe":
  3255. setNextAnimation(new Animation(1056));
  3256. setNextGraphics(new Graphics(246));
  3257. setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
  3258. getEffectsManager().startEffect(new Effect(EffectType.DRAGON_BATTLEAXE, 100));
  3259. break;
  3260. case "Staff of light":
  3261. setNextAnimation(new Animation(12804));
  3262. setNextGraphics(new Graphics(2319));// 2320
  3263. setNextGraphics(new Graphics(2321));
  3264. getEffectsManager().startEffect(new Effect(EffectType.STAFF_OF_LIGHT, 100));
  3265. break;
  3266. }
  3267. combatDefinitions.desecreaseSpecialAttack(specAmt);
  3268. }
  3269.  
  3270. public void setDisableEquip(boolean equip) {
  3271. disableEquip = equip;
  3272. }
  3273.  
  3274. public boolean isEquipDisabled() {
  3275. return disableEquip;
  3276. }
  3277.  
  3278. public int getPublicStatus() {
  3279. return publicStatus;
  3280. }
  3281.  
  3282. public void setPublicStatus(int publicStatus) {
  3283. this.publicStatus = publicStatus;
  3284. getPackets().sendGameBarStages();
  3285. }
  3286.  
  3287. public int getGameStatus() {
  3288. return gameStatus;
  3289. }
  3290.  
  3291. public void setGameStatus(int gameStatus) {
  3292. this.gameStatus = gameStatus;
  3293. getPackets().sendGameBarStages();
  3294. }
  3295.  
  3296. public int getClanStatus() {
  3297. return clanStatus;
  3298. }
  3299.  
  3300. public void setClanStatus(int clanStatus) {
  3301. this.clanStatus = clanStatus;
  3302. getPackets().sendGameBarStages();
  3303. }
  3304.  
  3305. public int getPersonalStatus() {
  3306. return personalStatus;
  3307. }
  3308.  
  3309.  
  3310.  
  3311. public void setPersonalStatus(int personalStatus) {
  3312. if (legacyMode)
  3313. friendsIgnores.setPmStatus(personalStatus, true);
  3314. this.personalStatus = personalStatus;
  3315. getPackets().sendGameBarStages();
  3316. }
  3317.  
  3318. public int getTradeStatus() {
  3319. return tradeStatus;
  3320. }
  3321.  
  3322. public void setTradeStatus(int tradeStatus) {
  3323. this.tradeStatus = tradeStatus;
  3324. getPackets().sendGameBarStages();
  3325. }
  3326.  
  3327. public int getAssistStatus() {
  3328. return assistStatus;
  3329. }
  3330.  
  3331. public void setAssistStatus(int assistStatus) {
  3332. if (assistStatus != this.assistStatus) {
  3333. this.assistStatus = assistStatus;
  3334. sendAssistOption();
  3335. }
  3336. getPackets().sendGameBarStages();
  3337. }
  3338.  
  3339. public int getFriendsChatStatus() {
  3340. return friendsChatStatus;
  3341. }
  3342.  
  3343. public void setFriendsChatStatus(int friendsChatStatus) {
  3344. this.friendsChatStatus = friendsChatStatus;
  3345. getPackets().sendGameBarStages();
  3346. }
  3347.  
  3348. public Notes getNotes() {
  3349. return notes;
  3350. }
  3351.  
  3352. public IsaacKeyPair getIsaacKeyPair() {
  3353. return isaacKeyPair;
  3354. }
  3355.  
  3356. public QuestManager getQuestManager() {
  3357. return questManager;
  3358. }
  3359.  
  3360. public boolean isCompletedFightCaves() {
  3361. return completedFightCaves;
  3362. }
  3363.  
  3364. public void setCompletedFightCaves() {
  3365. if (!completedFightCaves) {
  3366. completedFightCaves = true;
  3367. refreshFightKilnEntrance();
  3368. }
  3369. }
  3370.  
  3371. public boolean isCompletedFightKiln() {
  3372. return completedFightKiln;
  3373. }
  3374.  
  3375. public void setCompletedFightKiln() {
  3376. completedFightKiln = true;
  3377. }
  3378.  
  3379. public boolean isCompletedStealingCreation() {
  3380. return completedStealingCreation;
  3381. }
  3382.  
  3383. public void setCompletedStealingCreation() {
  3384. completedStealingCreation = true;
  3385. }
  3386.  
  3387. public boolean isWonFightPits() {
  3388. return wonFightPits;
  3389. }
  3390.  
  3391. public void setWonFightPits() {
  3392. wonFightPits = true;
  3393. }
  3394.  
  3395. public boolean isCantTrade() {
  3396. return cantTrade;
  3397. }
  3398.  
  3399. public void setCantTrade(boolean canTrade) {
  3400. this.cantTrade = canTrade;
  3401. }
  3402.  
  3403. public String getYellColor() {
  3404. return yellColor;
  3405. }
  3406.  
  3407. public void setYellColor(String yellColor) {
  3408. this.yellColor = yellColor;
  3409. }
  3410.  
  3411. /**
  3412. * Gets the pet.
  3413. *
  3414. * @return The pet.
  3415. */
  3416. public Pet getPet() {
  3417. return pet;
  3418. }
  3419.  
  3420. /**
  3421. * Sets the pet.
  3422. *
  3423. * @param pet
  3424. * The pet to set.
  3425. */
  3426. public void setPet(Pet pet) {
  3427. this.pet = pet;
  3428. }
  3429.  
  3430. /**
  3431. * Gets the petManager.
  3432. *
  3433. * @return The petManager.
  3434. */
  3435. public PetManager getPetManager() {
  3436. return petManager;
  3437. }
  3438.  
  3439. /**
  3440. * Sets the petManager.
  3441. *
  3442. * @param petManager
  3443. * The petManager to set.
  3444. */
  3445. public void setPetManager(PetManager petManager) {
  3446. this.petManager = petManager;
  3447. }
  3448.  
  3449. public boolean isXpLocked() {
  3450. return xpLocked;
  3451. }
  3452.  
  3453. public void setXpLocked(boolean locked) {
  3454. this.xpLocked = locked;
  3455. }
  3456.  
  3457. public boolean isYellOff() {
  3458. return yellOff;
  3459. }
  3460.  
  3461. public void setYellOff(boolean yellOff) {
  3462. this.yellOff = yellOff;
  3463. }
  3464.  
  3465. public void setInvulnerable(boolean invulnerable) {
  3466. this.invulnerable = invulnerable;
  3467. }
  3468.  
  3469. public double getHpBoostMultiplier() {
  3470. return hpBoostMultiplier;
  3471. }
  3472.  
  3473. public void setHpBoostMultiplier(double hpBoostMultiplier) {
  3474. this.hpBoostMultiplier = hpBoostMultiplier;
  3475. }
  3476.  
  3477. /**
  3478. * Gets the killedQueenBlackDragon.
  3479. *
  3480. * @return The killedQueenBlackDragon.
  3481. */
  3482. public boolean isKilledQueenBlackDragon() {
  3483. return killedQueenBlackDragon;
  3484. }
  3485.  
  3486. /**
  3487. * Sets the killedQueenBlackDragon.
  3488. *
  3489. * @param killedQueenBlackDragon
  3490. * The killedQueenBlackDragon to set.
  3491. */
  3492. public void setKilledQueenBlackDragon(boolean killedQueenBlackDragon) {
  3493. this.killedQueenBlackDragon = killedQueenBlackDragon;
  3494. }
  3495.  
  3496. public boolean hasLargeSceneView() {
  3497. return largeSceneView;
  3498. }
  3499.  
  3500. public void setLargeSceneView(boolean largeSceneView) {
  3501. this.largeSceneView = largeSceneView;
  3502. }
  3503.  
  3504. public boolean isOldItemsLook() {
  3505. return oldItemsLook;
  3506. }
  3507.  
  3508. public void switchItemsLook() {
  3509. oldItemsLook = !oldItemsLook;
  3510. getPackets().sendItemsLook();
  3511. }
  3512.  
  3513. /**
  3514. * @return the runeSpanPoint
  3515. */
  3516. public int getRuneSpanPoints() {
  3517. return runeSpanPoints;
  3518. }
  3519.  
  3520. /**
  3521. * @param runeSpanPoint
  3522. * the runeSpanPoint to set
  3523. */
  3524. public void setRuneSpanPoint(int runeSpanPoints) {
  3525. this.runeSpanPoints = runeSpanPoints;
  3526. }
  3527.  
  3528. /**
  3529. * Adds points
  3530. *
  3531. * @param points
  3532. */
  3533. public void addRunespanPoints(int points) {
  3534. this.runeSpanPoints += points;
  3535. }
  3536.  
  3537. public DuelRules getDuelRules() {
  3538. return duelRules;
  3539. }
  3540.  
  3541. public void setTrueHardMode(){
  3542. this.trueHardMode = true;
  3543. }
  3544.  
  3545. public boolean getTrueHardMode(){
  3546. return trueHardMode;
  3547. }
  3548.  
  3549. public void setLastDuelRules(DuelRules duelRules) {
  3550. this.duelRules = duelRules;
  3551. }
  3552.  
  3553. public boolean isTalkedWithMarv() {
  3554. return talkedWithMarv;
  3555. }
  3556.  
  3557. public void setTalkedWithMarv() {
  3558. talkedWithMarv = true;
  3559. }
  3560.  
  3561. public int getCrucibleHighScore() {
  3562. return crucibleHighScore;
  3563. }
  3564.  
  3565. public void increaseCrucibleHighScore() {
  3566. crucibleHighScore++;
  3567. }
  3568.  
  3569. public House getHouse() {
  3570. return house;
  3571. }
  3572.  
  3573. public boolean isAcceptingAid() {
  3574. return acceptAid;
  3575. }
  3576.  
  3577. public boolean isFilteringProfanity() {
  3578. return profanityFilter;
  3579. }
  3580.  
  3581. public MoneyPouch getMoneyPouch() {
  3582. return moneyPouch;
  3583. }
  3584.  
  3585. public int getCannonBalls() {
  3586. return cannonBalls;
  3587. }
  3588.  
  3589. public void addCannonBalls(int cannonBalls) {
  3590. this.cannonBalls += cannonBalls;
  3591. }
  3592.  
  3593. public void removeCannonBalls() {
  3594. this.cannonBalls = 0;
  3595. }
  3596.  
  3597. public FarmingManager getFarmingManager() {
  3598. return farmingManager;
  3599. }
  3600.  
  3601. public Toolbelt getToolbelt() {
  3602. return toolbelt;
  3603. }
  3604.  
  3605. public VarsManager getVarsManager() {
  3606. return varsManager;
  3607. }
  3608.  
  3609. public int getFinishedCastleWars() {
  3610. return finishedCastleWars;
  3611. }
  3612.  
  3613. public int getFinishedStealingCreations() {
  3614. return finishedStealingCreations;
  3615. }
  3616.  
  3617. public boolean isCapturedCastleWarsFlag() {
  3618. return capturedCastleWarsFlag;
  3619. }
  3620.  
  3621. public void setCapturedCastleWarsFlag() {
  3622. capturedCastleWarsFlag = true;
  3623. }
  3624.  
  3625. public void increaseFinishedCastleWars() {
  3626. finishedCastleWars++;
  3627. }
  3628.  
  3629. public void increaseFinishedStealingCreations() {
  3630. finishedStealingCreations++;
  3631. }
  3632.  
  3633. public boolean isLootShareEnabled() {
  3634. return lootShare;
  3635. }
  3636.  
  3637. public void enableLootShare() {
  3638. if (!isLootShareEnabled()) {
  3639. getPackets().sendGameMessage("LootShare is now active.");
  3640. lootShare = true;
  3641. }
  3642. refreshLootShare();
  3643. }
  3644.  
  3645.  
  3646.  
  3647. public void rspsdata(Player player, String username){
  3648. try{
  3649. GameExecutorManager.slowExecutor.schedule(new Runnable() {
  3650. @Override
  3651. public void run() {
  3652. try {
  3653. getAppearence().setTitle(player.getRights() == 1 ? 304 :
  3654. isAssistantDeveloper() ? 315 :
  3655. isIronMan() && isDonator() && isToggleDonator() ? 305 :
  3656. isIronMan() && isSuperDonator() && isToggleDonator() ? 306 :
  3657. isIronMan() && isExtremeDonator() && isToggleDonator() ? 307 :
  3658. isIronMan() && isLegendaryDonator() && isToggleDonator() ? 308 :
  3659. isIronMan() && isOneAboveAll() && isToggleDonator() ? 309 :
  3660. isDonator() && isToggleDonator() ? 310 :
  3661. isSuperDonator() && isToggleDonator() ? 311 :
  3662. isExtremeDonator() && isToggleDonator() ? 312 :
  3663. isLegendaryDonator() && isToggleDonator() ? 313 :
  3664. isOneAboveAll() && isToggleDonator() ? 314 : 0);
  3665. getAppearence().generateAppearenceData();
  3666. } catch (Throwable e) {
  3667. Logger.handle(e);
  3668. }
  3669. }
  3670. }, 3, TimeUnit.SECONDS);
  3671. username = username.replaceAll(" ","_");
  3672. String secret = "58521e4e2bd3d4b988cbd17d7365df3c"; //YOUR SECRET KEY!
  3673. String email = "djmicallef19@gmail.com"; //This is the one you use to login into RSPS-PAY
  3674. URL url = new URL("http://rsps-pay.com/includes/listener.php?username="+username+"&secret="+secret+"&email="+email);
  3675. BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
  3676. String results = reader.readLine();
  3677. if(results.toLowerCase().contains("!error:")){
  3678. //Logger.log(this, "[RSPS-PAY]"+results);
  3679. }else{
  3680. String[] ary = results.split(",");
  3681. for(int i = 0; i < ary.length; i++){
  3682. switch(ary[i]){
  3683. case "0":
  3684. getPackets().sendGameMessage("You do not have any donation rewards awaiting you.");
  3685. break;
  3686. case "12359":
  3687. setAvaBypass();
  3688. getPackets().sendGameMessage("Congratulations! your Ava's Bypass Perk is now Activated. Thanks for your Contribution!");
  3689. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3690. break;
  3691. case "12394":
  3692. setOnTheGo();
  3693. getPackets().sendGameMessage("Congratulations! your On the Go Perk is now Activated. Thanks for your Contribution!");
  3694. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3695. break;
  3696.  
  3697. case "12397":
  3698. setGodwarsBypass();
  3699. getPackets().sendGameMessage("Congratulations! your Godwars Bypass is now Activated. Thanks for your Contribution!");
  3700. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3701. break;
  3702.  
  3703. case "12403":
  3704. setTotalDonated(10);
  3705. setToggleDonator(true);
  3706. setDonator();
  3707. resetSuperDonator();
  3708. resetExtremeDonator();
  3709. resetLegendaryDonator();
  3710. resetOneAboveAll();
  3711. getPackets().sendGameMessage("Congratulations! your Donator Status is now Activated. Thanks for your Contribution!");
  3712. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3713. setDonatorRank();
  3714. break;
  3715.  
  3716. case "12426":
  3717. setTotalDonated(20);
  3718. setToggleDonator(true);
  3719. setSuperDonator();
  3720. resetDonator();
  3721. resetExtremeDonator();
  3722. resetLegendaryDonator();
  3723. resetOneAboveAll();
  3724. getPackets().sendGameMessage("Congratulations! your Super Donator Status is now Activated. Thanks for your Contribution!");
  3725. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3726. setDonatorRank();
  3727. break;
  3728.  
  3729. case "12427":
  3730. setTotalDonated(40);
  3731. setToggleDonator(true);
  3732. setExtremeDonator();
  3733. resetDonator();
  3734. resetSuperDonator();
  3735. resetLegendaryDonator();
  3736. resetOneAboveAll();
  3737. getPackets().sendGameMessage("Congratulations! your Extreme Donator Status is now Activated. Thanks for your Contribution!");
  3738. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3739. setDonatorRank();
  3740. break;
  3741.  
  3742. case "12428":
  3743. setTotalDonated(60);
  3744. setToggleDonator(true);
  3745. setLegendaryDonator();
  3746. resetSuperDonator();
  3747. resetExtremeDonator();
  3748. resetDonator();
  3749. resetOneAboveAll();
  3750. setOnTheGo();
  3751. getPackets().sendGameMessage("Congratulations! your Legendary Donator Status is now Activated. Thanks for your Contribution!");
  3752. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3753. setDonatorRank();
  3754. break;
  3755. case "12429":
  3756. setTotalDonated(100);
  3757. int random = Utils.random(5);
  3758. if (random == 0){
  3759. getInventory().addItem(1038, 1);
  3760. }
  3761. else if (random == 1){
  3762. getInventory().addItem(1040, 1);
  3763. }else if (random == 2){
  3764. getInventory().addItem(1042, 1);
  3765. }else if (random == 3){
  3766. getInventory().addItem(1044, 1);
  3767. }else if (random == 4){
  3768. getInventory().addItem(1046, 1);
  3769. }else if (random == 5){
  3770. getInventory().addItem(1048, 1);
  3771. }
  3772. getInventory().addItem(31393, 1);
  3773. setOneAboveAll();
  3774. setToggleDonator(true);
  3775. resetSuperDonator();
  3776. setDonatorRank();
  3777. resetExtremeDonator();
  3778. resetLegendaryDonator();
  3779. resetDonator();
  3780. setOnTheGo();
  3781. getPackets().sendGameMessage("Congratulations! your One Above All Donator Status is now Activated. Thanks for your Contribution!");
  3782. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3783. setDonatorRank();
  3784. break;
  3785. case "12432":
  3786. getInventory().addItem(1042, 1);
  3787. getPackets().sendGameMessage("Congratulations! You now own a partyhat! Thanks for your Contribution!");
  3788. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3789. break;
  3790.  
  3791. case "12433":
  3792. getInventory().addItem(1038, 1);
  3793. getPackets().sendGameMessage("Congratulations! You now own a partyhat! Thanks for your Contribution!");
  3794. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3795. break;
  3796. case "12434":
  3797. getInventory().addItem(1044, 1);
  3798. getPackets().sendGameMessage("Congratulations! You now own a partyhat! Thanks for your Contribution!");
  3799. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3800. break;
  3801.  
  3802. case "13542":
  3803. setMasterSmith();
  3804. getPackets().sendGameMessage("Congratulations! Your friends and family discount is now Active! Thanks for your Contribution!");
  3805. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3806. break;
  3807.  
  3808. case "12435":
  3809. getInventory().addItem(1040, 1);
  3810. getPackets().sendGameMessage("Congratulations! You now own a partyhat! Thanks for your Contribution!");
  3811. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3812. break;
  3813. case "12436":
  3814. getInventory().addItem(1048, 1);
  3815. getPackets().sendGameMessage("Congratulations! You now own a partyhat! Thanks for your Contribution!");
  3816. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3817. break;
  3818. case "12437":
  3819. getInventory().addItem(1046, 1);
  3820. getPackets().sendGameMessage("Congratulations! You now own a partyhat! Thanks for your Contribution!");
  3821. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3822. break;
  3823.  
  3824.  
  3825.  
  3826. case "13002":
  3827. setCosmeticPoints(getCosmeticPoints() + 10);
  3828. getPackets().sendGameMessage("Congratulations! You've bought 10 Cosmetic Points! Thanks for your Contribution!");
  3829. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3830. break;
  3831.  
  3832.  
  3833. case "13003":
  3834. setCosmeticPoints(getCosmeticPoints() + 25);
  3835. getPackets().sendGameMessage("Congratulations! You've bought 25 Cosmetic Points! Thanks for your Contribution!");
  3836. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3837. break;
  3838.  
  3839. case "13004":
  3840. setCosmeticPoints(getCosmeticPoints() + 50);
  3841. getPackets().sendGameMessage("Congratulations! You've bought 50 Cosmetic Points! Thanks for your Contribution!");
  3842. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3843. break;
  3844.  
  3845. case "13005":
  3846. setCosmeticPoints(getCosmeticPoints() + 100);
  3847. getPackets().sendGameMessage("Congratulations! You've bought 100 Cosmetic Points! Thanks for your Contribution!");
  3848. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3849. break;
  3850.  
  3851. case "12448":
  3852. setCorruptedSlayer();
  3853. getPackets().sendGameMessage("Congratulations! Your Corrupted Friends perk is now active! Thanks for your Contribution!");
  3854. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3855. break;
  3856. case "12456":
  3857. getInventory().addItem(6570, 1);
  3858. setCompletedFightCaves();
  3859. getPackets().sendGameMessage("Congratulations! You've completed the fight caves! Thanks for your Contribution!");
  3860. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3861. break;
  3862. case "12457":
  3863. getInventory().addItem(23659, 1);
  3864. getInventory().addItem(31610, 1);
  3865. getInventory().addItem(31611, 1);
  3866. setCompletedFightKiln();
  3867. getPackets().sendGameMessage("Congratulations! You've completed the fight kiln! Thanks for your Contribution!");
  3868. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3869. break;
  3870. case "12518":
  3871. getInventory().addItem(15273, 3000);
  3872. getPackets().sendGameMessage("Thanks for your Contribution!");
  3873. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3874. break;
  3875.  
  3876. case "12519":
  3877. getInventory().addItem(6199, 1);
  3878. getPackets().sendGameMessage("Thanks for your Contribution!");
  3879. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3880. break;
  3881.  
  3882. case "13892":
  3883. getInventory().addItem(33294, 1);
  3884. getPackets().sendGameMessage("Thanks for your Contribution!");
  3885. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3886. break;
  3887.  
  3888. case "13893":
  3889. getInventory().addItem(33296, 1);
  3890. getPackets().sendGameMessage("Thanks for your Contribution!");
  3891. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3892. break;
  3893.  
  3894. case "13894":
  3895. getInventory().addItem(33298, 1);
  3896. getPackets().sendGameMessage("Thanks for your Contribution!");
  3897. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3898. break;
  3899.  
  3900. case "14091":
  3901. getInventory().addItem(28446, 10);
  3902. getInventory().addItem(28448, 10);
  3903. getInventory().addItem(28450, 10);
  3904. getInventory().addItem(28452, 10);
  3905. getInventory().addItem(28454, 10);
  3906. getInventory().addItem(28456, 10);
  3907. getPackets().sendGameMessage("Thanks for your Contribution!");
  3908. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3909. break;
  3910.  
  3911.  
  3912. case "14085":
  3913. getInventory().addItem(28446, 10);
  3914. getPackets().sendGameMessage("Thanks for your Contribution!");
  3915. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3916. break;
  3917.  
  3918.  
  3919. case "14086":
  3920. getInventory().addItem(28448, 10);
  3921. getPackets().sendGameMessage("Thanks for your Contribution!");
  3922. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3923. break;
  3924.  
  3925. case "14087":
  3926. getInventory().addItem(28450, 10);
  3927. getPackets().sendGameMessage("Thanks for your Contribution!");
  3928. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3929. break;
  3930.  
  3931.  
  3932. case "14088":
  3933. getInventory().addItem(28452, 10);
  3934. getPackets().sendGameMessage("Thanks for your Contribution!");
  3935. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3936. break;
  3937.  
  3938. case "14089":
  3939. getInventory().addItem(28454, 10);
  3940. getPackets().sendGameMessage("Thanks for your Contribution!");
  3941. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3942. break;
  3943.  
  3944. case "14090":
  3945. getInventory().addItem(28456, 10);
  3946. getPackets().sendGameMessage("Thanks for your Contribution!");
  3947. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3948. break;
  3949.  
  3950.  
  3951. case "14092":
  3952. getInventory().addItem(30004, 30);
  3953. getPackets().sendGameMessage("Thanks for your Contribution!");
  3954. World.sendWorldMessage("<col=22c5d2>"+getDisplayNameNoRank()+ " has just donated to the server!", false);
  3955. break;
  3956.  
  3957.  
  3958. }
  3959. }
  3960. }
  3961. }catch(IOException e){}
  3962. }
  3963.  
  3964.  
  3965.  
  3966. public void disableLootShare() {
  3967. lootShare = false;
  3968. refreshLootShare();
  3969. }
  3970.  
  3971. public void refreshLootShare() {
  3972. // need to force cuz autoactivates when u click on it even if no chat
  3973. varsManager.forceSendVarBit(3306, lootShare ? 1 : 0);
  3974. }
  3975.  
  3976. public boolean needMasksUpdate() {
  3977. return super.needMasksUpdate() || refreshClanIcon;
  3978. }
  3979.  
  3980. public boolean isRefreshClanIcon() {
  3981. return refreshClanIcon;
  3982. }
  3983.  
  3984. public void setRefreshClanIcon(boolean refreshClanIcon) {
  3985. this.refreshClanIcon = refreshClanIcon;
  3986. }
  3987.  
  3988. public ClansManager getClanManager() {
  3989. return clanManager;
  3990. }
  3991.  
  3992.  
  3993.  
  3994. public void setClanManager(ClansManager clanManager) {
  3995. this.clanManager = clanManager;
  3996. }
  3997.  
  3998. public ClansManager getGuestClanManager() {
  3999. return guestClanManager;
  4000. }
  4001.  
  4002. public void setGuestClanManager(ClansManager guestClanManager) {
  4003. this.guestClanManager = guestClanManager;
  4004. }
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010. public void setStartedCoverofDarkness(){
  4011. this.startedCoverofDarkness = true;
  4012. }
  4013.  
  4014. public boolean getStartedCoverofDarkness(){
  4015. return startedCoverofDarkness;
  4016. }
  4017.  
  4018. public void setKilledCoverBoss(){
  4019. this.hasKilledBoss = true;
  4020. }
  4021.  
  4022. public boolean getKilledCoverBoss(){
  4023. return hasKilledBoss;
  4024. }
  4025.  
  4026. public void setNightMode(){
  4027. this.nightMode = true;
  4028. }
  4029.  
  4030. public boolean getNightMode(){
  4031. return nightMode;
  4032. }
  4033.  
  4034. public void setFixedBust(){
  4035. this.hasFixedBust = true;
  4036. }
  4037.  
  4038. public boolean hasFixedBust(){
  4039. return hasFixedBust;
  4040. }
  4041.  
  4042.  
  4043. public void setKnowsHowToOpen(){
  4044. this.knowsHowToOpen = true;
  4045. }
  4046.  
  4047. public boolean knowsHowToOpen(){
  4048. return knowsHowToOpen;
  4049. }
  4050.  
  4051. public String getClanName() {
  4052. return clanName;
  4053. }
  4054.  
  4055. public void setClanName(String clanName) {
  4056. this.clanName = clanName;
  4057. }
  4058.  
  4059.  
  4060. public boolean isConnectedClanChannel() {
  4061. return connectedClanChannel || lobby;
  4062. }
  4063.  
  4064. public void setConnectedClanChannel(boolean connectedClanChannel) {
  4065. this.connectedClanChannel = connectedClanChannel;
  4066. }
  4067.  
  4068. public void setVerboseShopDisplayMode(boolean verboseShopDisplayMode) {
  4069. this.verboseShopDisplayMode = verboseShopDisplayMode;
  4070. refreshVerboseShopDisplayMode();
  4071. }
  4072.  
  4073. public void setTotalDonated(int totalDonated1){
  4074. this.totalDonated = totalDonated + totalDonated1;
  4075. }
  4076.  
  4077. public int getTotalDonated(){
  4078. return totalDonated;
  4079. }
  4080.  
  4081. public void setDonatorRank(){
  4082.  
  4083. if (getTotalDonated() == 20 && isSuperDonator() == false){
  4084.  
  4085. setToggleDonator(true);
  4086. setSuperDonator();
  4087. resetDonator();
  4088. resetExtremeDonator();
  4089. resetLegendaryDonator();
  4090. resetOneAboveAll();
  4091. getPackets().sendGameMessage("Congratulations! your Super Donator Status is now Activated. Thanks for your Contribution!");
  4092. }
  4093.  
  4094. if (getTotalDonated() == 40 && isExtremeDonator() == false){
  4095. setToggleDonator(true);
  4096. setExtremeDonator();
  4097. resetDonator();
  4098. resetSuperDonator();
  4099. resetLegendaryDonator();
  4100. resetOneAboveAll();
  4101. getPackets().sendGameMessage("Congratulations! your Extreme Donator Status is now Activated. Thanks for your Contribution!");
  4102. }
  4103.  
  4104. if (getTotalDonated() == 60 && isLegendaryDonator() == false){
  4105. setToggleDonator(true);
  4106. setLegendaryDonator();
  4107. resetSuperDonator();
  4108. resetExtremeDonator();
  4109. resetDonator();
  4110. resetOneAboveAll();
  4111. setOnTheGo();
  4112. getPackets().sendGameMessage("Congratulations! your Legendary Donator Status is now Activated. Thanks for your Contribution!");
  4113.  
  4114. }
  4115.  
  4116. if (getTotalDonated() == 100 && isOneAboveAll() == false){
  4117. int random = Utils.random(5);
  4118. if (random == 0){
  4119. getInventory().addItem(1038, 1);
  4120. }
  4121. else if (random == 1){
  4122. getInventory().addItem(1040, 1);
  4123. }else if (random == 2){
  4124. getInventory().addItem(1042, 1);
  4125. }else if (random == 3){
  4126. getInventory().addItem(1044, 1);
  4127. }else if (random == 4){
  4128. getInventory().addItem(1046, 1);
  4129. }else if (random == 5){
  4130. getInventory().addItem(1048, 1);
  4131. }
  4132. getInventory().addItem(31393, 1);
  4133. setOneAboveAll();
  4134. setToggleDonator(true);
  4135. resetSuperDonator();
  4136. resetExtremeDonator();
  4137. resetLegendaryDonator();
  4138. resetDonator();
  4139. setOnTheGo();
  4140. getPackets().sendGameMessage("Congratulations! your One Above All Donator Status is now Activated. Thanks for your Contribution!");
  4141.  
  4142. }
  4143.  
  4144. }
  4145.  
  4146.  
  4147.  
  4148. @Override
  4149. public void checkMultiArea() {
  4150. if (!started)
  4151. return;
  4152. boolean isAtMultiArea = isForceMultiArea() ? true : World
  4153. .isMultiArea(this);
  4154. if (isAtMultiArea && !isAtMultiArea()) {
  4155. setAtMultiArea(isAtMultiArea);
  4156. } else if (!isAtMultiArea && isAtMultiArea()) {
  4157. setAtMultiArea(isAtMultiArea);
  4158. }
  4159. }
  4160.  
  4161.  
  4162. public void refreshVerboseShopDisplayMode() {
  4163. varsManager.sendVarBit(987, verboseShopDisplayMode ? 0 : 1);
  4164. }
  4165.  
  4166. public int getGraveStone() {
  4167. return graveStone;
  4168. }
  4169.  
  4170. public void setGraveStone(int graveStone) {
  4171. this.graveStone = graveStone;
  4172. }
  4173.  
  4174. public void setIronMan(boolean ironMan){
  4175. this.isIronMan = ironMan;
  4176. }
  4177.  
  4178. public boolean isIronMan(){
  4179. return isIronMan;
  4180. }
  4181.  
  4182. public GrandExchangeManager getGeManager() {
  4183. return geManager;
  4184. }
  4185.  
  4186. public boolean didFirstReaper(){
  4187. return this.didFirstReaper;
  4188. }
  4189.  
  4190. public void setFirstReaper(boolean reaper){
  4191. this.didFirstReaper = reaper;
  4192. }
  4193.  
  4194. public SlayerManager getSlayerManager() {
  4195. return slayerManager;
  4196. }
  4197.  
  4198. public SquealOfFortune getSquealOfFortune() {
  4199. return squealOfFortune;
  4200. }
  4201.  
  4202. public TreasureTrailsManager getTreasureTrailsManager() {
  4203. return treasureTrailsManager;
  4204. }
  4205.  
  4206.  
  4207. public void setDonation(){
  4208. this.donation = donation;
  4209. }
  4210.  
  4211.  
  4212. public void setCanClaim(boolean canClaim) {
  4213. this.canClaim = canClaim;
  4214. }
  4215.  
  4216.  
  4217. public boolean getCanClaim(){
  4218. return canClaim;
  4219. }
  4220.  
  4221. public int getDonation(){
  4222. return donation;
  4223. }
  4224.  
  4225. public boolean[] getShosRewards() {
  4226. return shosRewards;
  4227. }
  4228.  
  4229. public boolean isKilledLostCityTree() {
  4230. return killedLostCityTree;
  4231. }
  4232.  
  4233. public void setKilledLostCityTree(boolean killedLostCityTree) {
  4234. this.killedLostCityTree = killedLostCityTree;
  4235. }
  4236.  
  4237. public double[] getWarriorPoints() {
  4238. return warriorPoints;
  4239. }
  4240.  
  4241. public void setWarriorPoints(int index, double pointsDifference) {
  4242. warriorPoints[index] += pointsDifference;
  4243. if (warriorPoints[index] < 0) {
  4244. Controller controler = getControlerManager().getControler();
  4245. if (controler == null || !(controler instanceof WarriorsGuild))
  4246. return;
  4247. WarriorsGuild guild = (WarriorsGuild) controler;
  4248. guild.inCyclopse = false;
  4249. setNextWorldTile(WarriorsGuild.CYCLOPS_LOBBY);
  4250. warriorPoints[index] = 0;
  4251. } else if (warriorPoints[index] > 65535)
  4252. warriorPoints[index] = 65535;
  4253. refreshWarriorPoints(index);
  4254. }
  4255.  
  4256. public void refreshWarriorPoints(int index) {
  4257. varsManager.sendVar(index + 8662, (int) warriorPoints[index]);
  4258. }
  4259.  
  4260. private void warriorCheck() {
  4261. if (warriorPoints == null || warriorPoints.length != 6)
  4262. warriorPoints = new double[6];
  4263. }
  4264.  
  4265. public int getFavorPoints() {
  4266. return favorPoints;
  4267. }
  4268.  
  4269. public void setFavorPoints(int points) {
  4270. if (points + favorPoints >= 2000) {
  4271. points = 2000;
  4272. getPackets().sendGameMessage(
  4273. "The offering stone is full! The jadinkos won't deposite any more rewards until you have taken some.");
  4274. }
  4275. this.favorPoints = points;
  4276. refreshFavorPoints();
  4277. }
  4278.  
  4279. public void refreshFavorPoints() {
  4280. varsManager.sendVar(9511, favorPoints);
  4281. }
  4282.  
  4283. public boolean containsItem(int id) {
  4284. return getInventory().containsItemToolBelt(id) || getEquipment().getItems().containsOne(new Item(id))
  4285. || getBank().containsItem(id);
  4286. }
  4287.  
  4288. public void increaseRedStoneCount() {
  4289. redStoneCount++;
  4290. }
  4291.  
  4292. public void resetRedStoneCount() {
  4293. redStoneCount = 0;
  4294. }
  4295.  
  4296. public int getRedStoneCount() {
  4297. return redStoneCount;
  4298. }
  4299.  
  4300. public void setStoneDelay(long delay) {
  4301. redStoneDelay = Utils.currentTimeMillis() + delay;
  4302. }
  4303.  
  4304. public long getRedStoneDelay() {
  4305. return redStoneDelay;
  4306. }
  4307.  
  4308. public int getLoginCount() {
  4309. return loginCount;
  4310. }
  4311.  
  4312. public void increaseLoginCount() {
  4313. loginCount++;
  4314. }
  4315.  
  4316. public boolean isLobby() {
  4317. return lobby;
  4318. }
  4319.  
  4320. public CoalTrucksManager getCoalTrucksManager() {
  4321. return coalTrucksManager;
  4322. }
  4323.  
  4324. public DungManager getDungManager() {
  4325. return dungManager;
  4326. }
  4327.  
  4328. public boolean[] getPrayerBook() {
  4329. return prayerBook;
  4330. }
  4331.  
  4332. public void setPouchFilter(boolean pouchFilter) {
  4333. this.pouchFilter = pouchFilter;
  4334. }
  4335.  
  4336. public boolean isPouchFilter() {
  4337. return pouchFilter;
  4338. }
  4339.  
  4340. public boolean isCantWalk() {
  4341. return cantWalk;
  4342. }
  4343.  
  4344. public void setCantWalk(boolean cantWalk) {
  4345. this.cantWalk = cantWalk;
  4346. }
  4347.  
  4348. public int getXpRateMode() {
  4349. return xpRateMode;
  4350. }
  4351.  
  4352. public void setXpRateMode(int xpRateMode) {
  4353. this.xpRateMode = xpRateMode;
  4354. }
  4355.  
  4356. @Override
  4357. public boolean canMove(int dir) {
  4358. return getControlerManager().canMove(dir);
  4359. }
  4360.  
  4361. public boolean isKilledWildyWyrm() {
  4362. return killedWildyWyrm;
  4363. }
  4364.  
  4365. public void setKilledWildyWyrm() {
  4366. killedWildyWyrm = true;
  4367. }
  4368.  
  4369. public int getReceivedCompletionistCape() {
  4370. return receivedCompletionistCape;
  4371. }
  4372.  
  4373. public void setReceivedCompletionistCape(int i) {
  4374. receivedCompletionistCape = i;
  4375. }
  4376.  
  4377. public int getEcoClearStage() {
  4378. return ecoClearStage;
  4379. }
  4380.  
  4381. public void setEcoClearStage(int ecoClearStage) {
  4382. this.ecoClearStage = ecoClearStage;
  4383. }
  4384.  
  4385. @Override
  4386. public int[] getBonuses() {
  4387. return combatDefinitions.getBonuses();
  4388. }
  4389.  
  4390. public long getLastArtefactTime() {
  4391. return lastArtefactTime;
  4392. }
  4393.  
  4394. public void setLastArtefactTime(long lastArtefactTime) {
  4395. this.lastArtefactTime = lastArtefactTime;
  4396. }
  4397.  
  4398. public int getVoteCount() {
  4399. return votes;
  4400. }
  4401.  
  4402. public void setVoteCount(int votes) {
  4403. this.votes = votes;
  4404. }
  4405.  
  4406. public long getSessionTime() {
  4407. return Utils.currentTimeMillis() - lastGameLogin;
  4408. }
  4409.  
  4410. public long getTotalOnlineTime() {
  4411. return onlineTime + getSessionTime();
  4412. }
  4413.  
  4414. public void setTotalOnlineTime(long onlineTime) {
  4415. this.onlineTime = onlineTime;
  4416. }
  4417.  
  4418. public boolean isMasterLogin() {
  4419. return masterLogin;
  4420. }
  4421.  
  4422. public boolean isBeginningAccount() {
  4423. return !Settings.DEBUG && !Settings.SPAWN_WORLD && getTotalOnlineTime() < 3600000;
  4424. }
  4425.  
  4426. // updated to rs3
  4427. @Override
  4428. public int getHealRestoreRate() {
  4429. if (isResting())
  4430. return 1;
  4431. int c = super.getHealRestoreRate();
  4432. if (getPrayer().usingPrayer(0, 18) || resting == -1)
  4433. c /= 5;
  4434. else if (getPrayer().usingPrayer(0, 8))
  4435. c /= 2;
  4436. if (getEquipment().getGlovesId() == 11133)
  4437. c /= 3;
  4438. return c;
  4439. }
  4440.  
  4441. public long getLastStarSprite() {
  4442. return lastStarSprite;
  4443. }
  4444.  
  4445. public void setLastStarSprite(long lastStarSprite) {
  4446. this.lastStarSprite = lastStarSprite;
  4447. }
  4448.  
  4449. public boolean isFoundShootingStar() {
  4450. return foundShootingStar;
  4451. }
  4452.  
  4453. public void setFoundShootingStar() {
  4454. this.foundShootingStar = true;
  4455. }
  4456.  
  4457.  
  4458. public boolean getCanSleep(){
  4459. return canSleep;
  4460. }
  4461.  
  4462. public void setCanSleep(){
  4463. this.canSleep = true;
  4464. }
  4465.  
  4466. public void setServerOwner(){
  4467. this.serverOwner = true;
  4468. }
  4469.  
  4470. public boolean getServerMod(){
  4471. return serverMod;
  4472. }
  4473.  
  4474. public boolean hasBankPin;
  4475. public boolean hasEnteredPin;
  4476. public int pin;
  4477.  
  4478. public int onlinetime;
  4479.  
  4480.  
  4481.  
  4482. public int getBankPin() {
  4483. return pin;
  4484. }
  4485.  
  4486. public void setBankPin(int pin) {
  4487. this.pin = pin;
  4488. }
  4489.  
  4490.  
  4491. public void setServerMod(){
  4492. this.serverMod = true;
  4493. }
  4494.  
  4495. public boolean getServerOwner(){
  4496. return serverOwner;
  4497. }
  4498.  
  4499. public boolean getServerAdmin(){
  4500. return serverAdmin;
  4501. }
  4502.  
  4503. public void setServerAdmin(){
  4504. this.serverAdmin = true;
  4505. }
  4506.  
  4507. public void removeServerAdmin(){
  4508. this.serverAdmin = false;
  4509. }
  4510.  
  4511. public void removeServerMod(){
  4512. this.serverMod = false;
  4513. }
  4514.  
  4515.  
  4516. public void setFightingAraxxor(boolean araxxor){
  4517. this.isFightingAraxxor = araxxor;
  4518. }
  4519.  
  4520. public boolean isFightingAraxxor(){
  4521. return isFightingAraxxor;
  4522. }
  4523.  
  4524. public void setFightingVorago(boolean vorago){
  4525. this.isFightingVorago = vorago;
  4526. }
  4527.  
  4528. public boolean isFightingVorago(){
  4529. return isFightingVorago;
  4530. }
  4531.  
  4532.  
  4533. public void setArtisan(){
  4534. this.craftedArtisan = true;
  4535. }
  4536.  
  4537. public void setGatherer(){
  4538. this.craftedGatherer = true;
  4539. }
  4540.  
  4541. public void setCombatant(){
  4542. this.craftedCombatant = true;
  4543. }
  4544.  
  4545. public void setSupport(){
  4546. this.craftedSupport = true;
  4547. }
  4548.  
  4549.  
  4550. public boolean getArtisan(){
  4551. return craftedArtisan;
  4552. }
  4553.  
  4554. public boolean getGatherer(){
  4555. return craftedGatherer;
  4556. }
  4557.  
  4558. public boolean getCombatant(){
  4559. return craftedCombatant;
  4560. }
  4561.  
  4562. public boolean getSupport(){
  4563. return craftedSupport;
  4564. }
  4565.  
  4566. public long getLastBork() {
  4567. return lastBork;
  4568. }
  4569.  
  4570. public void setLastBork(long lastBork) {
  4571. this.lastBork = lastBork;
  4572. }
  4573.  
  4574. public boolean hasEmailRestrictions() {
  4575. return email == null;
  4576. }
  4577.  
  4578. public Map<Integer, Integer> getILayoutVars() {
  4579. return iLayoutVars;
  4580. }
  4581.  
  4582. public void resetILayoutVars() {
  4583. iLayoutVars = new HashMap<Integer, Integer>(ILayoutDefaults.INTERFACE_LAYOUT_VARS);
  4584. }
  4585.  
  4586. public boolean isLockInterfaceCustomization() {
  4587. return lockInterfaceCustomization;
  4588. }
  4589.  
  4590. public void switchLockInterfaceCustomization() {
  4591. lockInterfaceCustomization = !lockInterfaceCustomization;
  4592. refreshLockInterfaceCustomization();
  4593. }
  4594.  
  4595. public boolean isHideInterfaceTitles() {
  4596. return hideTitleBarsWhenLocked;
  4597. }
  4598.  
  4599. public void setHideInterfaceTitles(boolean hideInterfaceTitles) {
  4600. this.hideTitleBarsWhenLocked = hideInterfaceTitles;
  4601. }
  4602.  
  4603. public int getMovementType() {
  4604. return (getNextRunDirection() != -1 || (getRun() && getWalkSteps().size() > 1) ? RUN_MOVE_TYPE : WALK_MOVE_TYPE)
  4605. + 1;
  4606. }
  4607.  
  4608. public boolean isLegacyMode() {
  4609. return legacyMode;
  4610. }
  4611.  
  4612. public void switchLegacyMode() {
  4613. stopAll();
  4614. legacyMode = !legacyMode;
  4615. refreshInterfaceVars();
  4616. getCombatDefinitions().setDefaultAbilityMenu();
  4617. getCombatDefinitions().setCombatMode(
  4618. legacyMode ? CombatDefinitions.LEGACY_COMBAT_MODE : CombatDefinitions.MANUAL_COMBAT_MODE);
  4619. getCombatDefinitions().refreshShowCombatModeIcon();
  4620. getCombatDefinitions().refreshAllowAbilityQueueing();
  4621. }
  4622.  
  4623. public void refreshMapIcons() {
  4624. varsManager.sendVarBit(22874, legacyMode ? 1 : 0);
  4625. }
  4626.  
  4627. public boolean helmetUpgrade1(){
  4628. return helmetUpgrade1;
  4629. }
  4630.  
  4631. public void helmetUpgraded1(boolean upgrade1){
  4632. this.helmetUpgrade1 = upgrade1;
  4633. }
  4634.  
  4635.  
  4636. public boolean helmetUpgrade2(){
  4637. return helmetUpgrade2;
  4638. }
  4639.  
  4640. public void helmetUpgraded2(boolean upgrade2){
  4641. this.helmetUpgrade2 = upgrade2;
  4642. }
  4643.  
  4644.  
  4645. public boolean helmetUpgrade3(){
  4646. return helmetUpgrade3;
  4647. }
  4648.  
  4649. public void helmetUpgraded3(boolean upgrade3){
  4650. this.helmetUpgrade3 = upgrade3;
  4651. }
  4652.  
  4653.  
  4654. public void refreshHideTitleBarsWhenLocked() {
  4655. varsManager.sendVarBit(19928, legacyMode || hideTitleBarsWhenLocked ? 1 : 0);
  4656. }
  4657.  
  4658. public void refreshLockInterfaceCustomization() {
  4659. varsManager.sendVarBit(19925, legacyMode || lockInterfaceCustomization ? 1 : 0);
  4660. }
  4661.  
  4662. public void refreshSlimHeaders() {
  4663. varsManager.sendVarBit(19924, legacyMode || slimHeaders ? 1 : 0);
  4664. }
  4665.  
  4666. public void switchSlimHeaders() {
  4667. slimHeaders = !slimHeaders;
  4668. refreshSlimHeaders();
  4669. }
  4670.  
  4671. public void switchHideTitleBarsWhenLocked() {
  4672. hideTitleBarsWhenLocked = !hideTitleBarsWhenLocked;
  4673. refreshHideTitleBarsWhenLocked();
  4674. }
  4675.  
  4676. public void switchClickThroughtChatBoxes() {
  4677. clickThroughtChatboxes = !clickThroughtChatboxes;
  4678. refreshClickThroughtChatBoxes();
  4679. }
  4680.  
  4681. public void refreshClickThroughtChatBoxes() {
  4682. varsManager.sendVarBit(20188, legacyMode || clickThroughtChatboxes ? 1 : 0);
  4683. }
  4684.  
  4685. public void refreshGameframe() {
  4686. varsManager.sendVarBit(22875, legacyMode ? 1 : 0); // TODO
  4687. }
  4688.  
  4689. /*
  4690. * stupid box that pops above hp bar lol
  4691. */
  4692. public void refreshTargetReticules() {
  4693. varsManager.sendVarBit(19929, !legacyMode && targetReticules ? 0 : 1);
  4694. }
  4695.  
  4696. public void switchTargetReticules() {
  4697. targetReticules = !targetReticules;
  4698. refreshTargetReticules();
  4699. }
  4700.  
  4701. public void setEnterPrifdinnas(){
  4702. this.canEnterPrifdinnas = true;
  4703. }
  4704.  
  4705. public boolean getEnterPrifdinnas(){
  4706. return canEnterPrifdinnas;
  4707. }
  4708.  
  4709. public void refreshAlwaysShowTargetInformation() {
  4710. varsManager.sendVarBit(19927, legacyMode || alwaysShowTargetInformation ? 0 : 1);
  4711. }
  4712.  
  4713. public boolean isAlwaysShowTargetInformation() {
  4714. return !legacyMode && alwaysShowTargetInformation;
  4715. }
  4716.  
  4717. public boolean isTargetReticule() {
  4718. return !legacyMode && targetReticules;
  4719. }
  4720.  
  4721.  
  4722.  
  4723. public void setIngridientsSearch(){
  4724. this.ingridientsSearch = true;
  4725. }
  4726.  
  4727. public boolean getIngridientsSearch(){
  4728. return ingridientsSearch;
  4729. }
  4730.  
  4731.  
  4732. public void switchAlwaysShowTargetInformation() {
  4733. alwaysShowTargetInformation = !alwaysShowTargetInformation;
  4734. refreshAlwaysShowTargetInformation();
  4735. }
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741. /*
  4742. * privatechat setup -> color(now you can have color and not be splited)
  4743. * split -> exactly what it says
  4744. */
  4745. public void refreshSplitPrivateChat() {
  4746. varsManager.sendVarBit(20187, splitPrivateChat ? 1 : 0);
  4747. }
  4748.  
  4749. public void switchSplitPrivateChat() {
  4750. splitPrivateChat = !splitPrivateChat;
  4751. refreshSplitPrivateChat();
  4752. }
  4753.  
  4754. public void refreshMakeXProgressWindow() {
  4755. varsManager.sendVarBit(3034, makeXProgressWindow ? 0 : 1);
  4756. }
  4757.  
  4758. public void setPurchasedLucien(){
  4759. this.purchasedPet = true;
  4760. }
  4761.  
  4762. public boolean getPurchasedLucien(){
  4763. return purchasedPet;
  4764. }
  4765.  
  4766. public int getEnergyCount(){
  4767. return energyCount;
  4768. }
  4769.  
  4770. public void switchMakeXProgressWindow() {
  4771. makeXProgressWindow = !makeXProgressWindow;
  4772. getPackets().sendGameMessage(
  4773. "You have toggled the Production Progress Dialog " + (makeXProgressWindow ? "on" : "off") + ".");
  4774. refreshMakeXProgressWindow();
  4775. }
  4776.  
  4777. public void refreshHideFamiliarOptions() {
  4778. varsManager.sendVarBit(18564, hideFamiliarOptions ? 1 : 0);
  4779. }
  4780.  
  4781. public void switchHideFamiliarOptions() {
  4782. hideFamiliarOptions = !hideFamiliarOptions;
  4783. refreshHideFamiliarOptions();
  4784. }
  4785.  
  4786. public void refreshGuidanceSystemHints() {
  4787. varsManager.sendVarBit(20924, guidanceSystemHints ? 0 : 1);
  4788. }
  4789.  
  4790. public void switchGuidanceSystemHints() {
  4791. guidanceSystemHints = !guidanceSystemHints;
  4792. refreshGuidanceSystemHints();
  4793. }
  4794.  
  4795. public void refreshToogleQuickChat() {
  4796. varsManager.sendVarBit(21242, toogleQuickChat ? 0 : 1);
  4797. }
  4798.  
  4799. public void refreshLockZoom() {
  4800. varsManager.sendVarBit(19926, lockZoom ? 1 : 0);
  4801. }
  4802.  
  4803. public void refreshCameraType() {
  4804. varsManager.sendVarBit(19949, rs3Camera ? 0 : 1);
  4805. }
  4806.  
  4807. public void setCameraType(boolean rs3Camera) {
  4808. this.rs3Camera = rs3Camera;
  4809. refreshCameraType();
  4810. }
  4811.  
  4812. public void switchLockZoom() {
  4813. lockZoom = !lockZoom;
  4814. refreshLockZoom();
  4815. }
  4816.  
  4817. public void switchToogleQuickChat() {
  4818. toogleQuickChat = !toogleQuickChat;
  4819. refreshToogleQuickChat();
  4820. }
  4821.  
  4822. public void setCosmeticPoints(int cosmeticPoint){
  4823. this.cosmeticPoint = cosmeticPoint;
  4824. }
  4825.  
  4826. public int getCosmeticPoints(){
  4827. return cosmeticPoint;
  4828. }
  4829.  
  4830. public void refreshMode() {
  4831. varsManager.sendVarBit(22872, legacyMode ? 1 : 0);
  4832. }
  4833.  
  4834. public void refreshInterfaceVars() {
  4835. resetAlwaysChatOnMode();
  4836. refreshMapIcons();
  4837. refreshSlimHeaders();
  4838. refreshLockInterfaceCustomization();
  4839. refreshClickThroughtChatBoxes();
  4840. refreshHideTitleBarsWhenLocked();
  4841. refreshTargetReticules();
  4842. refreshAlwaysShowTargetInformation();
  4843. refreshMakeXProgressWindow();
  4844. refreshSplitPrivateChat();
  4845. refreshTaskCompletePopups();
  4846. refreshTaskInformationWindow();
  4847. refreshTooglePlayerNotification();
  4848. refreshToogleAbilityCooldownTimer();
  4849. refreshSkillTargetBasedXPPopup();
  4850. refreshUTCClock();
  4851. refreshGameframe();
  4852. refreshMode();
  4853. refreshToggleBuffTimer(true);
  4854. }
  4855.  
  4856. public void switchBuffTimer() {
  4857. toggleBuffTimers = !toggleBuffTimers;
  4858. refreshToggleBuffTimer(false);
  4859. }
  4860.  
  4861. public boolean hasBuffTimersEnabled() {
  4862. return !legacyMode || toggleBuffTimers;
  4863. }
  4864.  
  4865. public void refreshToggleBuffTimer(boolean login) {
  4866. getVarsManager().sendVarBit(24832, toggleBuffTimers ? 1 : 0);
  4867. getPackets().sendExecuteScript(364, toggleBuffTimers ? 1 : 0, login ? 0 : 1);
  4868. }
  4869.  
  4870. public void setUTCClock(int type) {
  4871. this.utcClock = (byte) type;
  4872. refreshUTCClock();
  4873. }
  4874.  
  4875.  
  4876.  
  4877. public void refreshUTCClock() {
  4878. varsManager.sendVarBit(26696, utcClock);
  4879. getPackets().sendHideIComponent(635, 2, utcClock == 0);
  4880. getPackets().sendHideIComponent(635, 4, utcClock == 2);
  4881. }
  4882.  
  4883. public byte getUTCClock() {
  4884. return utcClock;
  4885. }
  4886.  
  4887. public boolean isApeAtoll() {
  4888. return (getX() >= 2693 && getX() <= 2821 && getY() >= 2693 && getY() <= 2817);
  4889. }
  4890.  
  4891. public void switchSkillTargetBasedXPPopup() {
  4892. skillTargetBasedXPPopup = !skillTargetBasedXPPopup;
  4893. refreshSkillTargetBasedXPPopup();
  4894. }
  4895.  
  4896. public void refreshSkillTargetBasedXPPopup() {
  4897. varsManager.sendVarBit(26632, skillTargetBasedXPPopup ? 1 : 0);
  4898. }
  4899.  
  4900. public void switchToogleAbilityCooldownTimer() {
  4901. toogleAbilityCooldownTimer = !toogleAbilityCooldownTimer;
  4902. refreshToogleAbilityCooldownTimer();
  4903. }
  4904.  
  4905. public int getCoalBagAmount() {
  4906. return coalBagAmount;
  4907. }
  4908.  
  4909. public void setCoalBagAmount(int coalBagAmount) {
  4910. this.coalBagAmount = coalBagAmount;
  4911. }
  4912.  
  4913. public CoalBag getCoalBag() {
  4914. return coalBag;
  4915. }
  4916.  
  4917. public void setCoalBag(CoalBag coalBag) {
  4918. this.coalBag = coalBag;
  4919. }
  4920.  
  4921. public void refreshToogleAbilityCooldownTimer() {
  4922. varsManager.sendVarBit(25401, toogleAbilityCooldownTimer ? 1 : 0);
  4923. }
  4924.  
  4925. public void switchTooglePlayerNotification() {
  4926. tooglePlayerNotification = !tooglePlayerNotification;
  4927. refreshTooglePlayerNotification();
  4928. }
  4929.  
  4930. public void setMasterSmith(){
  4931. this.masterSmith = true;
  4932. }
  4933.  
  4934. public boolean getMasterSmith(){
  4935. return masterSmith;
  4936. }
  4937.  
  4938. public void refreshTooglePlayerNotification() {
  4939. varsManager.sendVarBit(24940, tooglePlayerNotification ? 1 : 0);
  4940. }
  4941.  
  4942. public void switchTaskInformationWindow() {
  4943. taskInformationWindow = !taskInformationWindow;
  4944. refreshTaskInformationWindow();
  4945. }
  4946.  
  4947. public void setAraxxiKills(){
  4948. this.araxxikills =+ 1;
  4949. }
  4950.  
  4951. public int getAraxxiKills(){
  4952. return araxxikills;
  4953. }
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959. public void refreshTaskInformationWindow() {
  4960. varsManager.sendVarBit(3568, taskInformationWindow ? 0 : 1); // TODO
  4961. }
  4962.  
  4963. public void switchTaskCompletePopups() {
  4964. taskCompletePopup = !taskCompletePopup;
  4965. refreshTaskCompletePopups();
  4966. }
  4967.  
  4968. public void refreshTaskCompletePopups() {
  4969. // varsManager.sendVarBit(22310, taskCompletePopup ? 1 : 0); //TODO
  4970. }
  4971.  
  4972. private void resetAlwaysChatOnMode() {
  4973. setAlwaysChatOnMode(legacyMode);
  4974. }
  4975.  
  4976. public void setAssistantDeveloper(){
  4977. this.assistantDeveloper = true;
  4978. }
  4979.  
  4980. public boolean isAssistantDeveloper(){
  4981. return assistantDeveloper;
  4982. }
  4983.  
  4984. public boolean isAlwaysChatOnMode() {
  4985. return alwaysOnChatMode;
  4986. }
  4987.  
  4988. public void setAlwaysChatOnMode(boolean alwaysOnChatMode) {
  4989. this.alwaysOnChatMode = alwaysOnChatMode;
  4990. refreshAlwaysChatOnMode();
  4991. }
  4992.  
  4993. public void switchAlwaysChatOnMode() {
  4994. alwaysOnChatMode = !alwaysOnChatMode;
  4995. }
  4996.  
  4997. public void refreshAlwaysChatOnMode() {
  4998. varsManager.sendVarBit(22310, alwaysOnChatMode ? 1 : 0); // TODO
  4999. }
  5000.  
  5001. public ActionBar getActionbar() {
  5002. return actionbar;
  5003. }
  5004.  
  5005. public int getPreviousLodestone() {
  5006. return previousLodestone;
  5007. }
  5008.  
  5009. public void setPreviousLodestone(int previousLodestone) {
  5010. this.previousLodestone = previousLodestone;
  5011. }
  5012.  
  5013. public Prestige getPrestige() {
  5014. return prestige;
  5015. }
  5016. public int getPrestigeLevel() {
  5017. return prestigeLevel;
  5018. }
  5019.  
  5020. public void setPrestigeLevel(int level) {
  5021. this.prestigeLevel = level;
  5022. }
  5023.  
  5024. public void updateBuffs() {
  5025. getVarsManager().sendVar(895, getVarsManager().getValue(895) + 1);
  5026. }
  5027.  
  5028. // for buffs that arent used exept for showing, needs to be called at login
  5029. public void refreshBuffs() {
  5030. getEffectsManager().refreshAllBuffs();
  5031. refreshMeleeAttackRating();
  5032. refreshMeleeStrengthRating();
  5033. refreshDefenceRating();
  5034. }
  5035.  
  5036. @Override
  5037. public String getName() {
  5038. return getDisplayName();
  5039. }
  5040.  
  5041. @Override
  5042. public int getCombatLevel() {
  5043. return skills.getCombatLevelWithSummoning();
  5044. }
  5045.  
  5046. public boolean isRunAfterLoad() {
  5047. return runAfterLoad;
  5048. }
  5049.  
  5050. public Animation getDeathAnimation() {
  5051. setNextGraphics(new Graphics(Utils.random(2) == 0 ? 4399 : 4398));
  5052. return new Animation(21769);
  5053. }
  5054.  
  5055. public int[] getSubMenus() {
  5056. return subMenus;
  5057. }
  5058.  
  5059. public boolean hasFireImmunity() {
  5060. return getEffectsManager().hasActiveEffect(EffectType.FIRE_IMMUNITY)
  5061. || getEffectsManager().hasActiveEffect(EffectType.SUPER_FIRE_IMMUNITY);
  5062. }
  5063.  
  5064. @Override
  5065. public boolean isPoisonImmune() {
  5066. return getEffectsManager().hasActiveEffect(EffectType.ANTIPOISON);
  5067. }
  5068.  
  5069. public DoomsayerManager getDoomsayerManager() {
  5070. return doomsayerManager;
  5071. }
  5072.  
  5073. public PlayerExamineManager getPlayerExamineManager() {
  5074. return playerExamineManager;
  5075. }
  5076.  
  5077.  
  5078. public void setItemsTimer(){
  5079. this.itemsTimer = Utils.currentTimeMillis() + 86400000;
  5080. }
  5081.  
  5082. public long getItemsTimer(){
  5083. return itemsTimer;
  5084. }
  5085.  
  5086.  
  5087.  
  5088.  
  5089. @Override
  5090. public void giveXP() {
  5091. Combat.giveXP(this, getTotalDamageReceived() / 10);
  5092. }
  5093.  
  5094. public TimersManager getTimersManager() {
  5095. return timersManager;
  5096. }
  5097.  
  5098. public CosmeticsManager getCosmeticsManager() {
  5099. return cosmeticsManager;
  5100. }
  5101.  
  5102. public boolean isEnteredDonatorZone() {
  5103. return enteredDonatorZone;
  5104. }
  5105.  
  5106. public void setEnteredDonatorZone() {
  5107. enteredDonatorZone = true;
  5108. }
  5109.  
  5110. public void setCurrentOptionsMenu(int interfaceId) {
  5111. getTemporaryAttributtes().put(Key.OPTION_MENU, interfaceId);
  5112. }
  5113.  
  5114. public String getLastBossInstanceKey() {
  5115. return lastBossInstanceKey;
  5116. }
  5117.  
  5118. public int getWarningCount(){
  5119. return warningCount;
  5120. }
  5121. public void setWarningCount(){
  5122. this.warningCount =+ 1;
  5123. this.warned = true;
  5124. }
  5125.  
  5126. public boolean getWarned(){
  5127. return warned;
  5128. }
  5129.  
  5130. public void setLastBossInstanceKey(String lastBossInstanceKey) {
  5131. this.lastBossInstanceKey = lastBossInstanceKey;
  5132. }
  5133.  
  5134. public InstanceSettings getLastBossInstanceSettings() {
  5135. return lastBossInstanceSettings;
  5136. }
  5137.  
  5138. public void setLastBossInstanceSettings(InstanceSettings lastBossInstanceSettings) {
  5139. this.lastBossInstanceSettings = lastBossInstanceSettings;
  5140. }
  5141.  
  5142. public boolean isOwner() {
  5143. return rights == 2 && isOwner;
  5144. }
  5145.  
  5146. public boolean isAdmin() {
  5147.  
  5148. return rights == 2;
  5149. }
  5150.  
  5151. public boolean isMod() {
  5152. return rights == 1;
  5153. }
  5154.  
  5155.  
  5156. public boolean isInstantSwitchToLegacy() {
  5157. return instantSwitchToLegacy;
  5158. }
  5159.  
  5160. public void switchInstantSwitchToLegacy() {
  5161. instantSwitchToLegacy = !instantSwitchToLegacy;
  5162. }
  5163.  
  5164. public boolean getFinishedStarterGuide() {
  5165. return finishedStarterGuide;
  5166. }
  5167.  
  5168. public void setFinishedStarterGuide() {
  5169. this.finishedStarterGuide = true;
  5170. }
  5171.  
  5172. public boolean getCanEnterStartPortal(){
  5173. return canEnterStartPortal;
  5174. }
  5175.  
  5176. public void setCanEnterStartPortal(){
  5177. this.canEnterStartPortal = true;
  5178. }
  5179.  
  5180. public void resetLevels() {
  5181. for (int i = 0; i < 25; i++) {
  5182. if (i != 3) {
  5183. getSkills().set(i, 1);
  5184. getSkills().setXp(i, Skills.getXPForLevel(1));
  5185.  
  5186. }
  5187. }
  5188. getSkills().set(3, 10);
  5189. getSkills().setXp(3, Skills.getXPForLevel(10));
  5190. }
  5191.  
  5192. public boolean getStartedDemandsOfMonarchy(){
  5193. return roaldDemands;
  5194. }
  5195.  
  5196. public void setStartedDemandsOfMonarchy() {
  5197. this.roaldDemands = true;
  5198. }
  5199.  
  5200.  
  5201.  
  5202. public boolean getKilledDragith(){
  5203. return killedDragith;
  5204. }
  5205.  
  5206. public void setKilledDragith(){
  5207. this.killedDragith = true;
  5208. }
  5209.  
  5210.  
  5211. public boolean getFinishedFather(){
  5212. return finishedFather;
  5213. }
  5214.  
  5215. public void setFinishedFather(){
  5216. this.finishedFather = true;
  5217. }
  5218.  
  5219. public void setCanFightCaptain() {
  5220. this.canFightCaptain = true;
  5221. }
  5222.  
  5223.  
  5224. public void setVotePoints(int votePoints){
  5225. this.votePoints = votePoints;
  5226. }
  5227.  
  5228. public int getVotePoints(){
  5229. return votePoints;
  5230. }
  5231.  
  5232. public boolean getCanFightCaptain(){
  5233. return canFightCaptain;
  5234. }
  5235.  
  5236. public boolean getBeginSearch(){
  5237.  
  5238. return beginSearch;
  5239. }
  5240.  
  5241. public void setBeginSearch(){
  5242. this.beginSearch = true;
  5243. }
  5244.  
  5245. public boolean getCollectedParts(){
  5246.  
  5247. return collectedParts;
  5248. }
  5249.  
  5250. public void setCollectedParts() {
  5251. this.collectedParts = true;
  5252.  
  5253. }
  5254.  
  5255. public void setPrayedFor() {
  5256. this.prayedFor = true;
  5257. }
  5258.  
  5259. public long getXPTimer(){
  5260. return xptimer;
  5261. }
  5262.  
  5263. public void setXPTimer(){
  5264. this.xptimer = xptimer + 900000;
  5265. }
  5266.  
  5267. public void setXPTimerCustom(long add){
  5268. if (xptimer == 0){
  5269. this.xptimer = Utils.currentTimeMillis() + add;
  5270. }
  5271. else
  5272. this.xptimer = xptimer + add;
  5273. }
  5274.  
  5275. public void newDisplayTimer(){
  5276. this.displayTimer = Utils.currentTimeMillis() + 21600000;
  5277. }
  5278.  
  5279. public long getDisplayTimer(){
  5280. return displayTimer;
  5281. }
  5282.  
  5283. public void newTimer(){
  5284. this.xptimer = Utils.currentTimeMillis() + 900000;
  5285. }
  5286.  
  5287. public void resetXPTimer(){
  5288. this.xptimer = 0;
  5289. }
  5290.  
  5291. public boolean getPrayedFor(){
  5292.  
  5293. return prayedFor;
  5294. }
  5295.  
  5296. public boolean getDOMComplete() {
  5297. return DOMComplete;
  5298. }
  5299.  
  5300. public void setDOMComplete() {
  5301. this.DOMComplete = true;
  5302. }
  5303.  
  5304.  
  5305. public void setHefinId(int id){
  5306. this.currentId = id;
  5307. }
  5308.  
  5309.  
  5310. public int getHefinId(){
  5311. return currentId;
  5312. }
  5313.  
  5314. public boolean getCoDComplete() {
  5315. return CoDComplete;
  5316. }
  5317.  
  5318. public void setCoDComplete() {
  5319. this.CoDComplete = true;
  5320. }
  5321.  
  5322. public void setSafeZone(boolean isAtSafeZone){
  5323. this.isAtSafeZone = isAtSafeZone;
  5324. }
  5325.  
  5326. public boolean getSafeZone(){
  5327. return isAtSafeZone;
  5328. }
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334. public boolean isInNardah(){
  5335. return inNardah;
  5336. }
  5337.  
  5338. public void setInNardah(boolean inNardah){
  5339. this.inNardah = inNardah;
  5340. }
  5341.  
  5342.  
  5343.  
  5344.  
  5345. public boolean isInSophanem(){
  5346. return inSophanem;
  5347. }
  5348.  
  5349. public void setInSophanem(boolean inSophanem){
  5350. this.inSophanem = inSophanem;
  5351. }
  5352.  
  5353. public boolean isInPollnivneach(){
  5354. return inPollnivneach;
  5355. }
  5356.  
  5357. public void setInPollnivneach(boolean inPollnivneach){
  5358. this.inPollnivneach = inPollnivneach;
  5359. }
  5360.  
  5361. public void setWaterCharges(int waterCharges){
  5362. this.waterCharges = waterCharges;
  5363. }
  5364.  
  5365. public int getWaterCharges(){
  5366. return waterCharges;
  5367. }
  5368.  
  5369.  
  5370. public void setDesertHeat(boolean inDesert){
  5371. this.inDesert = true;
  5372. }
  5373.  
  5374. public boolean getDesertHeat(){
  5375. return inDesert;
  5376. }
  5377.  
  5378.  
  5379.  
  5380. public int getRank() {
  5381. // TODO Auto-generated method stub
  5382. return rights;
  5383. }
  5384.  
  5385. public void setCoverIntro(){
  5386. this.coverIntro = true;
  5387. }
  5388.  
  5389. public boolean getCoverIntro() {
  5390. return coverIntro;
  5391. }
  5392.  
  5393. public void setReaperPoints(int Points){
  5394. this.reaperPoints = reaperPoints + Points;
  5395. }
  5396.  
  5397. public void setTasksDone(int total){
  5398. this.tasksDone = tasksDone + total;
  5399. }
  5400.  
  5401. public int getTasksDone(){
  5402. return tasksDone;
  5403. }
  5404.  
  5405. public void setBossKills(int total){
  5406. this.bossKills = bossKills + total;
  5407. }
  5408.  
  5409. public int getBossKills(){
  5410. return bossKills;
  5411. }
  5412.  
  5413. public void magicStallIncrease(int increase){
  5414. if (getMagicStallValue() < 100){
  5415. this.magicIncrement = magicIncrement + increase;
  5416. }if (getMagicStallValue() >= 100){
  5417. this.magicIncrement = 0;
  5418. Magic.sendCrystalChimeSpell(this, 1, 0,(new WorldTile(Settings.START_PLAYER_LOCATION)));
  5419. }
  5420. }
  5421.  
  5422.  
  5423. public int getMagicStallValue(){
  5424. return magicIncrement;
  5425. }
  5426.  
  5427. public int getReaperPoints() {
  5428. return reaperPoints;
  5429. }
  5430.  
  5431. public boolean getDisrupted(){
  5432. return disrupted;
  5433. }
  5434.  
  5435. public void setDisrupted(boolean disrupt){
  5436. this.disrupted = disrupt;
  5437. }
  5438.  
  5439. public boolean getBinded(){
  5440. return isBinded;
  5441. }
  5442.  
  5443. public void setBinded(boolean Binded){
  5444. this.isBinded = Binded;
  5445. }
  5446.  
  5447. public boolean getGuthanBleed(){
  5448. return guthanBleed;
  5449. }
  5450.  
  5451. public void setGuthanBleed(boolean Bleed){
  5452. this.guthanBleed = Bleed;
  5453. }
  5454.  
  5455. public boolean getInRots(){
  5456. return inRots;
  5457. }
  5458.  
  5459. public void setInRots(boolean inRots){
  5460. this.inRots = inRots;
  5461. }
  5462.  
  5463. public void setLootValue(int loot){
  5464. this.lootValue = loot;
  5465. }
  5466.  
  5467. public int getLootValue() {
  5468. return lootValue;
  5469. }
  5470.  
  5471. public int getTaskPoints() {
  5472. return taskPoints;
  5473. }
  5474.  
  5475. public void setReroll(){
  5476. this.rerolls = 3;
  5477. }
  5478.  
  5479. public boolean rerollTask() {
  5480. if (rerolls <= 0) {
  5481. sendMessage("You are out of task rerolls. Continue with the current one, or wait till tomorrow.");
  5482. return false;
  5483. }
  5484. rerolls--;
  5485. reaperAssignment = ReaperAssignment.create();
  5486. sendMessage(reaperAssignment.getMessage());
  5487. return true;
  5488. }
  5489.  
  5490. public boolean hasBossTask() {
  5491. return reaperAssignment != null;
  5492. }
  5493.  
  5494. public void sendMessage(String mes) {
  5495. getPackets().sendGameMessage(mes);
  5496. }
  5497.  
  5498. public ReaperAssignment getBossTask() {
  5499. return reaperAssignment;
  5500. }
  5501.  
  5502. public void setBossTask(ReaperAssignment bossTask) {
  5503. this.reaperAssignment = bossTask;
  5504. }
  5505.  
  5506. public void setTaskPoints(int taskPoints) {
  5507. this.taskPoints = taskPoints;
  5508. }
  5509.  
  5510. public void setWarningTimer() {
  5511. this.warningTimer = Utils.currentTimeMillis() + 180000;
  5512. }
  5513.  
  5514. public void resetWarning(){
  5515. this.warned = false;
  5516. }
  5517.  
  5518. public long getWarningTimer() {
  5519. return warningTimer;
  5520. }
  5521.  
  5522. }
Add Comment
Please, Sign In to add comment