Advertisement
Guest User

Player.Java

a guest
Jan 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 177.88 KB | None | 0 0
  1. package com.rs.game.player;
  2.  
  3. import com.rs.Settings;
  4. import com.rs.content.clans.ClansManager;
  5. import com.rs.cores.CoresManager;
  6. import com.rs.game.*;
  7. import com.rs.game.Hit.HitLook;
  8. import com.rs.game.item.FloorItem;
  9. import com.rs.game.item.Item;
  10. import com.rs.game.minigames.clanwars.FfaZone;
  11. import com.rs.game.minigames.clanwars.WarControler;
  12. import com.rs.game.minigames.duel.DuelArena;
  13. import com.rs.game.minigames.duel.DuelRules;
  14. import com.rs.game.minigames.hungergames.HungerGames;
  15. import com.rs.game.minigames.hungergames.HungerGamesLobby;
  16. import com.rs.game.npc.NPC;
  17. import com.rs.game.npc.familiar.Familiar;
  18. import com.rs.game.npc.glacor.Glacor;
  19. import com.rs.game.npc.glacor.GlacorEffect;
  20. import com.rs.game.npc.glacor.SappingGlacyte;
  21. import com.rs.game.npc.godwars.zaros.Nex;
  22. import com.rs.game.npc.pet.Pet;
  23. import com.rs.game.player.actions.PlayerCombat;
  24. import com.rs.game.player.content.*;
  25. import com.rs.game.player.content.dungeoneering.controlers.HordeDungeon;
  26. import com.rs.game.player.content.grandexchange.GrandExchange;
  27. import com.rs.game.player.content.pet.PetManager;
  28. import com.rs.game.player.content.pvp.PVPSystem;
  29. import com.rs.game.player.content.tempdung.DungeonManager;
  30. import com.rs.game.player.controlers.*;
  31. import com.rs.game.player.controlers.battleterrace.battleTerraceGame;
  32. import com.rs.game.player.controlers.castlewars.CastleWarsPlaying;
  33. import com.rs.game.player.controlers.castlewars.CastleWarsWaiting;
  34. import com.rs.game.player.controlers.events.DeathEvent;
  35. import com.rs.game.player.controlers.fightpits.FightPitsArena;
  36. import com.rs.game.player.controlers.fog.FistOfGuthixGame;
  37. import com.rs.game.player.controlers.pestcontrol.PestControlGame;
  38. import com.rs.game.player.controlers.pestcontrol.PestControlLobby;
  39. import com.rs.game.tasks.WorldTask;
  40. import com.rs.game.tasks.WorldTasksManager;
  41. import com.rs.net.LoginServerCommunication;
  42. import com.rs.net.Session;
  43. import com.rs.net.decoders.WorldPacketsDecoder;
  44. import com.rs.net.decoders.handlers.ButtonHandler;
  45. import com.rs.net.encoders.WorldPacketsEncoder;
  46. import com.rs.player.ChatMessage;
  47. import com.rs.utils.*;
  48.  
  49. import java.io.BufferedReader;
  50. import java.io.FileReader;
  51. import java.io.IOException;
  52. import java.io.InputStreamReader;
  53. import java.net.InetAddress;
  54. import java.net.URL;
  55. import java.net.UnknownHostException;
  56. import java.util.*;
  57. import java.util.concurrent.ConcurrentLinkedQueue;
  58. import java.util.concurrent.CopyOnWriteArrayList;
  59. import java.util.concurrent.TimeUnit;
  60.  
  61. public class Player extends Entity {
  62.  
  63. public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1,
  64. RUN_MOVE_TYPE = 2;
  65. private static final long serialVersionUID = 2011932556974180375L;
  66. public transient ActionManager actionManager;
  67. public int fishFished;
  68. public int openedChest;
  69. public boolean addedWeedstoCompost;
  70. public AuraManager auraManager;
  71. public long afkTimer = 0;
  72. public int battlePoints;
  73. public Player battleTarget;
  74. public transient BountyHunter bountyHunter;
  75. public transient boolean clientLoadedMapRegion;
  76. public int killedGiantMole;
  77. public int killedBarrelchest;
  78. public int gemsCut;
  79. public int wildyCourseCompleted;
  80. public int barbarianCourseCompleted;
  81. public int foodCooked;
  82. public int minedOres;
  83. public int gnomeCourseCompleted;
  84. /* count partyhats obtained from mystery box */
  85. public int countPartyHat;
  86. public transient FriendChatsManager currentFriendChat;
  87. public boolean goat;
  88. public transient CutscenesManager cutscenesManager;
  89. public boolean pyramidReward;
  90. public transient DialogueManager dialogueManager;
  91. public transient int displayMode;
  92. public DominionTower dominionTower;
  93. public int[] fairyRingCombination = new int[3];
  94. public Familiar familiar;
  95. // Battle Terrace
  96. public boolean hasTut;
  97. public BankPin bankPin;
  98. public transient HintIconsManager hintIconsManager;
  99. public transient InterfaceManager interfaceManager;
  100. public transient IsaacKeyPair isaacKeyPair;
  101. public boolean isBurying = false;
  102. public transient DuelRules lastDuelRules;
  103. public transient LocalNPCUpdate localNPCUpdate;
  104. // used for update
  105. public transient LocalPlayerUpdate localPlayerUpdate;
  106. // used for packets logic
  107. public transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
  108. public transient LoyaltyManager loyaltyManager;
  109. public int money;
  110. public int ordinanceTimer;
  111. public transient Pet pet;
  112. public PetManager petManager;
  113. public MoneyPouch pouch;
  114. public Prayer prayer;
  115. public transient PriceCheckManager priceCheckManager;
  116. public QuestManager questManager;
  117. public transient int screenHeight;
  118. public transient int screenWidth;
  119. public String selectedClass;
  120. public transient Session session;
  121. public String setMutedBy, mutedReason;
  122. public SquealOfFortune squealOfFortune;
  123. //Evil Tree
  124. public int treeDamage = 0;
  125. public int totalTreeDamage;
  126. public boolean isChopping = false;
  127. public boolean isLighting = false;
  128. public boolean isRooting = false;
  129. // SW TODO REMOVE THIS SHIT XD
  130. public transient boolean isInSoulWarsGame = false;
  131. public transient boolean isInSoulWarsLobby = false;
  132. public int zeals = 0;
  133. public DwarfCannon dwarfCannon;
  134. public boolean hasSetupCannon;
  135. // interface
  136. public boolean hasSetupGoldCannon;
  137. public boolean hasSetupRoyalCannon;
  138. public transient Trade trade;
  139. public int usedMacs;
  140. // transient stuff
  141. public transient String username;
  142. public int warriorKills, archerKills, mageKills;
  143. public int warriorLevel, archerLevel, mageLevel;
  144. // trivia shit
  145. public int triviaPointss = 0;
  146. public int[] triviaPoints;
  147. public int TriviaPoints;
  148. public boolean hasAnswered;
  149. public int lendMessage;
  150. public long lastSpinsReceived;
  151. public int reseted;
  152. //God Wars
  153. public int armadyl = 0;
  154. public int bandos = 0;
  155. public int saradomin = 0;
  156. public int zamorak = 0;
  157. // kills
  158. public int killedNex = 0;
  159. public int killedSunfreet = 0;
  160. public int killedAvatar = 0;
  161. public int killedPartyD = 0;
  162. public int killedZamorak = 0;
  163. public int killedArmadyl = 0;
  164. public int killedSaradomin = 0;
  165. public int killedBandos = 0;
  166. public int killedWildyW = 0;
  167. public int killedGlacor = 0;
  168. public int killedVorago = 0;
  169. public int killedPestQ = 0;
  170. public int killedBlink = 0;
  171. public int killedYklagor = 0;
  172. public int killedRainBD = 0;
  173. public int killedCorp = 0;
  174. public int killedKBD = 0;
  175. public int killedQBD = 0;
  176. public int killedGreenD = 0;
  177. public int killedBlueD = 0;
  178. public int killedRedD = 0;
  179. public int killedBlackD = 0;
  180. public int killedBronzeD = 0;
  181. public int killedIronD = 0;
  182. public int killedSteelD = 0;
  183. public int killedMithrilD = 0;
  184. public int killedFrostD = 0;
  185. public int killedOverAllDragons = 0;
  186. public int killedOverAll = 0;
  187. public boolean IsInNexIcicle;
  188. public int rosTrips;
  189. // sheathing
  190. public boolean canSheath, canSheath2;
  191. public FarmingManager farmingManager;
  192. // SkillFu
  193. public boolean samuraiCooking;
  194. public boolean chillBlastMining;
  195. public boolean karateFletching;
  196. public boolean ironFistSmithing;
  197. public boolean roundHouseWoodCutting;
  198. public boolean allSkillFu;
  199. public boolean inRing;
  200. public boolean hasHouse;
  201. public int chair1;
  202. public int chairX1;
  203. public int chairY1;
  204. public int chair2;
  205. public int chairX2;
  206. public int chairY2;
  207. public int chair3;
  208. public int chairX3;
  209. public int chairY3;
  210. public int rug1;
  211. public int rugX1;
  212. public int rugY1;
  213. public int fireplace1;
  214. public int fireplaceX1;
  215. public int fireplaceY1;
  216. public int fireplace2;
  217. public int fireplaceX2;
  218. public int fireplaceY2;
  219. public int fireplace3;
  220. public int fireplaceX3;
  221. public int fireplaceY3;
  222. public int bookcase1;
  223. public int bookcaseX1;
  224. public int bookcaseY1;
  225. public int bookcase2;
  226. public int bookcaseX2;
  227. public int bookcaseY2;
  228. public int bookcase3;
  229. public int bookcaseX3;
  230. public int bookcaseY3;
  231. public int bookcase4;
  232. public int bookcaseX4;
  233. public int bookcaseY4;
  234. public int bookcase5;
  235. public int bookcaseX5;
  236. public int bookcaseY5;
  237. public int table1;
  238. public int tableX1;
  239. public int tableY1;
  240. public int small1plant1;
  241. public int small1plantX1;
  242. public int small1plantY1;
  243. public int small2plant1;
  244. public int small2plantX1;
  245. public int small2plantY1;
  246. public int big1plant1;
  247. public int big1plantX1;
  248. public int big1plantY1;
  249. public int big2plant1;
  250. public int big2plantX1;
  251. public int big2plantY1;
  252. public int bench1;
  253. public int benchX1;
  254. public int benchY1;
  255. public int bench2;
  256. public int benchX2;
  257. public int benchY2;
  258. public int bench3;
  259. public int benchX3;
  260. public int benchY3;
  261. public int bench4;
  262. public int benchX4;
  263. public int benchY4;
  264. public int bench5;
  265. public int benchX5;
  266. public int benchY5;
  267. public int bench6;
  268. public int benchX6;
  269. public int benchY6;
  270. public int bench7;
  271. public int benchX7;
  272. public int benchY7;
  273. public int bench8;
  274. public int benchX8;
  275. public int benchY8;
  276. public int killedKalphiteQueen;
  277. public int killedSupreme;
  278. public int killedPrime;
  279. public int killedRex;
  280. public int killedTormentedDemon;
  281. public int capturedDragonImps;
  282. public int plantedMagicTrees;
  283. public int smithRuneItem;
  284. // Fist Of Guthix
  285. int FOGRating;
  286. boolean forfeited;
  287. private boolean finishedIntro;
  288. private transient ShootingStar shootingStar;
  289. private transient Notes notes;
  290. private ArrayList<Notes.Note> pnotes;
  291. private transient boolean onSpotDuelingRequest;
  292. private transient boolean onSpotDueling;
  293. private transient WorldTile duelLocation;
  294. private transient VarsManager varsManager = new VarsManager(this);
  295. private boolean agrithNaNa;
  296. private boolean allowChatEffects;
  297. private GlobalPlayerUpdater globalPlayerUpdater;
  298. private Appearence appearence;
  299. private int assistStatus;
  300. private Bank bank;
  301. private int barbarianAdvancedLaps;
  302. private int runeSpanPoints;
  303. private int barrowsKillCount;
  304. private int barsDone;
  305. private transient long boneDelay;
  306. private transient boolean canPvp;
  307. private transient boolean cantTrade;
  308. private transient boolean castedVeng;
  309. private int kills;
  310. private int hungerPoints;
  311. private int minutesPlayed;
  312. private ChargesManager charges;
  313. private int clanStatus;
  314. private long uniqueID;
  315. private transient Runnable closeInterfacesEvent;
  316. private int clueReward;
  317. private CombatDefinitions combatDefinitions;
  318. // completionistcape reqs
  319. private boolean completedFightCaves;
  320. private boolean completedFightKiln;
  321. private boolean completedRfd;
  322. private int[] completionistCapeCustomized;
  323. private ControlerManager controlerManager;
  324. private transient RouteEvent routeEvent;
  325. private long creationDate;
  326. private int crucibleHighScore;
  327. private boolean culinaromancer;
  328. private String currentFriendChatOwner;
  329. // lobby
  330. private int currentWorldLobby;
  331. private String customTitle;
  332. private boolean dessourt;
  333. // Dfs
  334. private boolean dfsActivated;
  335. private int dfscoolDown;
  336. private transient boolean disableEquip;
  337. private String displayName;
  338. private long displayTime;
  339. private int dominionFactor;
  340. private boolean premiumBronze;
  341. private long premiumBronzeTill;
  342. private DuelArena duelarena;
  343. private int dungeoneeringTokens;
  344. private int easterPoints;
  345. private String email;
  346. private EmotesManager emotesManager;
  347. private String enteredPinString = null;
  348. private Equipment equipment;
  349. private boolean premiumSilver;
  350. private long premiumTill;
  351. private boolean ironman;
  352. private boolean hardcoreIronman;
  353. private boolean youtuber;
  354. private boolean filterGame;
  355. private transient boolean finishing;
  356. private long fireImmune;
  357. private boolean flamBeed;
  358. private transient long foodDelay;
  359. private boolean forceNextMapLoadRefresh;
  360. private int friendChatSetup;
  361. private FriendsIgnores friendsIgnores;
  362. private int gnomeAdvancedLaps;
  363. private boolean gotInfernoAdze;
  364. private boolean hasCutEnoughLogs;
  365. private boolean hasCutMoreEnoughLogs;
  366. private int hiddenBrother;
  367. private boolean hideWorldAnnouncements;
  368. private transient double hpBoostMultiplier;
  369. private boolean inAnimationRoom;
  370. private Inventory inventory;
  371. private transient boolean invulnerable;
  372. private boolean isModerator;
  373. private boolean isGraphicDesigner;
  374. private boolean isInDefenderRoom;
  375. private boolean isInLobby;
  376. // supportteam
  377. private boolean isSupporter;
  378. private long jailed;
  379. private boolean karamel;
  380. // objects
  381. private boolean khalphiteLairEntranceSetted;
  382. private boolean khalphiteLairSetted;
  383. // honor
  384. private int killCount, deathCount;
  385. // barrows
  386. private boolean[] killedBarrowBrothers;
  387. private boolean killedBork;
  388. private boolean killedQueenBlackDragon;
  389. private transient boolean largeSceneView;
  390. private int lastBonfire;
  391. private String lastIP;
  392. private String lastKilled;
  393. private long lastLoggedIn;
  394. private String lastMsg;
  395. private transient long lastPublicMessage;
  396. private long lastRequestSQL;
  397. private long lastWalkedMillis;
  398. private int loadedLogs;
  399. private transient long lockDelay; // used for doors and stuff like that
  400. private int loggedWorld;
  401. private int logsCut;
  402. private boolean lootshareEnabled;
  403. private int Loyaltypoints;
  404. private boolean macBanned;
  405. // comp req stuff
  406. private int magicLogsBurned;
  407. // skill capes customizing
  408. private int[] maxedCapeCustomized;
  409. private boolean mouseButtons;
  410. private MusicsManager musicsManager;
  411. // voting
  412. private boolean oldItemsLook;
  413. private int overloadDelay;
  414. private List<String> ownedObjectsManagerKeys;
  415. private String Owner = "";
  416. private transient long packetsDecoderPing;
  417. // saving stuff
  418. private String password;
  419. private boolean permBanned;
  420. private boolean permMuted;
  421. private int pestControlGames;
  422. private int pestPoints;
  423. private int pkPoints;
  424. private long poisonImmune;
  425. private transient long polDelay;
  426. private transient long potDelay;
  427. private int[] pouches;
  428. private int prayerRenewalDelay;
  429. private int prestige;
  430. private int privateChatSetup;
  431. // game bar status
  432. private int publicStatus;
  433. private int pvmPoints;
  434. private String recovAnswer;
  435. // Recovery ques. & ans.
  436. private String recovQuestion;
  437. private String registeredMac, currentMac;
  438. private boolean reportOption;
  439. private transient boolean resting;
  440. private int rights;
  441. private int rocktailsCooked;
  442. private byte runEnergy;
  443. private transient boolean running;
  444. private boolean setStarter;
  445. private Skills skills;
  446. private int skullDelay;
  447. private int skullId;
  448. private boolean typeAction;
  449. private int[] gems = new int[4];
  450. private int coalAmount;
  451. private boolean wastelessHerblore;
  452. private boolean helpedTrader;
  453. private boolean slagilith;
  454. private transient boolean spawnsMode;
  455. private int specRestoreTimer;
  456. private transient ClansManager clanManager;
  457. private transient ClansManager guestClanManager;
  458. private String clanName;
  459. private int dungTokens;
  460. private int clanChatSetup;
  461. private int guestChatSetup;
  462. private boolean connectedClanChannel;
  463. private int spins;
  464. private int[] boundChuncks;
  465. private List<WorldObject> conObjectsToBeLoaded;
  466. private int place;
  467. /**
  468. * Dung
  469. */
  470. private transient DungeonManager dm;
  471. private transient PVPSystem pvp;
  472. private int killcount = 0;
  473. // player stages
  474. private transient boolean started;
  475. private int summoningLeftClickOption;
  476. private transient List<Integer> switchItemCache;
  477. private boolean talkedtoCook;
  478. private boolean mudskipper;
  479. // crucible
  480. private boolean talkedWithMarv;
  481. // Vannaka
  482. private boolean talkedWithVannaka;
  483. private int temporaryMovementType;
  484. private String Title = "custom";
  485. private String titleColor = "C12006";
  486. private int tradeStatus;
  487. private int uniquePlayerId;
  488. private boolean updateMovementType;
  489. private int vecnaTimer;
  490. private boolean premiumGold;
  491. private int votePoints;
  492. private boolean wonFightPits;
  493. private boolean xpLocked;
  494. private String yellColor = "ff0000";
  495. private transient long yellDelay;
  496. private boolean yellDisabled;
  497. private boolean yellOff;
  498. private String yellPrefix = "V.I.P";
  499. private String yellShade = "";
  500. private boolean zenRest;
  501. private long muted;
  502. private long banned;
  503. private boolean gmaulSpecCheapFix;
  504. private int questPoints;
  505. private boolean usingSnowGroundColor;
  506. private GrandExchange grandExchange = new GrandExchange(this);
  507. private boolean veteran;
  508. private TeleportMode teleportMode;
  509. private ArrayList<Notes.Note> cutNotes;
  510. private String referralCode;
  511. private boolean pendingItems;
  512. private int penguinPoints;
  513. private int penguinsAcquired;
  514. private boolean penguin;
  515. private int sinkholesFound;
  516. private boolean receivedStarGift;
  517. private boolean starSprite;
  518. private boolean temporaryEmptyToggle;
  519. private boolean emptyToggle;
  520. private SlayerManager slayerManager;
  521. private int tasksComplete;
  522. private boolean learnedBroad;
  523. private boolean learnedSlayerRing;
  524. private boolean learnedSlayerHelmet;
  525. private String[] removedTasks = new String[]{"", "", "", ""};
  526. private int slayerPoints;
  527. private long superFireImmune;
  528. private int livesPurchased;
  529. private int lives;
  530. private boolean officiallyDead;
  531.  
  532. // creates Player and saved classes
  533. public Player(String password) {
  534. super(Settings.START_PLAYER_LOCATION);
  535. setHitpoints(Settings.START_PLAYER_HITPOINTS);
  536. this.password = password;
  537. squealOfFortune = new SquealOfFortune();
  538. dm = new DungeonManager(this);
  539. appearence = new Appearence();
  540. inventory = new Inventory();
  541. setGlobalPlayerUpdater(new GlobalPlayerUpdater());
  542. equipment = new Equipment();
  543. skills = new Skills();
  544. farmingManager = new FarmingManager();
  545. combatDefinitions = new CombatDefinitions();
  546. prayer = new Prayer();
  547. bank = new Bank();
  548. bankPin = new BankPin();
  549. controlerManager = new ControlerManager();
  550. musicsManager = new MusicsManager();
  551. emotesManager = new EmotesManager();
  552. friendsIgnores = new FriendsIgnores();
  553. dominionTower = new DominionTower();
  554. charges = new ChargesManager();
  555. auraManager = new AuraManager();
  556. questManager = new QuestManager();
  557. dwarfCannon = new DwarfCannon(this);
  558. petManager = new PetManager();
  559. slayerManager = new SlayerManager();
  560. runEnergy = 100;
  561. allowChatEffects = true;
  562. mouseButtons = true;
  563. pouches = new int[4];
  564. fairyRingCombination = new int[3];
  565. pnotes = new ArrayList<Notes.Note>(30);
  566. setTeleportMode(TeleportMode.NORMAL);
  567. resetBarrows();
  568. SkillCapeCustomizer.resetSkillCapes(this);
  569. ownedObjectsManagerKeys = new LinkedList<String>();
  570. setCreationDate(Utils.currentTimeMillis());
  571. currentFriendChatOwner = "Nick";
  572.  
  573. // LOL
  574. uniqueID(Utils.random(Long.MAX_VALUE - 1000000000));
  575. System.out.println(uniqueID());
  576. }
  577.  
  578. public long getSuperFireImmune() {
  579. return superFireImmune;
  580. }
  581.  
  582. public SquealOfFortune getSquealOfFortune() {
  583. return squealOfFortune;
  584. }
  585.  
  586. public void setSquealOfFortune(SquealOfFortune squealOfFortune) {
  587. this.squealOfFortune = squealOfFortune;
  588. }
  589.  
  590. public PVPSystem getPVP() {
  591. if (pvp == null)
  592. pvp = new PVPSystem(this, getKillcount());
  593. return pvp;
  594. }
  595.  
  596. public DungeonManager getDungeonManager() {
  597. if (dm == null)
  598. dm = new DungeonManager(this);
  599. return dm;
  600. }
  601.  
  602. public void addTriviaPoints(int i) {
  603. triviaPoints[i]++;
  604. }
  605.  
  606. public int getTriviaPoints() {
  607. return TriviaPoints;
  608. }
  609.  
  610. public void setTriviaPoints(int triviaPoints) {
  611. this.TriviaPoints = triviaPoints;
  612. }
  613.  
  614. public long uniqueID() {
  615. return uniqueID;
  616. }
  617.  
  618. public void uniqueID(long random) {
  619. uniqueID = random;
  620. }
  621.  
  622. public void addBoneDelay(long time) {
  623. boneDelay = time + Utils.currentTimeMillis();
  624. }
  625.  
  626. public void addDisplayTime(long i) {
  627. this.displayTime = i + Utils.currentTimeMillis();
  628. }
  629.  
  630. public int getRuneSpanPoints() {
  631. return runeSpanPoints;
  632. }
  633.  
  634. public void addRunespanPoints(int points) {
  635. this.runeSpanPoints += points;
  636. }
  637.  
  638. public void addFireImmune(long time) {
  639. fireImmune = time + Utils.currentTimeMillis();
  640. }
  641.  
  642. public void addFoodDelay(long time) {
  643. foodDelay = time + Utils.currentTimeMillis();
  644. }
  645.  
  646. public void addLogicPacketToQueue(LogicPacket packet) {
  647. for (LogicPacket p : logicPackets) {
  648. if (p.getId() == packet.getId()) {
  649. logicPackets.remove(p);
  650. break;
  651. }
  652. }
  653. logicPackets.add(packet);
  654. }
  655.  
  656. public void addPoisonImmune(long time) {
  657. poisonImmune = time + Utils.currentTimeMillis();
  658. getPoison().reset();
  659. }
  660.  
  661. public void addPolDelay(long delay) {
  662. polDelay = delay + Utils.currentTimeMillis();
  663. }
  664.  
  665. public void addPotDelay(long time) {
  666. potDelay = time + Utils.currentTimeMillis();
  667. }
  668.  
  669. /**
  670. * Adds points
  671. *
  672. * @param points
  673. */
  674.  
  675. public void addStarterPackage(boolean extraCoins) {
  676. int coinsAmount = extraCoins ? 3500000 : 2500000;
  677. int smallRune = 1000;
  678. for (int item : Settings.STARTER_ITEMS) {
  679. if (item == 995) {
  680. continue;
  681. }
  682. if (item == Settings.STARTER_ITEMS[4]) {
  683. getBank().addItem(item, smallRune, true);
  684. continue;
  685. }
  686. if (item == Settings.STARTER_ITEMS[17]) {
  687. getBank().addItem(item, smallRune, true);
  688. continue;
  689. }
  690. if (item == Settings.STARTER_ITEMS[18]) {
  691. getBank().addItem(item, smallRune, true);
  692. continue;
  693. }
  694. if (item == Settings.STARTER_ITEMS[19]) {
  695. getBank().addItem(item, smallRune, true);
  696. continue;
  697. }
  698. if (item == Settings.STARTER_ITEMS[20]) {
  699. getBank().addItem(item, 500, true);
  700. continue;
  701. }
  702. if (item == Settings.STARTER_ITEMS[21]) {
  703. getBank().addItem(item, 100, true);
  704. continue;
  705. }
  706. if (item == Settings.STARTER_ITEMS[22]) {
  707. getBank().addItem(item, smallRune, true);
  708. continue;
  709. }
  710. getBank().addItem(item,
  711. item == 379 ? 1000 : 1, true);
  712. }
  713. setStarter(true);
  714. }
  715.  
  716. public boolean canSpawn() {
  717. if (Wilderness.isAtWild(this)
  718. || getControlerManager().getControler() instanceof FightPitsArena
  719. || getControlerManager().getControler() instanceof CorpBeastControler
  720. || getControlerManager().getControler() instanceof PestControlLobby
  721. || getControlerManager().getControler() instanceof PestControlGame
  722. || getControlerManager().getControler() instanceof DungeoneeringControler
  723. || getControlerManager().getControler() instanceof ZGDControler
  724. || getControlerManager().getControler() instanceof GodWars
  725. || getControlerManager().getControler() instanceof StartTutorial
  726. || getControlerManager().getControler() instanceof Introduction
  727. || getControlerManager().getControler() instanceof JailControler
  728. || getControlerManager().getControler() instanceof DTControler
  729. || getControlerManager().getControler() instanceof WarControler
  730. || getControlerManager().getControler() instanceof DeathEvent
  731. || getControlerManager().getControler() instanceof BarrelchestControler
  732. || getControlerManager().getControler() instanceof DuelArena
  733. || getControlerManager().getControler() instanceof CastleWarsPlaying
  734. || getControlerManager().getControler() instanceof CastleWarsWaiting
  735. || getControlerManager().getControler() instanceof FightCaves
  736. || getControlerManager().getControler() instanceof FightKiln
  737. || getControlerManager().getControler() instanceof ImpossibleJad
  738. || getControlerManager().getControler() instanceof BarrelchestControler
  739. || getControlerManager().getControler() instanceof battleTerraceGame
  740. || FfaZone.inPvpArea(this)
  741. || getControlerManager().getControler() instanceof NomadsRequiem
  742. || getControlerManager().getControler() instanceof QueenBlackDragonController
  743. || getControlerManager().getControler() instanceof HungerGames
  744. || getControlerManager().getControler() instanceof HungerGamesLobby
  745. || getControlerManager().getControler() instanceof HordeDungeon) {
  746. return false;
  747. }
  748. if (getControlerManager().getControler() instanceof CrucibleControler) {
  749. CrucibleControler controler = (CrucibleControler) getControlerManager()
  750. .getControler();
  751. return !controler.isInside();
  752. }
  753. return true;
  754. }
  755.  
  756. public void checkMovement(int x, int y, int plane) {
  757. Magic.teleControlersCheck(this, new WorldTile(x, y, plane));
  758. }
  759.  
  760. @Override
  761. public void checkMultiArea() {
  762. if (!started)
  763. return;
  764. boolean isAtMultiArea = isForceMultiArea() ? true : World
  765. .isMultiArea(this);
  766. if (isAtMultiArea && !isAtMultiArea()) {
  767. setAtMultiArea(isAtMultiArea);
  768. getPackets().sendGlobalConfig(616, 1);
  769. } else if (!isAtMultiArea && isAtMultiArea()) {
  770. setAtMultiArea(isAtMultiArea);
  771. getPackets().sendGlobalConfig(616, 0);
  772. }
  773. }
  774.  
  775. public int checkTotalLevel(int checktotal) {
  776. checktotal = 0;
  777. for (int i = 0; i < 25; i++) {
  778. checktotal += getSkills().getLevel(i);
  779. }
  780. return checktotal;
  781. }
  782.  
  783. public boolean clientHasLoadedMapRegion() {
  784. return clientLoadedMapRegion;
  785. }
  786.  
  787. public void closeInterfaces() {
  788. if (controlerManager.getControler() != null && controlerManager.getControler() instanceof Introduction) {
  789. return;
  790. }
  791. if (interfaceManager.containsScreenInter())
  792. interfaceManager.closeScreenInterface();
  793. if (interfaceManager.containsInventoryInter())
  794. interfaceManager.closeInventoryInterface();
  795. dialogueManager.finishDialogue();
  796. if (closeInterfacesEvent != null) {
  797. closeInterfacesEvent.run();
  798. closeInterfacesEvent = null;
  799. }
  800. getPackets().closeInterface(7);
  801. getInterfaceManager().sendTab(
  802. getInterfaceManager().getWindowsPane() == 746 ? 21 : 161, 752);
  803. }
  804.  
  805. void generateReferralCode() {
  806. String[] string = "abcdefghijklmnopqrstuvwxyz0123456789".split("");
  807. String code = "";
  808. for (int i = 0; i < 10; i++) {
  809. code = code + string[Utils.random(0, string.length - 1)];
  810. }
  811. if (!checkReferralCode(code)) {
  812. generateReferralCode();
  813. return;
  814. }
  815. LoggingSystem.logData("referralCodes", code + " - " + username);
  816. referralCode = code;
  817. }
  818.  
  819. public boolean checkReferralCode(String code) {
  820. try {
  821. BufferedReader reader = new BufferedReader(new FileReader("./data/logs/referralCodes.txt"));
  822. String line = null;
  823. while ((line = reader.readLine()) != null) {
  824. if (line.contains(code))
  825. return false;
  826. }
  827. } catch (IOException e) {
  828. e.printStackTrace();
  829. }
  830. return true;
  831. }
  832.  
  833. public void drainRunEnergy() {
  834. setRunEnergy(runEnergy - 1);
  835. }
  836.  
  837. @Override
  838. public void finish() {
  839. finish(0);
  840. }
  841.  
  842. public void finish(final int tryCount) {
  843. if (finishing || hasFinished()) {
  844. if (World.containsPlayer(username)) {
  845. World.removePlayer(this);
  846. }
  847. if (World.containsLobbyPlayer(username)) {
  848. World.removeLobbyPlayer(this);
  849. }
  850. return;
  851. }
  852. finishing = true;
  853. // if combating doesnt stop when xlog this way ends combat
  854. if (!World.containsLobbyPlayer(username)) {
  855. stopAll(false, true,
  856. !(actionManager.getAction() instanceof PlayerCombat));
  857. }
  858. long currentTime = Utils.currentTimeMillis();
  859. if ((getAttackedByDelay() + 10000 > currentTime && tryCount < 6)
  860. || getEmotesManager().getNextEmoteEnd() >= currentTime
  861. || lockDelay >= currentTime || isDead()) {
  862. CoresManager.slowExecutor.schedule(new Runnable() {
  863. @Override
  864. public void run() {
  865. try {
  866. packetsDecoderPing = Utils.currentTimeMillis();
  867. finishing = false;
  868. finish(tryCount + 1);
  869. } catch (Throwable e) {
  870. Logger.handle(e);
  871. }
  872. }
  873. }, 10, TimeUnit.SECONDS);
  874. return;
  875. }
  876. realFinish();
  877. }
  878.  
  879. public void forceLogout() {
  880. getPackets().sendLogout(false);
  881. setRunning(false);
  882. realFinish();
  883. }
  884.  
  885. public void forceSession() {
  886. setRunning(false);
  887. realFinish();
  888. }
  889.  
  890. public ActionManager getActionManager() {
  891. return actionManager;
  892. }
  893.  
  894. public Appearence getAppearence() {
  895. return appearence;
  896. }
  897.  
  898. public int getAssistStatus() {
  899. return assistStatus;
  900. }
  901.  
  902. public void setAssistStatus(int assistStatus) {
  903. this.assistStatus = assistStatus;
  904. }
  905.  
  906. public AuraManager getAuraManager() {
  907. return auraManager;
  908. }
  909.  
  910. public Bank getBank() {
  911. return bank;
  912. }
  913.  
  914. public long getBanned() {
  915. return banned;
  916. }
  917.  
  918. public void setBanned(long banned) {
  919. this.banned = banned;
  920. }
  921.  
  922. public int getBarbarianAdvancedLaps() {
  923. return barbarianAdvancedLaps;
  924. }
  925.  
  926. public void setBarbarianAdvancedLaps(int barbarianAdvancedLaps) {
  927. this.barbarianAdvancedLaps = barbarianAdvancedLaps;
  928. }
  929.  
  930. public int getBarrowsKillCount() {
  931. return barrowsKillCount;
  932. }
  933.  
  934. public int getBarsDone() {
  935. return barsDone;
  936. }
  937.  
  938. public void setBarsDone(int barsDone) {
  939. this.barsDone = barsDone;
  940. }
  941.  
  942. public long getBoneDelay() {
  943. return boneDelay;
  944. }
  945.  
  946. public BountyHunter getBountyHunter() {
  947. return bountyHunter;
  948. }
  949.  
  950. public ChargesManager getCharges() {
  951. return charges;
  952. }
  953.  
  954. public int getClanStatus() {
  955. return clanStatus;
  956. }
  957.  
  958. public void setClanStatus(int clanStatus) {
  959. this.clanStatus = clanStatus;
  960. }
  961.  
  962. public int getClueReward() {
  963. return clueReward;
  964. }
  965.  
  966. public void setClueReward(int clueReward) {
  967. this.clueReward = clueReward;
  968. }
  969.  
  970. public CombatDefinitions getCombatDefinitions() {
  971. return combatDefinitions;
  972. }
  973.  
  974. public int[] getCompletionistCapeCustomized() {
  975. return completionistCapeCustomized;
  976. }
  977.  
  978. public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
  979. this.completionistCapeCustomized = skillcapeCustomized;
  980. }
  981.  
  982. public ControlerManager getControlerManager() {
  983. return controlerManager;
  984. }
  985.  
  986. public long getCreationDate() {
  987. return creationDate;
  988. }
  989.  
  990. public void setCreationDate(long creationDate) {
  991. this.creationDate = creationDate;
  992. }
  993.  
  994. public int getCrucibleHighScore() {
  995. return crucibleHighScore;
  996. }
  997.  
  998. public FriendChatsManager getCurrentFriendChat() {
  999. return currentFriendChat;
  1000. }
  1001.  
  1002. public void setCurrentFriendChat(FriendChatsManager currentFriendChat) {
  1003. this.currentFriendChat = currentFriendChat;
  1004. }
  1005.  
  1006. public String getCurrentFriendChatOwner() {
  1007. return currentFriendChatOwner;
  1008. }
  1009.  
  1010. public void setCurrentFriendChatOwner(String currentFriendChatOwner) {
  1011. this.currentFriendChatOwner = currentFriendChatOwner;
  1012. }
  1013.  
  1014. public String getCurrentMac() {
  1015. return currentMac;
  1016. }
  1017.  
  1018. public void setCurrentMac(String currentMac) {
  1019. this.currentMac = currentMac;
  1020. }
  1021.  
  1022. public int getCurrentWorldLobby() {
  1023. return currentWorldLobby;
  1024. }
  1025.  
  1026. public void setCurrentWorldLobby(int currentWorldLobby) {
  1027. this.currentWorldLobby = currentWorldLobby;
  1028. }
  1029.  
  1030. public String getCustomTitle() {
  1031. return customTitle;
  1032. }
  1033.  
  1034. public void setCustomTitle(String customTitle) {
  1035. this.customTitle = customTitle;
  1036. }
  1037.  
  1038. public CutscenesManager getCutscenesManager() {
  1039. return cutscenesManager;
  1040. }
  1041.  
  1042. // LOL, bad way to do it, dont complain
  1043.  
  1044. public int getDeathCount() {
  1045. return deathCount;
  1046. }
  1047.  
  1048. public int getdfscoolDown() {
  1049. return dfscoolDown;
  1050. }
  1051.  
  1052. public DialogueManager getDialogueManager() {
  1053. return dialogueManager;
  1054. }
  1055.  
  1056. public int getDisplayMode() {
  1057. return displayMode;
  1058. }
  1059.  
  1060. public void setDisplayMode(int displayMode) {
  1061. this.displayMode = displayMode;
  1062. }
  1063.  
  1064. public String getDisplayName() {
  1065. if (displayName != null)
  1066. return displayName;
  1067. return Utils.formatPlayerNameForDisplay(username);
  1068. }
  1069.  
  1070. public void setDisplayName(String displayName) {
  1071. this.displayName = displayName;
  1072. }
  1073.  
  1074. public long getDisplayTime() {
  1075. return displayTime;
  1076. }
  1077.  
  1078. public int getDominionFactor() {
  1079. return dominionFactor;
  1080. }
  1081.  
  1082. public void setDominionFactor(int dominionFactor) {
  1083. this.dominionFactor = dominionFactor;
  1084. }
  1085.  
  1086. public DominionTower getDominionTower() {
  1087. return dominionTower;
  1088. }
  1089.  
  1090. @SuppressWarnings("deprecation")
  1091. public String getPremiumBronzeTill() {
  1092. return (premiumBronze ? "never" : new Date(premiumBronzeTill)
  1093. .toGMTString()) + ".";
  1094. }
  1095.  
  1096. public DuelArena getDuelArena() {
  1097. return duelarena;
  1098. }
  1099.  
  1100. public int getDungeoneeringTokens() {
  1101. return dungeoneeringTokens;
  1102. }
  1103.  
  1104. public void setDungeoneeringTokens(int dungeoneeringTokens) {
  1105. this.dungeoneeringTokens = dungeoneeringTokens;
  1106. }
  1107.  
  1108. public int getEasterPoints() {
  1109. return easterPoints;
  1110. }
  1111.  
  1112. public void setEasterPoints(int easterPoints) {
  1113. this.easterPoints = easterPoints;
  1114. }
  1115.  
  1116. public String getEmailAttached() {
  1117. return email;
  1118. }
  1119.  
  1120. public void setEmailAttached(String email) {
  1121. this.email = email;
  1122. }
  1123.  
  1124. public EmotesManager getEmotesManager() {
  1125. return emotesManager;
  1126. }
  1127.  
  1128. public String getEnteredBankPin() {
  1129. return enteredPinString;
  1130. }
  1131.  
  1132. public void setEnteredBankPin(String enteredPinString) {
  1133. this.enteredPinString = enteredPinString;
  1134. }
  1135.  
  1136. public Equipment getEquipment() {
  1137. return equipment;
  1138. }
  1139.  
  1140. @SuppressWarnings("deprecation")
  1141. public String getPremiumTill() {
  1142. return (premiumSilver ? "never" : new Date(premiumTill).toGMTString())
  1143. + ".";
  1144. }
  1145.  
  1146. public int[] getFairyRingCombination() {
  1147. return fairyRingCombination;
  1148. }
  1149.  
  1150. public Familiar getFamiliar() {
  1151. return familiar;
  1152. }
  1153.  
  1154. public void setFamiliar(Familiar familiar) {
  1155. this.familiar = familiar;
  1156. }
  1157.  
  1158. public FarmingManager getFarming() {
  1159. return farmingManager;
  1160. }
  1161.  
  1162. public long getFireImmune() {
  1163. return fireImmune;
  1164. }
  1165.  
  1166. public long getFoodDelay() {
  1167. return foodDelay;
  1168. }
  1169.  
  1170. public FriendsIgnores getFriendsIgnores() {
  1171. return friendsIgnores;
  1172. }
  1173.  
  1174. public int getGnomeAdvancedLaps() {
  1175. return gnomeAdvancedLaps;
  1176. }
  1177.  
  1178. public void setGnomeAdvancedLaps(int gnomeAdvancedLaps) {
  1179. this.gnomeAdvancedLaps = gnomeAdvancedLaps;
  1180. }
  1181.  
  1182. public int getHiddenBrother() {
  1183. return hiddenBrother;
  1184. }
  1185.  
  1186. public void setHiddenBrother(int hiddenBrother) {
  1187. this.hiddenBrother = hiddenBrother;
  1188. }
  1189.  
  1190. public HintIconsManager getHintIconsManager() {
  1191. return hintIconsManager;
  1192. }
  1193.  
  1194. public double getHpBoostMultiplier() {
  1195. return hpBoostMultiplier;
  1196. }
  1197.  
  1198. public void setHpBoostMultiplier(double hpBoostMultiplier) {
  1199. this.hpBoostMultiplier = hpBoostMultiplier;
  1200. }
  1201.  
  1202. public InterfaceManager getInterfaceManager() {
  1203. return interfaceManager;
  1204. }
  1205.  
  1206. public Inventory getInventory() {
  1207. return inventory;
  1208. }
  1209.  
  1210. public IsaacKeyPair getIsaacKeyPair() {
  1211. return isaacKeyPair;
  1212. }
  1213.  
  1214. public boolean getIsInLobby() {
  1215. return isInLobby;
  1216. }
  1217.  
  1218. public void setIsInLobby(boolean isInLobby) {
  1219. this.isInLobby = isInLobby;
  1220. }
  1221.  
  1222. public long getJailed() {
  1223. return jailed;
  1224. }
  1225.  
  1226. public void setJailed(long jailed) {
  1227. this.jailed = jailed;
  1228. }
  1229.  
  1230. public int getKillCount() {
  1231. return killCount;
  1232. }
  1233.  
  1234. public boolean[] getKilledBarrowBrothers() {
  1235. return killedBarrowBrothers;
  1236. }
  1237.  
  1238. public int getLastBonfire() {
  1239. return lastBonfire;
  1240. }
  1241.  
  1242. public void setLastBonfire(int lastBonfire) {
  1243. this.lastBonfire = lastBonfire;
  1244. }
  1245.  
  1246. /**
  1247. * END RFD
  1248. */
  1249.  
  1250. public DuelRules getLastDuelRules() {
  1251. return lastDuelRules;
  1252. }
  1253.  
  1254. public void setLastDuelRules(DuelRules duelRules) {
  1255. this.lastDuelRules = duelRules;
  1256. }
  1257.  
  1258. public String getLastHostname() {
  1259. InetAddress addr;
  1260. try {
  1261. addr = InetAddress.getByName(getLastIP());
  1262. String hostname = addr.getHostName();
  1263. return hostname;
  1264. } catch (UnknownHostException e) {
  1265. e.printStackTrace();
  1266. }
  1267. return null;
  1268. }
  1269.  
  1270. public String getLastIP() {
  1271. return lastIP;
  1272. }
  1273.  
  1274. public void setLastIP(String lastIP) {
  1275. this.lastIP = lastIP;
  1276. }
  1277.  
  1278. public long getLastLoggedIn() {
  1279. // TODO Auto-generated method stub
  1280. return lastLoggedIn;
  1281. }
  1282.  
  1283. public String getLastMsg() {
  1284. return lastMsg;
  1285. }
  1286.  
  1287. public void setLastMsg(String lastMsg) {
  1288. this.lastMsg = lastMsg;
  1289. }
  1290.  
  1291. public long getLastPublicMessage() {
  1292. return lastPublicMessage;
  1293. }
  1294.  
  1295. public void setLastPublicMessage(long lastPublicMessage) {
  1296. this.lastPublicMessage = lastPublicMessage;
  1297. }
  1298.  
  1299. public long getLastRequestSQL() {
  1300. // TODO Auto-generated method stub
  1301. return lastRequestSQL;
  1302. }
  1303.  
  1304. public void setLastRequestSQL(long lastRequestSQL) {
  1305. // TODO Auto-generated method stub
  1306. this.lastRequestSQL = lastRequestSQL;
  1307.  
  1308. }
  1309.  
  1310. public long getLastWalked() {
  1311. // TODO Auto-generated method stub
  1312. return lastWalkedMillis;
  1313. }
  1314.  
  1315. public void setLastWalked(long lastWalkedMillis) {
  1316. // TODO Auto-generated method stub
  1317. this.lastWalkedMillis = lastWalkedMillis;
  1318. }
  1319.  
  1320. public int getLoadedLogs() {
  1321. return loadedLogs;
  1322. }
  1323.  
  1324. public void setLoadedLogs(int loadedLogs) {
  1325. this.loadedLogs = loadedLogs;
  1326. }
  1327.  
  1328. public LocalNPCUpdate getLocalNPCUpdate() {
  1329. return localNPCUpdate;
  1330. }
  1331.  
  1332. public LocalPlayerUpdate getLocalPlayerUpdate() {
  1333. return localPlayerUpdate;
  1334. }
  1335.  
  1336. public long getLockDelay() {
  1337. return lockDelay;
  1338. }
  1339.  
  1340. public int getLoggedInWorld() {
  1341. // TODO Auto-generated method stub
  1342. return loggedWorld;
  1343. }
  1344.  
  1345. public void setLoggedInWorld(int loggedWorld) {
  1346. this.loggedWorld = loggedWorld;
  1347. }
  1348.  
  1349. public int getLogsCut() {
  1350. return logsCut;
  1351. }
  1352.  
  1353. public void setLogsCut(int logsCut) {
  1354. this.logsCut = logsCut;
  1355. }
  1356.  
  1357. public LoyaltyManager getLoyaltyManager() {
  1358. return loyaltyManager;
  1359. }
  1360.  
  1361. public int getLoyaltyPoints() {
  1362. return Loyaltypoints;
  1363. }
  1364.  
  1365. public void setLoyaltyPoints(int Loyaltypoints) {
  1366. this.Loyaltypoints = Loyaltypoints;
  1367. }
  1368.  
  1369. @Override
  1370. public double getMagePrayerMultiplier() {
  1371. return 0.6;
  1372. }
  1373.  
  1374. public int getMagicLogsBurned() {
  1375. return magicLogsBurned;
  1376. }
  1377.  
  1378. public void setMagicLogsBurned(int magicLogsBurned) {
  1379. this.magicLogsBurned = magicLogsBurned;
  1380. }
  1381.  
  1382. public int[] getMaxedCapeCustomized() {
  1383. return maxedCapeCustomized;
  1384. }
  1385.  
  1386. public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
  1387. this.maxedCapeCustomized = maxedCapeCustomized;
  1388. }
  1389.  
  1390. @Override
  1391. public int getMaxHitpoints() {
  1392. return skills.getLevel(Skills.HITPOINTS) * 10
  1393. + equipment.getEquipmentHpIncrease();
  1394. }
  1395.  
  1396. @Override
  1397. public double getMeleePrayerMultiplier() {
  1398. return 0.6;
  1399. }
  1400.  
  1401. public int getMessageIcon() {
  1402. return getRights() == 2
  1403. || getRights() == 1 ? getRights()
  1404. : isModerator() ? 10
  1405. : isSupporter ? 14
  1406. : isPremiumGold() ? 12
  1407. : isPremiumSilver() ? 11
  1408. : isPremiumBronze() ? 8
  1409. : isIronman() ? 13
  1410. : isHardcoreIronman() ? 10
  1411. : getRights();
  1412. }
  1413.  
  1414. public MoneyPouch getMoneyPouch() {
  1415. return pouch;
  1416. }
  1417.  
  1418. public int getMoneyPouchValue() {
  1419. return money;
  1420. }
  1421.  
  1422. public void setMoneyPouchValue(int money) {
  1423. this.money = money;
  1424. }
  1425.  
  1426. public int getMovementType() {
  1427. if (getTemporaryMoveType() != -1)
  1428. return getTemporaryMoveType();
  1429. return getRun() ? RUN_MOVE_TYPE : WALK_MOVE_TYPE;
  1430. }
  1431.  
  1432. public MusicsManager getMusicsManager() {
  1433. return musicsManager;
  1434. }
  1435.  
  1436. public long getMuted() {
  1437. return muted;
  1438. }
  1439.  
  1440. public void setMuted(long muted) {
  1441. this.muted = muted;
  1442. }
  1443.  
  1444. public ArrayList<Notes.Note> getCurNotes() {
  1445. return pnotes;
  1446. }
  1447.  
  1448. public Notes getNotes() {
  1449. return notes;
  1450. }
  1451.  
  1452. public void setNotes(Notes notes) {
  1453. this.notes = notes;
  1454. }
  1455.  
  1456. public int getOverloadDelay() {
  1457. return overloadDelay;
  1458. }
  1459.  
  1460. public void setOverloadDelay(int overloadDelay) {
  1461. this.overloadDelay = overloadDelay;
  1462. }
  1463.  
  1464. public List<String> getOwnedObjectManagerKeys() {
  1465. if (ownedObjectsManagerKeys == null) // temporary
  1466. ownedObjectsManagerKeys = new LinkedList<String>();
  1467. return ownedObjectsManagerKeys;
  1468. }
  1469.  
  1470. public String getOwner() {
  1471. return Owner;
  1472. }
  1473.  
  1474. public WorldPacketsEncoder getPackets() {
  1475. return session.getWorldPackets();
  1476. }
  1477.  
  1478. public long getPacketsDecoderPing() {
  1479. return packetsDecoderPing;
  1480. }
  1481.  
  1482. public void setPacketsDecoderPing(long packetsDecoderPing) {
  1483. this.packetsDecoderPing = packetsDecoderPing;
  1484. }
  1485.  
  1486. public String getPassword() {
  1487. return password;
  1488. }
  1489.  
  1490. public void setPassword(String password) {
  1491. this.password = password;
  1492. }
  1493.  
  1494. public int getPestControlGames() {
  1495. return pestControlGames;
  1496. }
  1497.  
  1498. public void setPestControlGames(int pestControlGames) {
  1499. this.pestControlGames = pestControlGames;
  1500. }
  1501.  
  1502. public int getPestPoints() {
  1503. return pestPoints;
  1504. }
  1505.  
  1506. public void setPestPoints(int pestPoints) {
  1507. this.pestPoints = pestPoints;
  1508. }
  1509.  
  1510. /**
  1511. * Gets the pet.
  1512. *
  1513. * @return The pet.
  1514. */
  1515. public Pet getPet() {
  1516. return pet;
  1517. }
  1518.  
  1519. /**
  1520. * Sets the pet.
  1521. *
  1522. * @param pet The pet to set.
  1523. */
  1524. public void setPet(Pet pet) {
  1525. this.pet = pet;
  1526. }
  1527.  
  1528. /**
  1529. * Gets the petManager.
  1530. *
  1531. * @return The petManager.
  1532. */
  1533. public PetManager getPetManager() {
  1534. return petManager;
  1535. }
  1536.  
  1537. /**
  1538. * Sets the petManager.
  1539. *
  1540. * @param petManager The petManager to set.
  1541. */
  1542. public void setPetManager(PetManager petManager) {
  1543. this.petManager = petManager;
  1544. }
  1545.  
  1546. public int getPkPoints() {
  1547. return pkPoints;
  1548. }
  1549.  
  1550. public void setPkPoints(int pkPoints) {
  1551. this.pkPoints = pkPoints;
  1552. }
  1553.  
  1554. public long getPoisonImmune() {
  1555. return poisonImmune;
  1556. }
  1557.  
  1558. public long getPolDelay() {
  1559. return polDelay;
  1560. }
  1561.  
  1562. public void setPolDelay(long delay) {
  1563. this.polDelay = delay;
  1564. }
  1565.  
  1566. public long getPotDelay() {
  1567. return potDelay;
  1568. }
  1569.  
  1570. public int[] getPouches() {
  1571. return pouches;
  1572. }
  1573.  
  1574. public Prayer getPrayer() {
  1575. return prayer;
  1576. }
  1577.  
  1578. public long getPrayerDelay() {
  1579. Long teleblock = (Long) getTemporaryAttributtes().get("PrayerBlocked");
  1580. if (teleblock == null)
  1581. return 0;
  1582. return teleblock;
  1583. }
  1584.  
  1585. public void setPrayerDelay(long teleDelay) {
  1586. getTemporaryAttributtes().put("PrayerBlocked",
  1587. teleDelay + Utils.currentTimeMillis());
  1588. prayer.closeAllPrayers();
  1589. }
  1590.  
  1591. public String getPrefix() {
  1592. return yellPrefix;
  1593. }
  1594.  
  1595. public void setPrefix(String yellPrefix) {
  1596. this.yellPrefix = yellPrefix;
  1597. }
  1598.  
  1599. public int getPrestige() {
  1600. return prestige;
  1601. }
  1602.  
  1603. public void setPrestige(int prestige) {
  1604. this.prestige = prestige;
  1605. }
  1606.  
  1607. public PriceCheckManager getPriceCheckManager() {
  1608. return priceCheckManager;
  1609. }
  1610.  
  1611. public int getPrivateChatSetup() {
  1612. return privateChatSetup;
  1613. }
  1614.  
  1615. public void setPrivateChatSetup(int privateChatSetup) {
  1616. this.privateChatSetup = privateChatSetup;
  1617. }
  1618.  
  1619. public int getPublicStatus() {
  1620. return publicStatus;
  1621. }
  1622.  
  1623. public void setPublicStatus(int publicStatus) {
  1624. this.publicStatus = publicStatus;
  1625. }
  1626.  
  1627. public int getPvmPoints() {
  1628. return pvmPoints;
  1629. }
  1630.  
  1631. public void setPvmPoints(int pvmPoints) {
  1632. this.pvmPoints = pvmPoints;
  1633. }
  1634.  
  1635. public QuestManager getQuestManager() {
  1636. return questManager;
  1637. }
  1638.  
  1639. @Override
  1640. public double getRangePrayerMultiplier() {
  1641. return 0.6;
  1642. }
  1643.  
  1644. public String getRecovAnswer() {
  1645. return recovAnswer;
  1646. }
  1647.  
  1648. public void setRecovAnswer(String recovAnswer) {
  1649. this.recovAnswer = recovAnswer;
  1650. }
  1651.  
  1652. public String getRecovQuestion() {
  1653. return recovQuestion;
  1654. }
  1655.  
  1656. public void setRecovQuestion(String recovQuestion) {
  1657. this.recovQuestion = recovQuestion;
  1658. }
  1659.  
  1660. public String getRegisteredMac() {
  1661. return registeredMac;
  1662. }
  1663.  
  1664. public void setRegisteredMac(String registeredMac) {
  1665. this.registeredMac = registeredMac;
  1666. }
  1667.  
  1668. public int getRights() {
  1669. return rights;
  1670. }
  1671.  
  1672. public void setRights(int rights) {
  1673. this.rights = rights;
  1674. appearence.generateAppearenceData();
  1675. }
  1676.  
  1677. public int getRocktailsCooked() {
  1678. return rocktailsCooked;
  1679. }
  1680.  
  1681. public void setRocktailsCooked(int rocktailsCooked) {
  1682. this.rocktailsCooked = rocktailsCooked;
  1683. }
  1684.  
  1685. public byte getRunEnergy() {
  1686. return runEnergy;
  1687. }
  1688.  
  1689. public void setRunEnergy(int runEnergy) {
  1690. this.runEnergy = (byte) runEnergy;
  1691. getPackets().sendRunEnergy();
  1692. }
  1693.  
  1694. /**
  1695. * @return the runeSpanPoint
  1696. */
  1697.  
  1698. public int getScreenHeight() {
  1699. return screenHeight;
  1700. }
  1701.  
  1702. public void setScreenHeight(int screenHeight) {
  1703. this.screenHeight = screenHeight;
  1704. }
  1705.  
  1706. public int getScreenWidth() {
  1707. return screenWidth;
  1708. }
  1709.  
  1710. public void setScreenWidth(int screenWidth) {
  1711. this.screenWidth = screenWidth;
  1712. }
  1713.  
  1714. public Session getSession() {
  1715. return session;
  1716. }
  1717.  
  1718. public String getShadColor() {
  1719. return yellShade;
  1720. }
  1721.  
  1722. @Override
  1723. public int getSize() {
  1724. return appearence.getSize();
  1725. }
  1726.  
  1727. public Skills getSkills() {
  1728. return skills;
  1729. }
  1730.  
  1731. public int getSkullId() {
  1732. return skullId;
  1733. }
  1734.  
  1735. public void setSkullId(int skullId) {
  1736. this.skullId = skullId;
  1737. }
  1738.  
  1739. public int getSpecRestoreTimer() {
  1740. return specRestoreTimer;
  1741. }
  1742.  
  1743. public void setSpecRestoreTimer(int specRestoreTimer) {
  1744. this.specRestoreTimer = specRestoreTimer;
  1745. }
  1746.  
  1747. public int getSpins() {
  1748. return spins;
  1749. }
  1750.  
  1751. public void setSpins(int spins) {
  1752. this.spins = spins;
  1753. }
  1754.  
  1755. public int getSummoningLeftClickOption() {
  1756. return summoningLeftClickOption;
  1757. }
  1758.  
  1759. public void setSummoningLeftClickOption(int summoningLeftClickOption) {
  1760. this.summoningLeftClickOption = summoningLeftClickOption;
  1761. }
  1762.  
  1763. public List<Integer> getSwitchItemCache() {
  1764. return switchItemCache;
  1765. }
  1766.  
  1767. public void setSwitchItemCache(List<Integer> switchItemCache) {
  1768. this.switchItemCache = switchItemCache;
  1769. }
  1770.  
  1771. public long getTeleBlockDelay() {
  1772. Long teleblock = (Long) getTemporaryAttributtes().get("TeleBlocked");
  1773. if (teleblock == null)
  1774. return 0;
  1775. return teleblock;
  1776. }
  1777.  
  1778. public void setTeleBlockDelay(long teleDelay) {
  1779. getTemporaryAttributtes().put("TeleBlocked",
  1780. teleDelay + Utils.currentTimeMillis());
  1781. }
  1782.  
  1783. public int getTemporaryMovementType() {
  1784. return temporaryMovementType;
  1785. }
  1786.  
  1787. public void setTemporaryMovementType(int temporaryMovementType) {
  1788. this.temporaryMovementType = temporaryMovementType;
  1789. }
  1790.  
  1791. public int getTemporaryMoveType() {
  1792. return getTemporaryMovementType();
  1793. }
  1794.  
  1795. public void setTemporaryMoveType(int temporaryMovementType) {
  1796. this.setTemporaryMovementType(temporaryMovementType);
  1797. }
  1798.  
  1799. public String getTitle() {
  1800. return Title;
  1801. }
  1802.  
  1803. public void setTitle(String Title) {
  1804. this.Title = Title;
  1805. }
  1806.  
  1807. public String getTitleColor() {
  1808. return titleColor;
  1809. }
  1810.  
  1811. public Trade getTrade() {
  1812. return trade;
  1813. }
  1814.  
  1815. public int getTradeStatus() {
  1816. return tradeStatus;
  1817. }
  1818.  
  1819. public void setTradeStatus(int tradeStatus) {
  1820. this.tradeStatus = tradeStatus;
  1821. }
  1822.  
  1823. public int getUniquePlayerId() {
  1824. return uniquePlayerId;
  1825. }
  1826.  
  1827. public void setUniquePlayerId(int uniquePlayerId) {
  1828. this.uniquePlayerId = uniquePlayerId;
  1829. }
  1830.  
  1831. public String getUsername() {
  1832. return username;
  1833. }
  1834.  
  1835. /*
  1836. * do not use this, only used by pm
  1837. */
  1838. public void setUsername(String username) {
  1839. this.username = username;
  1840. }
  1841.  
  1842. public int getVecnaTimer() {
  1843. return vecnaTimer;
  1844. }
  1845.  
  1846. public void setVecnaTimer(int vecnaTimer) {
  1847. this.vecnaTimer = vecnaTimer;
  1848. }
  1849.  
  1850. public int getVotePoints() {
  1851. return votePoints;
  1852. }
  1853.  
  1854. public void setVotePoints(int votePoints) {
  1855. this.votePoints = votePoints;
  1856. }
  1857.  
  1858. public String getYellColor() {
  1859. return yellColor;
  1860. }
  1861.  
  1862. public void setYellColor(String yellColor) {
  1863. this.yellColor = yellColor;
  1864. }
  1865.  
  1866. public long getYellDelay() {
  1867. return yellDelay;
  1868. }
  1869.  
  1870. public void setYellDelay(long l) {
  1871. yellDelay = l;
  1872. }
  1873.  
  1874. @Override
  1875. public void handleIngoingHit(final Hit hit) {
  1876. if (hit.getLook() != HitLook.MELEE_DAMAGE
  1877. && hit.getLook() != HitLook.RANGE_DAMAGE
  1878. && hit.getLook() != HitLook.MAGIC_DAMAGE)
  1879. return;
  1880. if (invulnerable) {
  1881. hit.setDamage(0);
  1882. return;
  1883. }
  1884. if (auraManager.usingPenance()) {
  1885. int amount = (int) (hit.getDamage() * 0.2);
  1886. if (amount > 0)
  1887. prayer.restorePrayer(amount);
  1888. }
  1889. Entity source = hit.getSource();
  1890. if (source == null)
  1891. return;
  1892. if (polDelay > Utils.currentTimeMillis())
  1893. hit.setDamage((int) (hit.getDamage() * 0.5));
  1894. if (prayer.hasPrayersOn() && hit.getDamage() != 0) {
  1895. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  1896. if (prayer.usingPrayer(0, 17))
  1897. hit.setDamage((int) (hit.getDamage() * source
  1898. .getMagePrayerMultiplier()));
  1899. else if (prayer.usingPrayer(1, 7)) {
  1900. int deflectedDamage = source instanceof Nex ? 0
  1901. : (int) (hit.getDamage() * 0.1);
  1902. hit.setDamage((int) (hit.getDamage() * source
  1903. .getMagePrayerMultiplier()));
  1904. if (deflectedDamage > 0) {
  1905. source.applyHit(new Hit(this, deflectedDamage,
  1906. HitLook.REFLECTED_DAMAGE));
  1907. setNextGraphics(new Graphics(2228));
  1908. setNextAnimation(new Animation(12573));
  1909. }
  1910. }
  1911. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  1912. if (prayer.usingPrayer(0, 18))
  1913. hit.setDamage((int) (hit.getDamage() * source
  1914. .getRangePrayerMultiplier()));
  1915. else if (prayer.usingPrayer(1, 8)) {
  1916. int deflectedDamage = source instanceof Nex ? 0
  1917. : (int) (hit.getDamage() * 0.1);
  1918. hit.setDamage((int) (hit.getDamage() * source
  1919. .getRangePrayerMultiplier()));
  1920. if (deflectedDamage > 0) {
  1921. source.applyHit(new Hit(this, deflectedDamage,
  1922. HitLook.REFLECTED_DAMAGE));
  1923. setNextGraphics(new Graphics(2229));
  1924. setNextAnimation(new Animation(12573));
  1925. }
  1926. }
  1927. } else if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  1928. if (prayer.usingPrayer(0, 19))
  1929. hit.setDamage((int) (hit.getDamage() * source
  1930. .getMeleePrayerMultiplier()));
  1931. else if (prayer.usingPrayer(1, 9)) {
  1932. int deflectedDamage = source instanceof Nex ? 0
  1933. : (int) (hit.getDamage() * 0.1);
  1934. hit.setDamage((int) (hit.getDamage() * source
  1935. .getMeleePrayerMultiplier()));
  1936. if (deflectedDamage > 0) {
  1937. source.applyHit(new Hit(this, deflectedDamage,
  1938. HitLook.REFLECTED_DAMAGE));
  1939. setNextGraphics(new Graphics(2230));
  1940. setNextAnimation(new Animation(12573));
  1941. }
  1942. }
  1943. }
  1944. }
  1945. if (hit.getDamage() >= 200) {
  1946. if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  1947. int reducedDamage = hit.getDamage()
  1948. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MELEE_BONUS]
  1949. / 100;
  1950. if (reducedDamage > 0) {
  1951. hit.setDamage(hit.getDamage() - reducedDamage);
  1952. hit.setSoaking(new Hit(source, reducedDamage,
  1953. HitLook.ABSORB_DAMAGE));
  1954. }
  1955. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  1956. int reducedDamage = hit.getDamage()
  1957. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_RANGE_BONUS]
  1958. / 100;
  1959. if (reducedDamage > 0) {
  1960. hit.setDamage(hit.getDamage() - reducedDamage);
  1961. hit.setSoaking(new Hit(source, reducedDamage,
  1962. HitLook.ABSORB_DAMAGE));
  1963. }
  1964. } else if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  1965. int reducedDamage = hit.getDamage()
  1966. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MAGE_BONUS]
  1967. / 100;
  1968. if (reducedDamage > 0) {
  1969. hit.setDamage(hit.getDamage() - reducedDamage);
  1970. hit.setSoaking(new Hit(source, reducedDamage,
  1971. HitLook.ABSORB_DAMAGE));
  1972. }
  1973. }
  1974. }
  1975. int shieldId = equipment.getShieldId();
  1976. if (shieldId == 13742 || shieldId == 23699) { // elsyian
  1977. if (Utils.getRandom(100) <= 70)
  1978. hit.setDamage((int) (hit.getDamage() * 0.75));
  1979. } else if (shieldId == 13740 || shieldId == 23698) { // divine
  1980. int drain = (int) (Math.ceil(hit.getDamage() * 0.3) / 2);
  1981. if (prayer.getPrayerpoints() >= drain) {
  1982. hit.setDamage((int) (hit.getDamage() * 0.70));
  1983. prayer.drainPrayer(drain);
  1984. }
  1985. }
  1986. if (castedVeng && hit.getDamage() >= 4) {
  1987. castedVeng = false;
  1988. setNextForceTalk(new ForceTalk("Taste vengeance!"));
  1989. source.applyHit(new Hit(this, (int) (hit.getDamage() * 0.75),
  1990. HitLook.REGULAR_DAMAGE));
  1991. }
  1992. if (source instanceof Player) {
  1993. final Player p2 = (Player) source;
  1994. if (getControlerManager().getControler() instanceof FistOfGuthixGame) {
  1995. FistOfGuthixGame controler = (FistOfGuthixGame) getControlerManager()
  1996. .getControler();
  1997. if (controler != null) {
  1998. if (controler.hunter) {
  1999. hit.setDamage((int) (hit.getDamage() * 0.6));
  2000. // System.out.println("Recieved lowered hits from the huntedby.");
  2001. }
  2002. }
  2003. }
  2004. if (p2.prayer.hasPrayersOn()) {
  2005. if (p2.prayer.usingPrayer(0, 24)) { // smite
  2006. int drain = hit.getDamage() / 4;
  2007. if (drain > 0)
  2008. prayer.drainPrayer(drain);
  2009. } else {
  2010. if (hit.getDamage() == 0)
  2011. return;
  2012. if (!p2.prayer.isBoostedLeech()) {
  2013. if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2014. if (p2.prayer.usingPrayer(1, 19)) {
  2015. if (Utils.getRandom(4) == 0) {
  2016. p2.prayer.increaseTurmoilBonus(this);
  2017. p2.prayer.setBoostedLeech(true);
  2018. return;
  2019. }
  2020. } else if (p2.prayer.usingPrayer(1, 1)) { // sap att
  2021. if (Utils.getRandom(4) == 0) {
  2022. if (p2.prayer.reachedMax(0)) {
  2023. p2.getPackets()
  2024. .sendGameMessage(
  2025. "Your opponent has been weakened so much that your sap curse has no effect.",
  2026. true);
  2027. } else {
  2028. p2.prayer.increaseLeechBonus(0);
  2029. p2.getPackets()
  2030. .sendGameMessage(
  2031. "Your curse drains Attack from the enemy, boosting your Attack.",
  2032. true);
  2033. }
  2034. p2.setNextAnimation(new Animation(12569));
  2035. p2.setNextGraphics(new Graphics(2214));
  2036. p2.prayer.setBoostedLeech(true);
  2037. World.sendProjectile(p2, this, 2215, 35,
  2038. 35, 20, 5, 0, 0);
  2039. WorldTasksManager.schedule(new WorldTask() {
  2040. @Override
  2041. public void run() {
  2042. setNextGraphics(new Graphics(2216));
  2043. }
  2044. }, 1);
  2045. return;
  2046. }
  2047. } else {
  2048. if (p2.prayer.usingPrayer(1, 10)) {
  2049. if (Utils.getRandom(7) == 0) {
  2050. if (p2.prayer.reachedMax(3)) {
  2051. p2.getPackets()
  2052. .sendGameMessage(
  2053. "Your opponent has been weakened so much that your leech curse has no effect.",
  2054. true);
  2055. } else {
  2056. p2.prayer.increaseLeechBonus(3);
  2057. p2.getPackets()
  2058. .sendGameMessage(
  2059. "Your curse drains Attack from the enemy, boosting your Attack.",
  2060. true);
  2061. }
  2062. p2.setNextAnimation(new Animation(12575));
  2063. p2.prayer.setBoostedLeech(true);
  2064. World.sendProjectile(p2, this, 2231,
  2065. 35, 35, 20, 5, 0, 0);
  2066. WorldTasksManager.schedule(
  2067. new WorldTask() {
  2068. @Override
  2069. public void run() {
  2070. setNextGraphics(new Graphics(
  2071. 2232));
  2072. }
  2073. }, 1);
  2074. return;
  2075. }
  2076. }
  2077. if (p2.prayer.usingPrayer(1, 14)) {
  2078. if (Utils.getRandom(7) == 0) {
  2079. if (p2.prayer.reachedMax(7)) {
  2080. p2.getPackets()
  2081. .sendGameMessage(
  2082. "Your opponent has been weakened so much that your leech curse has no effect.",
  2083. true);
  2084. } else {
  2085. p2.prayer.increaseLeechBonus(7);
  2086. p2.getPackets()
  2087. .sendGameMessage(
  2088. "Your curse drains Strength from the enemy, boosting your Strength.",
  2089. true);
  2090. }
  2091. p2.setNextAnimation(new Animation(12575));
  2092. p2.prayer.setBoostedLeech(true);
  2093. World.sendProjectile(p2, this, 2248,
  2094. 35, 35, 20, 5, 0, 0);
  2095. WorldTasksManager.schedule(
  2096. new WorldTask() {
  2097. @Override
  2098. public void run() {
  2099. setNextGraphics(new Graphics(
  2100. 2250));
  2101. }
  2102. }, 1);
  2103. return;
  2104. }
  2105. }
  2106.  
  2107. }
  2108. }
  2109. if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2110. if (p2.prayer.usingPrayer(1, 2)) { // sap range
  2111. if (Utils.getRandom(4) == 0) {
  2112. if (p2.prayer.reachedMax(1)) {
  2113. p2.getPackets()
  2114. .sendGameMessage(
  2115. "Your opponent has been weakened so much that your sap curse has no effect.",
  2116. true);
  2117. } else {
  2118. p2.prayer.increaseLeechBonus(1);
  2119. p2.getPackets()
  2120. .sendGameMessage(
  2121. "Your curse drains Range from the enemy, boosting your Range.",
  2122. true);
  2123. }
  2124. p2.setNextAnimation(new Animation(12569));
  2125. p2.setNextGraphics(new Graphics(2217));
  2126. p2.prayer.setBoostedLeech(true);
  2127. World.sendProjectile(p2, this, 2218, 35,
  2128. 35, 20, 5, 0, 0);
  2129. WorldTasksManager.schedule(new WorldTask() {
  2130. @Override
  2131. public void run() {
  2132. setNextGraphics(new Graphics(2219));
  2133. }
  2134. }, 1);
  2135. return;
  2136. }
  2137. } else if (p2.prayer.usingPrayer(1, 11)) {
  2138. if (Utils.getRandom(7) == 0) {
  2139. if (p2.prayer.reachedMax(4)) {
  2140. p2.getPackets()
  2141. .sendGameMessage(
  2142. "Your opponent has been weakened so much that your leech curse has no effect.",
  2143. true);
  2144. } else {
  2145. p2.prayer.increaseLeechBonus(4);
  2146. p2.getPackets()
  2147. .sendGameMessage(
  2148. "Your curse drains Range from the enemy, boosting your Range.",
  2149. true);
  2150. }
  2151. p2.setNextAnimation(new Animation(12575));
  2152. p2.prayer.setBoostedLeech(true);
  2153. World.sendProjectile(p2, this, 2236, 35,
  2154. 35, 20, 5, 0, 0);
  2155. WorldTasksManager.schedule(new WorldTask() {
  2156. @Override
  2157. public void run() {
  2158. setNextGraphics(new Graphics(2238));
  2159. }
  2160. });
  2161. return;
  2162. }
  2163. }
  2164. }
  2165. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2166. if (p2.prayer.usingPrayer(1, 3)) { // sap mage
  2167. if (Utils.getRandom(4) == 0) {
  2168. if (p2.prayer.reachedMax(2)) {
  2169. p2.getPackets()
  2170. .sendGameMessage(
  2171. "Your opponent has been weakened so much that your sap curse has no effect.",
  2172. true);
  2173. } else {
  2174. p2.prayer.increaseLeechBonus(2);
  2175. p2.getPackets()
  2176. .sendGameMessage(
  2177. "Your curse drains Magic from the enemy, boosting your Magic.",
  2178. true);
  2179. }
  2180. p2.setNextAnimation(new Animation(12569));
  2181. p2.setNextGraphics(new Graphics(2220));
  2182. p2.prayer.setBoostedLeech(true);
  2183. World.sendProjectile(p2, this, 2221, 35,
  2184. 35, 20, 5, 0, 0);
  2185. WorldTasksManager.schedule(new WorldTask() {
  2186. @Override
  2187. public void run() {
  2188. setNextGraphics(new Graphics(2222));
  2189. }
  2190. }, 1);
  2191. return;
  2192. }
  2193. } else if (p2.prayer.usingPrayer(1, 12)) {
  2194. if (Utils.getRandom(7) == 0) {
  2195. if (p2.prayer.reachedMax(5)) {
  2196. p2.getPackets()
  2197. .sendGameMessage(
  2198. "Your opponent has been weakened so much that your leech curse has no effect.",
  2199. true);
  2200. } else {
  2201. p2.prayer.increaseLeechBonus(5);
  2202. p2.getPackets()
  2203. .sendGameMessage(
  2204. "Your curse drains Magic from the enemy, boosting your Magic.",
  2205. true);
  2206. }
  2207. p2.setNextAnimation(new Animation(12575));
  2208. p2.prayer.setBoostedLeech(true);
  2209. World.sendProjectile(p2, this, 2240, 35,
  2210. 35, 20, 5, 0, 0);
  2211. WorldTasksManager.schedule(new WorldTask() {
  2212. @Override
  2213. public void run() {
  2214. setNextGraphics(new Graphics(2242));
  2215. }
  2216. }, 1);
  2217. return;
  2218. }
  2219. }
  2220. }
  2221.  
  2222. // overall
  2223.  
  2224. if (p2.prayer.usingPrayer(1, 13)) { // leech defence
  2225. if (Utils.getRandom(10) == 0) {
  2226. if (p2.prayer.reachedMax(6)) {
  2227. p2.getPackets()
  2228. .sendGameMessage(
  2229. "Your opponent has been weakened so much that your leech curse has no effect.",
  2230. true);
  2231. } else {
  2232. p2.prayer.increaseLeechBonus(6);
  2233. p2.getPackets()
  2234. .sendGameMessage(
  2235. "Your curse drains Defence from the enemy, boosting your Defence.",
  2236. true);
  2237. }
  2238. p2.setNextAnimation(new Animation(12575));
  2239. p2.prayer.setBoostedLeech(true);
  2240. World.sendProjectile(p2, this, 2244, 35, 35,
  2241. 20, 5, 0, 0);
  2242. WorldTasksManager.schedule(new WorldTask() {
  2243. @Override
  2244. public void run() {
  2245. setNextGraphics(new Graphics(2246));
  2246. }
  2247. }, 1);
  2248. return;
  2249. }
  2250. }
  2251.  
  2252. if (p2.prayer.usingPrayer(1, 15)) {
  2253. if (Utils.getRandom(10) == 0) {
  2254. if (getRunEnergy() <= 0) {
  2255. p2.getPackets()
  2256. .sendGameMessage(
  2257. "Your opponent has been weakened so much that your leech curse has no effect.",
  2258. true);
  2259. } else {
  2260. p2.setRunEnergy(p2.getRunEnergy() > 90 ? 100
  2261. : p2.getRunEnergy() + 10);
  2262. setRunEnergy(p2.getRunEnergy() > 10 ? getRunEnergy() - 10
  2263. : 0);
  2264. }
  2265. p2.setNextAnimation(new Animation(12575));
  2266. p2.prayer.setBoostedLeech(true);
  2267. World.sendProjectile(p2, this, 2256, 35, 35,
  2268. 20, 5, 0, 0);
  2269. WorldTasksManager.schedule(new WorldTask() {
  2270. @Override
  2271. public void run() {
  2272. setNextGraphics(new Graphics(2258));
  2273. }
  2274. }, 1);
  2275. return;
  2276. }
  2277. }
  2278.  
  2279. if (p2.prayer.usingPrayer(1, 16)) {
  2280. if (Utils.getRandom(10) == 0) {
  2281. if (combatDefinitions
  2282. .getSpecialAttackPercentage() <= 0) {
  2283. p2.getPackets()
  2284. .sendGameMessage(
  2285. "Your opponent has been weakened so much that your leech curse has no effect.",
  2286. true);
  2287. } else {
  2288. p2.combatDefinitions.restoreSpecialAttack();
  2289. combatDefinitions
  2290. .desecreaseSpecialAttack(10);
  2291. }
  2292. p2.setNextAnimation(new Animation(12575));
  2293. p2.prayer.setBoostedLeech(true);
  2294. World.sendProjectile(p2, this, 2252, 35, 35,
  2295. 20, 5, 0, 0);
  2296. WorldTasksManager.schedule(new WorldTask() {
  2297. @Override
  2298. public void run() {
  2299. setNextGraphics(new Graphics(2254));
  2300. }
  2301. }, 1);
  2302. return;
  2303. }
  2304. }
  2305.  
  2306. if (p2.prayer.usingPrayer(1, 4)) { // sap spec
  2307. if (Utils.getRandom(10) == 0) {
  2308. p2.setNextAnimation(new Animation(12569));
  2309. p2.setNextGraphics(new Graphics(2223));
  2310. p2.prayer.setBoostedLeech(true);
  2311. if (combatDefinitions
  2312. .getSpecialAttackPercentage() <= 0) {
  2313. p2.getPackets()
  2314. .sendGameMessage(
  2315. "Your opponent has been weakened so much that your sap curse has no effect.",
  2316. true);
  2317. } else {
  2318. combatDefinitions
  2319. .desecreaseSpecialAttack(10);
  2320. }
  2321. World.sendProjectile(p2, this, 2224, 35, 35,
  2322. 20, 5, 0, 0);
  2323. WorldTasksManager.schedule(new WorldTask() {
  2324. @Override
  2325. public void run() {
  2326. setNextGraphics(new Graphics(2225));
  2327. }
  2328. }, 1);
  2329. return;
  2330. }
  2331. }
  2332. }
  2333. }
  2334. }
  2335. } else {
  2336. NPC n = (NPC) source;
  2337. if (prayer.usingPrayer(1, 19)) {
  2338. if (Utils.getRandom(4) == 0) {
  2339. prayer.increaseTurmoilBonus(n);
  2340. prayer.setBoostedLeech(true);
  2341. }
  2342. }
  2343. if (n.getId() == 13448)
  2344. sendSoulSplit(hit, n);
  2345. if (n instanceof Glacor) {
  2346. Glacor glacor = (Glacor) n;
  2347. if (glacor.getEffect() == GlacorEffect.SAPPING) {
  2348. this.getPrayer().drainPrayer(
  2349. (int) Utils.getPercent(10, this.getPrayer()
  2350. .getPrayerpoints()));
  2351. }
  2352. } else if (n instanceof SappingGlacyte) {
  2353. this.getPrayer().drainPrayer(
  2354. (int) Utils.getPercent(5, this.getPrayer()
  2355. .getPrayerpoints()));
  2356. }
  2357. }
  2358. }
  2359.  
  2360. public boolean hasDisabledYell() {
  2361. return yellDisabled;
  2362. }
  2363.  
  2364. public boolean hasDisplayName() {
  2365. return displayName != null;
  2366. }
  2367.  
  2368. public boolean hasInstantSpecial(final int weaponId) {
  2369. switch (weaponId) {
  2370. case 4153:
  2371. case 15486:
  2372. case 22207:
  2373. case 22209:
  2374. case 22211:
  2375. case 22213:
  2376. case 1377:
  2377. case 13472:
  2378. case 35:// Excalibur
  2379. case 8280:
  2380. case 14632:
  2381. return true;
  2382. default:
  2383. return false;
  2384. }
  2385. }
  2386.  
  2387. public boolean hasLargeSceneView() {
  2388. return largeSceneView;
  2389. }
  2390.  
  2391. public boolean hasRecievedStarter() {
  2392. return setStarter;
  2393. }
  2394.  
  2395. public boolean hasSkull() {
  2396. return skullDelay > 0;
  2397. }
  2398.  
  2399. public boolean hasStarted() {
  2400. return started;
  2401. }
  2402.  
  2403. public boolean hasTalkedtoCook() {
  2404. return talkedtoCook;
  2405. }
  2406.  
  2407. @Override
  2408. public void heal(int ammount, int extra) {
  2409. super.heal(ammount, extra);
  2410. refreshHitPoints();
  2411. }
  2412.  
  2413. public void increaseKillCount(Player killed) {
  2414. if (lastKilled == killed.getUsername()) {
  2415. sendMessage("You haven't been awarded any pk points for killing; "
  2416. + killed.getDisplayName() + " twice.");
  2417. return;
  2418. }
  2419. killed.deathCount++;
  2420. PkRank.checkRank(killed);
  2421. lastKilled = killed.getUsername();
  2422. if (killed.getSession().getIP().equals(getSession().getIP()))
  2423. return;
  2424. int points = isPremiumGold() ? getPkPoints() + 15 : Wilderness.isAtWild(this) ? getPkPoints() + 10
  2425. : getPkPoints() + 3;
  2426. killCount++;
  2427. sendMessage("<shad=000000><col=ff0000>You have been awarded " + points
  2428. + " pk point for killing; " + killed.getDisplayName() + ".");
  2429. setPkPoints(points);
  2430. PkRank.checkRank(this);
  2431. }
  2432.  
  2433. public void init(Session session, String string, IsaacKeyPair isaacKeyPair) {
  2434. username = string;
  2435. this.session = session;
  2436. this.isaacKeyPair = isaacKeyPair;
  2437. afkTimer = Utils.currentTimeMillis() + (1000 * 60 * 5);
  2438. afkTime();
  2439.  
  2440. World.addLobbyPlayer(this);// .addLobbyPlayer(this);
  2441. setLoggedInWorld(3); // LOBBY STAGE
  2442. SerializableFilesManager.savePlayer(this);
  2443. if (Settings.DEBUG) {
  2444. Logger.log(this,
  2445. new StringBuilder("Lobby Inited Player: ").append(string)
  2446. .append(", pass: ").append(password).toString());
  2447. }
  2448. }
  2449.  
  2450. public void afkTime() {
  2451. CoresManager.slowExecutor.schedule(new Runnable() {
  2452. public void run() {
  2453. if (afkTimer < Utils.currentTimeMillis()) {
  2454. forceLogout();
  2455. }
  2456. afkTime();
  2457. }
  2458. }, 1, TimeUnit.MINUTES);
  2459. }
  2460.  
  2461. public boolean isAdmin() {
  2462. if (isOwner()) {
  2463. return false;
  2464. }
  2465. return getRights() == 2;
  2466. }
  2467.  
  2468. public boolean isApeAtoll() {
  2469. return (getX() >= 2693 && getX() <= 2821 && getY() >= 2693 && getY() <= 2817);
  2470. }
  2471.  
  2472. public boolean isCanPvp() {
  2473. return canPvp;
  2474. }
  2475.  
  2476. public void setCanPvp(boolean canPvp) {
  2477. this.canPvp = canPvp;
  2478. appearence.generateAppearenceData();
  2479. getPackets().sendPlayerOption(canPvp ? "Attack" : "null", 1, true);
  2480. getPackets().sendPlayerUnderNPCPriority(canPvp);
  2481. }
  2482.  
  2483. public boolean isCantTrade() {
  2484. return cantTrade;
  2485. }
  2486.  
  2487. public void setCantTrade(boolean canTrade) {
  2488. this.cantTrade = canTrade;
  2489. }
  2490.  
  2491. public boolean isCastVeng() {
  2492. return castedVeng;
  2493. }
  2494.  
  2495. public void setCastVeng(boolean castVeng) {
  2496. this.castedVeng = castVeng;
  2497. }
  2498.  
  2499. public boolean isCompletedFightCaves() {
  2500. return completedFightCaves;
  2501. }
  2502.  
  2503. public boolean isCompletedFightKiln() {
  2504. return completedFightKiln;
  2505. }
  2506.  
  2507. public boolean isCompletedRfd() {
  2508. return completedRfd;
  2509. }
  2510.  
  2511. public boolean isDfsActivated() {
  2512. return dfsActivated;
  2513. }
  2514.  
  2515. public void setDfsActivated(boolean dfsActivated) {
  2516. this.dfsActivated = dfsActivated;
  2517. }
  2518.  
  2519. public boolean isPremiumBronze() {
  2520. return isPremiumSilver() || premiumBronze || getRights() == 3
  2521. || premiumBronzeTill > Utils.currentTimeMillis();
  2522. }
  2523.  
  2524. public void setPremiumBronze(boolean premiumBronze) {
  2525. if (getRights() < 6)
  2526. setRights(3);
  2527. this.premiumBronze = premiumBronze;
  2528. }
  2529.  
  2530. /**
  2531. * For if all premiums can do something
  2532. */
  2533. public boolean isPremium() {
  2534. return isPremiumBronze() || isPremiumSilver() || isPremiumGold();
  2535. }
  2536.  
  2537. public boolean isEquipDisabled() {
  2538. return disableEquip;
  2539. }
  2540.  
  2541. public boolean isPremiumSilver() {
  2542. return premiumSilver || getRights() == 4 || premiumTill > Utils.currentTimeMillis();
  2543. }
  2544.  
  2545. public void setPremiumSilver(boolean premiumSilver) {
  2546. if (getRights() < 6)
  2547. setRights(4);
  2548. this.premiumSilver = premiumSilver;
  2549. }
  2550.  
  2551. public boolean isExtremePermDonator() {
  2552. return premiumSilver;
  2553. }
  2554.  
  2555. public boolean isFilterGame() {
  2556. return filterGame;
  2557. }
  2558.  
  2559. public void setFilterGame(boolean filterGame) {
  2560. this.filterGame = filterGame;
  2561. }
  2562.  
  2563. public boolean isForceNextMapLoadRefresh() {
  2564. return forceNextMapLoadRefresh;
  2565. }
  2566.  
  2567. public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
  2568. this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
  2569. }
  2570.  
  2571. public boolean isModerator() {
  2572. return isModerator;
  2573. }
  2574.  
  2575. public void setModerator(boolean isModerator) {
  2576. this.isModerator = isModerator;
  2577. }
  2578.  
  2579. public boolean isGotInfernoAdze() {
  2580. return gotInfernoAdze;
  2581. }
  2582.  
  2583. public void setGotInfernoAdze(boolean gotInfernoAdze) {
  2584. this.gotInfernoAdze = gotInfernoAdze;
  2585. }
  2586.  
  2587. public boolean isGraphicDesigner() {
  2588. return isGraphicDesigner;
  2589. }
  2590.  
  2591. public void setGraphicDesigner(boolean isGraphicDesigner) {
  2592. this.isGraphicDesigner = isGraphicDesigner;
  2593. }
  2594.  
  2595. public boolean isHasCutEnoughLogs() {
  2596. return hasCutEnoughLogs;
  2597. }
  2598.  
  2599. public void setHasCutEnoughLogs(boolean hasCutEnoughLogs) {
  2600. this.hasCutEnoughLogs = hasCutEnoughLogs;
  2601. }
  2602.  
  2603. public boolean isHasCutMoreEnoughLogs() {
  2604. return hasCutMoreEnoughLogs;
  2605. }
  2606.  
  2607. public void setHasCutMoreEnoughLogs(boolean hasCutMoreEnoughLogs) {
  2608. this.hasCutMoreEnoughLogs = hasCutMoreEnoughLogs;
  2609. }
  2610.  
  2611. public boolean isHidden() {
  2612. // TODO Auto-generated method stub
  2613. return true;
  2614. }
  2615.  
  2616. public boolean isHidingWorldMessages() {
  2617. return hideWorldAnnouncements;
  2618. }
  2619.  
  2620. public boolean isInAnimationRoom() {
  2621. return inAnimationRoom;
  2622. }
  2623.  
  2624. public void setInAnimationRoom(boolean inAnimationRoom) {
  2625. this.inAnimationRoom = inAnimationRoom;
  2626. }
  2627.  
  2628. public boolean isInDefenderRoom() {
  2629. return isInDefenderRoom;
  2630. }
  2631.  
  2632. public boolean isKalphiteLairEntranceSetted() {
  2633. return khalphiteLairEntranceSetted;
  2634. }
  2635.  
  2636. public boolean isKalphiteLairSetted() {
  2637. return khalphiteLairSetted;
  2638. }
  2639.  
  2640. public boolean isKilledAgrithNaNa() {
  2641. return agrithNaNa;
  2642. }
  2643.  
  2644. public void setKilledAgrithNaNa(boolean agrithNaNa) {
  2645. this.agrithNaNa = agrithNaNa;
  2646. }
  2647.  
  2648. public boolean isKilledBork() {
  2649. return killedBork;
  2650. }
  2651.  
  2652. public void setKilledBork(boolean killedBork) {
  2653. this.killedBork = killedBork;
  2654. }
  2655.  
  2656. /**
  2657. * RFD
  2658. */
  2659.  
  2660. public boolean isKilledCulinaromancer() {
  2661. return culinaromancer;
  2662. }
  2663.  
  2664. public void setKilledCulinaromancer(boolean culinaromancer) {
  2665. this.culinaromancer = culinaromancer;
  2666. }
  2667.  
  2668. public boolean isKilledDessourt() {
  2669. return dessourt;
  2670. }
  2671.  
  2672. public void setKilledDessourt(boolean dessourt) {
  2673. this.dessourt = dessourt;
  2674. }
  2675.  
  2676. public boolean isKilledFlambeed() {
  2677. return flamBeed;
  2678. }
  2679.  
  2680. public boolean isKilledKaramel() {
  2681. return karamel;
  2682. }
  2683.  
  2684. public void setKilledKaramel(boolean karamel) {
  2685. this.karamel = karamel;
  2686. }
  2687.  
  2688. /**
  2689. * Gets the killedQueenBlackDragon.
  2690. *
  2691. * @return The killedQueenBlackDragon.
  2692. */
  2693. public boolean isKilledQueenBlackDragon() {
  2694. return killedQueenBlackDragon;
  2695. }
  2696.  
  2697. /**
  2698. * Sets the killedQueenBlackDragon.
  2699. *
  2700. * @param killedQueenBlackDragon The killedQueenBlackDragon to set.
  2701. */
  2702. public void setKilledQueenBlackDragon(boolean killedQueenBlackDragon) {
  2703. this.killedQueenBlackDragon = killedQueenBlackDragon;
  2704. }
  2705.  
  2706. public boolean isLocked() {
  2707. return lockDelay >= Utils.currentTimeMillis();
  2708. }
  2709.  
  2710. public boolean isMacBanned() {
  2711. return macBanned;
  2712. }
  2713.  
  2714. public void setMacBanned(boolean macBanned) {
  2715. this.macBanned = macBanned;
  2716. }
  2717.  
  2718. public boolean isOldItemsLook() {
  2719. return oldItemsLook;
  2720. }
  2721.  
  2722. public boolean isOwner() {
  2723. boolean o = false;
  2724. for (String owner : Settings.MAIN_ACESSS) {
  2725. if (getUsername().equalsIgnoreCase(owner)) {
  2726. o = true;
  2727. break;
  2728. }
  2729. }
  2730. return o;
  2731. }
  2732.  
  2733. public void setOwner(String Owner) {
  2734. this.Owner = Owner;
  2735. }
  2736.  
  2737. public boolean isPermBanned() {
  2738. return permBanned;
  2739. }
  2740.  
  2741. public void setPermBanned(boolean permBanned) {
  2742. this.permBanned = permBanned;
  2743. }
  2744.  
  2745. public boolean isPermMuted() {
  2746. return permMuted;
  2747. }
  2748.  
  2749. public void setPermMuted(boolean permMuted) {
  2750. this.permMuted = permMuted;
  2751. }
  2752.  
  2753. public boolean isResting() {
  2754. return resting;
  2755. }
  2756.  
  2757. public void setResting(boolean resting) {
  2758. this.resting = resting;
  2759. sendRunButtonConfig();
  2760. }
  2761.  
  2762. public boolean isRunning() {
  2763. return running;
  2764. }
  2765.  
  2766. public void setRunning(boolean running) {
  2767. this.running = running;
  2768. }
  2769.  
  2770. public boolean isSpawnsMode() {
  2771. return spawnsMode;
  2772. }
  2773.  
  2774. public void setSpawnsMode(boolean spawnsMode) {
  2775. this.spawnsMode = spawnsMode;
  2776. }
  2777.  
  2778. public boolean isSupporter() {
  2779. return isSupporter;
  2780. }
  2781.  
  2782. public void setSupporter(boolean isSupporter) {
  2783. this.isSupporter = isSupporter;
  2784. }
  2785.  
  2786. public boolean isTalkedWithMarv() {
  2787. return talkedWithMarv;
  2788. }
  2789.  
  2790. public boolean isTalkedWithVannaka() {
  2791. return talkedWithVannaka;
  2792. }
  2793.  
  2794. public void setTalkedWithVannaka(boolean talkedWithVannaka) {
  2795. this.talkedWithVannaka = talkedWithVannaka;
  2796. }
  2797.  
  2798. public boolean isUpdateMovementType() {
  2799. return updateMovementType;
  2800. }
  2801.  
  2802. public void setUpdateMovementType(boolean updateMovementType) {
  2803. this.updateMovementType = updateMovementType;
  2804. }
  2805.  
  2806. public boolean isUsingReportOption() {
  2807. return reportOption;
  2808. }
  2809.  
  2810. public void setUsingReportOption(boolean option) {
  2811. reportOption = option;
  2812. }
  2813.  
  2814. public boolean isUsingZenRest() {
  2815. // TODO Auto-generated method stub
  2816. return zenRest;
  2817. }
  2818.  
  2819. public void setUsingZenRest(boolean zenRest) {
  2820. this.zenRest = zenRest;
  2821. }
  2822.  
  2823. public boolean isPremiumGold() {
  2824. return premiumGold || getRights() == 5;
  2825. }
  2826.  
  2827. public void setPremiumGold(boolean premiumGold) {
  2828. if (getRights() < 6)
  2829. setRights(5);
  2830. this.premiumGold = premiumGold;
  2831. }
  2832.  
  2833. public boolean isWonFightPits() {
  2834. return wonFightPits;
  2835. }
  2836.  
  2837. public boolean isXpLocked() {
  2838. return xpLocked;
  2839. }
  2840.  
  2841. public void setXpLocked(boolean locked) {
  2842. this.xpLocked = locked;
  2843. }
  2844.  
  2845. public boolean isYellOff() {
  2846. return yellOff;
  2847. }
  2848.  
  2849. public void setYellOff(boolean yellOff) {
  2850. this.yellOff = yellOff;
  2851. }
  2852.  
  2853. public void kickPlayerFromFriendsChannel(String name) {
  2854. if (currentFriendChat == null)
  2855. return;
  2856. currentFriendChat.kickPlayerFromChat(this, name);
  2857. }
  2858.  
  2859. @Override
  2860. public void loadMapRegions() {
  2861. boolean wasAtDynamicRegion = isAtDynamicRegion();
  2862. super.loadMapRegions();
  2863. clientLoadedMapRegion = false;
  2864. if (isAtDynamicRegion()) {
  2865. getPackets().sendDynamicMapRegion(!started);
  2866. if (!wasAtDynamicRegion)
  2867. localNPCUpdate.reset();
  2868. } else {
  2869. getPackets().sendMapRegion(!started);
  2870. if (wasAtDynamicRegion)
  2871. localNPCUpdate.reset();
  2872. }
  2873. forceNextMapLoadRefresh = false;
  2874. }
  2875.  
  2876. public void lock() {
  2877. lockDelay = Long.MAX_VALUE;
  2878. }
  2879.  
  2880. public void lock(long time) {
  2881. lockDelay = Utils.currentTimeMillis() + (time * 600);
  2882. }
  2883.  
  2884. /**
  2885. * Logs the player out.
  2886. *
  2887. * @param lobby If we're logging out to the lobby.
  2888. */
  2889. public void logout(boolean lobby) {
  2890. if (!isRunning())
  2891. return;
  2892. long currentTime = Utils.currentTimeMillis();
  2893. if (getAttackedByDelay() + 10000 > currentTime) {
  2894. getPackets()
  2895. .sendGameMessage(
  2896. "You can't log out until 10 seconds after the end of combat.");
  2897. return;
  2898. }
  2899. if (getEmotesManager().getNextEmoteEnd() >= currentTime) {
  2900. sendMessage("You can't log out while performing an emote.");
  2901. return;
  2902. }
  2903. if (lockDelay >= currentTime) {
  2904. sendMessage("You can't log out while performing an action.");
  2905. return;
  2906. }
  2907. bankPin.resetActivatedTime();
  2908. getPackets().sendLogout(lobby && Settings.MANAGMENT_SERVER_ENABLED);
  2909. setRunning(false);
  2910. }
  2911.  
  2912. public boolean lootshareEnabled() {
  2913. return lootshareEnabled;
  2914. }
  2915.  
  2916. @SuppressWarnings("deprecation")
  2917. public void makeDonator(int months) {
  2918. if (premiumBronzeTill < Utils.currentTimeMillis())
  2919. premiumBronzeTill = Utils.currentTimeMillis();
  2920. Date date = new Date(premiumBronzeTill);
  2921. date.setMonth(date.getMonth() + months);
  2922. premiumBronzeTill = date.getTime();
  2923. }
  2924.  
  2925. @Override
  2926. public boolean needMasksUpdate() {
  2927. return super.needMasksUpdate() || getTemporaryMovementType() != -1
  2928. || isUpdateMovementType();
  2929. }
  2930.  
  2931. public void ordinanceTimer() {
  2932. CoresManager.fastExecutor.schedule(new TimerTask() {
  2933. @Override
  2934. public void run() {
  2935. if (ordinanceTimer > 0)
  2936. ordinanceTimer--;
  2937. if (ordinanceTimer == 0) {
  2938. getPackets()
  2939. .sendGameMessage(
  2940. "<col=FFCC00>You are able to take more items from the ordinance.");
  2941. cancel();
  2942. }
  2943. }
  2944. }, 0, 1);
  2945. }
  2946.  
  2947. public void performInstantSpecial(final int weaponId) {
  2948. int specAmt = PlayerCombat.getSpecialAmmount(weaponId);
  2949. if (combatDefinitions.hasRingOfVigour())
  2950. specAmt *= 0.9;
  2951. if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
  2952. sendMessage("You don't have enough power left.");
  2953. combatDefinitions.desecreaseSpecialAttack(0);
  2954. return;
  2955. }
  2956. if (this.getSwitchItemCache().size() > 0) {
  2957. ButtonHandler.submitSpecialRequest(this);
  2958. return;
  2959. }
  2960. switch (weaponId) {
  2961. case 4153:
  2962. combatDefinitions.setInstantAttack(true);
  2963. combatDefinitions.switchUsingSpecialAttack();
  2964. Entity target = (Entity) getTemporaryAttributtes().get(
  2965. "last_target");
  2966. if (target != null
  2967. && target.getTemporaryAttributtes().get("last_attacker") == this) {
  2968. if (!(getActionManager().getAction() instanceof PlayerCombat)
  2969. || ((PlayerCombat) getActionManager().getAction())
  2970. .getTarget() != target) {
  2971. getActionManager().setAction(new PlayerCombat(target));
  2972. }
  2973. }
  2974. gmaulSpecCheapFix(true);
  2975. break;
  2976. case 1377:
  2977. case 13472:
  2978. setNextAnimation(new Animation(1056));
  2979. setNextGraphics(new Graphics(246));
  2980. setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
  2981. int defence = (int) (skills.getLevelForXp(Skills.DEFENCE) * 0.90D);
  2982. int attack = (int) (skills.getLevelForXp(Skills.ATTACK) * 0.90D);
  2983. int range = (int) (skills.getLevelForXp(Skills.RANGE) * 0.90D);
  2984. int magic = (int) (skills.getLevelForXp(Skills.MAGIC) * 0.90D);
  2985. int strength = (int) (skills.getLevelForXp(Skills.STRENGTH) * 1.2D);
  2986. skills.set(Skills.DEFENCE, defence);
  2987. skills.set(Skills.ATTACK, attack);
  2988. skills.set(Skills.RANGE, range);
  2989. skills.set(Skills.MAGIC, magic);
  2990. skills.set(Skills.STRENGTH, strength);
  2991. combatDefinitions.desecreaseSpecialAttack(specAmt);
  2992. break;
  2993. case 35:// Excalibur
  2994. case 8280:
  2995. case 14632:
  2996. setNextAnimation(new Animation(1168));
  2997. setNextGraphics(new Graphics(247));
  2998. final boolean enhanced = weaponId == 14632;
  2999. skills.set(
  3000. Skills.DEFENCE,
  3001. enhanced ? (int) (skills.getLevelForXp(Skills.DEFENCE) * 1.15D)
  3002. : (skills.getLevel(Skills.DEFENCE) + 8));
  3003. WorldTasksManager.schedule(new WorldTask() {
  3004. int count = 5;
  3005.  
  3006. @Override
  3007. public void run() {
  3008. if (isDead() || hasFinished()
  3009. || getHitpoints() >= getMaxHitpoints()) {
  3010. stop();
  3011. return;
  3012. }
  3013. heal(enhanced ? 80 : 40);
  3014. if (count-- == 0) {
  3015. stop();
  3016. return;
  3017. }
  3018. }
  3019. }, 4, 2);
  3020. combatDefinitions.desecreaseSpecialAttack(specAmt);
  3021. break;
  3022. case 15486:
  3023. case 22207:
  3024. case 22209:
  3025. case 22211:
  3026. case 22213:
  3027. setNextAnimation(new Animation(12804));
  3028. setNextGraphics(new Graphics(2319));// 2320
  3029. setNextGraphics(new Graphics(2321));
  3030. addPolDelay(60000);
  3031. combatDefinitions.desecreaseSpecialAttack(specAmt);
  3032. break;
  3033. }
  3034. }
  3035.  
  3036. public boolean getGmaulSpecCheapFix() {
  3037. return gmaulSpecCheapFix;
  3038. }
  3039.  
  3040. public void gmaulSpecCheapFix(boolean b) {
  3041. gmaulSpecCheapFix = b;
  3042. }
  3043.  
  3044. @Override
  3045. public void processEntity() {
  3046. processLogicPackets();
  3047. cutscenesManager.process();
  3048. if (routeEvent != null && routeEvent.processEvent(this))
  3049. routeEvent = null;
  3050. super.processEntity();
  3051. if (musicsManager.musicEnded())
  3052. musicsManager.replayMusic();
  3053. if (hasSkull()) {
  3054. skullDelay--;
  3055. if (!hasSkull())
  3056. appearence.generateAppearenceData();
  3057. }
  3058. if (polDelay != 0 && polDelay <= Utils.currentTimeMillis()) {
  3059. getPackets()
  3060. .sendGameMessage(
  3061. "The power of the light fades. Your resistance to melee attacks return to normal.");
  3062. polDelay = 0;
  3063. }
  3064. if (!canSheath && !canSheath2
  3065. && !((getAttackedByDelay() + 5000) > Utils.currentTimeMillis())) {
  3066. canSheath();
  3067. } else {
  3068. unSheath();
  3069. }
  3070. if (overloadDelay > 0) {
  3071. if (overloadDelay == 1 || isDead()) {
  3072. Pots.resetOverLoadEffect(this);
  3073. return;
  3074. } else if ((overloadDelay - 1) % 25 == 0)
  3075. Pots.applyOverLoadEffect(this);
  3076. overloadDelay--;
  3077. }
  3078. if (prayerRenewalDelay > 0) {
  3079. if (prayerRenewalDelay == 1 || isDead()) {
  3080. sendMessage("<col=0000FF>Your prayer renewal has ended.");
  3081. prayerRenewalDelay = 0;
  3082. return;
  3083. } else {
  3084. if (prayerRenewalDelay == 50)
  3085. getPackets()
  3086. .sendGameMessage(
  3087. "<col=0000FF>Your prayer renewal will wear off in 30 seconds.");
  3088. if (!prayer.hasFullPrayerpoints()) {
  3089. getPrayer().restorePrayer(1);
  3090. if ((prayerRenewalDelay - 1) % 25 == 0)
  3091. setNextGraphics(new Graphics(1295));
  3092. }
  3093. }
  3094. prayerRenewalDelay--;
  3095. }
  3096. if (dfscoolDown > 0) {
  3097. dfscoolDown--;
  3098. }
  3099. if (specRestoreTimer > 0) {
  3100. specRestoreTimer--;
  3101. }
  3102. if (yellDelay > 0) {
  3103. yellDelay--;
  3104. }
  3105. if (lastBonfire > 0) {
  3106. lastBonfire--;
  3107. if (lastBonfire == 500)
  3108. getPackets()
  3109. .sendGameMessage(
  3110. "<col=ffff00>The health boost you received from stoking a bonfire will run out in 5 minutes.");
  3111. else if (lastBonfire == 0) {
  3112. getPackets()
  3113. .sendGameMessage(
  3114. "<col=ff0000>The health boost you received from stoking a bonfire has run out.");
  3115. equipment.refreshConfigs(false);
  3116. }
  3117. }
  3118. charges.process();
  3119. auraManager.process();
  3120. actionManager.process();
  3121. prayer.processPrayer();
  3122. controlerManager.process();
  3123. bankPin.process();
  3124. farmingManager.process();
  3125. }
  3126.  
  3127. public void processLogicPackets() {
  3128. LogicPacket packet;
  3129. while ((packet = logicPackets.poll()) != null)
  3130. WorldPacketsDecoder.decodeLogicPacket(this, packet);
  3131. }
  3132.  
  3133. @Override
  3134. public void processReceivedHits() {
  3135. if (lockDelay > Utils.currentTimeMillis())
  3136. return;
  3137. super.processReceivedHits();
  3138. }
  3139.  
  3140. public void increaseCrucibleHighScore() {
  3141. crucibleHighScore++;
  3142. }
  3143.  
  3144. public void realFinish() {
  3145. if (hasFinished()) {
  3146. return;
  3147. }
  3148. getPVP().save();
  3149. if (!World.containsLobbyPlayer(username)) {
  3150. stopAll();
  3151. cutscenesManager.logout();
  3152. controlerManager.logout();
  3153. }
  3154. /* ITEM LENDING */
  3155. Lend lend = LendingManager.getLend(this);
  3156. Lend hasLendedOut = LendingManager.getHasLendedItemsOut(this);
  3157. if (lend != null) {
  3158. if (LendingManager.getMinutesLeft(lend.getTime()) < 0) {
  3159. LendingManager.unLend(lend);
  3160. }
  3161. }
  3162. temporaryEmptyToggle = false;
  3163. if (hasLendedOut != null) {
  3164. if (hasLendedOut.getTime() == 1337) {
  3165. LendingManager.unLend(hasLendedOut);
  3166. }
  3167. }
  3168. /* END OF ITEM LENDING */
  3169. setRunning(false);
  3170. new Thread(new Highscores(this)).start();
  3171. if (!World.containsLobbyPlayer(username)) {
  3172. friendsIgnores.sendFriendsMyStatus(false);
  3173. }
  3174. if (currentFriendChat != null) {
  3175. currentFriendChat.leaveChat(this, true);
  3176. }
  3177. if (familiar != null && !familiar.isFinished()) {
  3178. familiar.dissmissFamiliar(true);
  3179. } else if (pet != null && petManager != null) {
  3180. petManager.pickup(pet);
  3181. }
  3182. if (clanManager != null)
  3183. clanManager.disconnect(this, false);
  3184. dwarfCannon = null;
  3185. setFinished(true);
  3186. session.setDecoder(-1);
  3187. this.lastLoggedIn = System.currentTimeMillis();
  3188. SerializableFilesManager.savePlayer(this);
  3189. if (World.containsPlayer(username)) {
  3190. World.removePlayer(this);
  3191. }
  3192. if (World.containsLobbyPlayer(username)) {
  3193. World.removeLobbyPlayer(this);
  3194. }
  3195. World.updateEntityRegion(this);
  3196. if (World.containsPlayer(username)) {
  3197. try {
  3198. LoginServerCommunication.sendPlayerLoggedOut(username);
  3199. } catch (IOException e) {
  3200. // TODO Auto-generated catch block
  3201. e.printStackTrace();
  3202. }
  3203. World.removePlayer(this);
  3204. }
  3205. if (World.getPlayers().size() < Settings.DOUBLE_EXP_PLAYER_LIMIT && Settings.DOUBLE_EXPERIENCE) {
  3206. if (World.getPlayers().size() == Settings.DOUBLE_EXP_PLAYER_LIMIT - 1) {
  3207. World.sendWorldMessage("<img=7><col=ffa500>News: The double exp cap of " + Settings.DOUBLE_EXP_PLAYER_LIMIT + " has been broken as there are only " + World.getPlayers().size() + " players on.", false);
  3208. }
  3209. Settings.DOUBLE_EXPERIENCE = false;
  3210. }
  3211. if (Settings.DEBUG) {
  3212. Logger.log(this, "Finished Player: " + username + ", pass: "
  3213. + password);
  3214. }
  3215. }
  3216.  
  3217. public void refreshAllowChatEffects() {
  3218. getPackets().sendConfig(171, allowChatEffects ? 0 : 1);
  3219. }
  3220.  
  3221. private void refreshFightKilnEntrance() {
  3222. if (completedFightCaves)
  3223. getPackets().sendConfigByFile(10838, 1);
  3224. }
  3225.  
  3226. public ClansManager getClanManager() {
  3227. return clanManager;
  3228. }
  3229.  
  3230. public void setClanManager(ClansManager clanManager) {
  3231. this.clanManager = clanManager;
  3232. }
  3233.  
  3234. public ClansManager getGuestClanManager() {
  3235. return guestClanManager;
  3236. }
  3237.  
  3238. public void setGuestClanManager(ClansManager guestClanManager) {
  3239. this.guestClanManager = guestClanManager;
  3240. }
  3241.  
  3242. public void refreshHitPoints() {
  3243. getPackets().sendConfigByFile(7198, getHitpoints());
  3244. }
  3245.  
  3246. private void refreshKalphiteLair() {
  3247. if (khalphiteLairSetted)
  3248. getPackets().sendConfigByFile(7263, 1);
  3249. }
  3250.  
  3251. private void refreshKalphiteLairEntrance() {
  3252. if (khalphiteLairEntranceSetted)
  3253. getPackets().sendConfigByFile(7262, 1);
  3254. }
  3255.  
  3256. private void refreshLodestoneNetwork() {
  3257. getPackets().sendConfigByFile(358, 15);
  3258. getPackets().sendConfigByFile(2448, 190);
  3259. getPackets().sendConfigByFile(10900, 1);
  3260. getPackets().sendConfigByFile(10901, 1);
  3261. getPackets().sendConfigByFile(10902, 1);
  3262. getPackets().sendConfigByFile(10903, 1);
  3263. getPackets().sendConfigByFile(10904, 1);
  3264. getPackets().sendConfigByFile(10905, 1);
  3265. getPackets().sendConfigByFile(10906, 1);
  3266. getPackets().sendConfigByFile(10907, 1);
  3267. getPackets().sendConfigByFile(10908, 1);
  3268. getPackets().sendConfigByFile(10909, 1);
  3269. getPackets().sendConfigByFile(10910, 1);
  3270. getPackets().sendConfigByFile(10911, 1);
  3271. getPackets().sendConfigByFile(10912, 1);
  3272. }
  3273.  
  3274. public void refreshMoneyPouch() {
  3275. getPackets().sendRunScript(5560, getMoneyPouch().getTotal());
  3276. }
  3277.  
  3278. public void refreshMouseButtons() {
  3279. getPackets().sendConfig(170, mouseButtons ? 0 : 1);
  3280. }
  3281.  
  3282. public void refreshPrivateChatSetup() {
  3283. getPackets().sendConfig(287, privateChatSetup);
  3284. }
  3285.  
  3286. public void refreshSpawnedItems() {
  3287. for (int regionId : getMapRegionsIds()) {
  3288. List<FloorItem> floorItems = World.getRegion(regionId)
  3289. .getFloorItems();
  3290. if (floorItems == null)
  3291. continue;
  3292. for (FloorItem item : floorItems) {
  3293. getPackets().sendRemoveGroundItem(item);
  3294. }
  3295. }
  3296. for (int regionId : getMapRegionsIds()) {
  3297. List<FloorItem> floorItems = World.getRegion(regionId)
  3298. .getFloorItems();
  3299. if (floorItems == null)
  3300. continue;
  3301. for (FloorItem item : floorItems) {
  3302. getPackets().sendGroundItem(item);
  3303. }
  3304. }
  3305. }
  3306.  
  3307. public void refreshSpawnedObjects() {
  3308. for (int regionId : getMapRegionsIds()) {
  3309. List<WorldObject> spawnedObjects = World.getRegion(regionId)
  3310. .getSpawnedObjects();
  3311. if (spawnedObjects != null) {
  3312. for (WorldObject object : spawnedObjects)
  3313. if (object.getPlane() == getPlane())
  3314. getPackets().sendSpawnedObject(object);
  3315. }
  3316. List<WorldObject> removedObjects = World.getRegion(regionId)
  3317. .getRemovedOriginalObjects();
  3318. if (removedObjects != null) {
  3319. for (WorldObject object : removedObjects)
  3320. if (object.getPlane() == getPlane())
  3321. getPackets().sendDestroyObject(object);
  3322. }
  3323. }
  3324. }
  3325.  
  3326. @Override
  3327. public void removeHitpoints(Hit hit) {
  3328. super.removeHitpoints(hit);
  3329. refreshHitPoints();
  3330. }
  3331.  
  3332. public void removeSkull() {
  3333. skullDelay = -1;
  3334. appearence.generateAppearenceData();
  3335. }
  3336.  
  3337. @Override
  3338. public void reset() {
  3339. reset(true);
  3340. }
  3341.  
  3342. /**
  3343. * Removes an item from the equipment and inventory.
  3344. *
  3345. * @param item The item to remove
  3346. */
  3347. public void removeAll(Item item) {
  3348. for (Item equipment : getEquipment().getItems().getItemsCopy()) {
  3349. if (equipment != null) {
  3350. if (equipment.getId() == item.getId()) {
  3351. getEquipment().deleteItem(item.getId(), item.getAmount());
  3352. break;
  3353. }
  3354. }
  3355. }
  3356. for (Item inventory : getInventory().getItems().getItemsCopy()) {
  3357. if (inventory != null) {
  3358. if (inventory.getId() == item.getId()) {
  3359. getInventory().deleteItem(item.getId(), item.getAmount());
  3360. break;
  3361. }
  3362. }
  3363. }
  3364. }
  3365. @Override
  3366. public void reset(boolean attributes) {
  3367. super.reset(attributes);
  3368. refreshHitPoints();
  3369. hintIconsManager.removeAll();
  3370. skills.restoreSkills();
  3371. combatDefinitions.resetSpecialAttack();
  3372. prayer.reset();
  3373. combatDefinitions.resetSpells(true);
  3374. resting = false;
  3375. skullDelay = 0;
  3376. foodDelay = 0;
  3377. potDelay = 0;
  3378. poisonImmune = 0;
  3379. fireImmune = 0;
  3380. castedVeng = false;
  3381. setDfsActivated(false);
  3382. dfscoolDown = 0;
  3383. if (getLastBonfire() > 0)
  3384. getPackets()
  3385. .sendGameMessage(
  3386. "<col=ff0000>The health boost you received from stoking a bonfire has run out.");
  3387. setLastBonfire(0);
  3388. getEquipment().refreshConfigs(false);
  3389. if (getOverloadDelay() > 0)
  3390. Pots.resetOverLoadEffect(this);
  3391. setRunEnergy(100);
  3392. removeDamage(this);
  3393. appearence.generateAppearenceData();
  3394. }
  3395.  
  3396. public void resetBarrows() {
  3397. hiddenBrother = -1;
  3398. killedBarrowBrothers = new boolean[7]; // includes new bro for future
  3399. // use
  3400. barrowsKillCount = 0;
  3401. }
  3402.  
  3403. @Override
  3404. public void resetMasks() {
  3405. super.resetMasks();
  3406. setTemporaryMovementType(-1);
  3407. setUpdateMovementType(false);
  3408. if (!clientHasLoadedMapRegion()) {
  3409. // load objects and items here
  3410. setClientHasLoadedMapRegion();
  3411. refreshSpawnedObjects();
  3412. refreshSpawnedItems();
  3413. }
  3414. }
  3415.  
  3416. @Override
  3417. public boolean restoreHitPoints() {
  3418. boolean update = super.restoreHitPoints();
  3419. if (update) {
  3420. if (prayer.usingPrayer(0, 9))
  3421. super.restoreHitPoints();
  3422. if (resting)
  3423. super.restoreHitPoints();
  3424. refreshHitPoints();
  3425. }
  3426. return update;
  3427. }
  3428.  
  3429. public void restoreRunEnergy() {
  3430. if (getNextRunDirection() == -1 && runEnergy < 100) {
  3431. runEnergy++;
  3432. if (resting && runEnergy < 100)
  3433. runEnergy++;
  3434. getPackets().sendRunEnergy();
  3435. }
  3436. }
  3437.  
  3438. @Override
  3439. public void sendDeath(final Entity source) {
  3440. if (prayer.hasPrayersOn()
  3441. && getTemporaryAttributtes().get("startedDuel") != Boolean.TRUE) {
  3442. if (prayer.usingPrayer(0, 22)) {
  3443. setNextGraphics(new Graphics(437));
  3444. final Player target = this;
  3445. if (isAtMultiArea()) {
  3446. for (int regionId : getMapRegionsIds()) {
  3447. List<Integer> playersIndexes = World
  3448. .getRegion(regionId).getPlayerIndexes();
  3449. if (playersIndexes != null) {
  3450. for (int playerIndex : playersIndexes) {
  3451. Player player = World.getPlayers().get(
  3452. playerIndex);
  3453. if (player == null
  3454. || !player.hasStarted()
  3455. || player.isDead()
  3456. || player.hasFinished()
  3457. || !player.withinDistance(this, 1)
  3458. || !player.isCanPvp()
  3459. || !target.getControlerManager()
  3460. .canHit(player))
  3461. continue;
  3462. player.applyHit(new Hit(
  3463. target,
  3464. Utils.getRandom((int) (skills
  3465. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3466. HitLook.REGULAR_DAMAGE));
  3467. }
  3468. }
  3469. List<Integer> npcsIndexes = World.getRegion(regionId)
  3470. .getNPCsIndexes();
  3471. if (npcsIndexes != null) {
  3472. for (int npcIndex : npcsIndexes) {
  3473. NPC npc = World.getNPCs().get(npcIndex);
  3474. if (npc == null
  3475. || npc.isDead()
  3476. || npc.hasFinished()
  3477. || !npc.withinDistance(this, 1)
  3478. || !npc.getDefinitions()
  3479. .hasAttackOption()
  3480. || !target.getControlerManager()
  3481. .canHit(npc))
  3482. continue;
  3483. npc.applyHit(new Hit(
  3484. target,
  3485. Utils.getRandom((int) (skills
  3486. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3487. HitLook.REGULAR_DAMAGE));
  3488. }
  3489. }
  3490. }
  3491. } else {
  3492. if (source != null && source != this && !source.isDead()
  3493. && !source.hasFinished()
  3494. && source.withinDistance(this, 1))
  3495. source.applyHit(new Hit(target, Utils
  3496. .getRandom((int) (skills
  3497. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3498. HitLook.REGULAR_DAMAGE));
  3499. }
  3500. WorldTasksManager.schedule(new WorldTask() {
  3501. @Override
  3502. public void run() {
  3503. World.sendGraphics(target, new Graphics(438),
  3504. new WorldTile(target.getX() - 1, target.getY(),
  3505. target.getPlane()));
  3506. World.sendGraphics(target, new Graphics(438),
  3507. new WorldTile(target.getX() + 1, target.getY(),
  3508. target.getPlane()));
  3509. World.sendGraphics(target, new Graphics(438),
  3510. new WorldTile(target.getX(), target.getY() - 1,
  3511. target.getPlane()));
  3512. World.sendGraphics(target, new Graphics(438),
  3513. new WorldTile(target.getX(), target.getY() + 1,
  3514. target.getPlane()));
  3515. World.sendGraphics(target, new Graphics(438),
  3516. new WorldTile(target.getX() - 1,
  3517. target.getY() - 1, target.getPlane()));
  3518. World.sendGraphics(target, new Graphics(438),
  3519. new WorldTile(target.getX() - 1,
  3520. target.getY() + 1, target.getPlane()));
  3521. World.sendGraphics(target, new Graphics(438),
  3522. new WorldTile(target.getX() + 1,
  3523. target.getY() - 1, target.getPlane()));
  3524. World.sendGraphics(target, new Graphics(438),
  3525. new WorldTile(target.getX() + 1,
  3526. target.getY() + 1, target.getPlane()));
  3527. }
  3528. });
  3529. } else if (prayer.usingPrayer(1, 17)) {
  3530. World.sendProjectile(this, new WorldTile(getX() + 2,
  3531. getY() + 2, getPlane()), 2260, 24, 0, 41, 35, 30, 0);
  3532. World.sendProjectile(this, new WorldTile(getX() + 2, getY(),
  3533. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3534. World.sendProjectile(this, new WorldTile(getX() + 2,
  3535. getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3536. World.sendProjectile(this, new WorldTile(getX() - 2,
  3537. getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3538. World.sendProjectile(this, new WorldTile(getX() - 2, getY(),
  3539. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3540. World.sendProjectile(this, new WorldTile(getX() - 2,
  3541. getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3542.  
  3543. World.sendProjectile(this, new WorldTile(getX(), getY() + 2,
  3544. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3545. World.sendProjectile(this, new WorldTile(getX(), getY() - 2,
  3546. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3547. final Player target = this;
  3548. WorldTasksManager.schedule(new WorldTask() {
  3549. @Override
  3550. public void run() {
  3551. setNextGraphics(new Graphics(2259));
  3552.  
  3553. if (isAtMultiArea()) {
  3554. for (int regionId : getMapRegionsIds()) {
  3555. List<Integer> playersIndexes = World.getRegion(
  3556. regionId).getPlayerIndexes();
  3557. if (playersIndexes != null) {
  3558. for (int playerIndex : playersIndexes) {
  3559. Player player = World.getPlayers().get(
  3560. playerIndex);
  3561. if (player == null
  3562. || !player.hasStarted()
  3563. || player.isDead()
  3564. || player.hasFinished()
  3565. || !player.isCanPvp()
  3566. || !player.withinDistance(
  3567. target, 2)
  3568. || !target
  3569. .getControlerManager()
  3570. .canHit(player))
  3571. continue;
  3572. player.applyHit(new Hit(
  3573. target,
  3574. Utils.getRandom((skills
  3575. .getLevelForXp(Skills.PRAYER) * 3)),
  3576. HitLook.REGULAR_DAMAGE));
  3577. }
  3578. }
  3579. List<Integer> npcsIndexes = World.getRegion(
  3580. regionId).getNPCsIndexes();
  3581. if (npcsIndexes != null) {
  3582. for (int npcIndex : npcsIndexes) {
  3583. NPC npc = World.getNPCs().get(npcIndex);
  3584. if (npc == null
  3585. || npc.isDead()
  3586. || npc.hasFinished()
  3587. || !npc.withinDistance(target,
  3588. 2)
  3589. || !npc.getDefinitions()
  3590. .hasAttackOption()
  3591. || !target
  3592. .getControlerManager()
  3593. .canHit(npc))
  3594. continue;
  3595. npc.applyHit(new Hit(
  3596. target,
  3597. Utils.getRandom((skills
  3598. .getLevelForXp(Skills.PRAYER) * 3)),
  3599. HitLook.REGULAR_DAMAGE));
  3600. }
  3601. }
  3602. }
  3603. } else {
  3604. if (source != null && source != target
  3605. && !source.isDead()
  3606. && !source.hasFinished()
  3607. && source.withinDistance(target, 2))
  3608. source.applyHit(new Hit(
  3609. target,
  3610. Utils.getRandom((skills
  3611. .getLevelForXp(Skills.PRAYER) * 3)),
  3612. HitLook.REGULAR_DAMAGE));
  3613. }
  3614.  
  3615. World.sendGraphics(target, new Graphics(2260),
  3616. new WorldTile(getX() + 2, getY() + 2,
  3617. getPlane()));
  3618. World.sendGraphics(target, new Graphics(2260),
  3619. new WorldTile(getX() + 2, getY(), getPlane()));
  3620. World.sendGraphics(target, new Graphics(2260),
  3621. new WorldTile(getX() + 2, getY() - 2,
  3622. getPlane()));
  3623.  
  3624. World.sendGraphics(target, new Graphics(2260),
  3625. new WorldTile(getX() - 2, getY() + 2,
  3626. getPlane()));
  3627. World.sendGraphics(target, new Graphics(2260),
  3628. new WorldTile(getX() - 2, getY(), getPlane()));
  3629. World.sendGraphics(target, new Graphics(2260),
  3630. new WorldTile(getX() - 2, getY() - 2,
  3631. getPlane()));
  3632.  
  3633. World.sendGraphics(target, new Graphics(2260),
  3634. new WorldTile(getX(), getY() + 2, getPlane()));
  3635. World.sendGraphics(target, new Graphics(2260),
  3636. new WorldTile(getX(), getY() - 2, getPlane()));
  3637.  
  3638. World.sendGraphics(target, new Graphics(2260),
  3639. new WorldTile(getX() + 1, getY() + 1,
  3640. getPlane()));
  3641. World.sendGraphics(target, new Graphics(2260),
  3642. new WorldTile(getX() + 1, getY() - 1,
  3643. getPlane()));
  3644. World.sendGraphics(target, new Graphics(2260),
  3645. new WorldTile(getX() - 1, getY() + 1,
  3646. getPlane()));
  3647. World.sendGraphics(target, new Graphics(2260),
  3648. new WorldTile(getX() - 1, getY() - 1,
  3649. getPlane()));
  3650. }
  3651. });
  3652. }
  3653. }
  3654. setNextAnimation(new Animation(-1));
  3655. if (!controlerManager.sendDeath())
  3656. return;
  3657. if (!controlerManager.sendDeath(source))
  3658. return;
  3659. lock();
  3660. stopAll();
  3661. if (familiar != null)
  3662. familiar.sendDeath(this);
  3663. WorldTasksManager.schedule(new WorldTask() {
  3664. int loop;
  3665.  
  3666. @Override
  3667. public void run() {
  3668. if (loop == 0) {
  3669. setNextAnimation(new Animation(836));
  3670. } else if (loop == 1) {
  3671. getPackets().sendGameMessage("Oh dear, you have died.");
  3672. if (source instanceof Player) {
  3673. Player killer = (Player) source;
  3674. killer.setAttackedByDelay(4);
  3675. }
  3676. } else if (loop == 3) {
  3677. reset();
  3678. controlerManager.startControler("DeathEvent");
  3679. if (getDwarfCannon() != null && getDwarfCannon().getObject() != null) {
  3680. if (getDwarfCannon().getObject().getId() == 6)
  3681. getDwarfCannon().pickUpDwarfCannon(0, getDwarfCannon().getObject());
  3682. else if (getDwarfCannon().getObject().getId() == 29408)
  3683. getDwarfCannon().pickUpDwarfCannonRoyal(0, getDwarfCannon().getObject());
  3684. else if (getDwarfCannon().getObject().getId() == 29406)
  3685. getDwarfCannon().pickUpDwarfCannonGold(0, getDwarfCannon().getObject());
  3686. }
  3687. setNextAnimation(new Animation(-1));
  3688. sendItemsOnDeath(source);
  3689. getAppearence().generateAppearenceData();
  3690. //1delay because player cant walk while teleing :p, + possible issues avoid
  3691. WorldTasksManager.schedule(new WorldTask() {
  3692. @Override
  3693. public void run() {
  3694. getMusicsManager().playMusic(683);
  3695. unlock(); //unlocks player
  3696. }
  3697.  
  3698. }, 1);
  3699. } else if (loop == 4) {
  3700. getPackets().sendMusicEffect(90);
  3701. if (hardcoreIronman) {
  3702. lives--;
  3703. if (lives < 0) {
  3704. if (skills.getTotalLevel() >= 1000) {
  3705. String reason = "to an unknown power.";
  3706. if (source instanceof Player) {
  3707. Player killer = (Player) source;
  3708. reason = "during a PVP battle with " + killer.getDisplayName() + ".";
  3709. } else if (source instanceof NPC) {
  3710. NPC killer = (NPC) source;
  3711. reason = "fighting against: " + killer.getName() + ".";
  3712. }
  3713. World.sendWorldMessage("<img=15><col=FE0000>[" + displayName + "] just died in Hardcore Ironman mode with a skill total of " + skills.getTotalLevel() + " " + reason, false);
  3714. }
  3715. officiallyDead = true;
  3716. logout(false);
  3717. return;
  3718. } else {
  3719. getPackets().sendGameMessage("<col=ff0000>You only have " + (lives > 1 ? lives + " lives" : "1 life") + " remaining.");
  3720. }
  3721. }
  3722. stop();
  3723. }
  3724. loop++;
  3725. }
  3726. }, 0, 1);
  3727. }
  3728.  
  3729. public void sendDefaultPlayersOptions() {
  3730. getPackets().sendPlayerOption("Challenge", 1, false);
  3731. getPackets().sendPlayerOption("Follow", 2, false);
  3732. getPackets().sendPlayerOption("Trade with", 4, false);
  3733. getPackets().sendPlayerOption("View stats of", 6, false);
  3734. }
  3735.  
  3736. public void sendFriendsChannelMessage(ChatMessage message) {
  3737. if (currentFriendChat == null)
  3738. return;
  3739. currentFriendChat.sendMessage(this, message.getMessage(false));
  3740. }
  3741.  
  3742. public void sendFriendsChannelQuickMessage(QuickChatMessage message) {
  3743. if (currentFriendChat == null)
  3744. return;
  3745. currentFriendChat.sendQuickMessage(this, message);
  3746. }
  3747.  
  3748. public void sendLobbyConfigs(Player player) {
  3749. for (int i = 0; i < Utils.DEFAULT_LOBBY_CONFIGS.length; i++) {
  3750. int val = Utils.DEFAULT_LOBBY_CONFIGS[i];
  3751. if (val != 0) {
  3752. player.getPackets().sendConfig(i, val);
  3753. }
  3754. }
  3755. }
  3756.  
  3757. public void sendMessage(String message) {
  3758. getPackets().sendGameMessage(message);
  3759. }
  3760.  
  3761. public void sendPublicChatMessage(PublicChatMessage message) {
  3762. for (int regionId : getMapRegionsIds()) {
  3763. List<Integer> playersIndexes = World.getRegion(regionId)
  3764. .getPlayerIndexes();
  3765. if (playersIndexes == null)
  3766. continue;
  3767. for (Integer playerIndex : playersIndexes) {
  3768. Player p = World.getPlayers().get(playerIndex);
  3769. if (p == null
  3770. || !p.hasStarted()
  3771. || p.hasFinished()
  3772. || p.getLocalPlayerUpdate().getLocalPlayers()[getIndex()] == null)
  3773. continue;
  3774. p.getPackets().sendPublicMessage(this, message);
  3775. }
  3776. }
  3777. }
  3778.  
  3779. public void sendRandomJail(Player p) {
  3780. p.resetWalkSteps();
  3781. switch (Utils.getRandom(2)) {
  3782. case 0:
  3783. p.setNextWorldTile(new WorldTile(3230, 3407, 0));
  3784. break;
  3785. case 1:
  3786. p.setNextWorldTile(new WorldTile(3228, 3407, 0));
  3787. break;
  3788. case 2:
  3789. p.setNextWorldTile(new WorldTile(3226, 3407, 0));
  3790. break;
  3791. }
  3792. }
  3793.  
  3794. public void sendRunButtonConfig() {
  3795. getPackets().sendConfig(173, resting ? 3 : getRun() ? 1 : 0);
  3796. }
  3797.  
  3798. public void sendSoulSplit(final Hit hit, final Entity user) {
  3799. final Player target = this;
  3800. if (hit.getDamage() > 0)
  3801. World.sendProjectile(user, this, 2263, 11, 11, 20, 5, 0, 0);
  3802. user.heal(hit.getDamage() / 5);
  3803. prayer.drainPrayer(hit.getDamage() / 5);
  3804. WorldTasksManager.schedule(new WorldTask() {
  3805. @Override
  3806. public void run() {
  3807. setNextGraphics(new Graphics(2264));
  3808. if (hit.getDamage() > 0)
  3809. World.sendProjectile(target, user, 2263, 11, 11, 20, 5, 0,
  3810. 0);
  3811. }
  3812. }, 0);
  3813. }
  3814.  
  3815. public void sendUnlockedObjectConfigs() {
  3816. refreshKalphiteLairEntrance();
  3817. refreshKalphiteLair();
  3818. refreshLodestoneNetwork();
  3819. refreshFightKilnEntrance();
  3820. }
  3821.  
  3822. public int setBarrowsKillCount(int barrowsKillCount) {
  3823. return this.barrowsKillCount = barrowsKillCount;
  3824. }
  3825.  
  3826. public void setClientHasLoadedMapRegion() {
  3827. clientLoadedMapRegion = true;
  3828. }
  3829.  
  3830. public void setClientHasntLoadedMapRegion() {
  3831. clientLoadedMapRegion = false;
  3832. }
  3833.  
  3834. public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
  3835. this.closeInterfacesEvent = closeInterfacesEvent;
  3836. }
  3837.  
  3838. public void setCompletedFightCaves() {
  3839. if (!completedFightCaves) {
  3840. completedFightCaves = true;
  3841. refreshFightKilnEntrance();
  3842. }
  3843. }
  3844.  
  3845. public void setCompletedFightKiln() {
  3846. completedFightKiln = true;
  3847. }
  3848.  
  3849. public void setCompletedRfd() {
  3850. completedRfd = true;
  3851. }
  3852.  
  3853. public void setRouteEvent(RouteEvent routeEvent) {
  3854. this.routeEvent = routeEvent;
  3855. }
  3856.  
  3857. public int setDeathCount(int deathCount) {
  3858. return this.deathCount = deathCount;
  3859. }
  3860.  
  3861. public void setDefenderRoom(boolean isInDefenderRoom) {
  3862. this.isInDefenderRoom = isInDefenderRoom;
  3863. }
  3864.  
  3865. public void setdfscoolDown(int dfscoolDown) {
  3866. this.dfscoolDown = dfscoolDown;
  3867. }
  3868.  
  3869. public void setDisableEquip(boolean equip) {
  3870. disableEquip = equip;
  3871. }
  3872.  
  3873. public void setFightPitsSkull() {
  3874. skullDelay = Integer.MAX_VALUE;
  3875. skullId = 1;
  3876. appearence.generateAppearenceData();
  3877. }
  3878.  
  3879. public void setFriendChatSetup(int friendChatSetup) {
  3880. this.friendChatSetup = friendChatSetup;
  3881. }
  3882.  
  3883. public void setHideWorldMessages(boolean hideWorldAnnouncements) {
  3884. this.hideWorldAnnouncements = hideWorldAnnouncements;
  3885. }
  3886.  
  3887. public void setInvulnerable(boolean invulnerable) {
  3888. this.invulnerable = invulnerable;
  3889. }
  3890.  
  3891. public void setKalphiteLair() {
  3892. khalphiteLairSetted = true;
  3893. refreshKalphiteLair();
  3894. }
  3895.  
  3896. public void setKalphiteLairEntrance() {
  3897. khalphiteLairEntranceSetted = true;
  3898. refreshKalphiteLairEntrance();
  3899. }
  3900.  
  3901. public int setKillCount(int killCount) {
  3902. return this.killCount = killCount;
  3903. }
  3904.  
  3905. public void setKilledFlamBeed(boolean flamBeed) {
  3906. this.flamBeed = flamBeed;
  3907. }
  3908.  
  3909. public void setLargeSceneView(boolean largeSceneView) {
  3910. this.largeSceneView = largeSceneView;
  3911. }
  3912.  
  3913. public void setLastUsedGodwarsAltar(long l) {
  3914. // TODO Auto-generated method stub
  3915.  
  3916. }
  3917.  
  3918. public void setPrayerRenewalDelay(int delay) {
  3919. this.prayerRenewalDelay = delay;
  3920. }
  3921.  
  3922. @Override
  3923. public void setRun(boolean run) {
  3924. if (run != getRun()) {
  3925. super.setRun(run);
  3926. setUpdateMovementType(true);
  3927. sendRunButtonConfig();
  3928. }
  3929. }
  3930.  
  3931. /**
  3932. * @param runeSpanPoint the runeSpanPoint to set
  3933. */
  3934. public void setRuneSpanPoint(int runeSpanPoints) {
  3935. this.runeSpanPoints = runeSpanPoints;
  3936. }
  3937.  
  3938. public void setRunHidden(boolean run) {
  3939. super.setRun(run);
  3940. setUpdateMovementType(true);
  3941. }
  3942.  
  3943. public int setSkullDelay(int delay) {
  3944. return this.skullDelay = delay;
  3945. }
  3946.  
  3947. public void setSkullInfiniteDelay(int skullId) {
  3948. skullDelay = Integer.MAX_VALUE;
  3949. this.skullId = skullId;
  3950. appearence.generateAppearenceData();
  3951. }
  3952.  
  3953. public void setStarter(boolean setStarter) {
  3954. this.setStarter = setStarter;
  3955. }
  3956.  
  3957. public void setTalkedToCook() {
  3958. talkedtoCook = true;
  3959. }
  3960.  
  3961. public void setTalkedWithMarv() {
  3962. talkedWithMarv = true;
  3963. }
  3964.  
  3965. public void settitlecolor(String titleColor) {
  3966. this.titleColor = titleColor;
  3967. }
  3968.  
  3969. public void setWildernessSkull() {
  3970. skullDelay = 3000;
  3971. skullId = 0;
  3972. appearence.generateAppearenceData();
  3973. }
  3974.  
  3975. public void setWonFightPits() {
  3976. wonFightPits = true;
  3977. }
  3978.  
  3979. public void setYellDisabled(boolean yellDisabled) {
  3980. this.yellDisabled = yellDisabled;
  3981. }
  3982.  
  3983. public void setYellShade(String yellShade) {
  3984. this.yellShade = yellShade;
  3985. }
  3986.  
  3987. // now that we inited we can start showing game
  3988. public void start() {
  3989. loadMapRegions();
  3990. started = true;
  3991. LoginManager.sendLogin(this);
  3992. if (getHitpoints() == 0 || isDead() || getHitpoints() < 0 || isLocked()) {
  3993. sendDeath(null);
  3994. }
  3995. }
  3996.  
  3997. public void startLobby(Player player) {
  3998. player.sendLobbyConfigs(player);
  3999. // friendsIgnores.setPlayer(this);
  4000. // friendsIgnores.init();
  4001. player.getPackets().sendFriendsChatChannel();
  4002. // friendsIgnores.sendFriendsMyStatus(true);
  4003. }
  4004.  
  4005. public void stopAll() {
  4006. stopAll(true);
  4007. }
  4008.  
  4009. public void stopAll(boolean stopWalk) {
  4010. stopAll(stopWalk, true);
  4011. }
  4012.  
  4013. public void stopAll(boolean stopWalk, boolean stopInterface) {
  4014. stopAll(stopWalk, stopInterface, true);
  4015. }
  4016.  
  4017. // as walk done clientsided
  4018. public void stopAll(boolean stopWalk, boolean stopInterfaces,
  4019. boolean stopActions) {
  4020. routeEvent = null;
  4021. if (stopInterfaces)
  4022. closeInterfaces();
  4023. if (stopWalk) {
  4024. if (cantBeFrozen = true)
  4025. resetWalkSteps();
  4026. }
  4027. if (stopActions)
  4028. actionManager.forceStop();
  4029. combatDefinitions.resetSpells(false);
  4030. }
  4031.  
  4032. public void switchAllowChatEffects() {
  4033. allowChatEffects = !allowChatEffects;
  4034. refreshAllowChatEffects();
  4035. }
  4036.  
  4037. public void switchItemsLook() {
  4038. oldItemsLook = !oldItemsLook;
  4039. getPackets().sendItemsLook();
  4040. }
  4041.  
  4042. public void switchGroundColor() {
  4043. usingSnowGroundColor = !usingSnowGroundColor;
  4044. getPackets().sendGroundColor();
  4045. }
  4046.  
  4047. public void switchMouseButtons() {
  4048. mouseButtons = !mouseButtons;
  4049. refreshMouseButtons();
  4050. }
  4051.  
  4052. public void toggleLootShare(boolean message) {
  4053. lootshareEnabled = !lootshareEnabled;
  4054. getPackets().sendConfig(1083, lootshareEnabled ? 1 : 0);
  4055. if (!message)
  4056. return;
  4057. sendMessage(String.format("Lootshare is now %sactive.</col>",
  4058. lootshareEnabled ? "" : "un"));
  4059. }
  4060.  
  4061. public void toogleRun(boolean update) {
  4062. super.setRun(!getRun());
  4063. setUpdateMovementType(true);
  4064. if (update)
  4065. sendRunButtonConfig();
  4066. }
  4067.  
  4068. public void unlock() {
  4069. lockDelay = 0;
  4070. }
  4071.  
  4072. public void useStairs(int emoteId, final WorldTile dest, int useDelay,
  4073. int totalDelay) {
  4074. useStairs(emoteId, dest, useDelay, totalDelay, null);
  4075. }
  4076.  
  4077. public void useStairs(int emoteId, final WorldTile dest, int useDelay,
  4078. int totalDelay, final String message) {
  4079. stopAll();
  4080. lock(totalDelay);
  4081. if (emoteId != -1)
  4082. setNextAnimation(new Animation(emoteId));
  4083. if (useDelay == 0)
  4084. setNextWorldTile(dest);
  4085. else {
  4086. WorldTasksManager.schedule(new WorldTask() {
  4087. @Override
  4088. public void run() {
  4089. if (isDead())
  4090. return;
  4091. setNextWorldTile(dest);
  4092. if (message != null)
  4093. sendMessage(message);
  4094. }
  4095. }, useDelay - 1);
  4096. }
  4097. }
  4098.  
  4099. public void vecnaTimer(int amount) {
  4100. if (getVecnaTimer() > 0) {
  4101. CoresManager.fastExecutor.schedule(new TimerTask() {
  4102. @Override
  4103. public void run() {
  4104. if (hasFinished())
  4105. cancel();
  4106. if (getVecnaTimer() > 0)
  4107. setVecnaTimer(getVecnaTimer() - 1);
  4108. if (getVecnaTimer() == 0) {
  4109. getPackets()
  4110. .sendGameMessage(
  4111. "<col=FFCC00>Your skull of Vecna has regained its mysterious aura.");
  4112. cancel();
  4113. }
  4114. }
  4115. }, 10, 1);
  4116. }
  4117. }
  4118.  
  4119. public int getQuestPoints() {
  4120. // TODO Auto-generated method stub
  4121. return questPoints;
  4122. }
  4123.  
  4124. public void setQuestPoints(int questPoints) {
  4125. this.questPoints = questPoints;
  4126. }
  4127.  
  4128. public boolean isUsingSnowGroundColor() {
  4129. // TODO Auto-generated method stub
  4130. return usingSnowGroundColor;
  4131. }
  4132.  
  4133. public GrandExchange grandExchange() {
  4134. return this.getGrandExchange();
  4135. }
  4136.  
  4137. public GrandExchange getGrandExchange() {
  4138. return grandExchange;
  4139. }
  4140.  
  4141. public void setGrandExchange(GrandExchange grandExchange) {
  4142. this.grandExchange = grandExchange;
  4143. }
  4144.  
  4145. public GlobalPlayerUpdater getGlobalPlayerUpdater() {
  4146. return globalPlayerUpdater;
  4147. }
  4148.  
  4149. public void setGlobalPlayerUpdater(GlobalPlayerUpdater globalPlayerUpdater) {
  4150. this.globalPlayerUpdater = globalPlayerUpdater;
  4151. }
  4152.  
  4153. public GlobalPlayerUpdater getGlobalPlayerUpdate() {
  4154. return getGlobalPlayerUpdater();
  4155. }
  4156.  
  4157. public void setVeteran(boolean veteran) {
  4158. this.veteran = veteran;
  4159. }
  4160.  
  4161. public long getLastSpinsReceived() {
  4162. return lastSpinsReceived;
  4163. }
  4164.  
  4165. public void setLastSpinsReceived(long value) {
  4166. lastSpinsReceived = value;
  4167. }
  4168.  
  4169. public void myMessages() {
  4170. WorldTasksManager.schedule(new WorldTask() {
  4171. @Override
  4172. public void run() {
  4173. int r3 = 0;
  4174. r3 = Utils.random(6);
  4175. if (r3 == 0) {
  4176. getPackets()
  4177. .sendGameMessage(
  4178. "<img=14><col=FF6600>Do not forget to vote daily for more fun and awesome rewards!",
  4179. true);
  4180. } else if (r3 == 1) {
  4181. getPackets()
  4182. .sendGameMessage(
  4183. "<img=14><col=FF6600>Purchase for great Premiums benefits and rewards!",
  4184. true);
  4185. } else if (r3 == 2) {
  4186. getPackets()
  4187. .sendGameMessage(
  4188. "<img=14><col=FF6600>Protect your account by setting a Bank PIN",
  4189. true);
  4190. } else if (r3 == 3) {
  4191. getPackets()
  4192. .sendGameMessage(
  4193. "<img=14><col=FF6600>Feel free to ask any staff for help!",
  4194. true);
  4195. } else if (r3 == 4) {
  4196. getPackets()
  4197. .sendGameMessage(
  4198. "<img=14><col=FF6600>If you don't know your way around, feel free to ask for help, or do ;;ticket for staff.",
  4199. true);
  4200. } else if (r3 == 5) {
  4201. getPackets()
  4202. .sendGameMessage(
  4203. "<img=14><col=FF6600>To all new players, Welcome to Exion. Enjoy your stay!",
  4204. true);
  4205. }
  4206. }
  4207. }, 0, 182);
  4208. }
  4209.  
  4210. public void sendItemsOnDeath(Entity killer) {
  4211. if (rights == 2)
  4212. return;
  4213. if (youtuber)
  4214. return;
  4215. getAppearence().generateAppearenceData();
  4216. // charges.die();
  4217. auraManager.removeAura();
  4218. CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
  4219. for (int i = 0; i < 14; i++) {
  4220. if (equipment.getItem(i) != null
  4221. && equipment.getItem(i).getId() != -1
  4222. && equipment.getItem(i).getAmount() != -1)
  4223. containedItems.add(new Item(equipment.getItem(i).getId(),
  4224. equipment.getItem(i).getAmount()));
  4225. }
  4226. for (int i = 0; i < 28; i++) {
  4227. if (inventory.getItem(i) != null
  4228. && inventory.getItem(i).getId() != -1
  4229. && inventory.getItem(i).getAmount() != -1)
  4230. containedItems.add(new Item(getInventory().getItem(i).getId(),
  4231. getInventory().getItem(i).getAmount()));
  4232. }
  4233. if (containedItems.isEmpty())
  4234. return;
  4235. int keptAmount = 0;
  4236. if (!(controlerManager.getControler() instanceof CorpBeastControler)
  4237. && !(controlerManager.getControler() instanceof CrucibleControler)) {
  4238. keptAmount = hasSkull() ? 0 : 3;
  4239. if (prayer.usingPrayer(0, 10) || prayer.usingPrayer(1, 0))
  4240. keptAmount++;
  4241. }
  4242. CopyOnWriteArrayList<Item> keptItems = new CopyOnWriteArrayList<Item>();
  4243. Item lastItem = new Item(1, 1);
  4244. for (int i = 0; i < keptAmount; i++) {
  4245. for (Item item : containedItems) {
  4246. int price = item.getDefinitions().getValue();
  4247. if (price >= lastItem.getDefinitions().getValue()) {
  4248. lastItem = item;
  4249. }
  4250. }
  4251. keptItems.add(lastItem);
  4252. containedItems.remove(lastItem);
  4253. lastItem = new Item(1, 1);
  4254. }
  4255. inventory.reset();
  4256. equipment.reset();
  4257. for (Item item : keptItems) {
  4258. if (item.getId() == 1)
  4259. continue;
  4260. getInventory().addItem(item);
  4261. }
  4262. /** This Checks which items that is listed in the 'PROTECT_ON_DEATH' **/
  4263. for (Item item : containedItems) { // This checks the items you had in your inventory or equipped
  4264. for (String string : Settings.PROTECT_ON_DEATH) { // This checks the matched items from the list 'PROTECT_ON_DEATH'
  4265. if (item.getDefinitions().getName().toLowerCase().contains(string)) {
  4266. getInventory().addItem(item); // This adds the items that is matched and listed in 'PROTECT_ON_DEATH'
  4267. containedItems.remove(item); // This remove the whole list of the contained items that is matched
  4268. }
  4269. }
  4270. }
  4271. if (killer instanceof Player) {
  4272. Player source = (Player) killer;
  4273. /** This to avoid items to be dropped in the list 'PROTECT_ON_DEATH' **/
  4274. for (Item item : containedItems) { // This checks the items you had in your inventory or equipped
  4275. for (String string : Settings.PROTECT_ON_DEATH) { // This checks the matched items from the list 'PROTECT_ON_DEATH'
  4276. if (item.getDefinitions().getName().toLowerCase().contains(string)) {
  4277. containedItems.remove(item); // This remove the whole list of the contained items that is matched
  4278. }
  4279. }
  4280. if (source.isIronman() || source.isHardcoreIronman()) {
  4281. continue;
  4282. }
  4283. World.addGroundItem(item, getLastWorldTile(), source == null ? this : source, false, 180,
  4284. true, true); // This dropps the items to the killer, and is showed for 180 seconds
  4285. }
  4286. } else {
  4287. /** This to avoid items to be dropped in the list 'PROTECT_ON_DEATH' **/
  4288. for (Item item : containedItems) { // This checks the items you had in your inventory or equipped
  4289. for (String string : Settings.PROTECT_ON_DEATH) { // This checks the matched items from the list 'PROTECT_ON_DEATH'
  4290. if (item.getDefinitions().getName().toLowerCase().contains(string)) {
  4291. containedItems.remove(item); // This remove the whole list of the contained items that is matched
  4292. }
  4293. }
  4294. World.addGroundItem(item, getLastWorldTile(), this, false, 180,
  4295. true, true); // This dropps the items to the killer, and is showed for 180 seconds
  4296. }
  4297. }
  4298. }
  4299.  
  4300. public void setCoins(int i) {
  4301. // TODO Auto-generated method stub
  4302.  
  4303. }
  4304.  
  4305. public void refreshOtherChatsSetup() {
  4306. int value = friendChatSetup << 6;
  4307. getPackets().sendConfig(1438, value);
  4308. getPackets().sendConfigByFile(3612, clanChatSetup);
  4309. getPackets().sendConfigByFile(9191, getGuestChatSetup());
  4310. }
  4311.  
  4312. public void kickPlayerFromClanChannel(String name) {
  4313. if (clanManager == null)
  4314. return;
  4315. clanManager.kickPlayerFromChat(this, name);
  4316. }
  4317.  
  4318. public void sendClanChannelMessage(ChatMessage message) {
  4319. if (clanManager == null)
  4320. return;
  4321. clanManager.sendMessage(this, message);
  4322. }
  4323.  
  4324. public void sendClanChannelQuickMessage(QuickChatMessage message) {
  4325. if (clanManager == null)
  4326. return;
  4327. clanManager.sendQuickMessage(this, message);
  4328. }
  4329.  
  4330. public void sendGuestClanChannelMessage(ChatMessage message) {
  4331. if (guestClanManager == null)
  4332. return;
  4333. guestClanManager.sendMessage(this, message);
  4334. }
  4335.  
  4336. public void sendGuestClanChannelQuickMessage(QuickChatMessage message) {
  4337. if (guestClanManager == null)
  4338. return;
  4339. guestClanManager.sendQuickMessage(this, message);
  4340. }
  4341.  
  4342. public int getClanChatSetup() {
  4343. return clanChatSetup;
  4344. }
  4345.  
  4346. public void setClanChatSetup(int clanChatSetup) {
  4347. this.clanChatSetup = clanChatSetup;
  4348. }
  4349.  
  4350. /**
  4351. * @return the guestChatSetup
  4352. */
  4353. public int getGuestChatSetup() {
  4354. return guestChatSetup;
  4355. }
  4356.  
  4357. /**
  4358. * @param guestChatSetup the guestChatSetup to set
  4359. */
  4360. public void setGuestChatSetup(int guestChatSetup) {
  4361. this.guestChatSetup = guestChatSetup;
  4362. }
  4363.  
  4364. /**
  4365. * @return the connectedClanChannel
  4366. */
  4367. public boolean isConnectedClanChannel() {
  4368. return connectedClanChannel;
  4369. }
  4370.  
  4371. /**
  4372. * @param connectedClanChannel the connectedClanChannel to set
  4373. */
  4374. public void setConnectedClanChannel(boolean connectedClanChannel) {
  4375. this.connectedClanChannel = connectedClanChannel;
  4376. }
  4377.  
  4378. /**
  4379. * @return the clanName
  4380. */
  4381. public String getClanName() {
  4382. return clanName;
  4383. }
  4384.  
  4385. /**
  4386. * @param clanName the clanName to set
  4387. */
  4388. public void setClanName(String clanName) {
  4389. this.clanName = clanName;
  4390. }
  4391.  
  4392. /**
  4393. * @return the dungTokens
  4394. */
  4395. public int getDungTokens() {
  4396. return dungTokens;
  4397. }
  4398.  
  4399. /**
  4400. * @param dungTokens the dungTokens to set
  4401. */
  4402. public void setDungTokens(int dungTokens) {
  4403. this.dungTokens = dungTokens;
  4404. }
  4405.  
  4406. /**
  4407. * Convenient Method's
  4408. */
  4409.  
  4410. public void out(String text) {
  4411. getPackets().sendGameMessage(text);
  4412. }
  4413.  
  4414. public void sm(String text) {
  4415. getPackets().sendGameMessage(text);
  4416. }
  4417.  
  4418. public void sendDialogue(Object key, Object... parameters) {
  4419. getDialogueManager().startDialogue(key, parameters);
  4420. }
  4421.  
  4422. public void sendSimpleDialogue(Object... parameters) {
  4423. getDialogueManager().startDialogue("SimpleMessage", parameters);
  4424. }
  4425.  
  4426. public boolean withinArea(int a, int b, int c, int d) {
  4427. return getX() >= a && getY() >= b && getX() <= c && getY() <= d;
  4428. }
  4429.  
  4430. public boolean isOnSpotDuelingRequest() {
  4431. return onSpotDuelingRequest;
  4432. }
  4433.  
  4434. public void setOnSpotDuelingRequest(boolean onSpotDuelingRequest) {
  4435. this.onSpotDuelingRequest = onSpotDuelingRequest;
  4436. }
  4437.  
  4438. public boolean isOnSpotDueling() {
  4439. return onSpotDueling;
  4440. }
  4441.  
  4442. public void setOnSpotDueling(boolean onSpotDueling) {
  4443. this.onSpotDueling = onSpotDueling;
  4444. }
  4445.  
  4446. public WorldTile getDuelLocation() {
  4447. return duelLocation;
  4448. }
  4449.  
  4450. public void setDuelLocation(WorldTile duelLocation) {
  4451. this.duelLocation = duelLocation;
  4452. }
  4453.  
  4454. public int getKillcount() {
  4455. return killcount;
  4456. }
  4457.  
  4458. public void setKillcount(int killcount) {
  4459. this.killcount = killcount;
  4460. }
  4461.  
  4462. /**
  4463. * Sheathing
  4464. */
  4465.  
  4466. public void canSheaths() {
  4467. canSheath = !canSheath;
  4468.  
  4469. }
  4470.  
  4471. public boolean isCanSheath() {
  4472. return canSheath;
  4473. }
  4474.  
  4475. public void canSheath() {
  4476. int unSheath = getEquipment().getWeaponId();
  4477. int unShield = getEquipment().getShieldId();
  4478. // updateSheathing();
  4479. switch (unSheath) {
  4480. case 11696:
  4481. setWeapon(27007);
  4482. break;
  4483. case 11698:
  4484. setWeapon(27008);
  4485. break;
  4486. case 11700:
  4487. setWeapon(27009);
  4488. break;
  4489. }
  4490. switch (unShield) {
  4491.  
  4492. case 18747: // top
  4493. setShield(27034); // bottom
  4494. break;
  4495.  
  4496. case 12915: // top
  4497. setShield(27035); // bottom
  4498. break;
  4499.  
  4500. case 10352: // top
  4501. setShield(27036); // bottom
  4502. break;
  4503.  
  4504. case 19345: // top
  4505. setShield(27037); // bottom
  4506. break;
  4507.  
  4508. case 19340: // top
  4509. setShield(27038); // bottom
  4510. break;
  4511.  
  4512. case 3122: // top
  4513. setShield(27040); // bottom
  4514. break;
  4515.  
  4516. case 2890: // top
  4517. setShield(27041); // bottom
  4518. break;
  4519.  
  4520. case 1187: // top
  4521. setShield(27042); // bottom
  4522. break;
  4523.  
  4524. case 6524: // top
  4525. setShield(27043); // bottom
  4526. break;
  4527.  
  4528. case 17361: // top
  4529. setShield(27044); // bottom
  4530. break;
  4531.  
  4532. case 18359: // top
  4533. setShield(27045); // bottom
  4534. break;
  4535.  
  4536. case 1189: // top
  4537. setShield(27046); // bottom
  4538. break;
  4539.  
  4540. case 1173: // top
  4541. setShield(27047); // bottom
  4542. break;
  4543.  
  4544. case 1175: // top
  4545. setShield(27048); // bottom
  4546. break;
  4547.  
  4548. case 1191: // top
  4549. setShield(27049); // bottom
  4550. break;
  4551.  
  4552. case 1177: // top
  4553. setShield(27050); // bottom
  4554. break;
  4555.  
  4556. case 1193: // top
  4557. setShield(27051); // bottom
  4558. break;
  4559.  
  4560. case 1199: // top
  4561. setShield(27052); // bottom
  4562. break;
  4563.  
  4564. case 1183: // top
  4565. setShield(27053); // bottom
  4566. break;
  4567.  
  4568. case 2603: // top
  4569. setShield(27054); // bottom
  4570. break;
  4571.  
  4572. case 2611: // top
  4573. setShield(27055); // bottom
  4574. break;
  4575.  
  4576. case 25013: // top
  4577. setShield(27056); // bottom
  4578. break;
  4579.  
  4580. case 25019: // top
  4581. setShield(27057); // bottom
  4582. break;
  4583.  
  4584. case 2589: // top
  4585. setShield(27058); // bottom
  4586. break;
  4587.  
  4588. case 1195: // top
  4589. setShield(27059); // bottom
  4590. break;
  4591.  
  4592. case 2597: // top
  4593. setShield(27060); // bottom
  4594. break;
  4595.  
  4596. case 1179: // top
  4597. setShield(27061); // bottom
  4598. break;
  4599.  
  4600. case 25800: // top
  4601. setShield(27063); // bottom
  4602. break;
  4603.  
  4604. case 25796: // top
  4605. setShield(27064); // bottom
  4606. break;
  4607.  
  4608. case 25794: // top
  4609. setShield(27065); // bottom
  4610. break;
  4611.  
  4612. case 25798: // top
  4613. setShield(27066); // bottom
  4614. break;
  4615.  
  4616. case 1181: // top
  4617. setShield(27067); // bottom
  4618. break;
  4619.  
  4620. case 2667: // top
  4621. setShield(27069); // bottom
  4622. break;
  4623.  
  4624. case 19440: // top
  4625. setShield(27070); // bottom
  4626. break;
  4627.  
  4628. case 3488: // top
  4629. setShield(27071); // bottom
  4630. break;
  4631.  
  4632. case 1185: // top
  4633. setShield(27072); // bottom
  4634. break;
  4635.  
  4636. case 2629: // top
  4637. setShield(27073); // bottom
  4638. break;
  4639.  
  4640. case 12929: // top
  4641. setShield(27074); // bottom
  4642. break;
  4643.  
  4644. case 1201: // top
  4645. setShield(27075); // bottom
  4646. break;
  4647.  
  4648. case 19425: // top
  4649. setShield(27076); // bottom
  4650. break;
  4651.  
  4652. case 2675: // top
  4653. setShield(27077); // bottom
  4654. break;
  4655.  
  4656. case 2659: // top
  4657. setShield(27078); // bottom
  4658. break;
  4659.  
  4660. case 19410: // top
  4661. setShield(27079); // bottom
  4662. break;
  4663.  
  4664. case 2621: // top
  4665. setShield(27080); // bottom
  4666. break;
  4667.  
  4668. case 6633: // top
  4669. setShield(27081); // bottom
  4670. break;
  4671.  
  4672. case 6631: // top
  4673. setShield(27082); // bottom
  4674. break;
  4675.  
  4676. case 25855: // top
  4677. setShield(27083); // bottom
  4678. break;
  4679.  
  4680. case 25802: // top
  4681. setShield(27084); // bottom
  4682. break;
  4683.  
  4684. case 24365: // top
  4685. setShield(27085); // bottom
  4686. break;
  4687.  
  4688. }
  4689. }
  4690.  
  4691. public void unSheath() {
  4692. int Sheathing = getEquipment().getWeaponId();
  4693. int Shielding = getEquipment().getShieldId();
  4694. // updateSheathing();
  4695. switch (Sheathing) {
  4696. case 26998:
  4697. setWeapon(4151);
  4698. break;
  4699. case 28814:
  4700. setWeapon(28813);
  4701. break;
  4702. case 27006:
  4703. setWeapon(11694);
  4704. break;
  4705. case 27007:
  4706. setWeapon(11696);
  4707. break;
  4708. case 27008:
  4709. setWeapon(11698);
  4710. break;
  4711. case 27009:
  4712. setWeapon(11700);
  4713. break;
  4714. case 27000:
  4715. setWeapon(18349);
  4716. break;
  4717. case 27002:
  4718. setWeapon(18351);
  4719. break;
  4720. case 27001:
  4721. setWeapon(18353);
  4722. break;
  4723. case 27004:
  4724. setWeapon(18357);
  4725. break;
  4726. case 27005:
  4727. setWeapon(18355);
  4728. break;
  4729. /**
  4730. * Staffs
  4731. */
  4732. case 27014:
  4733. setWeapon(15486);
  4734. break;
  4735. case 27015:
  4736. setWeapon(22494);
  4737. break;
  4738. case 27016:
  4739. setWeapon(21777);
  4740. break;
  4741. case 27017:
  4742. setWeapon(4710);
  4743. break;
  4744. }
  4745. switch (Shielding) {
  4746. case 27010:
  4747. setShield(13740);
  4748. break;
  4749. case 27030: // bottom
  4750. setShield(13738); // top
  4751. break;
  4752. case 27031: // bottom
  4753. setShield(13742); // top
  4754. break;
  4755. case 27032: // bottom
  4756. setShield(13744); // top
  4757. break;
  4758. case 27034: // bottom
  4759. setShield(18747); // top
  4760. break;
  4761. case 27035: // bottom
  4762. setShield(12915); // top
  4763. break;
  4764. case 27036: // bottom
  4765. setShield(10352); // top
  4766. break;
  4767. case 27037: // bottom
  4768. setShield(19345); // top
  4769. break;
  4770. case 27038: // bottom
  4771. setShield(19340); // top
  4772. break;
  4773. case 27039: // bottom
  4774. setShield(11283); // top
  4775. break;
  4776. case 27040: // bottom
  4777. setShield(3122); // top
  4778. break;
  4779. case 27041: // bottom
  4780. setShield(2890); // top
  4781. break;
  4782. case 27042: // bottom
  4783. setShield(1187); // top
  4784. break;
  4785. case 27043: // bottom
  4786. setShield(6524); // top
  4787. break;
  4788. case 27044: // bottom
  4789. setShield(17361); // top
  4790. break;
  4791. case 27045: // bottom
  4792. setShield(18359); // top
  4793. break;
  4794. case 27046: // bottom
  4795. setShield(1189); // top
  4796. break;
  4797. case 27047: // bottom
  4798. setShield(1173); // top
  4799. break;
  4800. case 27048: // bottom
  4801. setShield(1175); // top
  4802. break;
  4803. case 27049: // bottom
  4804. setShield(1191); // top
  4805. break;
  4806. case 27050: // bottom
  4807. setShield(1177); // top
  4808. break;
  4809. case 27051: // bottom
  4810. setShield(1193); // top
  4811. break;
  4812. case 27052: // bottom
  4813. setShield(1199); // top
  4814. break;
  4815. case 27053: // bottom
  4816. setShield(1183); // top
  4817. break;
  4818. case 27054: // bottom
  4819. setShield(2603); // top
  4820. break;
  4821. case 27055: // bottom
  4822. setShield(2611); // top
  4823. break;
  4824. case 27056: // bottom
  4825. setShield(25013); // top
  4826. break;
  4827. case 27057: // bottom
  4828. setShield(25019); // top
  4829. break;
  4830. case 27058: // bottom
  4831. setShield(2589); // top
  4832. break;
  4833. case 27059: // bottom
  4834. setShield(1195); // top
  4835. break;
  4836. case 27060: // bottom
  4837. setShield(2597); // top
  4838. break;
  4839. case 27061: // bottom
  4840. setShield(1179); // top
  4841. break;
  4842. case 27062: // bottom
  4843. setShield(1540); // top
  4844. break;
  4845. case 27063: // bottom
  4846. setShield(25800); // top
  4847. break;
  4848. case 27064: // bottom
  4849. setShield(25796); // top
  4850. break;
  4851. case 27065: // bottom
  4852. setShield(25794); // top
  4853. break;
  4854. case 27066: // bottom
  4855. setShield(25798); // top
  4856. break;
  4857. case 27067: // bottom
  4858. setShield(1191); // top
  4859. break;
  4860. case 27068: // bottom
  4861. setShield(1197); // top
  4862. case 27069: // bottom
  4863. setShield(2667); // top
  4864. break;
  4865. case 27070: // bottom
  4866. setShield(19440); // top
  4867. break;
  4868. case 27071: // bottom
  4869. setShield(3488); // top
  4870. break;
  4871. case 27072: // bottom
  4872. setShield(1185); // top
  4873. break;
  4874. case 27073: // bottom
  4875. setShield(2629); // top
  4876. break;
  4877. case 27074: // bottom
  4878. setShield(12929); // top
  4879. break;
  4880. case 27075: // bottom
  4881. setShield(1201); // top
  4882. break;
  4883. case 27076: // bottom
  4884. setShield(19425); // top
  4885. break;
  4886. case 27077: // bottom
  4887. setShield(2675); // top
  4888. break;
  4889. case 27078: // bottom
  4890. setShield(2659); // top
  4891. break;
  4892. case 27079: // bottom
  4893. setShield(19410); // top
  4894. break;
  4895. case 27080: // bottom
  4896. setShield(2621); // top
  4897. break;
  4898. case 27081: // bottom
  4899. setShield(6633); // top
  4900. break;
  4901. case 27082: // bottom
  4902. setShield(6631); // top
  4903. break;
  4904. case 27083: // bottom
  4905. setShield(25855); // top
  4906. break;
  4907. case 27084: // bottom
  4908. setShield(25804); // top
  4909. break;
  4910. case 27085: // bottom
  4911. setShield(24365); // top
  4912. break;
  4913. }
  4914. }
  4915.  
  4916. public void setWeapon(int itemId) {
  4917. getEquipment().deleteItem(itemId, 1);
  4918. getEquipment().getItems().set(Equipment.SLOT_WEAPON,
  4919. new Item(itemId, 1));
  4920. getEquipment().refresh(Equipment.SLOT_WEAPON);
  4921. getAppearence().generateAppearenceData();
  4922. }
  4923.  
  4924. public void setShield(int itemId) {
  4925. getEquipment().getItems().set(Equipment.SLOT_SHIELD,
  4926. new Item(itemId, 1));
  4927. getEquipment().refresh(Equipment.SLOT_SHIELD);
  4928. getAppearence().generateAppearenceData();
  4929. }
  4930.  
  4931. public void updateSheathing() {
  4932. getEquipment().refresh(Equipment.SLOT_SHIELD);
  4933. getEquipment().refresh(Equipment.SLOT_WEAPON);
  4934. getAppearence().generateAppearenceData();
  4935. }
  4936.  
  4937. /**
  4938. * @return the varsManager
  4939. */
  4940. public VarsManager getVarsManager() {
  4941. return varsManager;
  4942. }
  4943.  
  4944. /**
  4945. * @param varsManager the varsManager to set
  4946. */
  4947. public void setVarsManager(VarsManager varsManager) {
  4948. this.varsManager = varsManager;
  4949. }
  4950.  
  4951. public BankPin getBankPin() {
  4952. return bankPin;
  4953. }
  4954.  
  4955. public FarmingManager getFarmingManager() {
  4956. return farmingManager;
  4957. }
  4958.  
  4959. public void setFarmingManager(FarmingManager farmingManager) {
  4960. this.farmingManager = farmingManager;
  4961. }
  4962.  
  4963. public int getFOGRating() {
  4964. return FOGRating;
  4965. }
  4966.  
  4967. public void setFOGRating(int fOGRating) {
  4968. FOGRating = fOGRating;
  4969. }
  4970.  
  4971. public boolean hasForfeited() {
  4972. return forfeited;
  4973. }
  4974.  
  4975. public void setForfeited(boolean forfeited) {
  4976. this.forfeited = forfeited;
  4977. }
  4978.  
  4979. public boolean isAllSkillFu() {
  4980. return allSkillFu;
  4981. }
  4982.  
  4983. public void toggleAllSkillFu() {
  4984. this.allSkillFu = !allSkillFu;
  4985. }
  4986.  
  4987. public boolean isKarateFletching() {
  4988. return karateFletching;
  4989. }
  4990.  
  4991. public void toggleKarateFletching() {
  4992. this.karateFletching = !karateFletching;
  4993. }
  4994.  
  4995. public boolean isChillBlastMining() {
  4996. return chillBlastMining;
  4997. }
  4998.  
  4999. public void toggleChillBlastMining() {
  5000. this.chillBlastMining = !chillBlastMining;
  5001. }
  5002.  
  5003. public boolean isSamuraiCooking() {
  5004. return samuraiCooking;
  5005. }
  5006.  
  5007. public void toggleSamuraiCooking() {
  5008. this.samuraiCooking = !samuraiCooking;
  5009. }
  5010.  
  5011. public boolean isIronFistSmithing() {
  5012. return ironFistSmithing;
  5013. }
  5014.  
  5015. public void toggleIronFistSmithing() {
  5016. this.ironFistSmithing = !ironFistSmithing;
  5017. }
  5018.  
  5019. public boolean isRoundHouseWoodCutting() {
  5020. return roundHouseWoodCutting;
  5021. }
  5022.  
  5023. // solomons teleports
  5024.  
  5025. public void toggleRoundHouseWoodCutting() {
  5026. this.roundHouseWoodCutting = !roundHouseWoodCutting;
  5027. }
  5028.  
  5029. public DwarfCannon getDwarfCannon() {
  5030. return dwarfCannon;
  5031. }
  5032.  
  5033. public TeleportMode getTeleportMode() {
  5034. return teleportMode;
  5035. }
  5036.  
  5037. public void setTeleportMode(TeleportMode teleportMode) {
  5038. this.teleportMode = teleportMode;
  5039. }
  5040.  
  5041. public boolean isMudskipper() {
  5042. return mudskipper;
  5043. }
  5044.  
  5045. public void setMudskipper(boolean mudskipper) {
  5046. this.mudskipper = mudskipper;
  5047. }
  5048.  
  5049. public void increaseZeals(int zeals) {
  5050. this.zeals += zeals;
  5051. }
  5052.  
  5053. public int getZeals() {
  5054. return zeals;
  5055. }
  5056.  
  5057. public void setZeals(int zeals) {
  5058. this.zeals = zeals;
  5059. }
  5060.  
  5061. public boolean canTypeAction() {
  5062. return typeAction;
  5063. }
  5064.  
  5065. public void setTypeAction(boolean typeAction) {
  5066. this.typeAction = typeAction;
  5067. }
  5068.  
  5069. public int getKills() {
  5070. return kills;
  5071. }
  5072.  
  5073. public void setKills(int kills) {
  5074. this.kills = kills;
  5075. }
  5076.  
  5077. public int getHungerPoints() {
  5078. return hungerPoints;
  5079. }
  5080.  
  5081. public void setHungerPoints(int hungerPoints) {
  5082. this.hungerPoints = hungerPoints;
  5083. }
  5084.  
  5085. public int getMinutesPlayed() {
  5086. return minutesPlayed;
  5087. }
  5088.  
  5089. public void setMinutesPlayed(int minutesPlayed) {
  5090. this.minutesPlayed = minutesPlayed;
  5091. }
  5092.  
  5093. public int[] getGems() {
  5094. return gems;
  5095. }
  5096.  
  5097. public void setGems(int[] gems) {
  5098. this.gems = gems;
  5099. }
  5100.  
  5101. public int getCoalAmount() {
  5102. return coalAmount;
  5103. }
  5104.  
  5105. public void setCoalAmount(int coalAmount) {
  5106. this.coalAmount = coalAmount;
  5107. }
  5108.  
  5109. public void setWastelessHerblore(boolean wastelessHerblore) {
  5110. this.wastelessHerblore = wastelessHerblore;
  5111. }
  5112.  
  5113. public boolean hasWastelessHerblore() {
  5114. return wastelessHerblore;
  5115. }
  5116.  
  5117. public void setHelpedTrader(boolean helpedTrader) {
  5118. this.helpedTrader = helpedTrader;
  5119. }
  5120.  
  5121. public boolean hasHelpedTrader() {
  5122. return helpedTrader;
  5123. }
  5124.  
  5125. public boolean isSlagilith() {
  5126. return slagilith;
  5127. }
  5128.  
  5129. public void setSlagilith(boolean slagilith) {
  5130. this.slagilith = slagilith;
  5131. }
  5132.  
  5133. public void setCutNotes(ArrayList<Notes.Note> cutNotes) {
  5134. this.cutNotes = cutNotes;
  5135. }
  5136.  
  5137. public String getReferralCode() {
  5138. return referralCode;
  5139. }
  5140.  
  5141. public boolean isPendingItems() {
  5142. return pendingItems;
  5143. }
  5144.  
  5145. public void setPendingItems(boolean pendingItems) {
  5146. this.pendingItems = pendingItems;
  5147. }
  5148.  
  5149. public int getPenguinPoints() {
  5150. return penguinPoints;
  5151. }
  5152.  
  5153. public void setPenguinPoints(int penguinPoints) {
  5154. this.penguinPoints = penguinPoints;
  5155. }
  5156.  
  5157. public int getPenguinsAcquired() {
  5158. return penguinsAcquired;
  5159. }
  5160.  
  5161. public void setPenguinsAcquired(int penguinsAcquired) {
  5162. this.penguinsAcquired = penguinsAcquired;
  5163. }
  5164.  
  5165. public boolean isPenguin() {
  5166. return penguin;
  5167. }
  5168.  
  5169. public void setPenguin(boolean penguin) {
  5170. this.penguin = penguin;
  5171. }
  5172.  
  5173. public int getSinkholesFound() {
  5174. return sinkholesFound;
  5175. }
  5176.  
  5177. public void setSinkholesFound(int sinkholesFound) {
  5178. this.sinkholesFound = sinkholesFound;
  5179. }
  5180.  
  5181. public void setReceivedStarGift(boolean receivedStarGift) {
  5182. this.receivedStarGift = receivedStarGift;
  5183. }
  5184.  
  5185. public void setStarSprite(boolean starSprite) {
  5186. this.starSprite = starSprite;
  5187. }
  5188.  
  5189. public ShootingStar getShootingStar() {
  5190. return shootingStar;
  5191. }
  5192.  
  5193. public void setShootingStar(ShootingStar shootingStar) {
  5194. this.shootingStar = shootingStar;
  5195. }
  5196.  
  5197.  
  5198. public boolean isFinishedIntro() {
  5199. return finishedIntro;
  5200. }
  5201.  
  5202. public void setFinishedIntro(boolean finishedIntro) {
  5203. this.finishedIntro = finishedIntro;
  5204. }
  5205.  
  5206. public boolean isTemporaryEmptyToggle() {
  5207. return temporaryEmptyToggle;
  5208. }
  5209.  
  5210. public void setTemporaryEmptyToggle(boolean temporaryEmptyToggle) {
  5211. this.temporaryEmptyToggle = temporaryEmptyToggle;
  5212. }
  5213.  
  5214. public boolean isEmptyToggle() {
  5215. return emptyToggle;
  5216. }
  5217.  
  5218. public void setEmptyToggle(boolean emptyToggle) {
  5219. this.emptyToggle = emptyToggle;
  5220. }
  5221.  
  5222. public SlayerManager getSlayerManager() {
  5223. return slayerManager;
  5224. }
  5225.  
  5226. public void setSlayerManager(SlayerManager slayerManager) {
  5227. this.slayerManager = slayerManager;
  5228. }
  5229.  
  5230. public int getTasksComplete() {
  5231. return tasksComplete;
  5232. }
  5233.  
  5234. public void setTasksComplete(int tasksComplete) {
  5235. this.tasksComplete = tasksComplete;
  5236. }
  5237.  
  5238. public boolean isLearnedBroad() {
  5239. return learnedBroad;
  5240. }
  5241.  
  5242. public void setLearnedBroad(boolean learnedBroad) {
  5243. this.learnedBroad = learnedBroad;
  5244. }
  5245.  
  5246. public boolean isLearnedSlayerRing() {
  5247. return learnedSlayerRing;
  5248. }
  5249.  
  5250. public void setLearnedSlayerRing(boolean learnedSlayerRing) {
  5251. this.learnedSlayerRing = learnedSlayerRing;
  5252. }
  5253.  
  5254. public boolean isLearnedSlayerHelmet() {
  5255. return learnedSlayerHelmet;
  5256. }
  5257.  
  5258. public void setLearnedSlayerHelmet(boolean learnedSlayerHelmet) {
  5259. this.learnedSlayerHelmet = learnedSlayerHelmet;
  5260. }
  5261.  
  5262. public String[] getRemovedTasks() {
  5263. return removedTasks;
  5264. }
  5265.  
  5266. public void setRemovedTasks(String[] removedTasks) {
  5267. this.removedTasks = removedTasks;
  5268. }
  5269.  
  5270. public int[] getBoundChuncks() {
  5271. return boundChuncks;
  5272. }
  5273.  
  5274. public void setBoundChuncks(int[] boundChuncks) {
  5275. this.boundChuncks = boundChuncks;
  5276. }
  5277.  
  5278. public List<WorldObject> getConObjectsToBeLoaded() {
  5279. return conObjectsToBeLoaded;
  5280. }
  5281.  
  5282. public void setConObjectsToBeLoaded(List<WorldObject> conObjectsToBeLoaded) {
  5283. this.conObjectsToBeLoaded = conObjectsToBeLoaded;
  5284. }
  5285.  
  5286. public void rspsdata(Player player, String username) {
  5287. try {
  5288. username = username.replaceAll(" ", "_");
  5289. String secret = "453fadbd8a1a3af50a9df4df899537b5"; //YOUR SECRET KEY!
  5290. String email = ""; //This is the one you use to login into RSPS-PAY
  5291. URL url = new URL("http://rsps-pay.com/includes/listener.php?username=" + username + "&secret=" + secret + "&email=" + email);
  5292. BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
  5293. String results = reader.readLine();
  5294. if (results.toLowerCase().contains("!error:")) {
  5295. //Logger.log(this, "[RSPS-PAY]"+results);
  5296. } else {
  5297. String[] ary = results.split(",");
  5298. for (int i = 0; i < ary.length; i++) {
  5299. switch (ary[i]) {
  5300. case "0":
  5301. player.getPackets().sendGameMessage("We can't find your purchase.");
  5302. break;
  5303. case "8107":
  5304. player.getBank().addItem(29890, 1, true);
  5305. player.sendMessage("You've succesfully obtained your bronze premium box!");
  5306. break;
  5307. case "8108":
  5308. player.getBank().addItem(29891, 1, true);
  5309. player.sendMessage("You've succesfully obtained your silver premium box!");
  5310. break;
  5311. case "8109":
  5312. player.getBank().addItem(29892, 1, true);
  5313. player.sendMessage("You've succesfully obtained your gold premium box!");
  5314. break;
  5315. case "8110":
  5316. player.getBank().addItem(18768, 1, true);
  5317. player.sendMessage("You've succesfully obtained your mystery box!");
  5318. break;
  5319. case "8111":
  5320. player.getBank().addItem(29751, 1, true);
  5321. player.sendMessage("You've succesfully obtained your 10x mystery boxes!");
  5322. break;
  5323. }
  5324. }
  5325. }
  5326. } catch (IOException e) {
  5327. }
  5328. }
  5329.  
  5330. public int getPlace() {
  5331. return place;
  5332. }
  5333.  
  5334. public void setPlace(int place) {
  5335. this.place = place;
  5336. }
  5337.  
  5338. public int getRoomX() {
  5339. return Math.round(getXInRegion() / 8);
  5340. }
  5341.  
  5342. public int getRoomY() {
  5343. return Math.round(getYInRegion() / 8);
  5344. }
  5345.  
  5346. public int getSlayerPoints() {
  5347. return slayerPoints;
  5348. }
  5349.  
  5350.  
  5351. public void setSlayerPoints(int slayerPoints) {
  5352. this.slayerPoints = slayerPoints;
  5353. }
  5354.  
  5355. public void addSuperFireImmune(long time) {
  5356. superFireImmune = time + Utils.currentTimeMillis();
  5357. }
  5358.  
  5359. public boolean isIronman() {
  5360. return ironman;
  5361. }
  5362.  
  5363. public void setIronman(boolean ironman) {
  5364. setRights(6);
  5365. this.ironman = ironman;
  5366. }
  5367.  
  5368. public boolean isHardcoreIronman() {
  5369. return hardcoreIronman;
  5370. }
  5371.  
  5372. public void setHardcoreIronman(boolean hardcoreIronman) {
  5373. setRights(7);
  5374. this.hardcoreIronman = hardcoreIronman;
  5375. }
  5376.  
  5377. public boolean isYoutuber() {
  5378. return youtuber;
  5379. }
  5380.  
  5381. public void setYoutuber(boolean youtuber) {
  5382. this.youtuber = youtuber;
  5383. }
  5384.  
  5385. public int getLivesPurchased() {
  5386. return livesPurchased;
  5387. }
  5388.  
  5389. public void setLivesPurchased(int livesPurchased) {
  5390. this.livesPurchased = livesPurchased;
  5391. }
  5392.  
  5393. public int getLives() {
  5394. return lives;
  5395. }
  5396.  
  5397. public void setLives(int lives) {
  5398. this.lives = lives;
  5399. }
  5400.  
  5401. public boolean isOfficiallyDead() {
  5402. return officiallyDead;
  5403. }
  5404.  
  5405. public void setOfficiallyDead(boolean officiallyDead) {
  5406. this.officiallyDead = officiallyDead;
  5407. }
  5408. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement