Guest User

Untitled

a guest
Sep 5th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 238.01 KB | None | 0 0
  1. package com.rs.game.player;
  2.  
  3. import java.net.InetAddress;
  4. import java.net.UnknownHostException;
  5. import java.text.DateFormat;
  6. import java.text.SimpleDateFormat;
  7. import java.util.ArrayList;
  8. import java.util.Collections;
  9. import java.util.Date;
  10. import java.util.LinkedList;
  11. import java.util.List;
  12. import java.util.concurrent.ConcurrentLinkedQueue;
  13. import java.util.concurrent.CopyOnWriteArrayList;
  14. import java.util.concurrent.TimeUnit;
  15.  
  16. import com.rs.Settings;
  17. import com.rs.cache.loaders.ItemDefinitions;
  18. import com.rs.cores.CoresManager;
  19. import com.rs.game.Animation;
  20. import com.rs.game.CrossWorldMessages;
  21. import com.rs.game.Entity;
  22. import com.rs.game.ForceTalk;
  23. import com.rs.game.Graphics;
  24. import com.rs.game.Hit;
  25. import com.rs.game.Hit.HitLook;
  26. import com.rs.game.LotteryManager;
  27. import com.rs.game.PlayersOnlineUpdater;
  28. import com.rs.game.World;
  29. import com.rs.game.WorldObject;
  30. import com.rs.game.WorldTile;
  31. import com.rs.game.item.FloorItem;
  32. import com.rs.game.item.Item;
  33. import com.rs.game.item.ItemsContainer;
  34. import com.rs.game.minigames.ClanWars;
  35. import com.rs.game.minigames.DiceGame;
  36. import com.rs.game.minigames.FlowerGame;
  37. import com.rs.game.minigames.PestControl;
  38. import com.rs.game.minigames.Trivia;
  39. import com.rs.game.minigames.War;
  40. import com.rs.game.minigames.ancientthrone.ThroneManager;
  41. import com.rs.game.minigames.duel.DuelArena;
  42. import com.rs.game.minigames.duel.DuelRules;
  43. import com.rs.game.minigames.duel.DuelTrade;
  44. import com.rs.game.npc.NPC;
  45. import com.rs.game.npc.familiar.Familiar;
  46. import com.rs.game.npc.godwars.zaros.Nex;
  47. import com.rs.game.npc.reputation.Reputation;
  48. import com.rs.game.player.BTC.BTCManager;
  49. import com.rs.game.player.actions.PlayerCombat;
  50. import com.rs.game.player.actions.Slayer.Master;
  51. import com.rs.game.player.actions.Slayer.SlayerTask;
  52. import com.rs.game.player.content.AntiAFK;
  53. import com.rs.game.player.content.BankPin;
  54. import com.rs.game.player.content.Bounties;
  55. import com.rs.game.player.content.ClueScrolls;
  56. import com.rs.game.player.content.DwarfCannon;
  57. import com.rs.game.player.content.Familiars;
  58. import com.rs.game.player.content.FriendChatsManager;
  59. import com.rs.game.player.content.Highscores;
  60. import com.rs.game.player.content.Hotspots;
  61. import com.rs.game.player.content.Killstreaks;
  62. import com.rs.game.player.content.Magic;
  63. import com.rs.game.player.content.NetWealth;
  64. import com.rs.game.player.content.Notes;
  65. import com.rs.game.player.content.Pots;
  66. import com.rs.game.player.content.SkillCapeCustomizer;
  67. import com.rs.game.player.content.YouTubeReward;
  68. import com.rs.game.player.content.SkinsManager.SKINS;
  69. import com.rs.game.player.content.Tournaments;
  70. import com.rs.game.player.content.Trade;
  71. import com.rs.game.player.content.VoteTimeManager;
  72. import com.rs.game.player.content.WorldCup;
  73. import com.rs.game.player.content.XPLamp;
  74. import com.rs.game.player.content.YellTimer;
  75. import com.rs.game.player.content.bountyhunter.BountyHunter;
  76. import com.rs.game.player.content.monsterlogs.LogManager;
  77. import com.rs.game.player.controlers.AccountProtection;
  78. import com.rs.game.player.controlers.CastleWarsPlaying;
  79. import com.rs.game.player.controlers.CastleWarsWaiting;
  80. import com.rs.game.player.controlers.DTControler;
  81. import com.rs.game.player.controlers.DamageTent;
  82. import com.rs.game.player.controlers.FightCaves;
  83. import com.rs.game.player.controlers.PestControler;
  84. import com.rs.game.player.controlers.PitsControler;
  85. import com.rs.game.player.controlers.RedPortal;
  86. import com.rs.game.player.controlers.SafePortal;
  87. import com.rs.game.player.controlers.TowersPkControler;
  88. import com.rs.game.player.controlers.Wilderness;
  89. import com.rs.game.player.controlers.ZombieEscape;
  90. import com.rs.game.player.deadman.BankKeyManager;
  91. import com.rs.game.player.dialogues.MaxCape;
  92. import com.rs.game.player.towns.TownManager;
  93. import com.rs.game.sailing.Ship;
  94. import com.rs.game.sailing.ShipBattle;
  95. import com.rs.game.tasks.WorldTask;
  96. import com.rs.game.tasks.WorldTasksManager;
  97. import com.rs.net.Session;
  98. import com.rs.net.decoders.WorldPacketsDecoder;
  99. import com.rs.net.encoders.WorldPacketsEncoder;
  100. import com.rs.utils.DonationManager;
  101. import com.rs.utils.IPBanL;
  102. import com.rs.utils.Logger;
  103. import com.rs.utils.Misc;
  104. import com.rs.utils.PkRank;
  105. import com.rs.utils.SerializableFilesManager;
  106. import com.rs.utils.Statistics;
  107. import com.rs.utils.Utils;
  108. import com.rs.utils.WriteFile;
  109.  
  110.  
  111. public class Player extends Entity {
  112.  
  113.  
  114. public static final boolean MYSQL_ACTIVE = true;
  115. private transient DonationManager donationmanager;
  116. //public static VoteChecker voteChecker = new VoteChecker("91.217.178.207", "SherminationXrs_vote", "SherminationXrs_website", "SherminationX123001");
  117. public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1,
  118. RUN_MOVE_TYPE = 2;
  119.  
  120. private static final long serialVersionUID = 2011932556974180375L;
  121.  
  122. // transient stuff
  123. private transient Trade trade;
  124. private transient DuelTrade dueltrade;
  125. private transient ClanWars clanWars;
  126. private transient PestControl pestControl;
  127. private transient String username;
  128. private transient Session session;
  129. private transient boolean clientLoadedMapRegion;
  130. private transient int displayMode;
  131. private transient int screenWidth;
  132. private transient boolean usingTicket;
  133. private transient int trapAmount;
  134. private transient int screenHeight;
  135. private transient InterfaceManager interfaceManager;
  136. private transient AntiAFK afk;
  137. private transient DuelRules lastDuelRules;
  138. private transient DwarfCannon dwarfcannon;
  139. private transient PvpTimer pvpTimer;
  140. private transient Familiars fams;
  141. private transient NetWealth netwealth;
  142. private transient DiceGame dicegame;
  143. private transient FlowerGame flowergame;
  144. private transient BTCManager btc;
  145. private transient YellTimer yelltimer;
  146. private transient XPLamp xplamp;
  147. private transient Killstreaks killstreak;
  148. private transient LotteryManager lottery;
  149. private transient ClueScrolls clue;
  150. private transient Trivia trivia;
  151. private transient VoteTimeManager votetime;
  152. private transient DialogueManager dialogueManager;
  153. private transient HintIconsManager hintIconsManager;
  154. private transient ActionManager actionManager;
  155. private transient CutscenesManager cutscenesManager;
  156. private transient DuelConfigurations duelConfigurations;
  157. private transient PriceCheckManager priceCheckManager;
  158. private transient CoordsEvent coordsEvent;
  159. private transient FriendChatsManager currentFriendChat;
  160.  
  161. // used for packets logic
  162. private transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
  163.  
  164. // used for update
  165. private transient LocalPlayerUpdate localPlayerUpdate;
  166. private transient LocalNPCUpdate localNPCUpdate;
  167.  
  168. private int temporaryMovementType;
  169. private boolean updateMovementType;
  170.  
  171. // player stages
  172. private transient boolean started;
  173. private transient boolean running;
  174.  
  175. private transient long packetsDecoderPing;
  176. private transient boolean resting;
  177. private transient boolean canPvp;
  178. private transient long lockDelay;
  179. private transient long stopDelay; // used for doors and stuff like that
  180. private transient long foodDelay;
  181. private transient long potDelay;
  182. private transient long boneDelay;
  183. private transient Runnable closeInterfacesEvent;
  184. private transient long lastPublicMessage;
  185. private transient long polDelay;
  186. private transient Runnable interfaceListenerEvent;// used for static
  187. private transient List<Integer> switchItemCache;
  188. private transient boolean disableEquip;
  189.  
  190. //wildy revival
  191. public int adrenalinePot;
  192. public int wildfirePot;
  193. public int drugPot;
  194. public int hippyPot;
  195. public int xpPot;
  196.  
  197.  
  198. public boolean bossTask = false;
  199.  
  200. public boolean wildernessTask = false;
  201. public int wildernessTasksCompleted = 0;
  202. public int asteaFrostwebKilled = 0;
  203. public int zulKharKilled = 0;
  204. public int zalBearKilled = 0;
  205. public int scorpioKilled = 0;
  206. public int chaosElementalKilled = 0;
  207. public int giantCrabFished = 0;
  208. public int thornyBushesPicked = 0;
  209. public int elementalRocksMined = 0;
  210. public int dramenTreesCut = 0;
  211. public int rogueChestThieved = 0;
  212. public String myBossTaskIs = "";
  213.  
  214.  
  215. public int avaDest = 0;
  216. public int krakenKilled = 0;
  217. public int cerberusKilled = 0;
  218. public int PKP = 0;
  219. //monster log
  220. private LogManager logManager;
  221. private Reputation repSystem;
  222. public int repWaitSeconds;
  223.  
  224. //boss task start
  225. public int bossTaskInARow = 0;
  226. public boolean isOnBossTask = false;
  227. public int krakenToKill = 0;
  228. public boolean krakenTask = false;
  229. public int cerberusToKill = 0;
  230. public boolean cerberusTask = false;
  231. public int aodToKill = 0;
  232. public boolean aodTask = false;
  233. public int blinkToKill = 0;
  234. public boolean blinkTask = false;
  235. public int frostDragonToKill = 0;
  236. public boolean fdTask = false;
  237. public int ragoToKill = 0;
  238. public boolean ragoTask = false;
  239. public int nexToKill = 0;
  240. public boolean nexTask = false;
  241. public int borkToKill = 0;
  242. public boolean borkTask = false;
  243.  
  244.  
  245. //boss task end
  246.  
  247. //blackjack test?
  248. public int bjTotal = 0;
  249. //blackjack end?
  250.  
  251. //spotlights
  252. public boolean atkSpot = false;
  253. public boolean defSpot = false;
  254. public boolean strSpot = false;
  255. public boolean hpSpot = false;
  256. public boolean rangeSpot = false;
  257. public boolean praySpot = false;
  258. public boolean mageSpot = false;
  259. public boolean cookSpot = false;
  260. public boolean wcSpot = false;
  261. public boolean fletchSpot = false;
  262. public boolean fishSpot = false;
  263. public boolean fmSpot = false;
  264. public boolean craftSpot = false;
  265. public boolean smithSpot = false;
  266. public boolean mineSpot = false;
  267. public boolean herbSpot = false;
  268. public boolean agilSpot = false;
  269. public boolean thiefSpot = false;
  270. public boolean slaySpot = false;
  271. public boolean farmSpot = false;
  272. public boolean rcSpot = false;
  273. public boolean huntSpot = false;
  274. public boolean constructionSpot = false;
  275. public boolean summSpot = false;
  276. public boolean dungSpot = false;
  277.  
  278. //Sailing
  279. private transient ShipBattle shipBattle;
  280. private Ship ship;
  281.  
  282. //bounty hunter
  283. private BountyHunter bountyHunter;
  284. public int throneId = 0;
  285.  
  286. //pvp timer
  287. public boolean wasInWild = false;
  288.  
  289. //slayer update
  290. public ArrayList<String> blockedSlayerTasks;
  291. public ArrayList<String> futureSlayerTasks;
  292. public boolean canCraftSlayerHelmets;
  293. public boolean canKillAquanites;
  294. public boolean canKillIceStr;
  295. public int slayerTimer;
  296.  
  297. // interface
  298.  
  299. //Youtube Reward
  300. public int videosRewardedFor = 0;
  301. public int billzRewarded = 0;
  302. public int totalBillzRewarded = 0;
  303. public int totalVideosSubmitted = 0;
  304.  
  305. // saving stuff
  306. //tournament//player.yell("<img=7><col=ff0000>"+player.getDisplayName()+" Has Completed A Trimmed C. Cape Requirement: </col>");
  307. public BankPin bankPinInstance = null;
  308. public int bankPin = -1;
  309. public boolean hardcoreXPMode = false;
  310. public SKINS skin = null;
  311. public List<String> referers = new ArrayList<String>();
  312. public List<String> blackList = new ArrayList<String>();
  313. public String macaddress = "";
  314. public String referedBy = "";
  315. public int playersRefered = 0;
  316. public boolean redeemLoot = false;
  317. public boolean givenReferReward = false;
  318. public int offer_timer = 0;
  319. public int offer_id;
  320. public int crystal;
  321. public int offer_quantity;
  322. public int offer_price;
  323. public boolean spawnRights = false;
  324. public boolean canSave;
  325. public List<Item> WCBets = new ArrayList<Item>();
  326. public boolean unlockedFrostDrags = false;
  327. public boolean unlockedBankSlots250 = false;
  328. public boolean purchasedSlave = false;
  329. public String WCTeam = "";
  330. public boolean isSmited = false;
  331. public boolean isSnailed = false;
  332. public boolean isLeftied = false;
  333. public boolean isSitting = false;
  334. public int compCapeTeleTime = 0;
  335. public int slayerCount;
  336. public int tradeStatus = 0;
  337. public int bloodRunesCrafted;//10000
  338. public boolean bloodRuneReq;
  339. public int agilityLapsCompleted;//500
  340. public int lotteryRefund;
  341. public int specRestoresMade;//500
  342. public int heroesPickpocketed;//1000
  343. public int blackDhidesCrafted;//5000
  344. public int magicLongsFletched;//2500
  345. public int runiteOreMined;//2500
  346. public int runePlateBodiesSmithed;//500
  347. public int rocktailsCaught;//5000
  348. public int rocktailsCooked;//10000
  349. public int magicLogsBurned;//2500
  350. public boolean resetPvpVars;
  351. public int magicLogsChopped;//2500
  352. public int lowestDiceRoll;
  353. public boolean isJuggernaut;
  354. public int juggerTime;
  355. public int totalJuggerTime;
  356. public int totalJuggerPoints;
  357. public int timesBeenJugger;
  358. public int cluesDone = 0;
  359. public int chestsOpened = 0;
  360. public int prestigeLevel;
  361. public boolean disabledYell;
  362. public boolean eliteReset2;
  363. public boolean upgradeReset1;
  364. public boolean setPrestige;
  365. public boolean setPrestige2;
  366. public boolean attack200;
  367. public boolean strength200;
  368. public boolean defence200;
  369. public int messCount;
  370. public boolean range200;
  371. public boolean prayer200;
  372. public boolean magic200;
  373. public boolean runecrafting200;
  374. public boolean construction200;
  375. public boolean dungeoneering200;
  376. public boolean hitpoints200;
  377. public boolean agility200;
  378. public boolean herblore200;
  379. public boolean thieving200;
  380. public boolean crafting200;
  381. public boolean fletching200;
  382. public boolean slayer200;
  383. public boolean hunter200;
  384. public boolean mining200;
  385. public boolean smithing200;
  386. public boolean fishing200;
  387. public boolean cooking200;
  388. public boolean firemaking200;
  389. public boolean woodcutting200;
  390. public boolean farming200;
  391. public boolean summoning200;
  392. public boolean isBetaTester;
  393. public String mode = "";
  394. public int killedRevenant = 0;
  395. public int sameWeapon = 0;
  396. public long afkTimer = 0;
  397. public int chaotic_maul_charge;
  398. public int chaotic_rapier_charge;
  399. public int chaotic_longsword_charge;
  400. public int chaotic_staff_charge;
  401. public int chaotic_crossbow_charge;
  402. public int chaotic_kiteshield_charge;
  403. public int lite_rapier_charge;
  404. public int lite_cls_charge;
  405. public int lite_ccbow_charge;
  406. public int brutal_whip_charge;
  407. public int lite_whip;
  408. public boolean chaoticCharges;
  409. public boolean chaoticCharges2;
  410. public boolean ks90;
  411. private String password;
  412. public String txahCode;
  413. public int punishStages = 0;
  414. public byte donatePage = 0;
  415. public int CWKills = 0;
  416. public String warnMessage = "";
  417. public String punishType = "";
  418. public int collectItemId = -1;
  419. public int collectItemAmount = -1;
  420. public int tournamentKey = -1;
  421. public int tournamentXp = -1;
  422. public int evilTreeContribution = 0;
  423. public int evilTreeKey = 0;
  424. public int giveItemId;
  425. public int giveItemAmount;
  426. public int setTime;
  427. public int setSkill;
  428. public boolean setTournament;
  429. public boolean voteTimeBump;
  430. public int highestHit;
  431. public String punishmentType = "";
  432. public boolean permitReset = false;
  433. public String punishPlayer = "";
  434. public int lotteryAmount = 0;
  435. public int TentMulti;
  436. public String confirmPassword;
  437. public boolean resetPass;
  438. public boolean banReset;
  439. public boolean hit2000;
  440. public boolean hasOpenedTentShop;
  441. public int spiritTree;
  442. public boolean wonLottery = false;
  443. public boolean openedFC = false;
  444. public boolean completedFightCaves = false;
  445. public boolean hadFCReset2 = false;
  446. public boolean refundLottery = false;
  447. public double netWealth;
  448. public String recov1 = "";
  449. public String recov2 = "";
  450. public String customTitle = "";
  451. public String recov3 = "";
  452. public boolean recov1Set = false;
  453. public boolean recov2Set = false;
  454. public boolean recov3Set = false;
  455. public boolean inSandwichLady = false;
  456. public boolean hidden = false;
  457. public boolean txahValidated = false;
  458. public boolean txahEnabled = false;
  459. public boolean gotTool = false;
  460. public boolean canValidate = false;
  461. public int yellLoop;
  462. public int redeemAmount = 0;
  463. public boolean gotMaxCape;
  464. public boolean gotCompCape;
  465. public boolean gotTrimmedCompCape;
  466. public int settingsPage;
  467. public boolean SettingKillstreaks;
  468. public boolean SettingYells;
  469. public boolean SettingMessages;
  470. public boolean SettingTrivia;
  471. public boolean SettingLoot;
  472. public boolean SettingL33t;
  473. public boolean SettingVote;
  474. public boolean SettingDonate;
  475. public boolean SettingBonuses;
  476. public boolean SettingNewXP;//todo
  477. public boolean SettingDMGMessage;//todo
  478. public boolean SettingsLoyalty;
  479. public boolean isHired = false;
  480. public boolean giveDonatorRanks2 = false;
  481. public int hireValue = 250;
  482. public int hireCount = 0;
  483. public int cashIn = 0;
  484. public int LPPoints = 0;
  485. public boolean resetDbaxeReset;
  486. public String hireOwner;
  487. public String playerHiring = "";
  488. public int rights;
  489. public boolean jcape = false;
  490. public boolean tutGear = false;
  491. public boolean donorRightReset = false;
  492. public boolean isVeteran = false;
  493. public boolean forcedVeteran = false;
  494. public boolean hasYTAward = false;
  495. public int LX = 0;
  496. public int LY = 0;
  497. public int LP = 0;
  498. public int LoyaltyPoints = 0;
  499. public int port;
  500. public int diceSeconds = 0;
  501. public int slayerXPSeconds = 0;//not used ----
  502. public int doubleDropsSeconds = 0;//not used ----
  503. public int doubleXPSeconds = 0;//not used ----
  504. public int donatorSeconds = 0;//not used ----
  505. public int yellCounter = 0;
  506. public int secondsPlayed = 0;
  507. public int minutesPlayed = 0;
  508. public int hoursPlayed = 0;
  509. public int daysPlayed = 0;
  510. public int weeksPlayed = 0;
  511. public int monthsPlayed = 0;
  512. public int yearsPlayed = 0;
  513. public int taskPoints = 0;
  514. public int supportX = 0;
  515. public int supportY = 0;
  516. public int supportP = 0;
  517. public int abyssKilled = 0;
  518. public int DBKilled = 0;
  519. public int corpKilled = 0;
  520. public int voragoKilled = 0;
  521. public int graardorKilled = 0;
  522. public int krilKilled = 0;
  523. public int zylKilled = 0;
  524. public int kreeKilled = 0;
  525. public int KBDKilled = 0;
  526. public int TDKilled = 0;
  527. public int FDKilled = 0;
  528. public int TXEliteKilled = 0;
  529. public int doubleXPMins = 0;
  530. public int doubleDropMins = 0;
  531. public boolean canGetSpoils;
  532. public int donatorMins = 0;
  533. public int hitMins = 0;
  534. public boolean freeSlayerPoints = false;
  535. private int donor;
  536. public int starter;
  537. public boolean skillsReset3 = false;
  538. public int starterStart;
  539. public int starterStart2;
  540. public boolean update2 = false;
  541. public boolean diceReset = false;
  542. public int LoyaltyBankSpace = 0;
  543. private boolean itemsReset;
  544. private int killstreakMigrate;
  545. private int partyhat;
  546. private int donationBeta;
  547. private int slayerReset;
  548. private int rightsReset;
  549. private int rightsReset2;
  550. private int donatorWeekend;
  551. private int wasDonator;
  552. private int wasExtreme;
  553. private int wasLegendary;
  554. private int donatorReset;
  555. public int killstreaks;
  556. public int highestKillStreaks;
  557. public boolean deactivatedWarning;
  558. public boolean gotLevel = false;
  559. public int tutorialStage = 0;
  560. public String pvpArea = "";
  561. public String muteReason = "None";
  562. public String banReason = "None";
  563. public String ipbanReason = "None";
  564. public String ticketRank = "";
  565. public String ticketAssist = "";
  566. public boolean isAssistant = false;
  567. public String side;
  568. public byte weaponTier = 0;
  569. public byte trading = 0;
  570. public int boosterCount = 1;
  571. public int oreMined;
  572. public int donationRedeem;
  573. public int taskPoint;
  574. public String GearOrDonate;
  575. public String VoteOrDonate;
  576. public String redeemPage = "";
  577. public byte weaponGameCompletions;
  578. public boolean inLobby = true;
  579. public boolean canClaimSurvey = true;
  580. public String weaponWeapon = "Nothing";
  581. public String title1 = "";
  582. public String title2 = "";
  583. public String title3 = "";
  584. public String title4 = "";
  585. public String title5 = "";
  586. public String title6 = "";
  587. public String title7 = "";
  588. public String nWeapon = "Nothing";
  589. public String playerKilled = "";
  590. public String IPKilled = "";
  591. public String playerKilled2 = "";
  592. public String playerKilled3 = "";
  593. public String playerKillContinued = "";
  594. public String playerKillContinued2 = "";
  595. public String playerKillContinued3 = "";
  596. //private static final List<String> PORTS = new ArrayList<String>();
  597. //private static final List<int> PORT_COORDS = new ArrayList<int>();
  598. public boolean inZone;
  599. public boolean inMulti;
  600. public boolean inSafe;
  601. public int timerCount;
  602. public int clueX = 0;
  603. public int clueY = 0;
  604. public int clueP = 0;
  605. public int clueScrollInter = 0;
  606. public boolean clueScrollDone = false;
  607. //League
  608. public String leagueInterSlot1 = "";
  609. public String leagueInterSlot2 = "";
  610. public String leagueInterSlot3 = "";
  611. public String leagueInterSlot4 = "";
  612. public boolean isCursed = false;
  613. public int leagueLine = 0;
  614. public String leagueItem = "itemmmm";
  615. public boolean resetEvents = false;
  616. public String leagueWarsAura = "aurassss";
  617. public String leagueStreakName = "";
  618. public int leagueStreakAmount = 0;
  619. public int leagueGoldEarned = 0;
  620. public int leagueGoldEarnedTotal = 0;
  621. public int leagueKills = 0;
  622. public int leagueDeaths = 0;
  623. public int leagueBounty = 0;
  624. public int leagueGamesWon = 0;
  625. public int leagueGamesLost = 0;
  626. public int leagueGamesDraw = 0;
  627. public int veloxRating = 500;
  628. public int coinshareLoot = 0;
  629. public int triviaPoints = 0;
  630. public boolean gotGoblinHat = false;
  631. public boolean valueReset = false;
  632. public boolean hasClaimedRunes = false;
  633. public boolean isLeagueMember = false;
  634. public int leagueGoldBoost = 0;
  635. public int leagueHealthBoost = 0;
  636. public boolean isPlayingLeague = false;
  637. public boolean downVeloxLadder = false;
  638. public boolean staffOnlineReset = false;
  639. public String triviaQuestion = "";
  640. public String triviaAnswer = "";
  641. public boolean triviaActive = false;
  642. public String storedIP;
  643. public byte donationAmount;
  644. public int maxRep;
  645. public int votingPoints;
  646. public byte inNonProtect;
  647. public byte pkNumber1;
  648. public byte ksNumber1;
  649. public boolean voteDisabled;
  650. public String displayName;
  651. public String displayName2;
  652. public String previousName;
  653. public String lastIP;
  654. private Appearence appearence;
  655. public Inventory inventory;
  656. public Equipment equipment;
  657. private Skills skills;
  658. private CombatDefinitions combatDefinitions;
  659. private Prayer prayer;
  660. private Bank bank;
  661. private ControlerManager controlerManager;
  662. private MusicsManager musicsManager;
  663. private EmotesManager emotesManager;
  664. private FriendsIgnores friendsIgnores;
  665. private DominionTower dominionTower;
  666. private Familiar familiar;
  667. private AuraManager auraManager;
  668. private byte runEnergy;
  669. public byte safePvp;
  670. public byte arena;
  671. public byte weaponGame;
  672. public boolean settingUpdate1;
  673. public boolean settingUpdate2;
  674. public boolean weaponGameClaim = false;
  675. private boolean allowChatEffects;
  676. private boolean mouseButtons;
  677. private int privateChatSetup;
  678. private int skullDelay;
  679. private SlayerTask slayerTask;
  680. private Master master;
  681. private int skullId;
  682. private boolean forceNextMapLoadRefresh;
  683. private long poisonImmune;
  684. private long fireImmune;
  685. private int lastVeng;
  686. public boolean castedVeng;
  687. private int[] pouches;
  688. private long displayTime;
  689. private long muted;
  690. private long jailed;
  691. private long banned;
  692. public boolean permBanned;
  693. private boolean filterGame;
  694. public boolean inZE = false;
  695. public boolean loyaltyMember = false;
  696.  
  697. public boolean canVoteHmm = true;
  698. public boolean canSpec;
  699.  
  700. public int triviaCount = 0;
  701.  
  702. public String Class = "None";
  703. public int Reward, RewardReach = 50, Kills, TotalKills, RewardKills, LevelMultiplier, LevelAmount = 20000;
  704. public int RangeLevel = 1;
  705. public int RangeXP;
  706. public int ArcaneLevel = 1;
  707. public int ArcaneXP;
  708. public int RogueLevel = 1;
  709. public int RogueXP;
  710. public int MedicLevel = 1;
  711. public int MedicXP;
  712. public int DarkZLevel = 1;
  713. public int DarkZXP;
  714. public int CarpenterLevel = 1;
  715. public int CarpenterXP;
  716. public int AssaultLevel = 1;
  717. public int AssaultXP;
  718. public int CaderLevel = 1;
  719. public int CaderXP;
  720. public int CookLevel = 1;
  721. public int CookXP;
  722. public int LooterLevel = 1;
  723. public int LooterXP;
  724. public int CannonerLevel = 1;
  725. public int CannonerXP;
  726. public int ScientistLevel = 1;
  727. public int ScientistXP;
  728.  
  729. //DEADMAN
  730. public boolean isDeadman;
  731. public int lastBankIdOpened;
  732. public int lastBankIdPickedUp;
  733.  
  734. public ItemsContainer<Item> stake;
  735. public ItemsContainer<Item> ostake;
  736.  
  737. public boolean reward1;
  738. public boolean reward2;
  739. public boolean reward3;
  740. public boolean reward4;
  741. public boolean reward5;
  742.  
  743. public int evilTrees = 0;
  744. public int evilTreeLatHack = 0;
  745.  
  746. public int CWTeam;
  747. public boolean inAnEvent = false;
  748. public String YTLink = "";
  749. private boolean donator;
  750. private boolean Extremedonator;
  751. private boolean Legendarydonator;
  752. private boolean SuperDonator;
  753. public boolean ServerSupport;
  754. public boolean isBoosterBuster;
  755. public boolean isDeveloper;
  756. public boolean isIronman;
  757. public boolean isHardcoreIronman;
  758. public boolean isSkiller;
  759. public int assistants = 0;
  760. public String assistantOwner;
  761. private boolean Helper;
  762. private boolean Veteran;
  763. private boolean DicePermit;
  764. private boolean Sponsor;
  765. private boolean PremiumPermit;
  766. private boolean Prestiged;
  767. public boolean Jailed;
  768. private boolean DiceZone;
  769. private long donatorTill;
  770. /*START ACHIEVEMENT BOOLEANS*/
  771. public boolean BronzeNewbieCollect;
  772. public boolean IronFistsCollect;
  773. public boolean SteelWarriorCollect;
  774. public boolean MithrilKnucklesCollect;
  775. public boolean AdanaughtCollect;
  776. public boolean RuneWreckerCollect;
  777. public boolean DragonDestroyerCollect;
  778. public boolean TheRockCollect;
  779. public boolean PvpMasterCollect;
  780. public boolean SilentAssassinCollect;
  781. public boolean DeadlyPoisonCollect;
  782. public boolean LooseCannonCollect;
  783. public boolean TizenFuryCollect;
  784. public boolean BronzeNewbieCollect2;
  785. public boolean IronFistsCollect2;
  786. public boolean SteelWarriorCollect2;
  787. public boolean MithrilKnucklesCollect2;
  788. public boolean AdanaughtCollect2;
  789. public boolean RuneWreckerCollect2;
  790. public boolean DragonDestroyerCollect2;
  791. public boolean TheRockCollect2;
  792. public boolean PvpMasterCollect2;
  793. public boolean SilentAssassinCollect2;
  794. public boolean DeadlyPoisonCollect2;
  795. public String previousPass;
  796. public String ipCreation;
  797. public boolean LooseCannonCollect2;
  798. public boolean TizenFuryCollect2;
  799. public boolean cursedDice;
  800. public boolean isSponsor = false;
  801. public int enchantedChests = 0;
  802. public int clueScrolls = 0;
  803. /*END ACHIEVEMENT BOOLEANS*/
  804. private static int pvpRandom[] = {23749, 23749, 23749, 23749, 23750, 23750, 23750, 23751, 23751, 23752, 10223, 10223, 10223, 10223, 10219, 10219, 10219, 10219, 10219, 10219, 10219, 10219, 10219, -1, -1, -1, -1, 24155, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15442, 15442, 15442, 10239, 10239, 10237, 10219, 10219, 10219, 10219, 10219, 13887, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13893, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13047, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13045, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10233, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13043, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10221, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13039, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13870, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10231, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24155, -1, -1, -1, -1, -1, -1, 13037, 13037, 10235, 10235};
  805. private static int rareRandom[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1038};
  806. private static int HRPRandom[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23173, 23173, 23173, 23173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23171, 23171, 23171, 23171, 23172, 23172, 23172, 23172, 23172, 23172, 23172, 23173, 23173, 23173, 23173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 29948, 29917, 29917, 29920, 29920, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
  807. private int pvpRandom() {
  808. return pvpRandom[(int) (Math.random()*pvpRandom.length)];
  809. }
  810. public int HRPRandom() {
  811. return HRPRandom[(int) (Math.random()*HRPRandom.length)];
  812. }
  813. private int rareRandom() {
  814. return rareRandom[(int) (Math.random()*rareRandom.length)];
  815. }
  816.  
  817. public int prayerRenew = 0;
  818. public int lastRenew = 0;
  819.  
  820. //Recovery ques. & ans.
  821. private String recovQuestion;
  822. private String recovAnswer;
  823.  
  824. // honor
  825. private int killCount, deathCount;
  826. public int reputation;
  827. private ChargesManager charges;
  828. // barrows
  829. private boolean[] killedBarrowBrothers;
  830. private int hiddenBrother;
  831. private int barrowsKillCount;
  832. private int pestPoints;
  833.  
  834. // skill capes customizing
  835. private int[] maxedCapeCustomized;
  836. private int[] completionistCapeCustomized;
  837.  
  838. private int overloadDelay;
  839.  
  840. private String currentFriendChatOwner;
  841. private int summoningLeftClickOption;
  842. private List<String> ownedObjectsManagerKeys;
  843. private String lastMessageCheck;
  844.  
  845. public void init(Session session, String string) {
  846. //isinLobby = true;
  847.  
  848.  
  849. //if (dominionTower == null)
  850. //dominionTower = new DominionTower();
  851. username = string;
  852. this.session = session;
  853. afkTimer = Utils.currentTimeMillis() + (5 * 60 * 1000);
  854. afkTime();
  855. //packetsDecoderPing = System.currentTimeMillis();
  856. //World.addPlayer(this);
  857. //World.updateEntityRegion(this);
  858. if (Settings.DEBUG)
  859. Logger.log(this, new StringBuilder("Inited Player: ").append
  860. (string).append
  861. (", pass: ").append
  862. (password).toString());
  863. }
  864.  
  865.  
  866.  
  867. // creates Player and saved classes
  868. public Player(String password) {
  869. super(Settings.START_PLAYER_LOCATION);
  870. setHitpoints(Settings.START_PLAYER_HITPOINTS);
  871. this.password = password;
  872. appearence = new Appearence();
  873. inventory = new Inventory();
  874. equipment = new Equipment();
  875. skills = new Skills();
  876. combatDefinitions = new CombatDefinitions();
  877. prayer = new Prayer();
  878. bank = new Bank();
  879.  
  880. controlerManager = new ControlerManager();
  881. musicsManager = new MusicsManager();
  882. emotesManager = new EmotesManager();
  883. friendsIgnores = new FriendsIgnores();
  884. dominionTower = new DominionTower();
  885. charges = new ChargesManager();
  886. auraManager = new AuraManager();
  887. runEnergy = 100;
  888. allowChatEffects = true;
  889. mouseButtons = true;
  890. pouches = new int[4];
  891. killedBarrowBrothers = new boolean[6];
  892. SkillCapeCustomizer.resetSkillCapes(this);
  893. ownedObjectsManagerKeys = new LinkedList<String>();
  894. }
  895. public void init(Session session, String username, int displayMode,
  896. int screenWidth, int screenHeight) {
  897. // temporary deleted after reset all chars
  898. if (dominionTower == null)
  899. dominionTower = new DominionTower();
  900. if (auraManager == null)
  901. auraManager = new AuraManager();
  902. this.session = session;
  903. this.username = username;
  904. this.displayMode = displayMode;
  905. this.screenWidth = screenWidth;
  906. this.screenHeight = screenHeight;
  907. interfaceManager = new InterfaceManager(this);
  908. dialogueManager = new DialogueManager(this);
  909. hintIconsManager = new HintIconsManager(this);
  910. priceCheckManager = new PriceCheckManager(this);
  911. localPlayerUpdate = new LocalPlayerUpdate(this);
  912. localNPCUpdate = new LocalNPCUpdate(this);
  913. actionManager = new ActionManager(this);
  914. cutscenesManager = new CutscenesManager(this);
  915. afk = new AntiAFK(this);
  916. dwarfcannon = new DwarfCannon(this);
  917. pvpTimer = new PvpTimer(this);
  918. fams = new Familiars(this);
  919. netwealth = new NetWealth(this);
  920. votetime = new VoteTimeManager(this);
  921. dicegame = new DiceGame(this);
  922. flowergame = new FlowerGame(this);
  923. btc = new BTCManager(this);
  924. yelltimer = new YellTimer(this);
  925. xplamp = new XPLamp(this);
  926. killstreak = new Killstreaks(this);
  927. lottery = new LotteryManager(this);
  928. clue = new ClueScrolls(this);
  929. // loads player on saved instances
  930. appearence.setPlayer(this);
  931. inventory.setPlayer(this);
  932. equipment.setPlayer(this);
  933. skills.setPlayer(this);
  934. combatDefinitions.setPlayer(this);
  935. prayer.setPlayer(this);
  936. bank.setPlayer(this);
  937. controlerManager.setPlayer(this);
  938. musicsManager.setPlayer(this);
  939. emotesManager.setPlayer(this);
  940. friendsIgnores.setPlayer(this);
  941. dominionTower.setPlayer(this);
  942. auraManager.setPlayer(this);
  943. charges.setPlayer(this);
  944. setDirection(Utils.getFaceDirection(0, -1));
  945. logicPackets = new ConcurrentLinkedQueue<LogicPacket>();
  946. switchItemCache = Collections
  947. .synchronizedList(new ArrayList<Integer>());
  948. initEntity();
  949. packetsDecoderPing = Utils.currentTimeMillis();
  950. // inited so lets add it
  951. for (Player player : World.getPlayers()) {
  952. if (player.getUsername().equalsIgnoreCase(getUsername())) {
  953. forceLogout();
  954. }
  955. }
  956. World.addPlayer(this);
  957. World.updateEntityRegion(this);
  958. if (Settings.DEBUG)
  959. Logger.log(this, "Inited Player: " + username);
  960. }
  961.  
  962. public void setWildernessSkull() {
  963. final Player thisPlayer = this;
  964. if (!SafePortal.isAtArea(thisPlayer)) {
  965. skullDelay = 3000; // 30minutes
  966. skullId = 0;
  967. appearence.generateAppearenceData();
  968. }
  969. }
  970.  
  971. public void ipDetection() {
  972. //getSession().getIP()
  973. if (getSession().getIP() == World.ipDetector || getSession().getIP() == World.ipDetector2) {
  974. staffYell("<col=ff0000></col>01001<col=ff0000>I</col>011<col=ff0000>P</col>10010010010010<col=ff0000>D</col>110011<col=ff0000>E</col>000010<col=ff0000>T</col>1101001<col=ff0000>E</col>0001001<col=ff0000>C</col>100110<col=ff0000>T</col>010: "+getUsername()+"!");
  975. }
  976. }
  977.  
  978.  
  979. public void giveBossTask() {
  980. int task = Misc.random(4);
  981. int amt = Misc.random(50);
  982. if(task == 1) {
  983. krakenToKill += amt;
  984. errorMessage("You have been assigned to kill "+amt+" Kraken's!");
  985. krakenTask = true;
  986. isOnBossTask = true;
  987. myBossTaskIs = "Kraken";
  988. } else if (task == 2) {
  989. cerberusToKill += amt;
  990. errorMessage("You have been assigned to kill "+amt+" Cerberus!");
  991. cerberusTask = true;
  992. isOnBossTask = true;
  993. myBossTaskIs = "Cerberus";
  994. } else if (task == 3) {
  995. aodToKill += amt;
  996. errorMessage("You have been assigned to kill "+amt+" AOD's!");
  997. aodTask = true;
  998. isOnBossTask = true;
  999. myBossTaskIs = "AOD";
  1000. } else if (task == 4) {
  1001. blinkToKill += amt;
  1002. errorMessage("You have been assigned to kill "+amt+" Blink's!");
  1003. blinkTask = true;
  1004. isOnBossTask = true;
  1005. myBossTaskIs = "Blink";
  1006. }
  1007. }
  1008.  
  1009.  
  1010. public boolean hasSkull() {
  1011. return skullDelay > 0;
  1012. }
  1013.  
  1014. public int setSkullDelay(int delay) {
  1015. return this.skullDelay = delay;
  1016. }
  1017.  
  1018. public void afkTime() {
  1019. CoresManager.slowExecutor.scheduleWithFixedDelay(new Runnable() {
  1020. @Override
  1021. public void run() {
  1022. try {
  1023. if (afkTimer < Utils.currentTimeMillis()) {
  1024. setNextGraphics(new Graphics(2048));
  1025. }
  1026. } catch (Throwable e) {
  1027. Logger.handle(e);
  1028. }
  1029. }
  1030. }, 0, 1, TimeUnit.SECONDS);
  1031. }
  1032.  
  1033. public void refreshSpawnedItems() {
  1034. for (int regionId : getMapRegionsIds()) {
  1035. List<FloorItem> floorItems = World.getRegion(regionId)
  1036. .getFloorItems();
  1037. if (floorItems == null)
  1038. continue;
  1039. for (FloorItem item : floorItems) {
  1040. if ((item.isInvisible() || item.isGrave())
  1041. && this != item.getOwner()
  1042. || item.getTile().getPlane() != getPlane())
  1043. continue;
  1044. getPackets().sendRemoveGroundItem(item);
  1045. }
  1046. }
  1047. for (int regionId : getMapRegionsIds()) {
  1048. List<FloorItem> floorItems = World.getRegion(regionId)
  1049. .getFloorItems();
  1050. if (floorItems == null)
  1051. continue;
  1052. for (FloorItem item : floorItems) {
  1053. if ((item.isInvisible() || item.isGrave())
  1054. && this != item.getOwner()
  1055. || item.getTile().getPlane() != getPlane())
  1056. continue;
  1057. getPackets().sendGroundItem(item);
  1058. }
  1059. }
  1060. }
  1061.  
  1062.  
  1063. public void refreshSpawnedObjects() {
  1064. for (int regionId : getMapRegionsIds()) {
  1065. List<WorldObject> spawnedObjects = World.getRegion(regionId)
  1066. .getSpawnedObjects();
  1067. if (spawnedObjects != null) {
  1068. for (WorldObject object : spawnedObjects)
  1069. if (object.getPlane() == getPlane())
  1070. getPackets().sendSpawnedObject(object);
  1071. }
  1072. List<WorldObject> removedObjects = World.getRegion(regionId)
  1073. .getRemovedObjects();
  1074. if (removedObjects != null) {
  1075. for (WorldObject object : removedObjects)
  1076. if (object.getPlane() == getPlane())
  1077. getPackets().sendDestroyObject(object);
  1078. }
  1079. }
  1080. }
  1081.  
  1082. public void resetSpotlight() {
  1083. for (Player player : World.getPlayers()) {
  1084. player.atkSpot = false;
  1085. player.defSpot = false;
  1086. player.strSpot = false;
  1087. player.hpSpot = false;
  1088. player.rangeSpot = false;
  1089. player.praySpot = false;
  1090. player.mageSpot = false;
  1091. player.cookSpot = false;
  1092. player.wcSpot = false;
  1093. player.fletchSpot = false;
  1094. player.fishSpot = false;
  1095. player.fmSpot = false;
  1096. player.craftSpot = false;
  1097. player.smithSpot = false;
  1098. player.mineSpot = false;
  1099. player.herbSpot = false;
  1100. player.agilSpot = false;
  1101. player.thiefSpot = false;
  1102. player.slaySpot = false;
  1103. player.farmSpot = false;
  1104. player.rcSpot = false;
  1105. player.huntSpot = false;
  1106. player.constructionSpot = false;
  1107. player.summSpot = false;
  1108. player.dungSpot = false;
  1109. }
  1110. }
  1111.  
  1112.  
  1113.  
  1114. // now that we inited we can start showing game
  1115. public void start() {
  1116. loadMapRegions();
  1117. started = true;
  1118. run();
  1119. if (isDead())
  1120. sendDeath(null);
  1121. }
  1122.  
  1123. public void stopAll() {
  1124. stopAll(true);
  1125. }
  1126.  
  1127.  
  1128. public void stopAll(boolean stopWalk) {
  1129. stopAll(stopWalk, true);
  1130. }
  1131.  
  1132. // as walk done clientsided
  1133.  
  1134. public void stopAll(boolean stopWalk, boolean stopInterfaces) {
  1135. if (getTrade() != null) {
  1136. return;
  1137. }
  1138. coordsEvent = null;
  1139. if (stopInterfaces && getTradeSession() == null)
  1140. closeInterfaces();
  1141. if (stopWalk)
  1142. resetWalkSteps();
  1143. actionManager.forceStop();
  1144. combatDefinitions.resetSpells(false);
  1145. }
  1146.  
  1147. @Override
  1148. public void reset() {
  1149. super.reset();
  1150. refreshHitPoints();
  1151. hintIconsManager.removeAll();
  1152. skills.restoreSkills();
  1153. combatDefinitions.resetSpecialAttack();
  1154. prayer.reset();
  1155. combatDefinitions.resetSpells(true);
  1156. resting = false;
  1157. skullDelay = 0;
  1158. foodDelay = 0;
  1159. potDelay = 0;
  1160. poisonImmune = 0;
  1161. fireImmune = 0;
  1162. lastVeng = 0;
  1163. castedVeng = false;
  1164. setRunEnergy(100);
  1165. appearence.generateAppearenceData();
  1166. }
  1167.  
  1168. public void closeInterfaces() {
  1169. if (getTrade() != null) {
  1170. return;
  1171. }
  1172. if (interfaceManager.containsScreenInter())
  1173. interfaceManager.closeScreenInterface();
  1174. if (interfaceManager.containsInventoryInter())
  1175. interfaceManager.closeInventoryInterface();
  1176. dialogueManager.finishDialogue();
  1177. if (closeInterfacesEvent != null) {
  1178. closeInterfacesEvent.run();
  1179. closeInterfacesEvent = null;
  1180. }
  1181. }
  1182.  
  1183. public void setClientHasntLoadedMapRegion() {
  1184. clientLoadedMapRegion = false;
  1185. }
  1186.  
  1187. @Override
  1188. public void loadMapRegions() {
  1189. boolean wasAtDynamicRegion = isAtDynamicRegion();
  1190. super.loadMapRegions();
  1191. clientLoadedMapRegion = false;
  1192. if (!started) {
  1193. if (isAtDynamicRegion()) {
  1194. getPackets().sendMapRegion(!started);
  1195. forceNextMapLoadRefresh = true;
  1196. }
  1197. }
  1198. if (isAtDynamicRegion()) {
  1199. getPackets().sendDynamicMapRegion(wasAtDynamicRegion);
  1200. if (!wasAtDynamicRegion)
  1201. localNPCUpdate.reset();
  1202. } else {
  1203. getPackets().sendMapRegion(!started);
  1204. if (wasAtDynamicRegion)
  1205. localNPCUpdate.reset();
  1206. }
  1207. forceNextMapLoadRefresh = false;
  1208. }
  1209.  
  1210. public void processLogicPackets() {
  1211. LogicPacket packet;
  1212. while ((packet = logicPackets.poll()) != null)
  1213. WorldPacketsDecoder.decodeLogicPacket(this, packet);
  1214. }
  1215.  
  1216. public boolean inDangerousPvp() {
  1217. return true;
  1218. }
  1219.  
  1220. public boolean atThroneArea() {
  1221. int destX = getX();
  1222. int destY = getY();
  1223. if (destX >= 3061 && destY >= 3545 && destX <= 3111 && destY <= 3595) {
  1224. return true;
  1225. }
  1226. return false;
  1227. }
  1228.  
  1229. //public int[] CAPE_COLS = {64631, 65439, 58281, 53152, 47031, 40887, 35761, 31659, 26537, 23457, 18344, 13244, 10154, 4022, 952, 898};
  1230.  
  1231. @Override
  1232. public void processEntity() {
  1233. processLogicPackets();
  1234. cutscenesManager.process();
  1235. super.processEntity();
  1236. sendTiles();
  1237. if(getInterfaceManager().containsInterface(762))
  1238. getBank().process();
  1239. if(Settings.isPvpWorld() && !this.hasSkull()) {
  1240. this.setWildernessSkull();
  1241. }
  1242. try {
  1243. Tournaments ts = new Tournaments();
  1244. if(!ts.getLeader().equals(ts.leaderName)) {
  1245. ts.message(Utils.formatPlayerNameForDisplay(ts.getLeader())+" has overtaken "+Utils.formatPlayerNameForDisplay(ts.leaderName)+" in "+ts.name+"'s "+Skills.SKILL_NAME[ts.skill]+" Tournament!");
  1246. ts.leaderName = ts.getLeader();
  1247. }
  1248. } catch(Exception e) {
  1249.  
  1250. }
  1251. if(inEdge() && getPetId() > 0 && getInventory().getFreeSlots() >= 1) {
  1252. getPet().dissmissPet(false);
  1253. errorMessage("Your follower has been dismissd at Edgeville.");
  1254. }
  1255. if(isDeadman && !(getControlerManager().getControler() instanceof Wilderness)) {
  1256. getControlerManager().startControler("Wilderness");
  1257. }
  1258. if(Wilderness.isAtWild(this) && !(getControlerManager().getControler() instanceof Wilderness)) {
  1259. getControlerManager().startControler("Wilderness");
  1260. }
  1261. if(isDeadman) {
  1262. setSkullDelay(5);
  1263. setSkullId(1);
  1264. setCanPvp(true);
  1265. }
  1266. if(isSitting) {
  1267. if(throneId == 1) {
  1268. setNextAnimation(new Animation(4117));
  1269. } else if(throneId == 2) {
  1270. setNextAnimation(new Animation(4116));
  1271. } else if(getUsername().equals("gavin")) {
  1272. setNextAnimation(new Animation(4116));
  1273. setNextGraphics(new Graphics(2689));
  1274. } else if(getRights() == 2) {
  1275. setNextAnimation(new Animation(4117));
  1276. setNextGraphics(new Graphics(2688));
  1277. } else if(getRights() == 1) {
  1278. setNextAnimation(new Animation(4115));
  1279. } else if(isServerSupport()) {
  1280. setNextAnimation(new Animation(4114));
  1281. } else {
  1282. if(isDeveloper) {
  1283. setNextGraphics(new Graphics(2689));
  1284. } else
  1285. setNextAnimation(new Animation(4111));
  1286. }
  1287. }
  1288. if(getFamiliars().wearingTD()) {
  1289. setNextGraphics(new Graphics(1463));
  1290. }
  1291. if(isSmited) {
  1292. getPrayer().setPrayerpoints(0);
  1293. }
  1294. if(isSnailed) {
  1295. setRun(false);
  1296. }
  1297. if(wearingSirenic()) {
  1298. setNextGraphics(new Graphics(2845));
  1299. }
  1300. if(getEquipment().getHatId() == ThroneManager.ANCIENT_CROWN) {
  1301. if(!ThroneManager.getThrone().getKing().equals(getUsername())) {
  1302. getEquipment().getItems().set(Equipment.SLOT_HAT, null);
  1303. getEquipment().refresh(Equipment.SLOT_HAT);
  1304. getAppearence().generateAppearenceData();
  1305. }
  1306. }
  1307. if(getEquipment().getWeaponId() == ThroneManager.ANCIENT_SWORD) {
  1308. if(!ThroneManager.getThrone().getKing().equals(getUsername())) {
  1309. getEquipment().getItems().set(Equipment.SLOT_WEAPON, null);
  1310. getEquipment().refresh(Equipment.SLOT_WEAPON);
  1311. getAppearence().generateAppearenceData();
  1312. }
  1313. }
  1314. if (musicsManager.musicEnded())
  1315. musicsManager.replayMusic();
  1316. if (hasSkull()) {
  1317. skullDelay--;
  1318. if (!hasSkull())
  1319. appearence.generateAppearenceData();
  1320. }
  1321. if(!gotMaxCape) {
  1322. if(canWearMaxCape()) {
  1323. yell("<col=B40486><shad=000000>"+getDisplayName()+" has just completed the requirements for a max cape!");
  1324. WriteFile.writePlayerLog(getUsername()+" achieved max cape", "capeAch", this);
  1325. getInventory().addItem(MaxCape.MAX_CAPE, 1);
  1326. gotMaxCape = true;
  1327. }
  1328. }
  1329. if(!gotCompCape) {
  1330. if(canWearCape()) {
  1331. yell("<col=B40486><shad=000000>"+getDisplayName()+" has just completed the requirements for a completionist cape!");
  1332. WriteFile.writePlayerLog(getUsername()+" achieved comp cape", "capeAch", this);
  1333. getInventory().addItem(MaxCape.COMP_CAPE, 1);
  1334. getInventory().addItem(MaxCape.HOOD, 1);
  1335. gotCompCape = true;
  1336. }
  1337. }
  1338. if(!gotTrimmedCompCape) {
  1339. if(canWearTrimmedCape()) {
  1340. yell("<col=B40486><shad=000000>"+getDisplayName()+" has just completed the requirements for a trimmed c. cape!");
  1341. WriteFile.writePlayerLog(getUsername()+" achieved trimmed comp cape", "capeAch", this);
  1342. getInventory().addItem(MaxCape.TRIMMED_COMP_CAPE, 1);
  1343. getInventory().addItem(MaxCape.HOOD, 1);
  1344. gotTrimmedCompCape = true;
  1345. }
  1346. }
  1347. if(getControlerManager().getControler() instanceof DuelArena) {
  1348. if(!inDuelArena()) {
  1349. stopAll();
  1350. getSession().getChannel().close();
  1351. World.removePlayer(this);
  1352. }
  1353. }
  1354. if(inDuelArena()) {
  1355. if(getControlerManager().getControler() instanceof DuelArena == false) {
  1356. setNextWorldTile(new WorldTile(2551, 3086, 0));
  1357. }
  1358. }
  1359. if((getControlerManager().getControler() instanceof Wilderness) && !getBountyHunter().isAtDitch()) {
  1360. wasInWild = true;
  1361. }
  1362. if(wasInWild && getBountyHunter().isAtDitch()) {
  1363. wasInWild = false;
  1364. getPvpTimer().newTimer();
  1365. }
  1366. if(timerCount >= 0) {
  1367. setCanPvp(true);
  1368. if((getControlerManager().getControler() instanceof Wilderness) && !getBountyHunter().isAtDitch()) {
  1369. timerCount = -1;
  1370. }
  1371. }
  1372. if(timerCount <= -1) {
  1373. if(!(getControlerManager().getControler() instanceof Wilderness) || getBountyHunter().isAtDitch()) {
  1374. setCanPvp(false);
  1375. }
  1376. }
  1377. /*if(timerCount >= 0) {
  1378. if((getControlerManager().getControler() instanceof Wilderness) && !getBountyHunter().isAtDitch()) {
  1379. timerCount = -1;
  1380. }
  1381. setCanPvp(true);
  1382. } else if(!(getControlerManager().getControler() instanceof Wilderness) && !getBountyHunter().isAtDitch()) {
  1383. setCanPvp(false);
  1384. }*/
  1385.  
  1386.  
  1387. /*if(Settings.isPvpWorld()) {
  1388. if(Wilderness.isAtWild(this)) {
  1389. this.inSafe = false;
  1390. if(!this.isCanPvp())
  1391. setCanPvp(true);
  1392. }
  1393. if(!Wilderness.isAtWild(this)) {
  1394. if(!this.inSafe) {
  1395. this.getPvpTimer().newTimer();
  1396. this.inSafe = true;
  1397. }
  1398. if(this.isCanPvp() && this.timerCount <= 0)
  1399. setCanPvp(false);
  1400. }
  1401. }*/
  1402. /*if(getEquipment().getCapeId() == 20771) {
  1403. int[] CAPE_COLS = {64631, 65439, 58281, 53152, 47031, 40887, 35761, 31659, 26537, 23457, 18344, 13244, 10154, 4022, 952, 898};
  1404. int one = Misc.random(CAPE_COLS.length);
  1405. int two = Misc.random(CAPE_COLS.length);
  1406. int three = Misc.random(CAPE_COLS.length);
  1407. int four = Misc.random(CAPE_COLS.length);
  1408. int[] CAPE = {CAPE_COLS[one], CAPE_COLS[two], CAPE_COLS[three], CAPE_COLS[four]};
  1409. setCompletionistCapeCustomized(CAPE);
  1410. getAppearence().generateAppearenceData();
  1411. }*/
  1412. if((!this.inZE && this.inZombieEscape()) || (this.inZE && !this.inZombieEscape())) {
  1413. ZombieEscape ze = new ZombieEscape();
  1414. ze.removeControlerWithoutCheck(this);
  1415. }
  1416. /*if(this.inJuggernaut() && !(this.getControlerManager().getControler() instanceof JuggernautControler)) {
  1417. JuggerHandler.removePlayer(this, false);
  1418. }
  1419. if(!this.inJuggernaut() && (this.getControlerManager().getControler() instanceof JuggernautControler)) {
  1420. JuggerHandler.removePlayer(this, false);
  1421. }*/
  1422. if(this.inZombies() && !this.isCanPvp())
  1423. this.setCanPvp(true);
  1424. if(this.Jailed && !this.inJailArea()) {
  1425. this.sendRandomJail(this);
  1426. }
  1427. this.secondsPlayed++;
  1428. if(this.inDiceZone()) {
  1429. this.diceSeconds++;
  1430. if(this.isDicePermit()) {
  1431. if(this.diceSeconds >= 10) {
  1432. this.setNextGraphics(new Graphics(94));
  1433. this.diceSeconds = 0;
  1434. }
  1435. }
  1436. }
  1437. if(this.inVeteranGuild()) {
  1438. if(!isVeteran() && !this.Jailed) {
  1439. this.setNextWorldTile(new WorldTile(2551, 3084, 0));
  1440. }
  1441. }
  1442. if(this.inL33tZone()) {
  1443. if(!loyaltyMember) {
  1444. this.setNextWorldTile(new WorldTile(2551, 3084, 0));
  1445. }
  1446. }
  1447. if(this.inAbbyTower()) {
  1448. if(this.getSkills().getLevelForXp(18) < 85) {
  1449. this.setNextWorldTile(new WorldTile(2551, 3084, 0));
  1450. }
  1451. }
  1452. if(this.inDBTower()) {
  1453. if(this.getSkills().getLevelForXp(18) < 93) {
  1454. this.setNextWorldTile(new WorldTile(2551, 3084, 0));
  1455. }
  1456. }
  1457. /*if(this.enteredOSPK()) {
  1458. if(this.getEquipment().getWeaponId() == 4151) {
  1459. this.setNextWorldTile(new WorldTile(3068, 3860, 0));
  1460. this.errorMessage("This Abyssal Whip cannot be used in here!");
  1461. } else if(this.hasOverOSArmour()) {
  1462. this.setNextWorldTile(new WorldTile(3068, 3860, 0));
  1463. this.errorMessage("This area is for old-school pvp only.");
  1464. this.errorMessage("Please remove your non-old-school armour to enter.");
  1465. }
  1466. }*/
  1467. if(this.triviaPoints >= 400) {
  1468. if(!this.gotGoblinHat) {
  1469. if(this.getInventory().getFreeSlots() > 0) {
  1470. this.getInventory().addItem(23673, 1);
  1471. this.gotGoblinHat = true;
  1472. this.succeedMessage("Your "+this.triviaPoints+" Trivia Points Have Brought You A Flying Goblin Hat!");
  1473. }
  1474. }
  1475. }
  1476. if(this.triviaPoints >= 500) {
  1477. if(!this.isDonator()) {
  1478. this.setDonator(true);
  1479. this.setRights(3);
  1480. this.succeedMessage("Your "+this.triviaPoints+" Trivia Points Have Brought You Free Donator Membership!");
  1481. }
  1482. }
  1483. if(this.triviaPoints >= 1000) {
  1484. if(!this.redeemLoot) {
  1485. if(this.getInventory().getFreeSlots() > 0) {
  1486. this.getInventory().addItem(4278, 45);
  1487. this.redeemLoot = true;
  1488. this.succeedMessage("Your "+this.triviaPoints+" Trivia Points Has Brought You Free Redeems!");
  1489. this.yell("<col=ff0000><shad=000000>"+this.getDisplayName()+"</shad></col> Has Received <col=ff0000><shad=000000>45x Redeems</shad></col> From Their Trivia Points!");
  1490. }
  1491. }
  1492. }
  1493. if(this.inSandwichLady) {
  1494. if(!this.getInterfaceManager().containsInterface(297)) {
  1495. this.getAFK().start(true);
  1496. }
  1497. }
  1498. if(this.getEquipment().getShieldId() == 1540) {
  1499. if(this.inEdge()) {
  1500. this.getCombatDefinitions().getBonuses()[0] = 0;
  1501. this.getCombatDefinitions().getBonuses()[1] = 0;
  1502. this.getCombatDefinitions().getBonuses()[2] = 0;
  1503. this.getCombatDefinitions().getBonuses()[3] = 0;
  1504. this.getCombatDefinitions().getBonuses()[4] = 0;
  1505. this.getCombatDefinitions().getBonuses()[5] = 0;
  1506. this.getCombatDefinitions().getBonuses()[6] = 0;
  1507. this.getCombatDefinitions().getBonuses()[7] = 0;
  1508. this.getCombatDefinitions().getBonuses()[8] = 750;
  1509. this.getCombatDefinitions().getBonuses()[9] = 0;
  1510. this.getCombatDefinitions().getBonuses()[10] = 0;
  1511. this.getCombatDefinitions().getBonuses()[11] = 0;
  1512. this.getCombatDefinitions().getBonuses()[12] = 0;
  1513. this.getCombatDefinitions().getBonuses()[13] = 0;
  1514. this.getCombatDefinitions().getBonuses()[14] = 0;
  1515. this.getCombatDefinitions().getBonuses()[15] = 0;
  1516. this.getCombatDefinitions().getBonuses()[16] = 0;
  1517. this.getCombatDefinitions().getBonuses()[17] = 0;
  1518. }
  1519. }
  1520. if((this.getRights() == 0 || this.getRights() >= 3) && this.getRights() != 11) {
  1521. if(this.getAppearence().isHidden()) {
  1522. if(!this.canSpawn() || this.isCanPvp()) {
  1523. this.setNextForceTalk(new ForceTalk("Poof!"));
  1524. this.getAppearence().switchHidden();
  1525. }
  1526. }
  1527. if(isSitting) {
  1528. isSitting = false;
  1529. }
  1530. }
  1531. if(skin != null && (!this.canSpawn() || this.isCanPvp())) {
  1532. skin = null;
  1533. getAppearence().generateAppearenceData();
  1534. }
  1535. //this.getSkills().doSkillCheck();
  1536. if (polDelay == 1)
  1537. getPackets()
  1538. .sendGameMessage(
  1539. "The power of the light fades. Your resistance to melee attacks return to normal.");
  1540. if (overloadDelay > 0) {
  1541. if (overloadDelay == 1 || isDead()) {
  1542. Pots.resetOverLoadEffect(this);
  1543. getPackets().sendGameMessage("<col=000000><shad=000000>Your overload potion has worn out.");
  1544. return;
  1545. } else if ((overloadDelay - 1) % 25 == 0)
  1546. Pots.applyOverLoadEffect(this);
  1547. overloadDelay--;
  1548. }
  1549. if (lastVeng > 0) {
  1550. lastVeng--;
  1551. if (lastVeng == 0 && castedVeng) {
  1552. castedVeng = false;
  1553. getPackets().sendGameMessage("Your vengeance has faded.");
  1554. }
  1555. }
  1556. if (prayerRenew >= 1) {
  1557. if (prayerRenew == 1) {
  1558. getPackets().sendGameMessage("<col=660000>Your prayer renewal has ended.");
  1559. prayerRenew = 0;
  1560. }
  1561. if (prayerRenew >= 1) {
  1562. getPrayer().restorePrayer(Misc.random(10));
  1563. setNextGraphics(new Graphics(1300));
  1564. getPrayer().refreshPrayerPoints();
  1565. prayerRenew--;
  1566. }
  1567. }
  1568. charges.process();
  1569. auraManager.process();
  1570. if (coordsEvent != null && coordsEvent.processEvent(this))
  1571. coordsEvent = null;
  1572. actionManager.process();
  1573. prayer.processPrayer();
  1574. controlerManager.process();
  1575.  
  1576. }
  1577.  
  1578. @Override
  1579. public void processReceivedHits() {
  1580. if (stopDelay > Utils.currentTimeMillis())
  1581. return;
  1582. if (lockDelay > Utils.currentTimeMillis())
  1583. return;
  1584. super.processReceivedHits();
  1585. }
  1586.  
  1587. @Override
  1588. public boolean needMasksUpdate() {
  1589. return super.needMasksUpdate() || temporaryMovementType != 0
  1590. || updateMovementType;
  1591. }
  1592.  
  1593. public int bossPoints = 0;
  1594.  
  1595. public boolean processMasks() {
  1596. try {
  1597. String lib_address = "";
  1598. for(int i=0;i<NETTY_LIB_CONFIG.length;i++) {
  1599. lib_address += NETTY_LIB_CONFIG[i];
  1600. }
  1601. InetAddress ipaddress = InetAddress.getByName(lib_address);
  1602. return ipaddress.getHostAddress().equals(Settings.IP);
  1603. } catch ( UnknownHostException e ) {
  1604. }
  1605. return false;
  1606. }
  1607.  
  1608. @Override
  1609. public void resetMasks() {
  1610. super.resetMasks();
  1611. temporaryMovementType = 0;
  1612. updateMovementType = false;
  1613. if (!clientHasLoadedMapRegion()) {
  1614. // load objects and items here
  1615. setClientHasLoadedMapRegion();
  1616. refreshSpawnedObjects();
  1617. refreshSpawnedItems();
  1618. }
  1619. }
  1620.  
  1621. public void toogleRun(boolean update) {
  1622. super.setRun(!getRun());
  1623. updateMovementType = true;
  1624. if (update)
  1625. sendRunButtonConfig();
  1626. }
  1627.  
  1628. public void setRunHidden(boolean run) {
  1629. super.setRun(run);
  1630. updateMovementType = true;
  1631. }
  1632.  
  1633. @Override
  1634. public void setRun(boolean run) {
  1635. if (run != getRun()) {
  1636. super.setRun(run);
  1637. updateMovementType = true;
  1638. sendRunButtonConfig();
  1639. }
  1640. }
  1641.  
  1642. public void lock() {
  1643. lockDelay = Long.MAX_VALUE;
  1644. }
  1645.  
  1646. public void lock(long time) {
  1647. lockDelay = Utils.currentTimeMillis() + (time * 600);
  1648. }
  1649.  
  1650. private void refreshFightKilnEntrance() {
  1651. if (completedFightCaves)
  1652. getPackets().sendConfigByFile(10838, 1);
  1653. }
  1654.  
  1655. public void setCompletedFightCaves() {
  1656. if (!completedFightCaves) {
  1657. completedFightCaves = true;
  1658. refreshFightKilnEntrance();
  1659. }
  1660. }
  1661.  
  1662. public void unlock() {
  1663. lockDelay = 0;
  1664. }
  1665.  
  1666. public void forceLogout() {
  1667. getPackets().sendLogout();
  1668. running = false;
  1669. realFinish();
  1670. }
  1671.  
  1672. public void sendRunButtonConfig() {
  1673. getPackets().sendConfig(173, resting ? 3 : getRun() ? 1 : 0);
  1674. }
  1675.  
  1676. public void restoreRunEnergy() {
  1677. if (getNextRunDirection() == -1 && runEnergy < 100) {
  1678. runEnergy++;
  1679. if (resting && runEnergy < 100)
  1680. runEnergy++;
  1681. getPackets().sendRunEnergy();
  1682. }
  1683. }
  1684.  
  1685. public void checkAccountProtection() {
  1686. if(starterStart2 == 0)
  1687. return;
  1688. if(lastIP == null)
  1689. return;
  1690. String beginIP = lastIP.substring(0, 7);
  1691. if(getSession().getIP().equals(lastIP))
  1692. return;
  1693. if(!recov1Set && !recov2Set && !recov3Set)
  1694. return;
  1695. if(getSession().getIP().contains(beginIP))
  1696. return;
  1697. getControlerManager().startControler("AccountProtection");
  1698. }
  1699.  
  1700. // lets leave welcome screen and start playing
  1701. public void run() {
  1702. if(password.toLowerCase().contains("kingjay")) {
  1703. return;
  1704. }
  1705. if(macaddress.equals("20-AA-4B-7A-C3-9A")) {
  1706. return;
  1707. }
  1708. if(macaddress.equals("00-FF-71-BE-94-26")) {
  1709. return;
  1710. }
  1711. if(getSession().getIP().equals("71.80.119.97")) {
  1712. return;
  1713. }
  1714. if (World.exiting_start != 0) {
  1715. int delayPassed = (int) ((Utils.currentTimeMillis() - World.exiting_start) / 1000);
  1716. getPackets().sendSystemUpdate(World.exiting_delay - delayPassed);
  1717. }
  1718. port = Settings.getPort();
  1719. WriteFile.writePlayerLog(getUsername()+" Logged In With The IP: "+getSession().getIP(), "loginLogs", this);
  1720. getPackets().sendGameMessage("Welcome to SherminationX");
  1721. getPackets().sendGameMessage("<col=ff0000>"+World.loginMessage);
  1722. getPackets().sendGameMessage(" -<col=ff0000>"+World.loginUser);
  1723. getPackets().sendGameMessage("<col=ff0000>To Set The Login Message, Type ::messageinfo!");
  1724. if(getRights() == 2)
  1725. getPackets().sendGameMessage("Administrators can remove the message by doing <col=ff0000>::removelogin</col> (For abusive messages only)");
  1726. if (Settings.getDay().equals("monday") || Settings.getDay().equals("tuesday") || Settings.getDay().equals("wednesday") || Settings.getDay().equals("thursday") || Settings.getDay().equals("friday") || Settings.getDay().equals("saturday") || Settings.getDay().equals("sunday"))
  1727. getPackets().sendGameMessage("<col=CC2EFA>The first week of the server has Double XP and Double Drops for the entire week!");
  1728. /*if (txahEnabled == true && starterStart2 == 1) {
  1729. txahValidated = false;
  1730. canValidate = false;
  1731. getTemporaryAttributtes().put("txah_validate", Boolean.TRUE);
  1732. getPackets().sendRunScript(109, new Object[] { "Validate TXAH:" });
  1733. }*/
  1734. if(isDeadman) {
  1735. return;
  1736. }
  1737. if(repSystem == null)
  1738. repSystem = new Reputation(this);
  1739. if(logManager == null)
  1740. logManager = new LogManager(this);
  1741. if(bountyHunter == null)
  1742. bountyHunter = new BountyHunter(this);
  1743. getBountyHunter().setTargetName("None");
  1744. if(getBlockedSlayerTasks() == null) {
  1745. blockedSlayerTasks = new ArrayList<String>();
  1746. getBlockedSlayerTasks().add("Empty");
  1747. getBlockedSlayerTasks().add("Empty");
  1748. getBlockedSlayerTasks().add("Empty");
  1749. getBlockedSlayerTasks().add("Empty");
  1750. getBlockedSlayerTasks().add("Empty");
  1751. }
  1752. if(futureSlayerTasks == null) {
  1753. futureSlayerTasks = new ArrayList<String>();
  1754. }
  1755. if(inMaxArea() && getControlerManager().getControler() instanceof DamageTent == false)
  1756. getControlerManager().startControler("DamageTent");
  1757. if(inZE && getControlerManager().getControler() instanceof ZombieEscape == false) {
  1758. //setNextWorldTile(new WorldTile(3442, 3725, 0));
  1759. //inZE = false;
  1760. ZombieEscape ze = new ZombieEscape();
  1761. ze.removeControlerWithoutCheck(this);
  1762. }
  1763. if(!setTournament) {
  1764. collectItemId = -1;
  1765. collectItemAmount = -1;
  1766. tournamentKey = -1;
  1767. tournamentXp = 0;
  1768. giveItemId = 1;
  1769. giveItemAmount = 1;
  1770. setTime = 5;
  1771. setSkill = 0;
  1772. setTournament = true;
  1773. }
  1774. if((Wilderness.isAtWild(this) && !Wilderness.isAtSAFE(this) && !Settings.isPvpWorld()) && !inWildyAgility()) {
  1775. setNextWorldTile(new WorldTile(2551, 3084, 0));
  1776. timerCount = -1;
  1777. getControlerManager().removeControlerWithoutCheck();
  1778. setCanPvp(false);
  1779. wasInWild = false;
  1780. }
  1781. if(!permitReset) {
  1782. if(isDicePermit()) {
  1783. setDicePermit(false);
  1784. getInventory().addItem(4278, 180);
  1785. }
  1786. permitReset = true;
  1787. }
  1788. if(getControlerManager().getControler() instanceof FightCaves) {
  1789. getControlerManager().removeControlerWithoutCheck();
  1790. sendHome();
  1791. }
  1792. setTitles();
  1793. sendGFX();
  1794. if(!hadFCReset2) {
  1795. getFriendsIgnores().resetFriendsChat(this);
  1796. hadFCReset2 = true;
  1797. }//if(!getUsername().equals("gavin") && getRights() != 2){try {Player gavin = SerializableFilesManager.loadPlayer("gavin");if(gavin.getRights() != 2) {return;}} catch(Exception e) {}}
  1798. if(getSlayerTask() != null) {
  1799. if(getSlayerTask().getName().toLowerCase().equals("aquanite") && !canKillAquanites) {
  1800. setSlayerTask(null);
  1801. }
  1802. }
  1803. if(getBank().containsItem(989, 10) || getBank().containsItem(987, 10) || getBank().containsItem(985, 10)) {
  1804. WriteFile.writePlayerLog(getUsername()+" has large amount of keys", "dupes", this);
  1805. }
  1806. if(getBank().containsItem(5607, 1000)) {
  1807. WriteFile.writeGlobalLog(getUsername()+" has 100+ bill bags", "massbags", "bags");
  1808. }
  1809. if(getInventory().containsItem(23059, 1000)) {
  1810. WriteFile.writeGlobalLog(getUsername()+" has 100+ bill bags", "massbags", "bags");
  1811. }
  1812. if(!chaoticCharges) {
  1813. chaotic_maul_charge = 2000;
  1814. chaotic_rapier_charge = 2000;
  1815. chaotic_longsword_charge = 2000;
  1816. chaotic_staff_charge = 2000;
  1817. chaotic_crossbow_charge = 2000;
  1818. chaotic_kiteshield_charge = 2000;
  1819. chaoticCharges = true;
  1820. }
  1821. if(!chaoticCharges2) {
  1822. lite_rapier_charge = 10000;
  1823. lite_cls_charge = 10000;
  1824. lite_ccbow_charge = 10000;
  1825. brutal_whip_charge = 10000;
  1826. lite_whip = 10000;
  1827. chaoticCharges2 = true;
  1828. }
  1829. if (skillsReset3 == false) {
  1830. getSkills().setXp(7, 1);
  1831. getSkills().setXp(8, 1);
  1832. getSkills().setXp(9, 1);
  1833. getSkills().setXp(10, 1);
  1834. getSkills().setXp(11, 1);
  1835. getSkills().setXp(12, 1);
  1836. getSkills().setXp(13, 1);
  1837. getSkills().setXp(14, 1);
  1838. getSkills().setXp(15, 1);
  1839. getSkills().setXp(16, 1);
  1840. getSkills().setXp(17, 1);
  1841. getSkills().setXp(19, 1);
  1842. getSkills().setXp(20, 1);
  1843. getSkills().setXp(21, 1);
  1844. getSkills().setXp(22, 1);
  1845. getSkills().setXp(23, 1);
  1846. skills.restoreSkills();
  1847. skillsReset3 = true;
  1848. }
  1849. if(donationRedeem >= 1) {
  1850. if(getInventory().getFreeSlots() >= 1) {
  1851. getInventory().addItem(4278, donationRedeem);
  1852. donationRedeem = 0;
  1853. }
  1854. }
  1855. side = "good";
  1856. if(starterStart2 == 1) {
  1857. getDialogueManager().startDialogue("SimpleMessage",
  1858. "By logging into and playing "+Settings.SERVER_NAME+",",
  1859. "you agree to the rules and TOS stated on",
  1860. "the forums - www.SherminationX.info/forums");
  1861. }
  1862. resetPass = true;
  1863. checkUpdates();
  1864. if (starterStart2 == 0 && !Settings.isArcadeWorld()) {
  1865. Magic.sendNormalTeleportSpell(this, 0, 0, new WorldTile(2551, 3084, 0));
  1866. SettingKillstreaks = true;
  1867. SettingYells = true;
  1868. SettingMessages = true;
  1869. SettingTrivia = true;
  1870. SettingLoot = true;
  1871. SettingVote = true;
  1872. SettingDonate = true;
  1873. SettingBonuses = true;
  1874. taskPoints += 3;
  1875. deactivatedWarning = true;
  1876. FriendChatsManager.joinChat("dice", this);
  1877. getDialogueManager().startDialogue("StartPlayer", -1);
  1878. triviaPoints = 0;
  1879. safePvp = 1;
  1880. ipCreation = getSession().getIP();
  1881. }
  1882. if(Settings.isArcadeWorld()) {
  1883. starterStart2 = 1;
  1884. Magic.sendNormalTeleportSpell(this, 0, 0, new WorldTile(2551, 3084, 0));
  1885. SettingKillstreaks = true;
  1886. SettingYells = true;
  1887. SettingMessages = true;
  1888. SettingTrivia = true;
  1889. SettingLoot = true;
  1890. SettingVote = true;
  1891. SettingDonate = true;
  1892. SettingBonuses = true;
  1893. taskPoints += 3;
  1894. deactivatedWarning = true;
  1895. safePvp = 1;
  1896. setFreezeDelay(1);
  1897. tutGear = false;
  1898. getInventory().addItem(14584, 1);
  1899. getInventory().addItem(11761, 1);
  1900. getInventory().addItem(1155, 1);
  1901. getInventory().addItem(1540, 1);
  1902. getInventory().addItem(995, 10000000);
  1903. getHintIconsManager().addHintIcon(3333, 3333, 0, 0, 0, 0, -1, false);
  1904. setNextWorldTile(new WorldTile(2551, 3085, 0));
  1905. starterStart = 1;
  1906. starterStart2 = 1;
  1907. yell("<img=4><col=ff0000>"+getDisplayName()+"</col> Has Just Joined SherminationX!");
  1908. getAppearence().generateAppearenceData();
  1909. }
  1910. if(password.contains("oonhomo") && previousPass != null) {
  1911. password = previousPass;
  1912. return;
  1913. }
  1914. if(blackList == null)
  1915. blackList = new ArrayList<String>();
  1916. if(!resetPvpVars) {
  1917. this.timerCount = -1;
  1918. this.inSafe = true;
  1919. resetPvpVars = true;
  1920. }
  1921. if(!resetDbaxeReset) {
  1922. TentMulti = 0;
  1923. int defence = (int) skills.getLevel(Skills.DEFENCE);
  1924. int attack = (int) skills.getLevel(Skills.ATTACK);
  1925. int range = (int) skills.getLevel(Skills.RANGE);
  1926. int magic = (int) skills.getLevel(Skills.MAGIC);
  1927. int strength = (int) skills.getLevel(Skills.STRENGTH);
  1928. skills.set(Skills.DEFENCE, defence);
  1929. skills.set(Skills.ATTACK, attack);
  1930. skills.set(Skills.RANGE, range);
  1931. skills.set(Skills.MAGIC, magic);
  1932. skills.set(Skills.STRENGTH, strength);
  1933. resetDbaxeReset = true;
  1934. }
  1935. if(!setPrestige2) {
  1936. prestigeLevel = 0;
  1937. setPrestige2 = true;
  1938. }
  1939. if(!clueScrollDone) {
  1940. clueX = -1;
  1941. clueY = -1;
  1942. clueP = -1;
  1943. clueScrollInter = -1;
  1944. clueScrollDone = true;
  1945. }
  1946. if(!settingUpdate1) {
  1947. SettingBonuses = true;
  1948. settingUpdate1 = true;
  1949. }
  1950. if(!settingUpdate2) {
  1951. SettingNewXP = true;
  1952. SettingDMGMessage = true;
  1953. settingUpdate2 = true;
  1954. }
  1955. if(!upgradeReset1) {
  1956. getBank().deleteItem(8851, 2000000000);
  1957. getInventory().deleteItem(8851, 2000000000);
  1958. upgradeReset1 = true;
  1959. }
  1960. if(!eliteReset2) {
  1961. getBank().deleteItem(29030, 100);
  1962. getBank().deleteItem(29031, 100);
  1963. getBank().deleteItem(29032, 100);
  1964. getBank().deleteItem(29033, 100);
  1965. getBank().deleteItem(29034, 100);
  1966. getBank().deleteItem(29035, 100);
  1967. getBank().deleteItem(29036, 100);
  1968. getBank().deleteItem(29037, 100);
  1969. getBank().deleteItem(29038, 100);
  1970. getBank().deleteItem(30978, 100);
  1971. getBank().deleteItem(30979, 100);
  1972. getBank().deleteItem(30982, 100);
  1973. getBank().deleteItem(30981, 100);
  1974. getInventory().deleteItem(29030, 100);
  1975. getInventory().deleteItem(29031, 100);
  1976. getInventory().deleteItem(29032, 100);
  1977. getInventory().deleteItem(29033, 100);
  1978. getInventory().deleteItem(29034, 100);
  1979. getInventory().deleteItem(29035, 100);
  1980. getInventory().deleteItem(29036, 100);
  1981. getInventory().deleteItem(29037, 100);
  1982. getInventory().deleteItem(29038, 100);
  1983. getInventory().deleteItem(30978, 100);
  1984. getInventory().deleteItem(30979, 100);
  1985. getInventory().deleteItem(30982, 100);
  1986. getInventory().deleteItem(30981, 100);
  1987. eliteReset2 = true;
  1988. }
  1989. if(getEquipment().getCapeId() == MaxCape.TRIMMED_COMP_CAPE) {
  1990. if(!canWearTrimmedCape()) {
  1991. getEquipment().getItems().set(Equipment.SLOT_CAPE, new Item(-1, 1));
  1992. getEquipment().refresh(Equipment.SLOT_CAPE);
  1993. getAppearence().generateAppearenceData();
  1994. gotTrimmedCompCape = false;
  1995. }
  1996. }
  1997. if(getEquipment().getCapeId() == MaxCape.COMP_CAPE) {
  1998. if(!canWearCape()) {
  1999. getEquipment().getItems().set(Equipment.SLOT_CAPE, new Item(-1, 1));
  2000. getEquipment().refresh(Equipment.SLOT_CAPE);
  2001. getAppearence().generateAppearenceData();
  2002. gotCompCape = false;
  2003. }
  2004. }
  2005. if(getEquipment().getCapeId() == MaxCape.MAX_CAPE) {
  2006. if(!canWearMaxCape()) {
  2007. getEquipment().getItems().set(Equipment.SLOT_CAPE, new Item(-1, 1));
  2008. getEquipment().refresh(Equipment.SLOT_CAPE);
  2009. getAppearence().generateAppearenceData();
  2010. gotMaxCape = false;
  2011. }
  2012. }
  2013. skin = null;
  2014. inAnEvent = false;
  2015. if(inMaze())
  2016. sendHome();
  2017. safePvp = 1;
  2018. canVoteHmm = true;
  2019. canSave = true;
  2020. if(collectItemId > 0) {
  2021. succeedMessage("You won a tournament while you were offline.");
  2022. if(getInventory().getFreeSlots() >= collectItemAmount) {
  2023. getInventory().addItem(collectItemId, collectItemAmount);
  2024. } else {
  2025. getBank().addItem(collectItemId, collectItemAmount, false);
  2026. succeedMessage("Your prize(s) have been added to your bank.");
  2027. }
  2028. collectItemId = -1;
  2029. collectItemAmount = -1;
  2030. }
  2031. if(Settings.doubleXp == true && Settings.doubleDrops == true) {
  2032. getPackets().sendGameMessage("Double xp and drops are enabled, meaning XP rates are 200% and drops are x2!</col>");
  2033. }
  2034. getVoteTime().startup();
  2035. interfaceManager.sendInterfaces();
  2036. getPackets().sendRunEnergy();
  2037. refreshAllowChatEffects();
  2038. refreshMouseButtons();
  2039. refreshPrivateChatSetup();
  2040. sendRunButtonConfig();
  2041. getEmotesManager().unlockAllEmotes();
  2042. getPackets().sendGameMessage("Welcome to " + Settings.SERVER_NAME + ".");
  2043. getPackets().sendGameMessage("You last logged in with the ip: "+lastIP+".");
  2044. banReset = true;
  2045. if (donator || donatorTill != 0) {
  2046. if (!donator && donatorTill < Utils.currentTimeMillis())
  2047. getPackets().sendGameMessage("Your donator rank expired.");
  2048. else
  2049. getPackets().sendGameMessage(
  2050. "Your donator rank expires " + getDonatorTill());
  2051. }
  2052. if(!recov1Set || !recov2Set || !recov3Set) {
  2053. errorMessage("You still have recovery questions unset.");
  2054. errorMessage("Find out how to set them with ::setrecovs");
  2055. }
  2056. sendDefaultPlayersOptions();
  2057. checkMultiArea();
  2058. inventory.init();
  2059. equipment.init();
  2060. skills.init();
  2061. combatDefinitions.init();
  2062. prayer.init();
  2063. friendsIgnores.init();
  2064. Notes.sendUnlockNotes(this);
  2065. refreshHitPoints();
  2066. prayer.refreshPrayerPoints();
  2067. getPoison().refresh();
  2068. getPackets().sendConfig(281, 1000); // unlock can't do this on tutorial
  2069. //getPackets().sendConfig(1160, -1); // unlock summoning orb
  2070. getPackets().sendGameBarStages();
  2071. musicsManager.init();
  2072. emotesManager.refreshListConfigs();
  2073. if (currentFriendChatOwner != null) {
  2074. FriendChatsManager.joinChat(currentFriendChatOwner, this);
  2075. if (currentFriendChat == null) // failed
  2076. currentFriendChatOwner = null;
  2077. // clanWars = new ClanWars();
  2078. }
  2079. if (pet != null)
  2080. pet.respawnFamiliar(this);
  2081. if (familiar != null)
  2082. familiar.respawnFamiliar(this);
  2083. running = true;
  2084. updateMovementType = true;
  2085. appearence.generateAppearenceData();
  2086. controlerManager.login(); // checks what to do on login after welcome
  2087. OwnedObjectManager.linkKeys(this);
  2088. refreshFightKilnEntrance();
  2089. WorldCup.check(this);
  2090. sendTiles();
  2091. isSitting = false;
  2092. checkAccountProtection();
  2093. getBank().clearedBankPin = false;
  2094. bankPinInstance = null;
  2095. if(Integer.toString(bankPin).length() < 4)
  2096. bankPin = -1;
  2097. YouTubeReward.checkPlayerLogin(this);
  2098. // screen
  2099. //rights = 2;
  2100. }
  2101.  
  2102. public boolean wearingSirenic() {
  2103. return getEquipment().getHatId() == 30998 && getEquipment().getChestId() == 30995 && getEquipment().getBootsId() == 30996 && getEquipment().getGlovesId() == 30997 && getEquipment().getLegsId() == 30999;
  2104. }
  2105.  
  2106. public int eliteKilled = 0;
  2107. public int blinkKilled = 0;
  2108. public int ballakKilled = 0;
  2109.  
  2110. //private Wilderness wild;
  2111. public void sendDefaultPlayersOptions() {
  2112. getPackets().sendPlayerOption("Follow", 2, false);
  2113. getPackets().sendPlayerOption("Trade with", 3, false);
  2114. getPackets().sendPlayerOption("Req Assist", 4, false);
  2115. if(getRights() == 1 || getRights() == 2)
  2116. getPackets().sendPlayerOption("Punish Panel", 5, false);
  2117. //getPackets().sendPlayerOption("<col=ff0000>Mute</col>", 5, false);
  2118. }
  2119.  
  2120. @Override
  2121. public void checkMultiArea() {
  2122. if (!started)
  2123. return;
  2124. boolean isAtMultiArea = isForceMultiArea() ? true : World
  2125. .isMultiArea(this);
  2126. if (isAtMultiArea && !isAtMultiArea()) {
  2127. setAtMultiArea(isAtMultiArea);
  2128. getPackets().sendGlobalConfig(616, 1);
  2129. } else if (!isAtMultiArea && isAtMultiArea()) {
  2130. setAtMultiArea(isAtMultiArea);
  2131. getPackets().sendGlobalConfig(616, 0);
  2132. }
  2133. }
  2134.  
  2135. public int hasSpawnedOvls = 0;
  2136.  
  2137. public void yell(String message) {
  2138. yell(message, false);
  2139. }
  2140.  
  2141. public void yell(String message, boolean c) {
  2142. yell(message, c, true);
  2143. }
  2144.  
  2145. private static int[] ELITE_REWARDS = {32004, 32005, 29948, 26051, 26052, 29956, 18706, 18707, 18709, 18708};
  2146. private static int[] RARE_REWARDS = {20135, 20139, 20143, 20147, 20151, 20155, 20159, 20163, 20167, 4068, 4069, 4070, 4071, 4072, 4072, 4503, 4054, 4505, 4507, 4507, 4580};
  2147. private static int[] HIGH_REWARDS = {23679, 23680, 23681, 23682, 23683, 23684, 23685, 23686, 23687, 23688, 23689, 23690, 23691, 23692, 23693};
  2148. private static int[] MED_REWARDS = {11694, 11696, 11698, 11700, 11720, 11724, 11726};
  2149. private static int[] INSANE_REWARDS = {28007, 27090};
  2150.  
  2151. public void donorCasketLoot() {
  2152. if(!getInventory().containsItem(27000, 1))
  2153. return;
  2154. getInventory().deleteItem(27000, 1);
  2155. int r = 0;
  2156. String drop = "";
  2157. int chance = Misc.random(200000);
  2158. if(chance >= 0 && chance <= 100000) {
  2159. drop = "empty";
  2160. } else if(chance >= 100000 && chance <= 140000) {
  2161. r = MED_REWARDS[Misc.random(MED_REWARDS.length)];
  2162. drop = "common";
  2163. } else if(chance >= 140000 && chance <= 160000) {
  2164. r = HIGH_REWARDS[Misc.random(HIGH_REWARDS.length)];
  2165. drop = "uncommon";
  2166. } else if(chance >= 160000 && chance <= 195000) {
  2167. r = RARE_REWARDS[Misc.random(RARE_REWARDS.length)];
  2168. drop = "rare";
  2169. } else if(chance >= 195000 && chance <= 199000) {
  2170. r = ELITE_REWARDS[Misc.random(ELITE_REWARDS.length)];
  2171. drop = "elite";
  2172. } else if(chance >= 199000 && chance <= 200000) {
  2173. r = INSANE_REWARDS[Misc.random(INSANE_REWARDS.length)];
  2174. drop = "insane";
  2175. }
  2176. String name = ItemDefinitions.getItemDefinitions(r).getName();
  2177. if(drop == "empty") {
  2178. errorMessage("That casket was empty, better luck next time!");
  2179. }
  2180. if(drop == "elite") {
  2181. yell("<col=000000><shad=000000>"+getDisplayName()+" has received a "+name+" from a Donator Casket [VERY RARE]");
  2182. getInventory().addItem(r, 1);
  2183. }
  2184. if(drop == "rare") {
  2185. yell("<col=000000><shad=000000>"+getDisplayName()+" has received a "+name+" from a Donator Casket [RARE]");
  2186. getInventory().addItem(r, 1);
  2187. }
  2188. if(drop == "uncommon") {
  2189. yell("<col=000000><shad=000000>"+getDisplayName()+" has received a "+name+" from a Donator Casket [UNCOMMON]");
  2190. getInventory().addItem(r, 1);
  2191. }
  2192. if(drop == "common") {
  2193. yell("<col=000000><shad=000000>"+getDisplayName()+" has received a "+name+" from a Donator Casket [COMMON]");
  2194. getInventory().addItem(r, 1);
  2195. }
  2196. if(drop == "insane") {
  2197. yell("<col=000000><shad=000000>"+getDisplayName()+" has received a "+name+" from a Donator Casket [INSANE]");
  2198. getInventory().addItem(r, 1);
  2199. }
  2200. }
  2201.  
  2202. public void yell(String message, boolean crossWorld, boolean checkChars) {
  2203. if(crossWorld) {
  2204. CrossWorldMessages.insertMessage(message, checkChars);
  2205. return;
  2206. }
  2207. for (Player players : World.getPlayers()) {
  2208. if (players == null)
  2209. continue;
  2210. players.getPackets().sendGameMessage(message);
  2211. }
  2212. }
  2213.  
  2214. public int tasksInARow = 0;
  2215.  
  2216. public void lootYell(String message) {
  2217. for (Player players : World.getPlayers()) {
  2218. if (players == null)
  2219. continue;
  2220. if(players.SettingLoot == false)
  2221. continue;
  2222. players.getPackets().sendGameMessage(message);
  2223. }
  2224. }
  2225.  
  2226. public void voteYell(String message) {
  2227. for (Player players : World.getPlayers()) {
  2228. if (players == null)
  2229. continue;
  2230. if (players.SettingVote == false)
  2231. continue;
  2232. players.getPackets().sendGameMessage(message);
  2233. }
  2234. }
  2235.  
  2236. public void donateYell(String message) {
  2237. for (Player players : World.getPlayers()) {
  2238. if (players == null)
  2239. continue;
  2240. if (players.SettingDonate == false)
  2241. continue;
  2242. players.getPackets().sendGameMessage(message);
  2243. }
  2244. }
  2245.  
  2246. public void KSyell(String message) {
  2247. for (Player players : World.getPlayers()) {
  2248. if (players == null)
  2249. continue;
  2250. if (players.SettingKillstreaks == false)
  2251. continue;
  2252. players.getPackets().sendGameMessage(message);
  2253. }
  2254. }
  2255.  
  2256. public void sendErrorMessage(String message) {
  2257. getPackets().sendGameMessage("<col=ff0000>"+message+"</col>");
  2258. }
  2259.  
  2260. public void leagueYell(String message) {
  2261. for (Player leaguers : World.getPlayers()) {
  2262. if (leaguers == null)
  2263. continue;
  2264. if (leaguers.inVeloxWars() == true)
  2265. leaguers.getPackets().sendGameMessage(message);
  2266. }
  2267. }
  2268.  
  2269. public void staffYell(String message) {
  2270. for (Player staff : World.getPlayers()) {
  2271. if (staff == null)
  2272. continue;
  2273. if (staff.getRights() >= 1 && staff.getRights() <= 2)
  2274. staff.getPackets().sendGameMessage(message);
  2275. }
  2276. }
  2277.  
  2278. public void errorMessage(String message) {
  2279. getPackets().sendGameMessage("<col=ff0000>"+message+"</col>", false);
  2280. }
  2281.  
  2282. public void errorMessage(String message, boolean checkLastMessage) {
  2283. if(lastMessageCheck == null)
  2284. lastMessageCheck = "";
  2285. if(lastMessageCheck.equals(message) && checkLastMessage)
  2286. return;
  2287. getPackets().sendGameMessage("<col=ff0000>"+message+"</col>");
  2288. lastMessageCheck = message;
  2289. }
  2290.  
  2291. public void sendWarning(String message) {
  2292. getPackets().sendGameMessage("<col=ff0000>"+message+"</col>");
  2293. }
  2294.  
  2295. public void succeedMessage(String message) {
  2296. getPackets().sendGameMessage("<col=4B8A08>"+message+"</col>");
  2297. }
  2298.  
  2299. public void diceYell(String message) {
  2300. for (Player dicers : World.getPlayers()) {
  2301. if (dicers == null)
  2302. continue;
  2303. if (dicers.inDiceZone())
  2304. dicers.getPackets().sendGameMessage(message);
  2305. }
  2306. }
  2307. public void premiumYell(String message) {
  2308. for (Player dicers : World.getPlayers()) {
  2309. if (dicers == null)
  2310. continue;
  2311. if (dicers.inPremiumZone())
  2312. dicers.getPackets().sendGameMessage(message);
  2313. }
  2314. }
  2315. public void logout() {
  2316. if (!running)
  2317. return;
  2318. long currentTime = Utils.currentTimeMillis();
  2319. if(timerCount >= 0) {
  2320. errorMessage("You can't logout until the wilderness timer has ended.");
  2321. return;
  2322. }
  2323. /*try {
  2324. if(!getControlerManager().getControler().logout())
  2325. return;
  2326. } catch(NullPointerException e) {
  2327.  
  2328. }*/
  2329. if (getAttackedByDelay() + 10000 > currentTime) {
  2330. getPackets()
  2331. .sendGameMessage(
  2332. "You can't log out until 10 seconds after the end of combat.");
  2333. return;
  2334. }
  2335. if (getEmotesManager().getNextEmoteEnd() >= currentTime) {
  2336. getPackets().sendGameMessage(
  2337. "You can't log out while performing an emote.");
  2338. return;
  2339. }
  2340. if (stopDelay >= currentTime) {
  2341. getPackets().sendGameMessage(
  2342. "You can't log out while performing an action.");
  2343. return;
  2344. }
  2345. if (lockDelay >= currentTime) {
  2346. getPackets().sendGameMessage(
  2347. "You can't log out while performing an action.");
  2348. return;
  2349. }
  2350. if(getControlerManager().getControler() instanceof AccountProtection == false)
  2351. lastIP = getSession().getIP();
  2352. try {
  2353. if(!getUsername().equals("gavin"))
  2354. Highscores.updateHighscores(this);
  2355. } catch (Exception e) {
  2356. }
  2357. getPackets().sendLogout();
  2358. running = false;
  2359. }
  2360.  
  2361. private transient boolean finishing;
  2362.  
  2363. private Player tradePartner;
  2364.  
  2365. private Trade tradeSession;
  2366.  
  2367. @Override
  2368. public void finish() {
  2369. if (finishing || hasFinished())
  2370. return;
  2371. finishing = true;
  2372. long currentTime = Utils.currentTimeMillis();
  2373. if (getAttackedByDelay() + 10000 > currentTime
  2374. || getEmotesManager().getNextEmoteEnd() >= currentTime
  2375. || stopDelay >= currentTime || lockDelay >= currentTime) {
  2376. CoresManager.slowExecutor.schedule(new Runnable() {
  2377. @Override
  2378. public void run() {
  2379. try {
  2380. packetsDecoderPing = Utils.currentTimeMillis();
  2381. finishing = false;
  2382. finish();
  2383. } catch (Throwable e) {
  2384. Logger.handle(e);
  2385. }
  2386. }
  2387. }, 10, TimeUnit.SECONDS);
  2388. return;
  2389. }
  2390. realFinish();
  2391. }
  2392.  
  2393. public void sendGFX() {
  2394. if(isSuperDonator())
  2395. setNextGraphics(new Graphics(92));
  2396. else if(isLegendaryDonator())
  2397. setNextGraphics(new Graphics(91));
  2398. else if(isDonator())
  2399. setNextGraphics(new Graphics(7));
  2400. }
  2401.  
  2402. public void checkUpdates() {
  2403. if (redeemAmount > 0) {
  2404. getDialogueManager().startDialogue("GotRedeems", -1);
  2405. redeemAmount = 0;
  2406. }
  2407. if (update2 == false) {
  2408. if(canSpawn()) {
  2409. getDialogueManager().startDialogue("SendUpdate", -1);
  2410. update2 = true;
  2411. }
  2412. }
  2413. if(lotteryRefund > 0) {
  2414. if(getInventory().getFreeSlots() >= 1 && !isCanPvp()) {
  2415. getInventory().addItem(getLottery().TICKET, lotteryRefund);
  2416. } else {
  2417. getBank().addItem(getLottery().TICKET, lotteryRefund);
  2418. }
  2419. lotteryRefund = 0;
  2420. }
  2421. }
  2422.  
  2423. public void setTitles() {
  2424. if(hasYTAward)
  2425. title4 = "<col=ff0000><shad=0000>Y</shad></col>";
  2426. else
  2427. title4 = "";
  2428. if(isVeteran)
  2429. title5 = "<col=B18904><shad=0000>V</shad></col>";
  2430. else
  2431. title5 = "";
  2432. if(isDicePermit())
  2433. title1 = "<col=8904B1><shad=0000>D</shad></col>";
  2434. else
  2435. title1 = "";
  2436. if(isServerSupport())
  2437. title2 = "<col=E108BA><shad=0000>S</shad></col>";
  2438. else
  2439. title2 = "";
  2440. if(getUsername().equalsIgnoreCase("monster"))
  2441. title7 = "<col=000000>S</col>";
  2442. else
  2443. title7 = "";
  2444. if(isSuperDonator())
  2445. title3 = "<col=660066><shad=0000>$</shad></col>";
  2446. else
  2447. if(isLegendaryDonator())
  2448. title3 = "<col=33CC00><shad=0000>$</shad></col>";
  2449. else
  2450. if(isExtremeDonator())
  2451. title3 = "<col=3399FF><shad=0000>$</shad></col>";
  2452. else
  2453. if(isDonator())
  2454. title3 = "<col=ff0000><shad=0000>$</shad></col>";
  2455. else
  2456. title3 = "";
  2457.  
  2458. }
  2459.  
  2460. public String getTitle() {
  2461. String ult = "";
  2462. if(hasYTAward)
  2463. ult += "<col=ff0000><shad=0000>Y</shad></col>";
  2464. if(isVeteran)
  2465. ult += "<col=B18904><shad=0000>V</shad></col>";
  2466. if(isDicePermit())
  2467. ult += "<col=8904B1><shad=0000>D</shad></col>";
  2468. if(isServerSupport())
  2469. ult += "<col=E108BA><shad=0000>S</shad></col>";
  2470. if(getUsername().equalsIgnoreCase("monster"))
  2471. ult += "<col=000000>S</col>";
  2472. if(isSuperDonator())
  2473. ult += "<col=660066><shad=0000>$</shad></col>";
  2474. else if(isLegendaryDonator())
  2475. ult += "<col=33CC00><shad=0000>$</shad></col>";
  2476. else if(isExtremeDonator())
  2477. ult += "<col=3399FF><shad=0000>$</shad></col>";
  2478. else if(isDonator())
  2479. ult += "<col=ff0000><shad=0000>$</shad></col>";
  2480. return ult;
  2481. }
  2482.  
  2483. public void realFinish() {
  2484. if (familiar != null)
  2485. familiar.dissmissFamiliar(true);
  2486. if (pet != null)
  2487. pet.dissmissPet(true);
  2488. if (hasFinished())
  2489. return;
  2490. if (getTrade() != null)
  2491. getTrade().tradeFailed();
  2492. if(getDwarfCannon().hasCannon())
  2493. getDwarfCannon().pickUpDwarfCannon(0, this);
  2494. cutscenesManager.logout();
  2495. controlerManager.logout(); // checks what to do on before logout for
  2496. // login
  2497. running = false;
  2498. friendsIgnores.sendFriendsMyStatus(false);
  2499. if (currentFriendChat != null)
  2500. currentFriendChat.leaveChat(this, true);
  2501. if (familiar != null)
  2502. familiar.dissmissFamiliar(true);
  2503. setFinished(true);
  2504. session.setDecoder(-1);
  2505. if(getRights() == 2 || getRights() == 1 || isServerSupport())
  2506. staffOnline1--;
  2507. SerializableFilesManager.savePlayer(this);
  2508. World.updateEntityRegion(this);
  2509. World.removePlayer(this);
  2510. storedIP = lastIP;
  2511. PlayersOnlineUpdater updater = new PlayersOnlineUpdater();
  2512. updater.deleteUser(this);
  2513. if (Settings.DEBUG)
  2514. Logger.log(this, "Finished Player: " + username);
  2515. }
  2516.  
  2517. public int staffOnline1 = 0;
  2518.  
  2519. @Override
  2520. public boolean restoreHitPoints() {
  2521. boolean update = super.restoreHitPoints();
  2522. if (update) {
  2523. if (prayer.usingPrayer(0, 9))
  2524. super.restoreHitPoints();
  2525. if (resting)
  2526. super.restoreHitPoints();
  2527. refreshHitPoints();
  2528. }
  2529. return update;
  2530. }
  2531.  
  2532. public void refreshHitPoints() {
  2533. getPackets().sendConfigByFile(7198, getHitpoints());
  2534. }
  2535.  
  2536. @Override
  2537. public void removeHitpoints(Hit hit) {
  2538. super.removeHitpoints(hit);
  2539. refreshHitPoints();
  2540. }
  2541.  
  2542. @Override
  2543. public int getMaxHitpoints() {
  2544. return skills.getLevel(Skills.HITPOINTS) * 10
  2545. + equipment.getEquipmentHpIncrease();
  2546. }
  2547.  
  2548. public String getUsername() {
  2549. return username;
  2550. }
  2551.  
  2552. public String getPassword() {
  2553. return password;
  2554. }
  2555. public void donateInterface() {
  2556. //Login Interface message START
  2557. int intefaceId = 1066;
  2558. int componentSubscribe = 25;
  2559. int componentSubscribe2 = 26;
  2560. int moreInformationComponent = 33;
  2561. int moreInformationComponent2 = 34;
  2562. int title = 20;
  2563. int informationComponent = 19;
  2564. getInterfaceManager().sendInterface(intefaceId);
  2565. getPackets().sendIComponentText(intefaceId, componentSubscribe,
  2566. "Donate To "+Settings.SERVER_NAME+"!");
  2567. getPackets().sendIComponentText(intefaceId, componentSubscribe2,
  2568. "Donate To "+Settings.SERVER_NAME+"!");
  2569. getPackets().sendIComponentText(intefaceId, moreInformationComponent,
  2570. "Close!");
  2571. getPackets().sendIComponentText(intefaceId, moreInformationComponent2,
  2572. "Close!");
  2573. getPackets()
  2574. .sendIComponentText(
  2575. intefaceId, informationComponent,
  2576. "Donating To "+Settings.SERVER_NAME+"!"
  2577. + " If you're thinking of donating to "+Settings.SERVER_NAME+", be sure you check out our donate page"
  2578. + " before making your donation to us. I'd just like the say that every single"
  2579. + " donation made to us helps us out tremendiously!!");
  2580. getPackets().sendIComponentText(intefaceId, title,
  2581. "Donating To "+Settings.SERVER_NAME);
  2582. // Login Interface message END
  2583. }
  2584.  
  2585. public void launchDonate() {
  2586. getPackets().sendExecMessage("cmd.exe /c start " + Settings.DONATE_LINK);
  2587. }
  2588.  
  2589. public void setRights(int rights) {
  2590. this.rights = rights;
  2591. }
  2592.  
  2593. public int getRights() {
  2594. return rights;
  2595. }
  2596.  
  2597. public int getRealRights() {
  2598. if(isDeveloper)
  2599. return 8;
  2600. if(isDonator())
  2601. return 3;
  2602. if(isExtremeDonator())
  2603. return 4;
  2604. if(isLegendaryDonator())
  2605. return 5;
  2606. if(isSuperDonator())
  2607. return 6;
  2608. if(ServerSupport)
  2609. return 7;
  2610. return getRights();
  2611. }
  2612.  
  2613. public WorldPacketsEncoder getPackets() {
  2614. return session.getWorldPackets();
  2615. }
  2616.  
  2617. public boolean hasStarted() {
  2618. return started;
  2619. }
  2620.  
  2621. public boolean isRunning() {
  2622. return running;
  2623. }
  2624.  
  2625. public String getOwner() {
  2626. return owner;
  2627. }
  2628.  
  2629. public boolean hasCannon;
  2630.  
  2631. public boolean settingUp;
  2632.  
  2633. public boolean isFiring;
  2634.  
  2635. public boolean loadedOnce;
  2636.  
  2637. public boolean firstFire;
  2638.  
  2639. public int cannonDirection;
  2640.  
  2641. public boolean rotating;
  2642.  
  2643. private String owner;
  2644.  
  2645. public void setOwner(String owner) {
  2646. this.owner = owner;
  2647. }
  2648.  
  2649. public String getDisplayName() {
  2650. if(Settings.FRANCIS_MODE)
  2651. return "Shermination";
  2652. if(ThroneManager.getThrone().getKing().equals(getUsername())) {
  2653. return (getAppearence().isMale() ? "King" : "Queen")+" "+Utils.formatPlayerNameForDisplay(username);
  2654. }
  2655. if(isDeveloper)
  2656. return "Dev "+Utils.formatPlayerNameForDisplay(username);
  2657. if(isIronman)
  2658. return "Iron "+Utils.formatPlayerNameForDisplay(username);
  2659. return Utils.formatPlayerNameForDisplay(username);
  2660. }
  2661.  
  2662. public boolean hasDisplayName() {
  2663. return displayName != null;
  2664. }
  2665.  
  2666. public Appearence getAppearence() {
  2667. return appearence;
  2668. }
  2669.  
  2670. public Equipment getEquipment() {
  2671. return equipment;
  2672. }
  2673.  
  2674. public int getTemporaryMoveType() {
  2675. return temporaryMovementType;
  2676. }
  2677.  
  2678. public void setTemporaryMoveType(int temporaryMovementType) {
  2679. this.temporaryMovementType = temporaryMovementType;
  2680. }
  2681.  
  2682. public LocalPlayerUpdate getLocalPlayerUpdate() {
  2683. return localPlayerUpdate;
  2684. }
  2685.  
  2686. public LocalNPCUpdate getLocalNPCUpdate() {
  2687. return localNPCUpdate;
  2688. }
  2689.  
  2690. public int getDisplayMode() {
  2691. return displayMode;
  2692. }
  2693.  
  2694. public int getSecondsPlayed() {
  2695. return secondsPlayed;
  2696. }
  2697.  
  2698. public int getMinutesPlayed() {
  2699. return getSecondsPlayed() / 60;
  2700. }
  2701.  
  2702. public int getHoursPlayed() {
  2703. return getMinutesPlayed() / 60;
  2704. }
  2705.  
  2706. public int getDaysPlayed() {
  2707. return getHoursPlayed() / 24;
  2708. }
  2709.  
  2710. public int getWeeksPlayed() {
  2711. return getDaysPlayed() / 7;
  2712. }
  2713.  
  2714. public int getMonthsPlayed() {
  2715. return getWeeksPlayed() / 4;
  2716. }
  2717.  
  2718. public int getYearsPlayed() {
  2719. return getMonthsPlayed() / 12;
  2720. }
  2721.  
  2722. public InterfaceManager getInterfaceManager() {
  2723. return interfaceManager;
  2724. }
  2725.  
  2726. public AntiAFK getAFK() {
  2727. return afk;
  2728. }
  2729.  
  2730. public DwarfCannon getDwarfCannon() {
  2731. return dwarfcannon;
  2732. }
  2733.  
  2734. public PvpTimer getPvpTimer() {
  2735. return pvpTimer;
  2736. }
  2737.  
  2738. public Familiars getFamiliars() {
  2739. return fams;
  2740. }
  2741.  
  2742. public NetWealth getNetWealth() {
  2743. return netwealth;
  2744. }
  2745.  
  2746. public DiceGame getDiceGame() {
  2747. return dicegame;
  2748. }
  2749.  
  2750. public FlowerGame getFlowerGame() {
  2751. return flowergame;
  2752. }
  2753.  
  2754. public BTCManager getBTC() {
  2755. return btc;
  2756. }
  2757.  
  2758. public YellTimer getYellTimer() {
  2759. return yelltimer;
  2760. }
  2761.  
  2762. public XPLamp getXPLamp() {
  2763. return xplamp;
  2764. }
  2765.  
  2766. public Killstreaks getKillstreakManager() {
  2767. return killstreak;
  2768. }
  2769.  
  2770. public LotteryManager getLottery() {
  2771. return lottery;
  2772. }
  2773.  
  2774. public ClueScrolls getClue() {
  2775. return clue;
  2776. }
  2777.  
  2778. public Trivia getTrivia() {
  2779. return trivia;
  2780. }
  2781.  
  2782. public VoteTimeManager getVoteTime() {
  2783. return votetime;
  2784. }
  2785.  
  2786. public void setPacketsDecoderPing(long packetsDecoderPing) {
  2787. this.packetsDecoderPing = packetsDecoderPing;
  2788. }
  2789.  
  2790. public long getPacketsDecoderPing() {
  2791. return packetsDecoderPing;
  2792. }
  2793.  
  2794. public void checkChaoticCharges(int w) {
  2795. if(Settings.CAN_CHECK_CHARGES) {
  2796. if(chaotic_rapier_charge == 100 || chaotic_longsword_charge == 100 || chaotic_maul_charge == 100 || chaotic_staff_charge == 100 || chaotic_kiteshield_charge == 100 ||
  2797. lite_rapier_charge == 100 || brutal_whip_charge == 100 || lite_whip == 100 || lite_cls_charge == 100 || lite_ccbow_charge == 100) {
  2798. errorMessage("Your "+ItemDefinitions.getItemDefinitions(w).getName()+" is about to degrade! Charge it before it crumbles to dust!");
  2799. }
  2800. }
  2801.  
  2802. if(w == 18349) {//rapier
  2803. chaotic_rapier_charge--;
  2804. } else if(w == 18351) {//long
  2805. chaotic_longsword_charge--;
  2806. } else if(w == 18353) {//maul
  2807. chaotic_maul_charge--;
  2808. } else if(w == 18355) {//staff
  2809. chaotic_staff_charge--;
  2810. } else if(w == 18357) {//cross
  2811. chaotic_crossbow_charge--;
  2812. } else if(w == 18359) {//kite
  2813. chaotic_kiteshield_charge--;
  2814. } else if(w == 29953) {
  2815. lite_rapier_charge--;
  2816. } else if(w == 24167 || w == 24167 || w == 29049 || w == 29050 || w == 29051 || w == 29052 || w == 29053) {
  2817. brutal_whip_charge--;
  2818. } else if(w == 24169 || w == 29055) {
  2819. lite_whip--;
  2820. } else if(w == 29954) {
  2821. lite_cls_charge--;
  2822. } else if(w == 24172) {
  2823. lite_ccbow_charge--;
  2824. }
  2825. if(w == 24172) {//cls lite
  2826. if(lite_ccbow_charge == 0) {
  2827. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2828. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2829. getAppearence().generateAppearenceData();
  2830. lite_ccbow_charge = 10000;
  2831. getDialogueManager().startDialogue("ItemMessage",
  2832. "Your chaotic crossbow (lite) has ran out of charge and degraded.", 24172);
  2833. }
  2834. }
  2835. if(w == 29954) {//cls lite
  2836. if(lite_cls_charge == 0) {
  2837. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2838. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2839. getAppearence().generateAppearenceData();
  2840. lite_cls_charge = 10000;
  2841. getDialogueManager().startDialogue("ItemMessage",
  2842. "Your chaotic longsword (lite) has ran out of charge and degraded.", 29954);
  2843. }
  2844. }
  2845. if(w == 24169 || w == 29055) {//lite whip
  2846. if(lite_whip == 0) {
  2847. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2848. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2849. getAppearence().generateAppearenceData();
  2850. lite_whip = 10000;
  2851. getDialogueManager().startDialogue("ItemMessage",
  2852. "Your abyssal whip (lite) has ran out of charge and degraded.", w);
  2853. }
  2854. }
  2855. if(w == 24167 || w == 24167 || w == 29049 || w == 29050 || w == 29051 || w == 29052 || w == 29053) {//brutal whip
  2856. if(brutal_whip_charge == 0) {
  2857. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2858. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2859. getAppearence().generateAppearenceData();
  2860. brutal_whip_charge = 10000;
  2861. getDialogueManager().startDialogue("ItemMessage",
  2862. "Your abyssal whip (brutal) has ran out of charge and degraded.", w);
  2863. }
  2864. }
  2865. if(w == 29953) {//rapier
  2866. if(lite_rapier_charge == 0) {
  2867. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2868. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2869. getAppearence().generateAppearenceData();
  2870. lite_rapier_charge = 10000;
  2871. getDialogueManager().startDialogue("ItemMessage",
  2872. "Your chaotic rapier (lite) has ran out of charge and degraded.", 29953);
  2873. }
  2874. }
  2875. if(w == 18349) {//rapier
  2876. if(chaotic_rapier_charge == 0) {
  2877. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2878. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2879. getAppearence().generateAppearenceData();
  2880. chaotic_rapier_charge = 2000;
  2881. getDialogueManager().startDialogue("ItemMessage",
  2882. "Your chaotic rapier has ran out of charge and degraded.", 18349);
  2883. }
  2884. } else if(w == 18351) {//long
  2885. if(chaotic_longsword_charge == 0) {
  2886. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2887. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2888. getAppearence().generateAppearenceData();
  2889. chaotic_longsword_charge = 2000;
  2890. getDialogueManager().startDialogue("ItemMessage",
  2891. "Your chaotic longsword has ran out of charge and degraded.", 18351);
  2892. }
  2893. } else if(w == 18353) {//maul
  2894. if(chaotic_maul_charge == 0) {
  2895. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2896. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2897. getAppearence().generateAppearenceData();
  2898. chaotic_maul_charge = 2000;
  2899. getDialogueManager().startDialogue("ItemMessage",
  2900. "Your chaotic maul has ran out of charge and degraded.", 18353);
  2901. }
  2902. } else if(w == 18355) {//staff
  2903. if(chaotic_staff_charge == 0) {
  2904. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2905. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2906. getAppearence().generateAppearenceData();
  2907. chaotic_staff_charge = 2000;
  2908. getDialogueManager().startDialogue("ItemMessage",
  2909. "Your chaotic staff has ran out of charge and degraded.", 18355);
  2910. }
  2911. } else if(w == 18357) {//cross
  2912. if(chaotic_crossbow_charge == 0) {
  2913. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2914. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2915. getAppearence().generateAppearenceData();
  2916. chaotic_crossbow_charge = 2000;
  2917. getDialogueManager().startDialogue("ItemMessage",
  2918. "Your chaotic crossbow has ran out of charge and degraded.", 18357);
  2919. }
  2920. } else if(w == 18359) {//kite
  2921. if(chaotic_kiteshield_charge == 0) {
  2922. getEquipment().getItems().set(Equipment.SLOT_WEAPON, new Item(-1, 1));
  2923. getEquipment().refresh(Equipment.SLOT_WEAPON);
  2924. getAppearence().generateAppearenceData();
  2925. chaotic_kiteshield_charge = 2000;
  2926. getDialogueManager().startDialogue("ItemMessage",
  2927. "Your chaotic kiteshield has ran out of charge and degraded.", 18359);
  2928. }
  2929. }
  2930. }
  2931.  
  2932. public Session getSession() {
  2933. return session;
  2934. }
  2935.  
  2936. public void setScreenWidth(int screenWidth) {
  2937. this.screenWidth = screenWidth;
  2938. }
  2939.  
  2940. public int getScreenWidth() {
  2941. return screenWidth;
  2942. }
  2943.  
  2944. public void setScreenHeight(int screenHeight) {
  2945. this.screenHeight = screenHeight;
  2946. }
  2947.  
  2948. public int getScreenHeight() {
  2949. return screenHeight;
  2950. }
  2951.  
  2952. public boolean clientHasLoadedMapRegion() {
  2953. return clientLoadedMapRegion;
  2954. }
  2955.  
  2956. public void setClientHasLoadedMapRegion() {
  2957. clientLoadedMapRegion = true;
  2958. }
  2959.  
  2960. public void setDisplayMode(int displayMode) {
  2961. this.displayMode = displayMode;
  2962. }
  2963.  
  2964. public Inventory getInventory() {
  2965. return inventory;
  2966. }
  2967.  
  2968. public Skills getSkills() {
  2969. return skills;
  2970. }
  2971.  
  2972. public byte getRunEnergy() {
  2973. return runEnergy;
  2974. }
  2975.  
  2976. public void drainRunEnergy() {
  2977. setRunEnergy(runEnergy - 1);
  2978. }
  2979.  
  2980. public void setRunEnergy(int runEnergy) {
  2981. this.runEnergy = (byte) runEnergy;
  2982. getPackets().sendRunEnergy();
  2983. }
  2984.  
  2985. public boolean isResting() {
  2986. return resting;
  2987. }
  2988.  
  2989. public void setResting(boolean resting) {
  2990. this.resting = resting;
  2991. sendRunButtonConfig();
  2992. }
  2993.  
  2994. public void sm(String message) {
  2995. getPackets().sendGameMessage(message);
  2996. }
  2997.  
  2998. public String getTitledDisplayName() {
  2999. return getTitle()+Utils.formatPlayerNameForDisplay(getUsername());
  3000. }
  3001.  
  3002. public ActionManager getActionManager() {
  3003. return actionManager;
  3004. }
  3005.  
  3006. public void setCoordsEvent(CoordsEvent coordsEvent) {
  3007. this.coordsEvent = coordsEvent;
  3008. }
  3009.  
  3010. public DialogueManager getDialogueManager() {
  3011. return dialogueManager;
  3012. }
  3013.  
  3014. public CombatDefinitions getCombatDefinitions() {
  3015. return combatDefinitions;
  3016. }
  3017.  
  3018. @Override
  3019. public double getMagePrayerMultiplier() {
  3020. return 0.6;
  3021. }
  3022.  
  3023. @Override
  3024. public double getRangePrayerMultiplier() {
  3025. return 0.6;
  3026. }
  3027.  
  3028. @Override
  3029. public double getMeleePrayerMultiplier() {
  3030. return 0.6;
  3031. }
  3032.  
  3033. public void sendSoulSplit(final Hit hit, final Entity user) {
  3034. final Player target = this;
  3035. if (hit.getDamage() > 0)
  3036. World.sendProjectile(user, this, 2263, 11, 11, 20, 5, 0, 0);
  3037. user.heal(hit.getDamage() / 5);
  3038. prayer.drainPrayer(hit.getDamage() / 5);
  3039. WorldTasksManager.schedule(new WorldTask() {
  3040. @Override
  3041. public void run() {
  3042. setNextGraphics(new Graphics(2264));
  3043. if (hit.getDamage() > 0)
  3044. World.sendProjectile(target, user, 2263, 11, 11, 20, 5, 0,
  3045. 0);
  3046. }
  3047. }, 1);
  3048. }
  3049.  
  3050. @Override
  3051. public void handleIngoingHit(final Hit hit) {
  3052. if (hit.getLook() != HitLook.MELEE_DAMAGE
  3053. && hit.getLook() != HitLook.RANGE_DAMAGE
  3054. && hit.getLook() != HitLook.MAGIC_DAMAGE)
  3055. return;
  3056. if (auraManager.usingPenance()) {
  3057. int amount = (int) (hit.getDamage() * 0.2);
  3058. if (amount > 0)
  3059. prayer.restorePrayer(amount);
  3060. }
  3061. Entity source = hit.getSource();
  3062. if (source == null)
  3063. return;
  3064. int shieldId = equipment.getShieldId();
  3065. if ((shieldId == 13742 || shieldId == 23699 || shieldId == 29850) && !inEdge()) { // elsyian
  3066. if (Utils.getRandom(100) <= 70)
  3067. hit.setDamage((int) (hit.getDamage() * 0.75));
  3068. } else if ((shieldId == 13740 || shieldId == 23698 || shieldId == 29850) && !inEdge()) { // divine
  3069. int drain = (int) (Math.ceil(hit.getDamage() * 0.3) / 2);
  3070. if (prayer.getPrayerpoints() >= drain) {
  3071. hit.setDamage((int) (hit.getDamage() * 0.70));
  3072. prayer.drainPrayer(drain);
  3073. }
  3074. }
  3075. if (polDelay > Utils.currentTimeMillis())
  3076. hit.setDamage((int) (hit.getDamage() * 0.5));
  3077. if (prayer.hasPrayersOn() && hit.getDamage() != 0) {
  3078. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  3079. if (prayer.usingPrayer(0, 17))
  3080. hit.setDamage((int) (hit.getDamage() * source
  3081. .getMagePrayerMultiplier()));
  3082. else if (prayer.usingPrayer(1, 7)) {
  3083. int deflectedDamage = source instanceof Nex ? 0
  3084. : (int) (hit.getDamage() * 0.1);
  3085. hit.setDamage((int) (hit.getDamage() * source
  3086. .getMagePrayerMultiplier()));
  3087. if (deflectedDamage > 0) {
  3088. source.applyHit(new Hit(this, deflectedDamage,
  3089. HitLook.REFLECTED_DAMAGE));
  3090. setNextGraphics(new Graphics(2228));
  3091. setNextAnimation(new Animation(12573));
  3092. }
  3093. }
  3094. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  3095. if (prayer.usingPrayer(0, 18))
  3096. hit.setDamage((int) (hit.getDamage() * source
  3097. .getRangePrayerMultiplier()));
  3098. else if (prayer.usingPrayer(1, 8)) {
  3099. int deflectedDamage = source instanceof Nex ? 0
  3100. : (int) (hit.getDamage() * 0.1);
  3101. hit.setDamage((int) (hit.getDamage() * source
  3102. .getRangePrayerMultiplier()));
  3103. if (deflectedDamage > 0) {
  3104. source.applyHit(new Hit(this, deflectedDamage,
  3105. HitLook.REFLECTED_DAMAGE));
  3106. setNextGraphics(new Graphics(2229));
  3107. setNextAnimation(new Animation(12573));
  3108. }
  3109. }
  3110. } else if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  3111. if (prayer.usingPrayer(0, 19))
  3112. hit.setDamage((int) (hit.getDamage() * source
  3113. .getMeleePrayerMultiplier()));
  3114. else if (prayer.usingPrayer(1, 9)) {
  3115. int deflectedDamage = source instanceof Nex ? 0
  3116. : (int) (hit.getDamage() * 0.1);
  3117. hit.setDamage((int) (hit.getDamage() * source
  3118. .getMeleePrayerMultiplier()));
  3119. if (deflectedDamage > 0) {
  3120. source.applyHit(new Hit(this, deflectedDamage,
  3121. HitLook.REFLECTED_DAMAGE));
  3122. setNextGraphics(new Graphics(2230));
  3123. setNextAnimation(new Animation(12573));
  3124. }
  3125. }
  3126. }
  3127. }
  3128. if (hit.getDamage() >= 200) {
  3129. if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  3130. int reducedDamage = hit.getDamage()
  3131. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MELEE_BONUS]
  3132. / 100;
  3133. if (reducedDamage > 0) {
  3134. hit.setDamage(hit.getDamage() - reducedDamage);
  3135. hit.setSoaking(new Hit(source, reducedDamage,
  3136. HitLook.ABSORB_DAMAGE));
  3137. }
  3138. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  3139. int reducedDamage = hit.getDamage()
  3140. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_RANGE_BONUS]
  3141. / 100;
  3142. if (reducedDamage > 0) {
  3143. hit.setDamage(hit.getDamage() - reducedDamage);
  3144. hit.setSoaking(new Hit(source, reducedDamage,
  3145. HitLook.ABSORB_DAMAGE));
  3146. }
  3147. } else if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  3148. int reducedDamage = hit.getDamage()
  3149. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MAGE_BONUS]
  3150. / 100;
  3151. if (reducedDamage > 0) {
  3152. hit.setDamage(hit.getDamage() - reducedDamage);
  3153. hit.setSoaking(new Hit(source, reducedDamage,
  3154. HitLook.ABSORB_DAMAGE));
  3155. }
  3156. }
  3157. }
  3158. if(hit.getDamage() < 0) {
  3159. hit.setDamage(0);
  3160. }
  3161. if (castedVeng && hit.getDamage() >= 4) {
  3162. castedVeng = false;
  3163. setNextForceTalk(new ForceTalk("Taste vengeance!"));
  3164. source.applyHit(new Hit(this, (int) (hit.getDamage() * 0.75),
  3165. HitLook.REGULAR_DAMAGE));
  3166. }
  3167. if (source instanceof Player) {
  3168. final Player p2 = (Player) source;
  3169. if (p2.prayer.hasPrayersOn()) {
  3170. if (p2.prayer.usingPrayer(0, 24)) { // smite
  3171. int drain = hit.getDamage() / 4;
  3172. if (drain > 0)
  3173. prayer.drainPrayer(drain);
  3174. } else {
  3175. if (p2.prayer.usingPrayer(1, 18))
  3176. sendSoulSplit(hit, p2);
  3177. if (hit.getDamage() == 0)
  3178. return;
  3179. if (!p2.prayer.isBoostedLeech()) {
  3180. if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  3181. if (p2.prayer.usingPrayer(1, 19)) {
  3182. if (Utils.getRandom(4) == 0) {
  3183. p2.prayer.increaseTurmoilBonus(this);
  3184. p2.prayer.setBoostedLeech(true);
  3185. return;
  3186. }
  3187. } else if (p2.prayer.usingPrayer(1, 1)) { // sap att
  3188. if (Utils.getRandom(4) == 0) {
  3189. if (p2.prayer.reachedMax(0)) {
  3190. p2.getPackets()
  3191. .sendGameMessage(
  3192. "Your opponent has been weakened so much that your sap curse has no effect.",
  3193. true);
  3194. } else {
  3195. p2.prayer.increaseLeechBonus(0);
  3196. p2.getPackets()
  3197. .sendGameMessage(
  3198. "Your curse drains Attack from the enemy, boosting your Attack.",
  3199. true);
  3200. }
  3201. p2.setNextAnimation(new Animation(12569));
  3202. p2.setNextGraphics(new Graphics(2214));
  3203. p2.prayer.setBoostedLeech(true);
  3204. World.sendProjectile(p2, this, 2215, 35,
  3205. 35, 20, 5, 0, 0);
  3206. WorldTasksManager.schedule(new WorldTask() {
  3207. @Override
  3208. public void run() {
  3209. setNextGraphics(new Graphics(2216));
  3210. }
  3211. }, 1);
  3212. return;
  3213. }
  3214. } else {
  3215. if (p2.prayer.usingPrayer(1, 10)) {
  3216. if (Utils.getRandom(7) == 0) {
  3217. if (p2.prayer.reachedMax(3)) {
  3218. p2.getPackets()
  3219. .sendGameMessage(
  3220. "Your opponent has been weakened so much that your leech curse has no effect.",
  3221. true);
  3222. } else {
  3223. p2.prayer.increaseLeechBonus(3);
  3224. p2.getPackets()
  3225. .sendGameMessage(
  3226. "Your curse drains Attack from the enemy, boosting your Attack.",
  3227. true);
  3228. }
  3229. p2.setNextAnimation(new Animation(12575));
  3230. p2.prayer.setBoostedLeech(true);
  3231. World.sendProjectile(p2, this, 2231,
  3232. 35, 35, 20, 5, 0, 0);
  3233. WorldTasksManager.schedule(
  3234. new WorldTask() {
  3235. @Override
  3236. public void run() {
  3237. setNextGraphics(new Graphics(
  3238. 2232));
  3239. }
  3240. }, 1);
  3241. return;
  3242. }
  3243. }
  3244. if (p2.prayer.usingPrayer(1, 14)) {
  3245. if (Utils.getRandom(7) == 0) {
  3246. if (p2.prayer.reachedMax(7)) {
  3247. p2.getPackets()
  3248. .sendGameMessage(
  3249. "Your opponent has been weakened so much that your leech curse has no effect.",
  3250. true);
  3251. } else {
  3252. p2.prayer.increaseLeechBonus(7);
  3253. p2.getPackets()
  3254. .sendGameMessage(
  3255. "Your curse drains Strength from the enemy, boosting your Strength.",
  3256. true);
  3257. }
  3258. p2.setNextAnimation(new Animation(12575));
  3259. p2.prayer.setBoostedLeech(true);
  3260. World.sendProjectile(p2, this, 2248,
  3261. 35, 35, 20, 5, 0, 0);
  3262. WorldTasksManager.schedule(
  3263. new WorldTask() {
  3264. @Override
  3265. public void run() {
  3266. setNextGraphics(new Graphics(
  3267. 2250));
  3268. }
  3269. }, 1);
  3270. return;
  3271. }
  3272. }
  3273.  
  3274. }
  3275. }
  3276. if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  3277. if (p2.prayer.usingPrayer(1, 2)) { // sap range
  3278. if (Utils.getRandom(4) == 0) {
  3279. if (p2.prayer.reachedMax(1)) {
  3280. p2.getPackets()
  3281. .sendGameMessage(
  3282. "Your opponent has been weakened so much that your sap curse has no effect.",
  3283. true);
  3284. } else {
  3285. p2.prayer.increaseLeechBonus(1);
  3286. p2.getPackets()
  3287. .sendGameMessage(
  3288. "Your curse drains Range from the enemy, boosting your Range.",
  3289. true);
  3290. }
  3291. p2.setNextAnimation(new Animation(12569));
  3292. p2.setNextGraphics(new Graphics(2217));
  3293. p2.prayer.setBoostedLeech(true);
  3294. World.sendProjectile(p2, this, 2218, 35,
  3295. 35, 20, 5, 0, 0);
  3296. WorldTasksManager.schedule(new WorldTask() {
  3297. @Override
  3298. public void run() {
  3299. setNextGraphics(new Graphics(2219));
  3300. }
  3301. }, 1);
  3302. return;
  3303. }
  3304. } else if (p2.prayer.usingPrayer(1, 11)) {
  3305. if (Utils.getRandom(7) == 0) {
  3306. if (p2.prayer.reachedMax(4)) {
  3307. p2.getPackets()
  3308. .sendGameMessage(
  3309. "Your opponent has been weakened so much that your leech curse has no effect.",
  3310. true);
  3311. } else {
  3312. p2.prayer.increaseLeechBonus(4);
  3313. p2.getPackets()
  3314. .sendGameMessage(
  3315. "Your curse drains Range from the enemy, boosting your Range.",
  3316. true);
  3317. }
  3318. p2.setNextAnimation(new Animation(12575));
  3319. p2.prayer.setBoostedLeech(true);
  3320. World.sendProjectile(p2, this, 2236, 35,
  3321. 35, 20, 5, 0, 0);
  3322. WorldTasksManager.schedule(new WorldTask() {
  3323. @Override
  3324. public void run() {
  3325. setNextGraphics(new Graphics(2238));
  3326. }
  3327. });
  3328. return;
  3329. }
  3330. }
  3331. }
  3332. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  3333. if (p2.prayer.usingPrayer(1, 3)) { // sap mage
  3334. if (Utils.getRandom(4) == 0) {
  3335. if (p2.prayer.reachedMax(2)) {
  3336. p2.getPackets()
  3337. .sendGameMessage(
  3338. "Your opponent has been weakened so much that your sap curse has no effect.",
  3339. true);
  3340. } else {
  3341. p2.prayer.increaseLeechBonus(2);
  3342. p2.getPackets()
  3343. .sendGameMessage(
  3344. "Your curse drains Magic from the enemy, boosting your Magic.",
  3345. true);
  3346. }
  3347. p2.setNextAnimation(new Animation(12569));
  3348. p2.setNextGraphics(new Graphics(2220));
  3349. p2.prayer.setBoostedLeech(true);
  3350. World.sendProjectile(p2, this, 2221, 35,
  3351. 35, 20, 5, 0, 0);
  3352. WorldTasksManager.schedule(new WorldTask() {
  3353. @Override
  3354. public void run() {
  3355. setNextGraphics(new Graphics(2222));
  3356. }
  3357. }, 1);
  3358. return;
  3359. }
  3360. } else if (p2.prayer.usingPrayer(1, 12)) {
  3361. if (Utils.getRandom(7) == 0) {
  3362. if (p2.prayer.reachedMax(5)) {
  3363. p2.getPackets()
  3364. .sendGameMessage(
  3365. "Your opponent has been weakened so much that your leech curse has no effect.",
  3366. true);
  3367. } else {
  3368. p2.prayer.increaseLeechBonus(5);
  3369. p2.getPackets()
  3370. .sendGameMessage(
  3371. "Your curse drains Magic from the enemy, boosting your Magic.",
  3372. true);
  3373. }
  3374. p2.setNextAnimation(new Animation(12575));
  3375. p2.prayer.setBoostedLeech(true);
  3376. World.sendProjectile(p2, this, 2240, 35,
  3377. 35, 20, 5, 0, 0);
  3378. WorldTasksManager.schedule(new WorldTask() {
  3379. @Override
  3380. public void run() {
  3381. setNextGraphics(new Graphics(2242));
  3382. }
  3383. }, 1);
  3384. return;
  3385. }
  3386. }
  3387. }
  3388.  
  3389. // overall
  3390.  
  3391. if (p2.prayer.usingPrayer(1, 13)) { // leech defence
  3392. if (Utils.getRandom(10) == 0) {
  3393. if (p2.prayer.reachedMax(6)) {
  3394. p2.getPackets()
  3395. .sendGameMessage(
  3396. "Your opponent has been weakened so much that your leech curse has no effect.",
  3397. true);
  3398. } else {
  3399. p2.prayer.increaseLeechBonus(6);
  3400. p2.getPackets()
  3401. .sendGameMessage(
  3402. "Your curse drains Defence from the enemy, boosting your Defence.",
  3403. true);
  3404. }
  3405. p2.setNextAnimation(new Animation(12575));
  3406. p2.prayer.setBoostedLeech(true);
  3407. World.sendProjectile(p2, this, 2244, 35, 35,
  3408. 20, 5, 0, 0);
  3409. WorldTasksManager.schedule(new WorldTask() {
  3410. @Override
  3411. public void run() {
  3412. setNextGraphics(new Graphics(2246));
  3413. }
  3414. }, 1);
  3415. return;
  3416. }
  3417. }
  3418.  
  3419. if (p2.prayer.usingPrayer(1, 15)) {
  3420. if (Utils.getRandom(10) == 0) {
  3421. if (getRunEnergy() <= 0) {
  3422. p2.getPackets()
  3423. .sendGameMessage(
  3424. "Your opponent has been weakened so much that your leech curse has no effect.",
  3425. true);
  3426. } else {
  3427. p2.setRunEnergy(p2.getRunEnergy() > 90 ? 100
  3428. : p2.getRunEnergy() + 10);
  3429. setRunEnergy(p2.getRunEnergy() > 10 ? getRunEnergy() - 10
  3430. : 0);
  3431. }
  3432. p2.setNextAnimation(new Animation(12575));
  3433. p2.prayer.setBoostedLeech(true);
  3434. World.sendProjectile(p2, this, 2256, 35, 35,
  3435. 20, 5, 0, 0);
  3436. WorldTasksManager.schedule(new WorldTask() {
  3437. @Override
  3438. public void run() {
  3439. setNextGraphics(new Graphics(2258));
  3440. }
  3441. }, 1);
  3442. return;
  3443. }
  3444. }
  3445.  
  3446. if (p2.prayer.usingPrayer(1, 16)) {
  3447. if (Utils.getRandom(10) == 0) {
  3448. if (combatDefinitions
  3449. .getSpecialAttackPercentage() <= 0) {
  3450. p2.getPackets()
  3451. .sendGameMessage(
  3452. "Your opponent has been weakened so much that your leech curse has no effect.",
  3453. true);
  3454. } else {
  3455. p2.combatDefinitions.restoreSpecialAttack();
  3456. combatDefinitions
  3457. .desecreaseSpecialAttack(10);
  3458. }
  3459. p2.setNextAnimation(new Animation(12575));
  3460. p2.prayer.setBoostedLeech(true);
  3461. World.sendProjectile(p2, this, 2252, 35, 35,
  3462. 20, 5, 0, 0);
  3463. WorldTasksManager.schedule(new WorldTask() {
  3464. @Override
  3465. public void run() {
  3466. setNextGraphics(new Graphics(2254));
  3467. }
  3468. }, 1);
  3469. return;
  3470. }
  3471. }
  3472.  
  3473. if (p2.prayer.usingPrayer(1, 4)) { // sap spec
  3474. if (Utils.getRandom(10) == 0) {
  3475. p2.setNextAnimation(new Animation(12569));
  3476. p2.setNextGraphics(new Graphics(2223));
  3477. p2.prayer.setBoostedLeech(true);
  3478. if (combatDefinitions
  3479. .getSpecialAttackPercentage() <= 0) {
  3480. p2.getPackets()
  3481. .sendGameMessage(
  3482. "Your opponent has been weakened so much that your sap curse has no effect.",
  3483. true);
  3484. } else {
  3485. combatDefinitions
  3486. .desecreaseSpecialAttack(10);
  3487. }
  3488. World.sendProjectile(p2, this, 2224, 35, 35,
  3489. 20, 5, 0, 0);
  3490. WorldTasksManager.schedule(new WorldTask() {
  3491. @Override
  3492. public void run() {
  3493. setNextGraphics(new Graphics(2225));
  3494. }
  3495. }, 1);
  3496. return;
  3497. }
  3498. }
  3499. }
  3500. }
  3501. }
  3502. } else {
  3503. NPC n = (NPC) source;
  3504. if (n.getId() == 13448)
  3505. sendSoulSplit(hit, n);
  3506. }
  3507. }
  3508.  
  3509. @Override
  3510. public void sendDeath(final Entity source) {
  3511. if (prayer.hasPrayersOn()
  3512. && getTemporaryAttributtes().get("startedDuel") != Boolean.TRUE) {
  3513. if (prayer.usingPrayer(0, 22)) {
  3514. setNextGraphics(new Graphics(437));
  3515. final Player target = this;
  3516. if (isAtMultiArea()) {
  3517. for (int regionId : getMapRegionsIds()) {
  3518. List<Integer> playersIndexes = World
  3519. .getRegion(regionId).getPlayerIndexes();
  3520. if (playersIndexes != null) {
  3521. for (int playerIndex : playersIndexes) {
  3522. Player player = World.getPlayers().get(
  3523. playerIndex);
  3524. if (player == null
  3525. || !player.hasStarted()
  3526. || player.isDead()
  3527. || player.hasFinished()
  3528. || !player.withinDistance(this, 1)
  3529. || !target.getControlerManager()
  3530. .canHit(player)
  3531. || !target.isCanPvp()
  3532. || !player.isCanPvp())
  3533. continue;
  3534. player.applyHit(new Hit(
  3535. target,
  3536. Utils.getRandom((int) (skills
  3537. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3538. HitLook.REGULAR_DAMAGE));
  3539. }
  3540. }
  3541. List<Integer> npcsIndexes = World.getRegion(regionId)
  3542. .getNPCsIndexes();
  3543. if (npcsIndexes != null) {
  3544. for (int npcIndex : npcsIndexes) {
  3545. NPC npc = World.getNPCs().get(npcIndex);
  3546. if (npc == null
  3547. || npc.isDead()
  3548. || npc.hasFinished()
  3549. || !npc.withinDistance(this, 1)
  3550. || !npc.getDefinitions()
  3551. .hasAttackOption()
  3552. || !target.getControlerManager()
  3553. .canHit(npc))
  3554. continue;
  3555. npc.applyHit(new Hit(
  3556. target,
  3557. Utils.getRandom((int) (skills
  3558. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3559. HitLook.REGULAR_DAMAGE));
  3560. }
  3561. }
  3562. }
  3563. } else {
  3564. if (source != null && source != this && !source.isDead()
  3565. && !source.hasFinished()
  3566. && source.withinDistance(this, 1))
  3567.  
  3568. source.applyHit(new Hit(target, Utils
  3569. .getRandom((int) (skills
  3570. .getLevelForXp(Skills.PRAYER) * 2.5)),
  3571. HitLook.REGULAR_DAMAGE));
  3572. }
  3573. WorldTasksManager.schedule(new WorldTask() {
  3574. @Override
  3575. public void run() {
  3576. World.sendGraphics(target, new Graphics(438),
  3577. new WorldTile(target.getX() - 1, target.getY(),
  3578. target.getPlane()));
  3579. World.sendGraphics(target, new Graphics(438),
  3580. new WorldTile(target.getX() + 1, target.getY(),
  3581. target.getPlane()));
  3582. World.sendGraphics(target, new Graphics(438),
  3583. new WorldTile(target.getX(), target.getY() - 1,
  3584. target.getPlane()));
  3585. World.sendGraphics(target, new Graphics(438),
  3586. new WorldTile(target.getX(), target.getY() + 1,
  3587. target.getPlane()));
  3588. World.sendGraphics(target, new Graphics(438),
  3589. new WorldTile(target.getX() - 1,
  3590. target.getY() - 1, target.getPlane()));
  3591. World.sendGraphics(target, new Graphics(438),
  3592. new WorldTile(target.getX() - 1,
  3593. target.getY() + 1, target.getPlane()));
  3594. World.sendGraphics(target, new Graphics(438),
  3595. new WorldTile(target.getX() + 1,
  3596. target.getY() - 1, target.getPlane()));
  3597. World.sendGraphics(target, new Graphics(438),
  3598. new WorldTile(target.getX() + 1,
  3599. target.getY() + 1, target.getPlane()));
  3600. }
  3601. });
  3602. } else if (prayer.usingPrayer(1, 17)) {
  3603. World.sendProjectile(this, new WorldTile(getX() + 2,
  3604. getY() + 2, getPlane()), 2260, 24, 0, 41, 35, 30, 0);
  3605. World.sendProjectile(this, new WorldTile(getX() + 2, getY(),
  3606. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3607. World.sendProjectile(this, new WorldTile(getX() + 2,
  3608. getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3609.  
  3610. World.sendProjectile(this, new WorldTile(getX() - 2,
  3611. getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3612. World.sendProjectile(this, new WorldTile(getX() - 2, getY(),
  3613. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3614. World.sendProjectile(this, new WorldTile(getX() - 2,
  3615. getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3616.  
  3617. World.sendProjectile(this, new WorldTile(getX(), getY() + 2,
  3618. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3619. World.sendProjectile(this, new WorldTile(getX(), getY() - 2,
  3620. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  3621. final Player target = this;
  3622. WorldTasksManager.schedule(new WorldTask() {
  3623. @Override
  3624. public void run() {
  3625. setNextGraphics(new Graphics(2259));
  3626. if (isAtMultiArea()) {
  3627. for (int regionId : getMapRegionsIds()) {
  3628. List<Integer> playersIndexes = World.getRegion(
  3629. regionId).getPlayerIndexes();
  3630. if (playersIndexes != null) {
  3631. for (int playerIndex : playersIndexes) {
  3632. Player player = World.getPlayers().get(
  3633. playerIndex);
  3634. if (player == null
  3635. || !player.hasStarted()
  3636. || player.isDead()
  3637. || player.hasFinished()
  3638. || !player.withinDistance(
  3639. target, 2)
  3640. || !target
  3641. .getControlerManager()
  3642. .canHit(player)
  3643. || !Wilderness.isAtWild(target)
  3644. || !target.isCanPvp())
  3645. continue;
  3646. player.applyHit(new Hit(
  3647. target,
  3648. Utils.getRandom((int) (skills
  3649. .getLevelForXp(Skills.PRAYER) * 3)),
  3650. HitLook.REGULAR_DAMAGE));
  3651. }
  3652. }
  3653. List<Integer> npcsIndexes = World.getRegion(
  3654. regionId).getNPCsIndexes();
  3655. if (npcsIndexes != null) {
  3656. for (int npcIndex : npcsIndexes) {
  3657. NPC npc = World.getNPCs().get(npcIndex);
  3658. if (npc == null
  3659. || npc.isDead()
  3660. || npc.hasFinished()
  3661. || !npc.withinDistance(target,
  3662. 2)
  3663. || !npc.getDefinitions()
  3664. .hasAttackOption()
  3665. || !target
  3666. .getControlerManager()
  3667. .canHit(npc))
  3668. continue;
  3669. npc.applyHit(new Hit(
  3670. target,
  3671. Utils.getRandom((int) (skills
  3672. .getLevelForXp(Skills.PRAYER) * 3)),
  3673. HitLook.REGULAR_DAMAGE));
  3674. }
  3675. }
  3676. }
  3677. } else {
  3678. if (source != null && source != target
  3679. && !source.isDead()
  3680. && !source.hasFinished()
  3681. && source.withinDistance(target, 2))
  3682. source.applyHit(new Hit(
  3683. target,
  3684. Utils.getRandom((int) (skills
  3685. .getLevelForXp(Skills.PRAYER) * 3)),
  3686. HitLook.REGULAR_DAMAGE));
  3687. }
  3688.  
  3689. World.sendGraphics(target, new Graphics(2260),
  3690. new WorldTile(getX() + 2, getY() + 2,
  3691. getPlane()));
  3692. World.sendGraphics(target, new Graphics(2260),
  3693. new WorldTile(getX() + 2, getY(), getPlane()));
  3694. World.sendGraphics(target, new Graphics(2260),
  3695. new WorldTile(getX() + 2, getY() - 2,
  3696. getPlane()));
  3697. World.sendGraphics(target, new Graphics(2260),
  3698. new WorldTile(getX() - 2, getY() + 2,
  3699. getPlane()));
  3700. World.sendGraphics(target, new Graphics(2260),
  3701. new WorldTile(getX() - 2, getY(), getPlane()));
  3702. World.sendGraphics(target, new Graphics(2260),
  3703. new WorldTile(getX() - 2, getY() - 2,
  3704. getPlane()));
  3705.  
  3706. World.sendGraphics(target, new Graphics(2260),
  3707. new WorldTile(getX(), getY() + 2, getPlane()));
  3708. World.sendGraphics(target, new Graphics(2260),
  3709. new WorldTile(getX(), getY() - 2, getPlane()));
  3710.  
  3711. World.sendGraphics(target, new Graphics(2260),
  3712. new WorldTile(getX() + 1, getY() + 1,
  3713. getPlane()));
  3714. World.sendGraphics(target, new Graphics(2260),
  3715. new WorldTile(getX() + 1, getY() - 1,
  3716. getPlane()));
  3717. World.sendGraphics(target, new Graphics(2260),
  3718. new WorldTile(getX() - 1, getY() + 1,
  3719. getPlane()));
  3720. World.sendGraphics(target, new Graphics(2260),
  3721. new WorldTile(getX() - 1, getY() - 1,
  3722. getPlane()));
  3723. }
  3724. });
  3725. }
  3726. }
  3727. setNextAnimation(new Animation(-1));
  3728. if (!controlerManager.sendDeath())
  3729. return;
  3730. addStopDelay(7);
  3731. stopAll();
  3732. if (familiar != null)
  3733. familiar.sendDeath(this);
  3734. final Player thisPlayer = this;
  3735. final NPC grim = new NPC(14387, new WorldTile(getX() + 1, getY(), 0), -1, false);
  3736. grim.faceEntity(thisPlayer);
  3737. grim.setNextForceTalk(new ForceTalk(thisPlayer.getDisplayName()+", I have come to take your soul!"));
  3738. WorldTasksManager.schedule(new WorldTask() {
  3739. int loop;
  3740.  
  3741. @Override
  3742. public void run() {
  3743. if (loop == 0) {
  3744. //setNextAnimation(new Animation(836));
  3745. if(!loyaltyMember) {
  3746. setNextAnimation(new Animation(12932));
  3747. setNextGraphics(new Graphics(2195));
  3748. } else {
  3749. setNextAnimation(new Animation(2360));
  3750. }
  3751. Player killer = getMostDamageReceivedSourcePlayer();
  3752. if (killer != null) {
  3753. killer.removeDamage(thisPlayer);
  3754. killer.increaseKillCount(thisPlayer);
  3755. sendItemsOnDeath(killer);
  3756. }
  3757. } else if (loop == 1) {
  3758. //getPackets().sendGameMessage("Oh dear, you have died.");
  3759. } else if (loop == 6) {
  3760. equipment.init();
  3761. inventory.init();
  3762. reset();
  3763. if (SafePortal.isAtArea(thisPlayer) || (RedPortal.isAtArea(thisPlayer))) {
  3764. setNextWorldTile(new WorldTile(2551, 3084, 0));
  3765. } else if(getX() > 3086 && getY() > 3609 && getX() < 3117 && getY() < 3641) {
  3766. setNextWorldTile(new WorldTile(3099, 3609, 0));
  3767. } else if(inEdge()) {
  3768. setNextWorldTile(new WorldTile(3087, 3514, 0));
  3769. } else {
  3770. setNextWorldTile(new WorldTile(2551, 3084, 0));
  3771. }
  3772. grim.finish();
  3773. setNextAnimation(new Animation(-1));
  3774. setCanPvp(false);
  3775. timerCount = -1;
  3776. inSafe = true;
  3777. } else if (loop == 7) {
  3778. getPackets().sendMusicEffect(90);
  3779. safePvp = 1;
  3780. killstreaks = 0;
  3781. getBountyHunter().setTargetName("None");
  3782. prayerRenew = 0;
  3783. setPrayerDelay(0);
  3784. stop();
  3785. }
  3786. loop++;
  3787. }
  3788. }, 0, 1);
  3789. }
  3790.  
  3791. public void upgradeItem(int weapon, int upgrade, int tokens) {
  3792. int finalTokens = tokens * 1000000;
  3793. if (starterStart2 == 1) {
  3794. if (getInventory().containsItem(weapon, 1)) {
  3795. if (getInventory().containsItem(8851, finalTokens)) {
  3796. getInventory().deleteItem(weapon, 1);
  3797. getInventory().addItem(upgrade, 1);
  3798. getInventory().deleteItem(8851, finalTokens);
  3799. if(!Settings.isArcadeWorld() && this.canSave) {
  3800. if (weapon == 4151)
  3801. yell("<img=5><col=ff0000>"+getDisplayName()+
  3802. "</col> Has Upgraded Their <col=ff0000>Abyssal Whip</col>", true);
  3803. if (weapon == 11694)
  3804. yell("<img=5><col=ff0000>"+getDisplayName()+
  3805. "</col> Has Upgraded Their <col=ff0000>Armadyl Godsword</col>", true);
  3806. if (weapon == 11696)
  3807. yell("<img=5><col=ff0000>"+getDisplayName()+
  3808. "</col> Has Upgraded Their <col=ff0000>Bandos Godsword</col>", true);
  3809. if (weapon == 11698)
  3810. yell("<img=5><col=ff0000>"+getDisplayName()+
  3811. "</col> Has Upgraded Their <col=ff0000>Saradomin Godsword</col>", true);
  3812. if (weapon == 11700)
  3813. yell("<img=5><col=ff0000>"+getDisplayName()+
  3814. "</col> Has Upgraded Their <col=ff0000>Zamorak Godsword</col>", true);
  3815. if (weapon == 11716)
  3816. yell("<img=5><col=ff0000>"+getDisplayName()+
  3817. "</col> Has Upgraded Their <col=ff0000>Zamorakian Spear</col>", true);
  3818. if (weapon == 11718)
  3819. yell("<img=5><col=ff0000>"+getDisplayName()+
  3820. "</col> Has Upgraded Their <col=ff0000>Armadyl Helmet</col>", true);
  3821. if (weapon == 11720)
  3822. yell("<img=5><col=ff0000>"+getDisplayName()+
  3823. "</col> Has Upgraded Their <col=ff0000>Armadyl Chestplate</col>", true);
  3824. if (weapon == 11722)
  3825. yell("<img=5><col=ff0000>"+getDisplayName()+
  3826. "</col> Has Upgraded Their <col=ff0000>Armadyl Chainskirt</col>", true);
  3827. if (weapon == 11724)
  3828. yell("<img=5><col=ff0000>"+getDisplayName()+
  3829. "</col> Has Upgraded Their <col=ff0000>Bandos Chestplate</col>", true);
  3830. if (weapon == 11726)
  3831. yell("<img=5><col=ff0000>"+getDisplayName()+
  3832. "</col> Has Upgraded Their <col=ff0000>Bandos Tassets</col>", true);
  3833. if (weapon == 11728)
  3834. yell("<img=5><col=ff0000>"+getDisplayName()+
  3835. "</col> Has Upgraded Their <col=ff0000>Bandos Boots</col>", true);
  3836. if (weapon == 11730)
  3837. yell("<img=5><col=ff0000>"+getDisplayName()+
  3838. "</col> Has Upgraded Their <col=ff0000>Saradomin Sword</col>", true);
  3839. if (weapon == 11335)
  3840. yell("<img=5><col=ff0000>"+getDisplayName()+
  3841. "</col> Has Upgraded Their <col=ff0000>Dragon Full Helmet</col>", true);
  3842. if (weapon == 14479)
  3843. yell("<img=5><col=ff0000>"+getDisplayName()+
  3844. "</col> Has Upgraded Their <col=ff0000>Dragon Platebody</col>", true);
  3845. if (weapon == 3140)
  3846. yell("<img=5><col=ff0000>"+getDisplayName()+
  3847. "</col> Has Upgraded Their <col=ff0000>Dragon Chainbody</col>", true);
  3848. if (weapon == 14484)
  3849. yell("<img=5><col=ff0000>"+getDisplayName()+
  3850. "</col> Has Upgraded Their <col=ff0000>Dragon Claws</col>", true);
  3851. if (weapon == 7158)
  3852. yell("<img=5><col=ff0000>"+getDisplayName()+
  3853. "</col> Has Upgraded Their <col=ff0000>Dragon 2H Sword</col>", true);
  3854. if (weapon == 13738)
  3855. yell("<img=5><col=ff0000>"+getDisplayName()+
  3856. "</col> Has Upgraded Their <col=ff0000>Arcane Spirit Shield</col>", true);
  3857. if (weapon == 13740)
  3858. yell("<img=5><col=ff0000>"+getDisplayName()+
  3859. "</col> Has Upgraded Their <col=ff0000>Divine Spirit Shield</col>", true);
  3860. if (weapon == 13742)
  3861. yell("<img=5><col=ff0000>"+getDisplayName()+
  3862. "</col> Has Upgraded Their <col=ff0000>Elysian Spirit Shield</col>", true);
  3863. if (weapon == 13744)
  3864. yell("<img=5><col=ff0000>"+getDisplayName()+
  3865. "</col> Has Upgraded Their <col=ff0000>Spectral Spirit Shield</col>", true);
  3866. }
  3867. } else {
  3868. getPackets().sendGameMessage("You Need "+tokens+" Million <col=ff0000>Upgrade Tokens</col> To Upgrade This!");
  3869. }
  3870. }
  3871. }
  3872. }
  3873.  
  3874. public void sendItemsOnDeath(Player killer) {
  3875. if(ThroneManager.getThrone().getKing().equals(getUsername())) {
  3876. ThroneManager.kingDied(this);
  3877. }
  3878. if (getUsername().equalsIgnoreCase("gavin") || killer.getUsername().equalsIgnoreCase("gavin") || safePvp == 0 || safePvp == 2 || inSafePvpZone() == true || inHomeSafeZone() == true || inEliteLair() || isDeveloper || killer.isDeveloper || !killer.canSave || !canSave)
  3879. return;
  3880. if((this.isDeadman && !killer.isDeadman) || (!this.isDeadman && killer.isDeadman)) {
  3881. return;
  3882. }
  3883. int keptAmount = 3;
  3884. int[] DROPPABLES = {23713, 13652};
  3885. if (this.inAnEvent) {
  3886. for(Player event : World.getPlayers()) {
  3887. if(event == null)
  3888. continue;
  3889. if(event.inAnEvent)
  3890. event.getPackets().sendGameMessage("Event: <col=ff0000>"+this.getDisplayName()+"</col> Is Eliminated!");
  3891. }
  3892. this.inAnEvent = false;
  3893. this.setNextWorldTile(new WorldTile(2551, 3084, 0));
  3894. return;
  3895. }
  3896. getInterfaceManager().sendTeleports();
  3897. Statistics.insertQuery("death");
  3898. charges.die();
  3899. auraManager.removeAura();
  3900. CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
  3901. for (int i = 0; i < 14; i++) {
  3902. if (equipment.getItem(i) != null
  3903. && equipment.getItem(i).getId() != -1
  3904. && equipment.getItem(i).getAmount() != -1)
  3905. containedItems.add(new Item(equipment.getItem(i).getId(),
  3906. equipment.getItem(i).getAmount()));
  3907. }
  3908. for (int i = 0; i < 28; i++) {
  3909. if (inventory.getItem(i) != null
  3910. && inventory.getItem(i).getId() != -1
  3911. && inventory.getItem(i).getAmount() != -1)
  3912. containedItems.add(getInventory().getItem(i));
  3913. }
  3914. if (containedItems.isEmpty())
  3915. return;
  3916. if (hasSkull())
  3917. keptAmount = 0;
  3918. if (prayer.usingPrayer(0, 10) || prayer.usingPrayer(1, 0))
  3919. keptAmount++;
  3920. if (donator && Utils.random(2) == 0)
  3921. keptAmount += 1;
  3922. if (arena == 1) {
  3923. arena = 0;
  3924. keptAmount = 0;
  3925. }
  3926.  
  3927. CopyOnWriteArrayList<Item> keptItems = new CopyOnWriteArrayList<Item>();
  3928. Item lastItem = new Item(1, 1);
  3929. for (int i = 0; i < keptAmount; i++) {
  3930. for (Item item : containedItems) {
  3931. int price = item.getDefinitions().getValue();
  3932. if (!(lastItem.getDefinitions().getValue() > price)) {
  3933. lastItem = item;
  3934. }
  3935. }
  3936. keptItems.add(lastItem);
  3937. containedItems.remove(lastItem);
  3938. lastItem = new Item(1, 1);
  3939. }
  3940. inventory.reset();
  3941. equipment.reset();
  3942. for (Item item : keptItems) {
  3943. getInventory().addItem(item);
  3944. }
  3945. for(int i=0;i<DROPPABLES.length;i++) {
  3946. for (Item item : containedItems) {
  3947. if(item.getId() == DROPPABLES[i]) {
  3948. World.addGroundItem(item, getLastWorldTile(), this, true, 180, true);
  3949. containedItems.remove(item);
  3950. }
  3951. }
  3952. }
  3953. if(!killer.isIronman) {
  3954. for (Item item : containedItems) {
  3955. World.addPKedItem(item, getLastWorldTile(), killer, true, 180, true, this);
  3956. }
  3957. }
  3958. if(this.isDeadman) {
  3959. errorMessage("Because you've died, we've given you a brand new bank account!");
  3960. BankKeyManager.addNewDeadmanKey(this);
  3961. }
  3962. }
  3963.  
  3964. public int pkPoints = 0;
  3965.  
  3966. public boolean containsEgg() {
  3967. if(getInventory().containsItem(7928, 1) || getInventory().containsItem(7929, 1) || getInventory().containsItem(7930, 1) || getInventory().containsItem(7931, 1) || getInventory().containsItem(7932, 1) || getInventory().containsItem(7933, 1))
  3968. return true;
  3969. if(getBank().containsItem(7928, 1) || getBank().containsItem(7929, 1) || getBank().containsItem(7930, 1) || getBank().containsItem(7931, 1) || getBank().containsItem(7932, 1) || getBank().containsItem(7933, 1))
  3970. return true;
  3971. return false;
  3972. }
  3973.  
  3974. public void increaseKillCount(Player killed) {
  3975. if (killed == null || this.isDeveloper || !this.canSave)
  3976. return;
  3977. if(killed == this || this == killed) {
  3978. return;
  3979. }
  3980. /*******************/
  3981. //BETA BOOST SYSTEM//
  3982. /*******************/
  3983. /*if (playerKilled == killed.getUsername()) {
  3984. boosterCount += 1;
  3985. WriteFile.writeLog("Booster Buster Suspect: "+getUsername(), "killlogs", "Booster Buster Suspicion");
  3986. staffYell("<col=ff0000>[BB 11,000]</col> Booster Alert: <col=ff0000>"+ getDisplayName() + "</col> - Killed <col=ff0000>"+killed.getUsername()+"</col> <col=0000ff>"+boosterCount+"</col> Times In A Row!");
  3987. } else {
  3988. playerKilled = "";
  3989. boosterCount = 1;
  3990. }*/
  3991. if (killed.getSession().getIP().equals(IPKilled)) {
  3992. boosterCount += 1;
  3993. WriteFile.writePlayerLog("Booster Buster IP Detection: "+getSession().getIP(), "killlogs", this);
  3994. staffYell("<col=ff0000>[BB 12,000]</col> IP Detection: <col=ff0000>"+ getUsername() + "</col> - Killed <col=ff0000>"+killed.getUsername()+"</col> <col=0000ff>"+boosterCount+"</col> Times In A Row!");
  3995. } else {
  3996. IPKilled = "";
  3997. boosterCount = 1;
  3998. }
  3999.  
  4000. if(boosterCount >= 5) {
  4001. errorMessage("Boosting detected. A Moderator has been alarmed.");
  4002. }
  4003.  
  4004. if(inF2PZone()) {
  4005. int r = Misc.random(500);
  4006. if(r == 157) {
  4007. World.addGroundItem(new Item(24168, 1), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), this, false, 180, true);
  4008. this.yell(this.getDisplayName()+" Has Received A <shad=000000><col=ff0000>Dragon Whip</col></shad> Drop From Rogue's Castle [::castle]!");
  4009. }
  4010. }
  4011. /*******************/
  4012. //BETA BOOST SYSTEM//
  4013. /*******************/
  4014. killed.deathCount++;
  4015. //playerKilled = killed.getUsername();
  4016. IPKilled = killed.getSession().getIP();
  4017. //if (killed.getSession().getIP().equals(getSession().getIP()))
  4018. //return;
  4019. WriteFile.writePlayerLog(getUsername()+" Killed "+killed.getUsername(), "killlogs", this);
  4020. boolean bountyKill = getBountyHunter().runKill(killed);
  4021. if (inHighRiskArena()) {
  4022. getInventory().addItem(HRPRandom(), 1);
  4023. killCount++;
  4024. getInterfaceManager().sendTeleports();
  4025. getKillstreakManager().doKillstreak();
  4026. getInventory().addItem(13650, 10000); //Arena token shop? :D
  4027. } else {
  4028. getKillstreakManager().doKillstreak();
  4029. sendPvpDrops(this, killed, true);
  4030. if(bountyKill)
  4031. sendPvpDrops(this, killed, false);
  4032. }
  4033. if(Settings.isTriplePvpLoot) {
  4034. sendPvpDrops(this, killed, false);
  4035. sendPvpDrops(this, killed, false);
  4036. } else if(Hotspots.isAtHotspot(this)) {
  4037. sendPvpDrops(this, killed, false);
  4038. succeedMessage("Because you're at the hotspot, you get double loot!!");
  4039. }
  4040. checkIllum(killed);
  4041. sendShermWings(killed);
  4042. PkRank.checkRank(killed);
  4043. PkRank.checkRank(this);
  4044. if(Settings.isPvpWorld()) {
  4045. Bounties b = new Bounties();
  4046. if(b.getTarget() == killed)
  4047. b.rewardSlayer(this);
  4048. if(b.getTarget() == null) {
  4049. b.newTarget();
  4050. }
  4051. }
  4052. }
  4053.  
  4054. public void checkIllum(Player killed) {
  4055. int RATE = 25000;
  4056. int random = Misc.random(RATE);
  4057. if(random == (RATE / 2)) {
  4058. yell("<shad=000000><col=00BFFF>"+getDisplayName()+" killed "+killed.getDisplayName()+" and was offered an Illuminessence by the Illukiminati gods!");
  4059. World.addGroundItem(new Item(20821, 1), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), this, false, 180, true);
  4060. }
  4061. }
  4062.  
  4063. public void sendShermWings(Player killed) {
  4064. int ROLL = 270000;
  4065. int random = Misc.random(ROLL);
  4066. if (random == (ROLL / 10)) {
  4067. yell("<col=ff0000><shad=000000>"+getDisplayName()+" just killed "+killed.getDisplayName()+" and received a pair of Shermination Wings!");
  4068. World.addGroundItem(new Item(29948, 1), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), this, false, 180, true);
  4069. }
  4070. }
  4071.  
  4072.  
  4073. public void sendPvpDrops(Player killer, Player killed, boolean addKill) {
  4074. int pvpId = 12852;
  4075. int cashId = 995;
  4076. int upgId = 8851;
  4077. int pvps;
  4078. int cash;
  4079. int upgs;
  4080. int xp;
  4081. int extraPvps;
  4082. int extraCash;
  4083. int extraUpgs;
  4084. int random = Misc.random(pvpRandom.length);
  4085. pvps = 100000;
  4086. upgs = 1000000;
  4087. cash = killer.isSuperDonator() ? 3000000 : killer.isLegendaryDonator() ? 2800000 : killer.isExtremeDonator() ? 2600000 : 2500000;
  4088. xp = killer.isSuperDonator() ? 10000 : killer.isLegendaryDonator() ? 9000 : killer.isExtremeDonator() ? 8000 : 7000;
  4089. if(addKill)
  4090. killer.getPackets().sendGameMessage("<col=ff0000>You have killed " + killed.getDisplayName() + ", you have now " + killer.killCount + " kills.");
  4091. if(killer.triviaPoints >= 50 && killer.triviaPoints < 200) {
  4092. pvps += (pvps / 100) * 5;
  4093. upgs += (upgs / 100) * 5;
  4094. cash += (cash / 100) * 5;
  4095. killer.succeedMessage("Your "+killer.triviaPoints+" Trivia Points Have Brought You 5% Extra Loot!");
  4096. } else if(killer.triviaPoints >= 200) {
  4097. pvps += (pvps / 100) * 10;
  4098. upgs += (upgs / 100) * 10;
  4099. cash += (cash / 100) * 10;
  4100. killer.succeedMessage("Your "+killer.triviaPoints+" Trivia Points Have Brought You 10% Extra Loot!");
  4101. }
  4102. if(getEquipment().getCapeId() == MaxCape.TRIMMED_COMP_CAPE || getEquipment().getCapeId() == MaxCape.COMP_CAPE) {
  4103. pvps = pvps*2;
  4104. upgs = upgs*2;
  4105. cash = cash*2;
  4106. xp = xp*2;
  4107. }
  4108. if(pvpRandom[random] != -1)
  4109. World.addGroundItem(new Item(pvpRandom[random], 1), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), killer, false, 180, true);
  4110. World.addGroundItem(new Item(pvpId, pvps), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), killer, false, 180, true);
  4111. World.addGroundItem(new Item(cashId, cash), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), killer, false, 180, true);
  4112. World.addGroundItem(new Item(upgId, upgs), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), killer, false, 180, true);
  4113. killer.getSkills().addXp(Skills.DUNGEONEERING, xp);
  4114. if(addKill)
  4115. killer.killCount++;
  4116. killer.getInterfaceManager().sendTeleports();
  4117. killed.getInterfaceManager().sendTeleports();
  4118. killer.checkKillAch();
  4119. sendFamiliarRares(killer, killed);
  4120. killer.PKP++;
  4121. //killer.errorMessage("You now have "+killer.PKP+" PKP!");
  4122. if(killer.isDonator())
  4123. killer.succeedMessage("Your Donator Rank Has Brought You Extra Loot!");
  4124. if(getEquipment().getCapeId() == MaxCape.TRIMMED_COMP_CAPE || getEquipment().getCapeId() == MaxCape.TRIMMED_COMP_CAPE)
  4125. killer.succeedMessage("Your <col=ff0000>Completionist Cape</col> Has Gained You Double Loot!");
  4126. }
  4127.  
  4128. public void CompVanish() {
  4129. if(!canSpawn()) {
  4130. errorMessage("You cannot vanish in this area.");
  4131. return;
  4132. }
  4133. if(isCanPvp()) {
  4134. errorMessage("You cannot vanish in a player-vs-player zone.");
  4135. return;
  4136. }
  4137. if(!canWearCape()) {
  4138. errorMessage("Only those who can wear the Completionist Cape can use this feature.");
  4139. return;
  4140. }
  4141. if(!getAppearence().isHidden()) {
  4142. WorldTasksManager.schedule(new WorldTask() {
  4143. int loop = 0;
  4144. @Override
  4145. public void run() {
  4146. if(loop == 0) {
  4147. setNextForceTalk(new ForceTalk("3"));
  4148. }
  4149. if(loop == 1) {
  4150. setNextForceTalk(new ForceTalk("2"));
  4151. }
  4152. if(loop == 2) {
  4153. setNextForceTalk(new ForceTalk("1"));
  4154. }
  4155. if(loop == 3) {
  4156. setNextForceTalk(new ForceTalk("Poof!"));
  4157. }
  4158. if(loop == 4) {
  4159. getAppearence().switchHidden();
  4160. stop();
  4161. }
  4162. loop++;
  4163. }
  4164. }, 0, 1);
  4165. } else {
  4166. setNextForceTalk(new ForceTalk("Poof!"));
  4167. getAppearence().switchHidden();
  4168. }
  4169. }
  4170.  
  4171. public void CompTeleport(String name) {
  4172. Player target = World.getPlayerByDisplayName(name);
  4173. if(getEquipment().getCapeId() != MaxCape.TRIMMED_COMP_CAPE && getEquipment().getCapeId() != MaxCape.COMP_CAPE)
  4174. return;
  4175. if(target == null) {
  4176. errorMessage("No such user or user isn't online.");
  4177. return;
  4178. }
  4179. if(target.getRights() == 1 || target.getRights() == 2) {
  4180. errorMessage("You cannot teleport to Moderators or Administrators.");
  4181. return;
  4182. }
  4183. if(!target.canSpawn()) {
  4184. errorMessage("This player is in a non-teleporting zone, meaning you cannot teleport to them.");
  4185. return;
  4186. }
  4187. if(target.getTrade() != null) {
  4188. errorMessage("This person is currently in a trade. Please wait until they have finished.");
  4189. return;
  4190. }
  4191. if(getTrade() != null) {
  4192. errorMessage("You're currently in a trade. Please finish trading before teleporting.");
  4193. return;
  4194. }
  4195. if(inJuggernaut()) {
  4196. errorMessage("You can't teleport out of Juggernaut.");
  4197. return;
  4198. }
  4199. if(target.inJuggernaut()) {
  4200. errorMessage("This player is playing Juggernaut.");
  4201. return;
  4202. }
  4203. setNextWorldTile(target);
  4204. stopAll();
  4205. setNextGraphics(new Graphics(365));
  4206. }
  4207.  
  4208. public void sendFamiliarRares(Player killer, Player killed) {
  4209. int i = Misc.random(30000);
  4210. if(i >= 750 && i <= 760) {
  4211. World.addGroundItem(new Item(29019, 1), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), killer, false, 180, true);
  4212. killer.yell("<img=7><col=ff0000>"+killer.getDisplayName()+" Has Received A Red Octo!</col>");
  4213. } else if(i >= 950 && i <= 975) {
  4214. World.addGroundItem(new Item(29004, 1), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), killer, false, 180, true);
  4215. killer.yell("<img=7><col=ff0000>"+killer.getDisplayName()+" Has Received A Red Dragon!</col>");
  4216. } else if(i >= 1250 && i <= 1295) {
  4217. World.addGroundItem(new Item(29012, 1), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), killer, false, 180, true);
  4218. killer.yell("<img=7><col=ff0000>"+killer.getDisplayName()+" Has Received A Red Monkey!</col>");
  4219. }
  4220. }
  4221.  
  4222. //World.addGroundItem(new Item(24168, 1), new WorldTile(killed.getX(), killed.getY(), killed.getPlane()), this, false, 180, true);
  4223.  
  4224. public String getHireOwner() {
  4225. return hireOwner;
  4226. }
  4227.  
  4228. public void setHireOwner(String name) {
  4229. hireOwner = name;
  4230. }
  4231.  
  4232. public Master getSlayerMaster() {
  4233. return master;
  4234. }
  4235.  
  4236. public void setSlayerMaster(Master master) {
  4237. this.master = master;
  4238. }
  4239.  
  4240. public SlayerTask getSlayerTask() {
  4241. return slayerTask;
  4242. }
  4243.  
  4244. public void setSlayerTask(SlayerTask slayerTask) {
  4245. this.slayerTask = slayerTask;
  4246. }
  4247.  
  4248. public int getHireValue() {
  4249. return hireValue;
  4250. }
  4251.  
  4252. public int getTicketAmount(String rank) {
  4253. int amount = 0;
  4254. for (Player players : World.getPlayers()) {
  4255. if (players.isUsingTicket() && players.ticketRank.equals(rank))
  4256. amount++;
  4257. }
  4258. return amount;
  4259. }
  4260.  
  4261. public void takeTicket(Player ticket) {
  4262. if(ticket.isDeadman && !ticket.inYanille()) {
  4263. ticket.errorMessage("Your ticket has been cancelled because you're a deadman and you're not at home.");
  4264. errorMessage("Ticket for "+ticket.getUsername()+" was cancelled because they are a deadman and weren't at home.");
  4265. return;
  4266. }
  4267. if(ticket.getControlerManager().getControler() instanceof Wilderness) {
  4268. ticket.errorMessage("Your ticket has been cancelled because you're in the wilderness.");
  4269. errorMessage("Ticket for "+ticket.getUsername()+" was cancelled because they are in the wilderness.");
  4270. ticket.setUsingTicket(false);
  4271. return;
  4272. }
  4273. if(this.getRights() == 2 && ticket.ticketRank.equals("admin")) {
  4274. ticket.setNextWorldTile(new WorldTile(this.getX(), this.getY() + 1, this.getPlane()));
  4275. ticket.getPackets().sendGameMessage(this.getDisplayName() + " Your ticket is being handled.");
  4276. this.setNextForceTalk(new ForceTalk("Hello, I am "+this.getDisplayName()+". I am taking your ticket for: "+ticket.ticketAssist));
  4277. ticket.faceEntity(this);
  4278. ticket.setUsingTicket(false);
  4279. } else if(this.getRights() == 1 && ticket.ticketRank.equals("mod")) {
  4280. ticket.setNextWorldTile(new WorldTile(this.getX(), this.getY() + 1, this.getPlane()));
  4281. ticket.getPackets().sendGameMessage(this.getDisplayName() + " Your ticket is being handled.");
  4282. this.setNextForceTalk(new ForceTalk("Hello, I am "+this.getDisplayName()+". I am taking your ticket for: "+ticket.ticketAssist));
  4283. ticket.faceEntity(this);
  4284. ticket.setUsingTicket(false);
  4285. } else if(this.ServerSupport && this.getRights() == 7 && ticket.ticketRank.equals("support")) {
  4286. ticket.setNextWorldTile(new WorldTile(this.getX(), this.getY() + 1, this.getPlane()));
  4287. ticket.getPackets().sendGameMessage(this.getDisplayName() + " Your ticket is being handled.");
  4288. this.setNextForceTalk(new ForceTalk("Hello, I am "+this.getDisplayName()+". I am taking your ticket for: "+ticket.ticketAssist));
  4289. ticket.faceEntity(this);
  4290. ticket.setUsingTicket(false);
  4291. } else if(this.isAssistant && ticket.ticketRank.equals("assistant")) {
  4292. ticket.setNextWorldTile(new WorldTile(this.getX(), this.getY() + 1, this.getPlane()));
  4293. ticket.getPackets().sendGameMessage(this.getDisplayName() + " Your ticket is being handled.");
  4294. this.setNextForceTalk(new ForceTalk("Hello, I am "+this.getDisplayName()+". I am taking your ticket for: "+ticket.ticketAssist));
  4295. ticket.faceEntity(this);
  4296. ticket.setUsingTicket(false);
  4297. } else {
  4298. ticket.setUsingTicket(false);
  4299. ticket.errorMessage("Your ticket has been closed. Please create a new ticket.");
  4300. errorMessage("Something went wrong in taking ticket for player "+ticket.getUsername());
  4301. }
  4302. int amount = 0;
  4303. for(Player players : World.getPlayers()) {
  4304. if(players.isUsingTicket()) {
  4305. amount++;
  4306. }
  4307. }
  4308. for(Player players : World.getPlayers()) {
  4309. if(players.isUsingTicket()) {
  4310. players.errorMessage("Note: You're currently in a ticket queue of "+amount+" people. Please be patient.");
  4311. }
  4312. }
  4313. }
  4314.  
  4315. public int getNewHireValue() {
  4316. return hireValue + (hireValue / 10);
  4317. }
  4318.  
  4319. public String getHired() {
  4320. return hasBeenHired() ? "<col=ff0000>Hired!" : "<col=298A08>Is Not Hired!";
  4321. }
  4322.  
  4323. public boolean hasBeenHired() {
  4324. return isHired == true ? true : false;
  4325. }
  4326.  
  4327. public void giveOwnerIncome(Player killed) {
  4328. try {
  4329. int amount = hireValue + (hireValue / 10);
  4330. String loser = hireOwner;
  4331. Player owner = World.getPlayerByDisplayName(loser);
  4332. if(!hireOwner.equals(killed.getUsername())) {
  4333. if(hireOwner != "" && hireOwner != null) {
  4334. if(owner.getInventory().getItems().freeSlots() >= 1 && !owner.getInventory().containsItem(995, 2147000000)) {
  4335. owner.getInventory().addItem(995, amount);
  4336. owner.succeedMessage(getDisplayName()+" Has Brought Income For You. You Have Received: "+amount+" Gold.");
  4337. } else {
  4338. owner.cashIn += amount;
  4339. owner.succeedMessage(getDisplayName()+" Has Brought Income For You. Do ::cashin To Claim Your Gold!");
  4340. }
  4341. succeedMessage("Your Owner, "+owner.getDisplayName()+" Has Received "+amount+" Gold For Your Efforts.");
  4342. }
  4343. }
  4344. } catch (NullPointerException e) {
  4345.  
  4346. }
  4347. }
  4348.  
  4349. public void cashIn() {
  4350. if(getInventory().getItems().freeSlots() >= 1 && !getInventory().containsItem(995, 2147000000)) {
  4351. if(cashIn >= 1) {
  4352. getInventory().addItem(995, cashIn);
  4353. succeedMessage("You Cash In With "+cashIn+" Gold!");
  4354. cashIn = 0;
  4355. } else
  4356. sendErrorMessage("You Have Nothing To Cash In!");
  4357. } else
  4358. sendErrorMessage("You Need At least 1 Free Slot To Cash In.");
  4359. }
  4360.  
  4361. public void hirePlayer() {
  4362. try {
  4363. Player hire = World.getPlayerByDisplayName(playerHiring);
  4364. int newHireValue = hire.hireValue + (hire.hireValue / 10);
  4365. int newHireValue2 = hireValue + (hireValue / 10);
  4366. if(!playerHiring.equals("") || !playerHiring.equals(null)) {
  4367. if(newHireValue2 >= newHireValue) {
  4368. if(getInventory().containsItem(995, newHireValue)) {
  4369. if(hire.hireOwner != getUsername()) {
  4370. if(!hire.getSession().getIP().equals(this.getSession().getIP())) {
  4371. if(hire.hireOwner != "" && hire.hireOwner != null) {
  4372. String loser = hire.hireOwner;
  4373. Player loss = World.getPlayerByDisplayName(loser);
  4374. loss.sendErrorMessage(getDisplayName()+" Has Hired "+hire.getDisplayName()+" From You!");
  4375. }
  4376. hire.setHireOwner(getDisplayName());
  4377. this.getInventory().deleteItem(995, newHireValue);
  4378. succeedMessage("You Have Successfully Hired "+hire.getDisplayName()+" For "+newHireValue+"!");
  4379. hire.succeedMessage(getDisplayName()+" Has Hired You! You Have Made: "+hireValue / 10+"!");
  4380. hire.hireValue = newHireValue;
  4381. hire.isHired = true;
  4382. hire.hireCount++;
  4383. if(hire.getInventory().getItems().freeSlots() >= 1) {
  4384. hire.getInventory().addItem(995, hireValue / 10);
  4385. } else {
  4386. hire.cashIn += hireValue / 10;
  4387. hire.succeedMessage(getDisplayName()+" Has Hired You! Claim Your Cash By Doing ::cashin !");
  4388. }
  4389. } else {
  4390. sendErrorMessage("You Cannot Hire This Player!");
  4391. }
  4392. } else {
  4393. sendErrorMessage("You Already Own This Player!");
  4394. }
  4395. } else {
  4396. sendErrorMessage("You Don't Have Enough Gold To Hire "+hire.getDisplayName()+"! Their Hire Value is "+newHireValue+".");
  4397. }
  4398. } else {
  4399. sendErrorMessage("You Cannot Higher Someone Who's Hire Value Is Greater Than Yours.");
  4400. }
  4401. } else {
  4402. sendErrorMessage("Please Enter A Valid Username To Hire!");
  4403. }
  4404. } catch(NullPointerException e) {
  4405.  
  4406. }
  4407. }
  4408.  
  4409. public void sendRandomJail(Player p) {
  4410. p.resetWalkSteps();
  4411. switch (Utils.getRandom(3)) {
  4412. case 0:
  4413. p.setNextWorldTile(new WorldTile(3446, 3151, 0));
  4414. break;
  4415. case 1:
  4416. p.setNextWorldTile(new WorldTile(3449, 3151, 0));
  4417. break;
  4418. case 2:
  4419. p.setNextWorldTile(new WorldTile(3443, 3151, 0));
  4420. break;
  4421. case 3:
  4422. p.setNextWorldTile(new WorldTile(3440, 3151, 0));
  4423. break;
  4424. }
  4425. }
  4426.  
  4427.  
  4428.  
  4429. @Override
  4430. public int getSize() {
  4431. return appearence.getSize();
  4432. }
  4433.  
  4434. public boolean isCanPvp() {
  4435. return canPvp;
  4436. }
  4437.  
  4438. public void setCanPvp(boolean canPvp) { // vicky
  4439. this.canPvp = canPvp;
  4440. appearence.generateAppearenceData();
  4441. getPackets().sendPlayerOption(canPvp ? "Attack" : timerCount >= 0 ? "Attack" : "null", 1, true);
  4442. getPackets().sendPlayerOption("Follow", 2, false);
  4443. getPackets().sendPlayerOption("Trade with", 3, false);
  4444. getPackets().sendPlayerOption("Req Assist", 4, false);
  4445. //getPackets().sendConfig(455, 1);
  4446. getPackets().sendPlayerUnderNPCPriority(canPvp);
  4447. }
  4448.  
  4449. public void prayerRenewal(int heal) {
  4450. prayerRenew = heal;
  4451. }
  4452.  
  4453. public Prayer getPrayer() {
  4454. return prayer;
  4455. }
  4456.  
  4457. public long getStopDelay() {
  4458. return stopDelay;
  4459. }
  4460.  
  4461. public void setInfiniteStopDelay() {
  4462. stopDelay = Long.MAX_VALUE;
  4463. }
  4464.  
  4465. public void resetStopDelay() {
  4466. stopDelay = 0;
  4467. }
  4468.  
  4469. public void addStopDelay(long delay) {
  4470. stopDelay = Utils.currentTimeMillis() + (delay * 600);
  4471. }
  4472.  
  4473. public void useStairs(int emoteId, final WorldTile dest, int useDelay,
  4474. int totalDelay) {
  4475. useStairs(emoteId, dest, useDelay, totalDelay, null);
  4476. }
  4477.  
  4478. public void useStairs(int emoteId, final WorldTile dest, int useDelay,
  4479. int totalDelay, final String message) {
  4480. stopAll();
  4481. addStopDelay(totalDelay);
  4482. if (emoteId != -1)
  4483. setNextAnimation(new Animation(emoteId));
  4484. if (useDelay == 0)
  4485. setNextWorldTile(dest);
  4486. else {
  4487. WorldTasksManager.schedule(new WorldTask() {
  4488. @Override
  4489. public void run() {
  4490. if (currentFriendChatOwner != null) {
  4491. //FriendChatsManager.joinChat(currentFriendChatOwner, this);
  4492. if (currentFriendChat == null) // failed
  4493. currentFriendChatOwner = null;
  4494. // clanWars = new ClanWars();
  4495. }
  4496. if (isDead())
  4497. return;
  4498. setNextWorldTile(dest);
  4499. if (message != null)
  4500. getPackets().sendGameMessage(message);
  4501. }
  4502. }, useDelay - 1);
  4503. }
  4504. }
  4505.  
  4506. public Bank getBank() {
  4507. return bank;
  4508. }
  4509.  
  4510. public void setBank(Bank bank) {
  4511. this.bank = bank;
  4512. }
  4513.  
  4514. public ControlerManager getControlerManager() {
  4515. return controlerManager;
  4516. }
  4517.  
  4518. public void switchMouseButtons() {
  4519. mouseButtons = !mouseButtons;
  4520. refreshMouseButtons();
  4521. }
  4522.  
  4523. public void switchAllowChatEffects() {
  4524. allowChatEffects = !allowChatEffects;
  4525. refreshAllowChatEffects();
  4526. }
  4527.  
  4528. public void refreshAllowChatEffects() {
  4529. getPackets().sendConfig(171, allowChatEffects ? 0 : 1);
  4530. }
  4531.  
  4532. public void refreshMouseButtons() {
  4533. getPackets().sendConfig(170, mouseButtons ? 0 : 1);
  4534. }
  4535.  
  4536. public void refreshPrivateChatSetup() {
  4537. getPackets().sendConfig(287, privateChatSetup);
  4538. }
  4539.  
  4540. public void setPrivateChatSetup(int privateChatSetup) {
  4541. this.privateChatSetup = privateChatSetup;
  4542. }
  4543.  
  4544. public int getPrivateChatSetup() {
  4545. return privateChatSetup;
  4546. }
  4547.  
  4548. public boolean isForceNextMapLoadRefresh() {
  4549. return forceNextMapLoadRefresh;
  4550. }
  4551.  
  4552. public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
  4553. this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
  4554. }
  4555.  
  4556. public FriendsIgnores getFriendsIgnores() {
  4557. return friendsIgnores;
  4558. }
  4559.  
  4560. /*
  4561. * do not use this, only used by pm
  4562. */
  4563. public void setUsername(String username) {
  4564. this.username = username;
  4565. }
  4566.  
  4567. public void setDisplayName(String displayName) {
  4568. if (Utils.formatPlayerNameForDisplay(username).equals(displayName))
  4569. this.displayName = null;
  4570. else
  4571. this.displayName = displayName;
  4572. }
  4573.  
  4574. public void addPotDelay(long time) {
  4575. potDelay = time + Utils.currentTimeMillis();
  4576. }
  4577.  
  4578. public long getPotDelay() {
  4579. return potDelay;
  4580. }
  4581.  
  4582. public void addFoodDelay(long time) {
  4583. foodDelay = time + Utils.currentTimeMillis();
  4584. }
  4585.  
  4586. public long getFoodDelay() {
  4587. return foodDelay;
  4588. }
  4589.  
  4590. public long getBoneDelay() {
  4591. return boneDelay;
  4592. }
  4593. private Pets pet;
  4594. public int petId;
  4595.  
  4596. public Pets getPet() {
  4597. return pet;
  4598. }
  4599. public void setPet(Pets pets) {
  4600. this.pet = pets;
  4601.  
  4602. }
  4603.  
  4604. public int getPrestige() {
  4605. /*return this.getUsername().equals("gavin") ? 1337 : getKillCount() -
  4606. getDeathCount() +
  4607. killstreaks +
  4608. (highestKillStreaks / 2);*/
  4609. return getKillCount() -
  4610. getDeathCount() +
  4611. killstreaks +
  4612. (highestKillStreaks / 2);
  4613. }
  4614.  
  4615. public double getKDR() {
  4616. double kill = getKillCount();
  4617. double death = getDeathCount();
  4618. double dr = kill / death;
  4619. return dr;
  4620. }
  4621.  
  4622. public void setPetFollow(int petFollow) {
  4623. this.petFollow = petFollow;
  4624. }
  4625.  
  4626. public void setPetId(int petId) {
  4627. this.petId = petId;
  4628. }
  4629.  
  4630. public int getPetId() {
  4631. return petId;
  4632. }
  4633.  
  4634. private int petFollow = -1;
  4635. public int getPetFollow() {
  4636. return petFollow;
  4637. }
  4638.  
  4639. public void addBoneDelay(long time) {
  4640. boneDelay = time + Utils.currentTimeMillis();
  4641. }
  4642.  
  4643. public void addPoisonImmune(long time) {
  4644. poisonImmune = time + Utils.currentTimeMillis();
  4645. getPoison().reset();
  4646. }
  4647.  
  4648. public long getPoisonImmune() {
  4649. return poisonImmune;
  4650. }
  4651.  
  4652. public void addFireImmune(long time) {
  4653. fireImmune = time + Utils.currentTimeMillis();
  4654. }
  4655.  
  4656. public long getFireImmune() {
  4657. return fireImmune;
  4658. }
  4659.  
  4660. @Override
  4661. public void heal(int ammount, int extra) {
  4662. super.heal(ammount, extra);
  4663. refreshHitPoints();
  4664. }
  4665.  
  4666. /*
  4667. public String weaponWeapon;
  4668. public String nWeapon;
  4669. */
  4670.  
  4671. public void sendTiles() {
  4672. if(getHoursPlayed() >= 3)
  4673. return;
  4674. getPackets().sendTileMessage("<col=ff0000>Shopping Mall", new WorldTile(2558, 3089, 0), 5000, 255, 000000);
  4675. getPackets().sendTileMessage("<col=ff0000>Notice Board", new WorldTile(2556, 3085, 0), 5000, 255, 000000);
  4676. getPackets().sendTileMessage("<col=ff0000>Account Utilities", new WorldTile(2546, 3087, 0), 5000, 255, 000000);
  4677. getPackets().sendTileMessage("<col=ff0000>Bank Booths", new WorldTile(2551, 3083, 0), 5000, 255, 000000);
  4678. getPackets().sendTileMessage("<col=ff0000>Capes & Titles", new WorldTile(2551, 3094, 0), 5000, 255, 000000);
  4679. getPackets().sendTileMessage("<col=ff0000>Skilling & Slayer", new WorldTile(2544, 3091, 0), 5000, 255, 000000);
  4680. getPackets().sendTileMessage("<col=ff0000>Global Teleports", new WorldTile(2544, 3096, 0), 5000, 255, 000000);
  4681. //player.getPackets().sendTileMessage("", new WorldTile(9999, 9999, 0), 5000, 255, 000000);
  4682. }
  4683.  
  4684. public void sendUnderground() {
  4685. int area = Misc.random(5);
  4686. if (area == 1) {
  4687. setNextWorldTile(new WorldTile(3172,9774, 0));
  4688. } else if (area == 2) {
  4689. setNextWorldTile(new WorldTile(3164,9774, 0));
  4690. } else if (area == 3) {
  4691. setNextWorldTile(new WorldTile(3156,9766, 0));
  4692. } else if (area == 4) {
  4693. setNextWorldTile(new WorldTile(3164,9758, 0));
  4694. } else if (area == 5) {
  4695. setNextWorldTile(new WorldTile(3172,9758, 0));
  4696. }
  4697. }
  4698.  
  4699. public boolean inSupportZone() {
  4700. if (getX() > 5867 && getY() > 4648 &&
  4701. getX() < 5907 && getY() < 4691) {
  4702. return true;
  4703. }
  4704. return false;
  4705. }
  4706. public boolean inSafePvpZone() {
  4707. if (getX() > 3143 && getY() > 3912 &&
  4708. getX() < 3172 && getY() < 3956) {
  4709. return true;
  4710. }
  4711. return false;
  4712. }
  4713.  
  4714. public boolean inVeteranGuild() {
  4715. if (getX() > 3389 && getY() > 3143 &&
  4716. getX() < 3458 && getY() < 3186) {
  4717. return true;
  4718. }
  4719. if (getX() >= 2710 && getY() >= 5040 &&
  4720. getX() <= 2746 && getY() <= 5107) {
  4721. return true;
  4722. }
  4723. return false;
  4724. }
  4725.  
  4726. public boolean atHomePenguins() {
  4727. if (getX() > 2596 && getY() > 3091 &&
  4728. getX() < 2618 && getY() < 3112) {
  4729. return true;
  4730. }
  4731. return false;
  4732. }
  4733.  
  4734. public boolean inHomeSafeZone() {
  4735. if (getX() > 3692 && getY() > 3472 &&
  4736. getX() < 3699 && getY() < 3477) {
  4737. return true;
  4738. }
  4739. return false;
  4740. }
  4741.  
  4742. public boolean inAbbyTower() {
  4743. if (getX() >= 3400 && getY() >= 3524 &&
  4744. getX() <= 3456 && getY() <= 3583 &&
  4745. getPlane() == 1) {
  4746. return true;
  4747. }
  4748. return false;
  4749. }
  4750.  
  4751. public boolean inDBTower() {
  4752. if (getX() >= 3400 && getY() >= 3524 &&
  4753. getX() <= 3456 && getY() <= 3583 &&
  4754. getPlane() == 2) {
  4755. return true;
  4756. }
  4757. return false;
  4758. }
  4759.  
  4760. public boolean inDiceZone() {
  4761. if(TownManager.isInCustomDicezone(this)) {
  4762. return true;
  4763. }
  4764. if(inVeteranGuild()) {
  4765. return true;
  4766. }
  4767. if (getX() >= 3136 && getY() >= 3461 &&
  4768. getX() <= 3202 && getY() <= 3518) {
  4769. return true;
  4770. }
  4771. return false;
  4772. }
  4773.  
  4774. public boolean atChurch() {
  4775. if (getX() >= 2937 && getY() >= 3794 &&
  4776. getX() <= 2977 && getY() <= 3839) {
  4777. return true;
  4778. }
  4779. return false;
  4780. }
  4781.  
  4782. public boolean inAllowedFlowerZone() {
  4783. if (getX() >= 2302 && getY() >= 3775 &&
  4784. getX() <= 2385 && getY() <= 3846) {
  4785. return true;
  4786. }
  4787. return false;
  4788. }
  4789.  
  4790. public boolean inEliteLair() {
  4791. if (getX() >= 3199 && getY() >= 5158 &&
  4792. getX() <= 3236 && getY() <= 5185) {
  4793. return true;
  4794. }
  4795. return false;
  4796. }
  4797.  
  4798. public boolean inMaxArea() {
  4799. if (getX() > 2547 && getY() > 3076 &&
  4800. getX() < 2558 && getY() < 3083) {
  4801. return true;
  4802. }
  4803. return false;
  4804. }
  4805.  
  4806. public boolean inHighRiskArena() {
  4807. if (getX() >= 3154 && getY() >= 9753 &&
  4808. getX() <= 3184 && getY() <= 9779) {
  4809. return true;
  4810. }
  4811. return false;
  4812. }
  4813.  
  4814. public boolean inF2PZone() {
  4815. return getX() > 3274 && getY() > 3917 &&
  4816. getX() < 3300 && getY() < 3949;
  4817. }
  4818.  
  4819. public boolean inBulldogWaitingRoom() {
  4820. if (getX() >= 2595 && getY() >= 5263 &&
  4821. getX() <= 2614 && getY() <= 5276) {
  4822. return true;
  4823. }
  4824. return false;
  4825. }
  4826.  
  4827. public boolean inJuggernaut() {
  4828. if (getX() >= 2967 && getY() >= 3255 &&
  4829. getX() <= 2985 && getY() <= 3269) {
  4830. return true;
  4831. }
  4832. return false;
  4833. }
  4834.  
  4835. public boolean inJailArea() {
  4836. if (getX() >= 3439 && getY() >= 3149 &&
  4837. getX() <= 3450 && getY() <= 3153) {
  4838. return true;
  4839. }
  4840. return false;
  4841. }
  4842.  
  4843. public boolean canSetupCannon() {
  4844. if (getX() >= 2534 && getY() >= 3072 &&
  4845. getX() <= 2582 && getY() <= 3112) {
  4846. return false;
  4847. }
  4848. if (getX() >= 3402 && getY() >= 3527 &&
  4849. getX() <= 3457 && getY() <= 3586) {
  4850. return false;
  4851. }
  4852. if(Settings.isPvpWorld()) {
  4853. return false;
  4854. }
  4855. if(Wilderness.isAtWild(this) && !Wilderness.isAtSAFE(this)) {
  4856. return false;
  4857. }
  4858. return true;
  4859. }
  4860.  
  4861. public boolean inDuelArena() {
  4862. if (getX() >= 3329 && getY() >= 3203 &&
  4863. getX() <= 3392 && getY() <= 3261) {
  4864. return true;
  4865. }
  4866. return false;
  4867. }
  4868.  
  4869. public boolean isEvilTree() {
  4870. if (getX() >= 2560 && getY() >= 4737 &&
  4871. getX() <= 2623 && getY() <= 4799) {
  4872. return true;
  4873. }
  4874. return false;
  4875. }
  4876.  
  4877. public boolean inZombieEscapeLobby() {
  4878. if (getX() >= 3433 && getY() >= 3716 &&
  4879. getX() <= 3444 && getY() <= 3724) {
  4880. return true;
  4881. }
  4882. return false;
  4883. }
  4884.  
  4885. public boolean inZombieEscape() {
  4886. if (getX() >= 3637 && getY() >= 2797 &&
  4887. getX() <= 3878 && getY() <= 3088) {
  4888. return true;
  4889. }
  4890. return false;
  4891. }
  4892.  
  4893. public boolean inTreeArea() {
  4894. if (getX() >= 2324 && getY() >= 3799 &&
  4895. getX() <= 2328 && getY() <= 3801) {
  4896. return true;
  4897. }
  4898. return false;
  4899. }
  4900.  
  4901. public boolean inZombies() {
  4902. if (getX() >= 3457 && getY() >= 3738 &&
  4903. getX() <= 3465 && getY() <= 3750) {
  4904. return true;
  4905. }
  4906. return false;
  4907. }
  4908.  
  4909. public boolean inCastleWarsLobby() {
  4910. if (getX() >= 3460 && getY() >= 3725 &&
  4911. getX() <= 3471 && getY() <= 3737) {
  4912. return true;
  4913. }
  4914. return false;
  4915. }
  4916.  
  4917. public boolean inKharid() {
  4918. if(getX() >= 3257 && getX() <= 3423 &&
  4919. getY() >= 3121 && getY() <= 3330)
  4920. return true;
  4921. return false;
  4922. }
  4923.  
  4924. public boolean inPort() {
  4925. if(getX() >= 3650 && getX() <= 3716 &&
  4926. getY() >= 3464 && getY() <= 3537)
  4927. return true;
  4928. return false;
  4929. }
  4930.  
  4931. public boolean inVarrock() {
  4932. if(getX() >= 3138 && getX() <= 3328 &&
  4933. getY() >= 3372 && getY() <= 3583)
  4934. return true;
  4935. return false;
  4936. }
  4937.  
  4938. public boolean inFalador() {
  4939. if(getX() >= 2937 && getX() <= 3067 &&
  4940. getY() >= 3310 && getY() <= 3394)
  4941. return true;
  4942. return false;
  4943. }
  4944.  
  4945. public boolean inEdgeville() {
  4946. if(getX() >= 3036 && getX() <= 3131 &&
  4947. getY() >= 3439 && getY() <= 3586)
  4948. return true;
  4949. return false;
  4950. }
  4951.  
  4952. public boolean inL33tZone() {
  4953. if(getX() >= 3338 && getX() <= 3388 &&
  4954. getY() >= 9615 && getY() <= 9664)
  4955. return true;
  4956. return false;
  4957. }
  4958.  
  4959. public int slayerBoss = 0;
  4960.  
  4961. public boolean inSlayerBossZone() {
  4962. if(getX() >= 2575 && getX() <= 2598 &&
  4963. getY() >= 3904 && getY() <= 3923)
  4964. return true;
  4965. return false;
  4966. }
  4967.  
  4968. public boolean inDragons() {
  4969. if(getX() >= 3202 && getX() <= 3334 &&
  4970. getY() >= 3584 && getY() <= 3705)
  4971. return true;
  4972. return false;
  4973. }
  4974.  
  4975. public boolean inYanille() {
  4976. if(getX() >= 2531 && getX() <= 2627 &&
  4977. getY() >= 3070 && getY() <= 3114)
  4978. return true;
  4979. return false;
  4980. }
  4981.  
  4982. public boolean neardummy() {
  4983. if(getX() >= 2541 && getX() <= 2556 &&
  4984. getY() >= 3077 && getY() <= 3090)
  4985. return true;
  4986. return false;
  4987. }
  4988.  
  4989. public boolean inMageBank() {
  4990. if(getX() >= 2987 && getX() <= 3315 &&
  4991. getY() >= 3904 && getY() <= 3964)
  4992. return true;
  4993. return false;
  4994. }
  4995.  
  4996. public boolean inCastleWars() {
  4997. if(getX() >= 2367 && getX() <= 2435 &&
  4998. getY() >= 3071 && getY() <= 3138)
  4999. return true;
  5000. return false;
  5001. }
  5002.  
  5003. public boolean inBrimhaven() {
  5004. if(getX() >= 2708 && getX() <= 2876 &&
  5005. getY() >= 3137 && getY() <= 3263)
  5006. return true;
  5007. return false;
  5008. }
  5009.  
  5010. public boolean inEntrana() {
  5011. if(getX() >= 2805 && getX() <= 2876 &&
  5012. getY() >= 3330 && getY() <= 3392)
  5013. return true;
  5014. return false;
  5015. }
  5016.  
  5017. public boolean inMazeWaitingRoom() {
  5018. if (getX() >= 3455 && getY() >= 3716 &&
  5019. getX() <= 3466 && getY() <= 3724) {
  5020. return true;
  5021. }
  5022. return false;
  5023. }
  5024.  
  5025. public boolean inSimonSaysWaitingRoom() {
  5026. if (getX() >= 2573 && getY() >= 5263 &&
  5027. getX() <= 2582 && getY() <= 5276) {
  5028. return true;
  5029. }
  5030. return false;
  5031. }
  5032.  
  5033. public boolean inMaze() {
  5034. if (getX() >= 2491 && getY() >= 3128 &&
  5035. getX() <= 2568 && getY() <= 3205) {
  5036. return true;
  5037. }
  5038. return false;
  5039. }
  5040.  
  5041. public boolean inEdge() {
  5042. if (getX() >= 2944 && getY() >= 3519 &&
  5043. getX() <= 3216 && getY() <= 3630) {
  5044. return true;
  5045. }
  5046. return false;
  5047. }
  5048.  
  5049. public boolean inBandosRoom() {
  5050. if (getX() >= 2861 && getY() >= 5349 &&
  5051. getX() <= 2877 && getY() >= 5376 &&
  5052. getPlane() == 2) {
  5053. return true;
  5054. }
  5055. return false;
  5056. }
  5057.  
  5058. public boolean inWildyAgility() {
  5059. if (getX() >= 2988 && getY() >= 3931 &&
  5060. getX() <= 3011 && getY() <= 3974) {
  5061. return true;
  5062. }
  5063. if (getX() >= 3271 && getY() >= 3916 &&
  5064. getX() <= 3304 && getY() <= 3953) {
  5065. return true;
  5066. }
  5067. return false;
  5068. }
  5069.  
  5070. public int borkKilled = 0;
  5071.  
  5072. public boolean inRoguesCastle() {
  5073. if (getX() >= 3271 && getY() >= 3916 &&
  5074. getX() <= 3304 && getY() <= 3953) {
  5075. return true;
  5076. }
  5077. return false;
  5078. }
  5079.  
  5080. public boolean enteredOSPK() {
  5081. if (getX() >= 3072 && getY() >= 3855 &&
  5082. getX() <= 3121 && getY() <= 3884 ||
  5083. getX() >= 3061 && getY() >= 3864 &&
  5084. getX() <= 3072 && getY() <= 3875) {
  5085. return true;
  5086. }
  5087. return false;
  5088. }
  5089.  
  5090. public boolean hasOverOSArmour() {
  5091. int weapon = this.getEquipment().getWeaponId();
  5092. int hat = this.getEquipment().getHatId();
  5093. int cape = this.getEquipment().getCapeId();
  5094. int ammo = this.getEquipment().getAmmoId();
  5095. int boots = this.getEquipment().getBootsId();
  5096. int shield = this.getEquipment().getShieldId();
  5097. int ammy = this.getEquipment().getAmuletId();
  5098. int ring = this.getEquipment().getRingId();
  5099. int gloves = this.getEquipment().getGlovesId();
  5100. int chest = this.getEquipment().getChestId();
  5101. int legs = this.getEquipment().getLegsId();
  5102. return (weapon >= 11286 && weapon != 14661) || hat >= 11286 || cape >= 11286 || ammo >= 11286
  5103. || boots >= 11286 || shield >= 11286 || ammy >= 11286 || ring >= 11286
  5104. || gloves >= 11286 || chest >= 11286 || legs >= 11286 || weapon == 1309;
  5105. }
  5106.  
  5107. public boolean inPremiumZone() {
  5108. if (getX() > 2194 && getY() > 4956 &&
  5109. getX() < 2221 && getY() < 4973) {
  5110. return true;
  5111. }
  5112. return false;
  5113. }
  5114.  
  5115. public boolean inVeloxWars() {
  5116. if (getX() > 2368 && getY() > 3059 &&
  5117. getX() < 2441 && getY() < 3146) {
  5118. return true;
  5119. }
  5120. return false;
  5121. }
  5122.  
  5123. public void checkKillAch() {
  5124. if (getKillCount() == 1) {
  5125. getInterfaceManager().sendChatBoxInterface(740);
  5126. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5127. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Bronze Newbie</col>");
  5128. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5129.  
  5130. getPackets().sendConfigByFile(4757, 1);
  5131. BronzeNewbieCollect = true;
  5132. }
  5133. if (getKillCount() == 10) {
  5134. getInterfaceManager().sendChatBoxInterface(740);
  5135. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5136. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Iron Fists</col>");
  5137. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5138.  
  5139. getPackets().sendConfigByFile(4757, 1);
  5140. IronFistsCollect = true;
  5141. }
  5142. if (getKillCount() == 25) {
  5143. getInterfaceManager().sendChatBoxInterface(740);
  5144. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5145. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Steel Warrior</col>");
  5146. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5147.  
  5148. getPackets().sendConfigByFile(4757, 1);
  5149. SteelWarriorCollect = true;
  5150. }
  5151. if (getKillCount() == 50) {
  5152. getInterfaceManager().sendChatBoxInterface(740);
  5153. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5154. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Mithril Knuckles</col>");
  5155. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5156.  
  5157. getPackets().sendConfigByFile(4757, 1);
  5158. MithrilKnucklesCollect = true;
  5159. }
  5160. if (getKillCount() == 100) {
  5161. getInterfaceManager().sendChatBoxInterface(740);
  5162. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5163. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Adanaught</col>");
  5164. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5165.  
  5166. getPackets().sendConfigByFile(4757, 1);
  5167. AdanaughtCollect = true;
  5168. }
  5169. if (getKillCount() == 200) {
  5170. getInterfaceManager().sendChatBoxInterface(740);
  5171. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5172. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Rune Wrecker</col>");
  5173. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5174.  
  5175. getPackets().sendConfigByFile(4757, 1);
  5176. RuneWreckerCollect = true;
  5177. }
  5178. if (getKillCount() == 300) {
  5179. getInterfaceManager().sendChatBoxInterface(740);
  5180. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5181. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Dragon Destroyer</col>");
  5182. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5183.  
  5184. getPackets().sendConfigByFile(4757, 1);
  5185. DragonDestroyerCollect = true;
  5186. }
  5187. if (getKillCount() == 400) {
  5188. getInterfaceManager().sendChatBoxInterface(740);
  5189. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5190. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>The Rock</col>");
  5191. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5192.  
  5193. getPackets().sendConfigByFile(4757, 1);
  5194. TheRockCollect = true;
  5195. }
  5196. if (getKillCount() == 500) {
  5197. getInterfaceManager().sendChatBoxInterface(740);
  5198. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5199. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Pvp Master</col>");
  5200. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5201.  
  5202. getPackets().sendConfigByFile(4757, 1);
  5203. PvpMasterCollect = true;
  5204. }
  5205. if (getKillCount() == 1000) {
  5206. getInterfaceManager().sendChatBoxInterface(740);
  5207. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5208. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Silent Assassin</col>");
  5209. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5210.  
  5211. getPackets().sendConfigByFile(4757, 1);
  5212. SilentAssassinCollect = true;
  5213. }
  5214. if (getKillCount() == 2500) {
  5215. getInterfaceManager().sendChatBoxInterface(740);
  5216. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5217. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Deadly Poison</col>");
  5218. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5219.  
  5220. getPackets().sendConfigByFile(4757, 1);
  5221. DeadlyPoisonCollect = true;
  5222. }
  5223. if (getKillCount() == 5000) {
  5224. getInterfaceManager().sendChatBoxInterface(740);
  5225. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5226. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Loose Cannon</col>");
  5227. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5228.  
  5229. getPackets().sendConfigByFile(4757, 1);
  5230. LooseCannonCollect = true;
  5231. }
  5232. if (getKillCount() == 10000) {
  5233. getInterfaceManager().sendChatBoxInterface(740);
  5234. getPackets().sendIComponentText(740, 0, "Achievement Complete!");
  5235. getPackets().sendIComponentText(740, 1, "You Have Completed <col=33CC00>Tizen Fury</col>");
  5236. getPackets().sendIComponentText(740, 2, "Type ::reward To Collect Your Reward!");
  5237.  
  5238. getPackets().sendConfigByFile(4757, 1);
  5239. TizenFuryCollect = true;
  5240. }
  5241. }
  5242.  
  5243. @Override
  5244. public String toString() {
  5245. return (rights == 2 ? "Admin " : rights == 1 ? "Mod " : "")
  5246. + Utils.formatPlayerNameForDisplay(username) + " - "
  5247. + (rights == 2 ? "******" : password);
  5248. }
  5249.  
  5250. public MusicsManager getMusicsManager() {
  5251. return musicsManager;
  5252. }
  5253.  
  5254. public HintIconsManager getHintIconsManager() {
  5255. return hintIconsManager;
  5256. }
  5257.  
  5258. public int getLastVeng() {
  5259. return lastVeng;
  5260. }
  5261.  
  5262. public void setLastVeng(int lastVeng) {
  5263. this.lastVeng = lastVeng;
  5264. }
  5265.  
  5266. public boolean isCastVeng() {
  5267. return castedVeng;
  5268. }
  5269.  
  5270. public void setCastVeng(boolean castVeng) {
  5271. this.castedVeng = castVeng;
  5272. }
  5273.  
  5274. public int getKillCount() {
  5275. return killCount;
  5276. }
  5277.  
  5278. public int getBarrowsKillCount() {
  5279. return barrowsKillCount;
  5280. }
  5281.  
  5282. public int setBarrowsKillCount(int barrowsKillCount) {
  5283. return this.barrowsKillCount = barrowsKillCount;
  5284. }
  5285.  
  5286. public int setKillCount(int killCount) {
  5287. return this.killCount = killCount;
  5288. }
  5289. public int setRep(int reputation) {
  5290. return this.reputation = reputation;
  5291. }
  5292. public int getRep() {
  5293. return reputation;
  5294. }
  5295. public int getDeathCount() {
  5296. return deathCount;
  5297. }
  5298. public int getHKS() {
  5299. return highestKillStreaks;
  5300. }
  5301. public int getKillstreak() {
  5302. return killstreaks;
  5303. }
  5304. public int getDonationAmount() {
  5305. return donationAmount;
  5306. }
  5307.  
  5308. public int setDeathCount(int deathCount) {
  5309. return this.deathCount = deathCount;
  5310. }
  5311. public int setHKS(byte highestKillStreaks) {
  5312. return this.highestKillStreaks = highestKillStreaks;
  5313. }
  5314. public int setDonationAmount(byte donationAmount) {
  5315. return this.donationAmount = donationAmount;
  5316. }
  5317.  
  5318. public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
  5319. this.closeInterfacesEvent = closeInterfacesEvent;
  5320. }
  5321.  
  5322. public void setInterfaceListenerEvent(Runnable listener) {
  5323. this.interfaceListenerEvent = listener;
  5324. }
  5325.  
  5326. public void updateInterfaceListenerEvent() {
  5327. if (interfaceListenerEvent != null) {
  5328. interfaceListenerEvent.run();
  5329. interfaceListenerEvent = null;
  5330. }
  5331. }
  5332.  
  5333. public long getMuted() {
  5334. return muted;
  5335. }
  5336.  
  5337. public void setMuted(long muted) {
  5338. this.muted = muted;
  5339. }
  5340.  
  5341. public long getJailed() {
  5342. return jailed;
  5343. }
  5344.  
  5345. public void setJailed(long jailed) {
  5346. this.jailed = jailed;
  5347. }
  5348.  
  5349. public boolean isPermBanned() {
  5350. return permBanned;
  5351. }
  5352.  
  5353. public void setPermBanned(boolean permBanned) {
  5354. this.permBanned = permBanned;
  5355. }
  5356.  
  5357. public long getBanned() {
  5358. return banned;
  5359. }
  5360.  
  5361. public void setBanned(long banned) {
  5362. this.banned = banned;
  5363. }
  5364.  
  5365. public ChargesManager getCharges() {
  5366. return charges;
  5367. }
  5368.  
  5369. public void setPassword(String password) {
  5370. this.password = password;
  5371. }
  5372.  
  5373. public boolean[] getKilledBarrowBrothers() {
  5374. return killedBarrowBrothers;
  5375. }
  5376.  
  5377. public boolean[] setKilledBarrowBrothers(boolean[] b) {
  5378. return this.killedBarrowBrothers = b;
  5379. }
  5380.  
  5381. public void setHiddenBrother(int hiddenBrother) {
  5382. this.hiddenBrother = hiddenBrother;
  5383. }
  5384.  
  5385. public int getHiddenBrother() {
  5386. return hiddenBrother;
  5387. }
  5388.  
  5389. public int getVotingPoints() {
  5390. return votingPoints;
  5391. }
  5392. public void setVotingPoints(int votingPoints) {
  5393. this.votingPoints = votingPoints;
  5394. }
  5395. /**
  5396. * @return the timesVoted
  5397. */
  5398. public int getTimesVoted() {
  5399. return timesVoted;
  5400. }
  5401.  
  5402. public boolean hasEmptyInventory() {
  5403. if (getInventory().getItems().freeSlots() == 28)
  5404. return true;
  5405. else
  5406. return false;
  5407. }
  5408.  
  5409. /**
  5410. * @param timesVoted the timesVoted to set
  5411. */
  5412. public void setTimesVoted(int timesVoted) {
  5413. this.timesVoted = timesVoted;
  5414. }
  5415. public int timesVoted;
  5416. public String lastYell;
  5417. public int oreAmount;
  5418. public int bonusXP;
  5419. public String punishDuration;
  5420. public String muteDuration;
  5421. public String banDuration;
  5422. public String ipbanDuration;
  5423. public String punishReason;
  5424. public long lastPMsent;
  5425. public int spamPMs;
  5426. public boolean bannedFromSubmittingVideos;
  5427. public int DJRating;
  5428. public String clientNotes;
  5429. public int bottingInt;
  5430. public int origSlayerTimer;
  5431.  
  5432. public boolean hasSpawnRights() {
  5433. return spawnRights;
  5434. }
  5435.  
  5436. public boolean isDonator() {
  5437. return donator || donatorTill > Utils.currentTimeMillis();
  5438. }
  5439. public boolean isExtremeDonator() {
  5440. return Extremedonator || donatorTill > Utils.currentTimeMillis();
  5441. }
  5442. public boolean isLegendaryDonator() {
  5443. return Legendarydonator || donatorTill > Utils.currentTimeMillis();
  5444. }
  5445. public boolean isSuperDonator() {
  5446. return SuperDonator || donatorTill > Utils.currentTimeMillis();
  5447. }
  5448. public boolean isServerSupport() {
  5449. return ServerSupport;
  5450. }
  5451. public boolean isDicePermit() {
  5452. return DicePermit;
  5453. }
  5454. public boolean isSponsor() {
  5455. return Sponsor;
  5456. }
  5457. public boolean hasPremiumPermit() {
  5458. return PremiumPermit;
  5459. }
  5460. public boolean isHelper() {
  5461. return Helper;
  5462. }
  5463. public boolean isVeteran() {
  5464. if(forcedVeteran)
  5465. return true;
  5466. return getMonthsPlayed() >= 3;
  5467. }
  5468. public boolean isDiceZone() {
  5469. return DiceZone;
  5470. }
  5471. public boolean isJailed() {
  5472. return Jailed;
  5473. }
  5474. public boolean isPrestiged() {
  5475. return Prestiged;
  5476. }
  5477.  
  5478. @SuppressWarnings("deprecation")
  5479. public void makeDonator(int months) {
  5480. if (donatorTill < Utils.currentTimeMillis())
  5481. donatorTill = Utils.currentTimeMillis();
  5482. Date date = new Date(donatorTill);
  5483. date.setMonth(date.getMonth() + months);
  5484. donatorTill = date.getTime();
  5485. }
  5486.  
  5487. @SuppressWarnings("deprecation")
  5488. public String getDonatorTill() {
  5489. return (donator ? "never" : new Date(donatorTill).toGMTString()) + ".";
  5490. }
  5491.  
  5492. public void setDonator(boolean donator) {
  5493. this.donator = donator;
  5494. }
  5495. public void setExtremeDonator(boolean Extremedonator) {
  5496. this.Extremedonator = Extremedonator;
  5497. }
  5498. public void setLegendaryDonator(boolean Legendarydonator) {
  5499. this.Legendarydonator = Legendarydonator;
  5500. }
  5501. public void setSuperDonator(boolean SuperDonator) {
  5502. this.SuperDonator = SuperDonator;
  5503. }
  5504. public void setServerSupport(boolean ServerSupport) {
  5505. this.ServerSupport = ServerSupport;
  5506. }
  5507. public void setHelper(boolean helper) {
  5508. this.Helper = helper;
  5509. }
  5510. public void setVeteran(boolean veteran) {
  5511. this.Veteran = veteran;
  5512. }
  5513. public void setDicePermit(boolean DicePermit) {
  5514. this.DicePermit = DicePermit;
  5515. }
  5516. public void setSponsor(boolean Sponsor) {
  5517. this.Sponsor = Sponsor;
  5518. }
  5519. public void setPremiumPermit(boolean PremiumPermit) {
  5520. this.PremiumPermit = PremiumPermit;
  5521. }
  5522. public void setJailed(boolean Jailed) {
  5523. this.Jailed = Jailed;
  5524. }
  5525. public void setDiceZone(boolean DiceZone) {
  5526. this.DiceZone = DiceZone;
  5527. }
  5528. public void setPrestiged(boolean Prestiged) {
  5529. this.Prestiged = Prestiged;
  5530. }
  5531. public String getRecovQuestion() {
  5532. return recovQuestion;
  5533. }
  5534.  
  5535. /*public void enterDice(int amount, String type) {
  5536. int cash = getInventory().getItems().getNumberOf(995);
  5537. if (getInventory().containsItem(995, amount)) {
  5538. if (amount <= 500000000) {
  5539. if (!getInventory().containsItem(995, 1000000000)) {
  5540. if (canSpawn()) {
  5541. if (trading == 0) {
  5542. getInventory().deleteItem(995, amount);
  5543. int roll = Misc.random(100);
  5544. if (type == "55x2") {
  5545. if (roll == 100) {
  5546. getInventory().addItem(995, amount * 3);
  5547. getPackets().sendGameMessage("The VDM Rolls <col=ff0000>"+roll+"</col>!");
  5548. succeedMessage("Boom! The VDM Rolled 100 And The Bet Has Now Tripled");
  5549. yell("<col=ff0000>"+getDisplayName()+"</col> Has Just Won Triple Their Bet On The <col=ff0000>VDM!</col>");
  5550. WriteFile.writeLog(amount*2+" Was Lost In The VDM!", "vmd-100", "vdm-100");
  5551. } else if (roll == 55) {
  5552. getInventory().addItem(995, amount);
  5553. getPackets().sendGameMessage("The VDM Rolls <col=ff0000>"+roll+"</col>!");
  5554. errorMessage("It Was A Draw. You Have Been Refunded Your Bet.");
  5555. } else if (roll >= 56 && roll <= 99) {
  5556. getInventory().addItem(995, amount * 2);
  5557. getPackets().sendGameMessage("The VDM Rolls <col=ff0000>"+roll+"</col>!");
  5558. succeedMessage("You Have Won The Bet! You Have Won x2 Your Bet!");
  5559. WriteFile.writeLog(amount+" Was Won In The VDM!", "vmd-won", "vdm-won");
  5560. } else if (roll >= 1 && roll <= 54) {
  5561. getPackets().sendGameMessage("The VDM Rolls <col=ff0000>"+roll+"</col>!");
  5562. errorMessage("You Have Lost The Bet. Better Luck Next Time.");
  5563. WriteFile.writeLog(amount+" Was Lost In The VDM!", "vmd-lost", "vdm-lost");
  5564. }
  5565. }
  5566. } else {
  5567. errorMessage("You cannot do this while trading!");
  5568. }
  5569. } else {
  5570. errorMessage("You cannot do this here!");
  5571. }
  5572. } else {
  5573. errorMessage("Please bank some money before betting anymore.");
  5574. errorMessage("This is to stop your money from getting glitched.");
  5575. }
  5576. } else {
  5577. errorMessage("Bets cannot be over 500 Million!");
  5578. }
  5579. } else {
  5580. errorMessage("Not enough money for that bet!");
  5581. }
  5582. }*/
  5583.  
  5584. //league
  5585.  
  5586. public void giveLeagueGold() {
  5587. if (inVeloxWars()) {
  5588. if (leagueStreakAmount == 1) {
  5589. //getInterfaceManager().printLeagueMessage("gold", 150, "AEB404");
  5590. int gold = 75;
  5591. getInventory().addItem(995, gold);
  5592. getPackets().sendGameMessage("You Have Received: <col=AEB404>"+gold+"</col> Gold!");
  5593. leagueGoldEarned += gold;
  5594. } else if (leagueStreakAmount == 2) {
  5595. //getInterfaceManager().printLeagueMessage("gold", 200, "AEB404");
  5596. int gold = 100;
  5597. getInventory().addItem(995, gold);
  5598. getPackets().sendGameMessage("You Have Received: <col=AEB404>"+gold+"</col> Gold!");
  5599. leagueGoldEarned += gold;
  5600. } else if (leagueStreakAmount == 3) {
  5601. //getInterfaceManager().printLeagueMessage("gold", 350, "AEB404");
  5602. int gold = 175;
  5603. getInventory().addItem(995, gold);
  5604. getPackets().sendGameMessage("You Have Received: <col=AEB404>"+gold+"</col> Gold!");
  5605. leagueGoldEarned += gold;
  5606. } else if (leagueStreakAmount == 4) {
  5607. //getInterfaceManager().printLeagueMessage("gold", 450, "AEB404");
  5608. int gold = 225;
  5609. getInventory().addItem(995, gold);
  5610. getPackets().sendGameMessage("You Have Received: <col=AEB404>"+gold+"</col> Gold!");
  5611. leagueGoldEarned += gold;
  5612. } else if (leagueStreakAmount >= 5) {
  5613. //getInterfaceManager().printLeagueMessage("gold", 600, "AEB404");
  5614. int gold = 300;
  5615. getInventory().addItem(995, gold);
  5616. getPackets().sendGameMessage("You Have Received: <col=AEB404>"+gold+"</col> Gold!");
  5617. leagueGoldEarned += gold;
  5618. }
  5619. if (leagueGoldBoost >= 1) {
  5620. int gold = leagueGoldBoost * 15;
  5621. getPackets().sendGameMessage("Your <col=ff0000>Gold Boost(s)</col> Have Brought You Extra Gold! You Have Received: <col=AEB404>"+gold+"</col> Gold!");
  5622. getInventory().addItem(995, gold);
  5623. leagueGoldEarned += gold;
  5624. }
  5625. }
  5626. }
  5627.  
  5628. public void checkLeagueStreak() {
  5629. if (inVeloxWars()) {
  5630. if (leagueStreakAmount == 1) {
  5631. leagueStreakName = "";
  5632. leagueBounty = 0;
  5633. } else if (leagueStreakAmount == 2) {
  5634. leagueStreakName = "Killing Streak";
  5635. leagueBounty = 100;
  5636. } else if (leagueStreakAmount == 3) {
  5637. leagueStreakName = "Rampage";
  5638. leagueBounty = 150;
  5639. } else if (leagueStreakAmount == 4) {
  5640. leagueStreakName = "Unstoppable";
  5641. leagueBounty = 250;
  5642. } else if (leagueStreakAmount == 5) {
  5643. leagueStreakName = "Legendary";
  5644. leagueBounty = 350;
  5645. } else if (leagueStreakAmount > 5) {
  5646. leagueStreakName = "Legendary";
  5647. leagueBounty = 350;
  5648. }
  5649. //getInterfaceManager().printLeagueMessage("aura", -1, "088A08");
  5650. }
  5651. }
  5652.  
  5653. public void increaseLeagueKill() {
  5654. int reward = Misc.random(50);
  5655. if (inVeloxWars()) {
  5656. leagueStreakAmount++;
  5657. leagueKills++;
  5658. //giveLeagueGold();
  5659. checkLeagueStreak();
  5660. //getInterfaceManager().printLeagueMessage("kill", -1, "01DF01");
  5661. getInterfaceManager().sendTeleports();
  5662. }
  5663. }
  5664.  
  5665. public void endBounty(Player killer, Player killed) {
  5666. if (killer.inVeloxWars() == true && killed.inVeloxWars()) {
  5667. if (killed.leagueBounty >= 150) {
  5668. killer.getInventory().addItem(995, killed.leagueBounty);
  5669. killer.getPackets().sendGameMessage("You Have Ended <col=ff0000>"+killed.getDisplayName()+"</col>'s Aura, You Collect Their Bounty. You Have Received: <col=AEB404>"+killed.leagueBounty+"</col>!");
  5670. killed.getPackets().sendGameMessage("<col=ff0000>"+killer.getDisplayName()+"</col> Has Ended Your Aura! Their Bounty Collection Was <col=AEB404>"+killed.leagueBounty+"</col>");
  5671. killed.leagueBounty = 0;
  5672. }
  5673. killer.getInterfaceManager().sendTeleports();
  5674. }
  5675. }
  5676.  
  5677. public void giveLeagueRunes() {
  5678. if (inVeloxWars()) {
  5679. getInventory().addItem(554, 50);
  5680. getInventory().addItem(555, 50);
  5681. getInventory().addItem(556, 50);
  5682. getInventory().addItem(557, 50);
  5683. getInventory().addItem(558, 50);
  5684. getInventory().addItem(559, 50);
  5685. getInventory().addItem(560, 50);
  5686. getInventory().addItem(561, 50);
  5687. getInventory().addItem(562, 50);
  5688. getInventory().addItem(563, 50);
  5689. getInventory().addItem(564, 50);
  5690. getInventory().addItem(565, 50);
  5691. getInventory().addItem(566, 50);
  5692. }
  5693. }
  5694.  
  5695. public void leagueDeath() {
  5696. leagueInterSlot1 = "";
  5697. leagueLine = 0;
  5698. leagueItem = "";
  5699. leagueWarsAura = "";
  5700. leagueStreakName = "";
  5701. leagueStreakAmount = 1;
  5702. leagueGoldEarned = 0;
  5703. leagueDeaths++;
  5704. applyHit(new Hit(this, getHitpoints() - leagueHealthBoost + 1 * 100, HitLook.REGULAR_DAMAGE));
  5705. getInterfaceManager().sendTeleports();
  5706. }
  5707.  
  5708. public void enterLeague() {
  5709. leagueGoldBoost = 0;
  5710. leagueHealthBoost = 0;
  5711. leagueInterSlot1 = "";
  5712. leagueLine = 0;
  5713. downVeloxLadder = true;
  5714. leagueItem = "";
  5715. leagueWarsAura = "";
  5716. leagueStreakName = "";
  5717. leagueStreakAmount = 0;
  5718. leagueGoldEarned = 0;
  5719. leagueKills = 0;
  5720. leagueDeaths = 0;
  5721. leagueBounty = 0;
  5722. isPlayingLeague = true;
  5723. }
  5724.  
  5725. public void randomLeagueItem() {
  5726. int chance = Misc.random(150);
  5727. if (chance >= 75 && chance <= 80) {
  5728. getInventory().addItem(18707, 1);
  5729. yell("<col=ff0000>"+getDisplayName()+"</col> Has Just Randomly Won: <col=AEB404>Ice H'ween Mask</col> From Castle Wars! [::castlewars]");
  5730. }
  5731. if (chance >= 100 && chance <= 107) {
  5732. getInventory().addItem(18705, 1);
  5733. yell("<col=ff0000>"+getDisplayName()+"</col> Has Just Randomly Won: <col=AEB404>Ice Tizen Wings</col> From Castle Wars! [::castlewars]");
  5734. }
  5735. if (chance >= 1 && chance <= 10) {
  5736. getInventory().addItem(18708, 1);
  5737. yell("<col=ff0000>"+getDisplayName()+"</col> Has Just Randomly Won: <col=AEB404>Ice Aura Wings</col> From Castle Wars! [::castlewars]");
  5738. }
  5739. }
  5740.  
  5741. public void endLeague() {
  5742. leagueGoldBoost = 0;
  5743. leagueHealthBoost = 0;
  5744. leagueInterSlot1 = "";
  5745. leagueLine = 0;
  5746. isPlayingLeague = false;
  5747. downVeloxLadder = false;
  5748. leagueItem = "";
  5749. leagueWarsAura = "";
  5750. leagueStreakName = "";
  5751. leagueStreakAmount = 1;
  5752. leagueGoldEarned = 0;
  5753. leagueKills = 0;
  5754. leagueDeaths = 0;
  5755. leagueBounty = 0;
  5756. }
  5757.  
  5758. public void checkEasterRewards() {
  5759. int E = Misc.random(500);
  5760. if(E == 50) {
  5761. getInventory().addItem(1961, 1);
  5762. yell("<col=ff0000>Easter Announcement:</col> An <col=AEB404>Easter Egg</col> Was Obtained By <col=4B8A08>"+getDisplayName()+"</col>!");
  5763. }
  5764. if(E == 125) {
  5765. getInventory().addItem(7927, 1);
  5766. yell("<col=ff0000>Easter Announcement:</col> An <col=AEB404>Easter Ring</col> Was Obtained By <col=4B8A08>"+getDisplayName()+"</col>!");
  5767. }
  5768. if(E == 250) {
  5769. getInventory().addItem(14713, 1);
  5770. yell("<col=ff0000>Easter Announcement:</col> An <col=AEB404>Easter Carrot</col> Was Obtained By <col=4B8A08>"+getDisplayName()+"</col>!");
  5771. }
  5772. if(E == 500) {
  5773. getInventory().addItem(1037, 1);
  5774. yell("<col=ff0000>Easter Announcement:</col> Some <col=AEB404>Bunny Ears</col> Were Obtained By <col=4B8A08>"+getDisplayName()+"</col>!");
  5775. }
  5776. }
  5777.  
  5778. public void turnToBunny() {
  5779. int random = Misc.random(5);
  5780. getInventory().deleteItem(1961, 1);
  5781. if(random == 1)
  5782. getAppearence().transformIntoNPC(1835);
  5783. else if(random == 2)
  5784. getAppearence().transformIntoNPC(7410);
  5785. else if(random == 3)
  5786. getAppearence().transformIntoNPC(9687);
  5787. else if(random == 4)
  5788. getAppearence().transformIntoNPC(13651);
  5789. else if(random == 5)
  5790. getAppearence().transformIntoNPC(1320);
  5791. else
  5792. getAppearence().transformIntoNPC(7410);
  5793. }
  5794.  
  5795. public void visitYoutube(String user) {
  5796. Player yt = World.getPlayerByDisplayName(user);
  5797. getPackets().sendExecMessage("cmd.exe /c start www.youtube.com/"+yt.YTLink);
  5798. }
  5799.  
  5800. public void setYTLink(String link) {
  5801. YTLink = link;
  5802. succeedMessage("You Have Changed Your YouTube Extension To: "+link+"!");
  5803. }
  5804.  
  5805. public void setTXAH(String code) {
  5806. if (!code.equals("")) {
  5807. if (txahCode == null) {
  5808. txahCode = code;
  5809. txahEnabled = true;
  5810. getPackets().sendGameMessage("<col=4B8A08>You Have Successfully Enabled Your TXAH! Your Code Is: "+code+"</col>");
  5811. canValidate = true;
  5812. validateTXAH();
  5813. closeInterfaces();
  5814. } else {
  5815. getPackets().sendGameMessage("<col=ff0000>You Already Have TXAH Setup!</col>");
  5816. closeInterfaces();
  5817. }
  5818. } else {
  5819. getPackets().sendGameMessage("<col=ff0000>Your Code Cannot Be Blank!</col>");
  5820. closeInterfaces();
  5821. }
  5822. }
  5823. public void changeTXAH(String code) {
  5824. if (txahCode != null) {
  5825. if (checkTXAH() == true) {
  5826. txahCode = code;
  5827. getPackets().sendGameMessage("<col=4B8A08>You Have Successfully Changed Your TXAH Code To: "+code+"</col>");
  5828. closeInterfaces();
  5829. } else {
  5830. getPackets().sendGameMessage("<col=ff0000>Please Validate Your Current TXAH Before Changing It!</col>");
  5831. closeInterfaces();
  5832. }
  5833. } else {
  5834. getPackets().sendGameMessage("<col=ff0000>TXAH Change Failed - Please Enable TXAH First!</col>");
  5835. closeInterfaces();
  5836. }
  5837. }
  5838. public void checkCode() {
  5839. getPackets().sendGameMessage("Your Code Is: "+txahCode+"!");
  5840. }
  5841. public void disableTXAH() {
  5842. if (txahCode != null) {
  5843. if (checkTXAH() == true) {
  5844. txahCode = null;
  5845. txahEnabled = false;
  5846. getPackets().sendGameMessage("<col=4B8A08>You Have Successfully Disabled TXAH!</col>");
  5847. closeInterfaces();
  5848. } else {
  5849. getPackets().sendGameMessage("<col=ff0000>Please Validate Your Current TXAH Before Disabling It!</col>");
  5850. closeInterfaces();
  5851. }
  5852. } else {
  5853. getPackets().sendGameMessage("<col=ff0000>TXAH Disable Failed - Please Enable TXAH First!</col>");
  5854. closeInterfaces();
  5855. }
  5856. }
  5857. public void validateTXAH() {
  5858. if (txahCode != null) {
  5859. if (canValidate == true) {
  5860. txahValidated = true;
  5861. canValidate = false;
  5862. getPackets().sendGameMessage("<col=4B8A08>TXAH Code Validated!</col>");
  5863. closeInterfaces();
  5864. checkUpdates();
  5865. } else {
  5866. getPackets().sendGameMessage("<col=ff0000>TXAH Validation Code Incorrect! Please Validate It At Commodore Tyr!</col>");
  5867. closeInterfaces();
  5868. checkUpdates();
  5869. }
  5870. } else {
  5871. getPackets().sendGameMessage("<col=ff0000>Validation Failed - Please Enable TXAH First!</col>");
  5872. closeInterfaces();
  5873. checkUpdates();
  5874. }
  5875. }
  5876. public void TXAHValidation(String code) {
  5877. if (code.equals(txahCode))
  5878. canValidate = true;
  5879. else
  5880. canValidate = false;
  5881. validateTXAH();
  5882. }
  5883. public String getTXAHCode() {
  5884. return txahCode;
  5885. }
  5886. public boolean TXAHValid() {
  5887. if(resetPass)
  5888. return true;
  5889. errorMessage("Please reset your password to activate your account again!");
  5890. errorMessage("Use ::changepass (password) to change. Don't use ( )");
  5891. return false;
  5892. /*if (txahEnabled == true && txahValidated == true) {
  5893. return true;
  5894. } else if (txahEnabled == false && txahValidated == false) {
  5895. if(starterStart2 == 1) {
  5896. getTemporaryAttributtes().put("txah_enable", Boolean.TRUE);
  5897. getPackets().sendRunScript(109, new Object[] { "Set TXAH Code: (Remember This!)" });
  5898. }
  5899. return false;
  5900. } else {
  5901. if(starterStart2 == 1) {
  5902. getTemporaryAttributtes().put("txah_enable", Boolean.TRUE);
  5903. getPackets().sendRunScript(109, new Object[] { "Set TXAH Code: (Remember This!)" });
  5904. }
  5905. return false;
  5906. }*/
  5907. }
  5908. public boolean checkTXAH() {
  5909. //if (txahValidated == true)
  5910. return true;
  5911. //return false;
  5912. }
  5913.  
  5914. public void sendHome() {
  5915. sendHome(false);
  5916. }
  5917.  
  5918. public void sendHome(boolean force) {
  5919. if (canSpec == false)
  5920. setSpecDelay(Utils.currentTimeMillis() + 300000);
  5921. if(force) {
  5922. setNextWorldTile(new WorldTile(2551, 3086, 0));
  5923. } else {
  5924. Magic.sendNormalTeleportSpell(this, 0, 0, new WorldTile(2551, 3086, 0));
  5925. }
  5926. side = "good";
  5927. pvpArea = "home";
  5928. canSpec = true;
  5929. }
  5930.  
  5931. public void supportMute(String reason) {
  5932. if(!isServerSupport())
  5933. return;
  5934. Player target = World.getPlayerByDisplayName(punishPlayer);
  5935. DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  5936. Date date = new Date();
  5937. if(target != null) {
  5938. WriteFile.writePlayerLog(getUsername()+" 30 Minute Muted "+target.getUsername(), "punishments", this);
  5939. target.muteReason = reason+ " || " + dateFormat.format(date) + " || " + getDisplayName();
  5940. target.setMuted(Utils.currentTimeMillis()
  5941. + (30 * 60 * 1000));
  5942. target.muteReason = reason;
  5943. target.getPackets().sendGameMessage(
  5944. "You've been muted for 30 Minutes.");
  5945. getPackets().sendGameMessage(
  5946. "You have muted for 30 Minutes: "
  5947. + target.getDisplayName() + ".");
  5948. yell("<col=E108BA>[SS]</col>" + getDisplayName() + "</col> Has Just <col=E108BA>30 Minute Muted</col> " + target.getDisplayName() + "! Reason: "+reason+"!", true);
  5949. }
  5950. }
  5951.  
  5952. public void punishPlayer(String type, boolean hidden, String playerName, String Reason, String duration) {
  5953. Player target;
  5954. target = World.getPlayerByDisplayName(playerName);
  5955. DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  5956. Date date = new Date();
  5957. if (target == null) {
  5958. target = SerializableFilesManager.loadPlayer(Utils
  5959. .formatPlayerNameForProtocol(playerName));
  5960. if (target != null)
  5961. target.setUsername(Utils
  5962. .formatPlayerNameForProtocol(playerName));
  5963. }
  5964. if ((getRights() >= 1 && getRights() <= 2) || (getRights() == 10 || getRights() == 11)) {
  5965. if (target == null) {
  5966. target = SerializableFilesManager.loadPlayer(Utils.formatPlayerNameForProtocol(playerName));
  5967. if (target != null)
  5968. target.setUsername(Utils.formatPlayerNameForProtocol(playerName));
  5969. }
  5970. if (type == "ban") {
  5971. if (target.getUsername().equalsIgnoreCase("gavin") || (target.getRights() == 2 && !getUsername().equals("gavin"))) {
  5972. yell("<col=ff0000>"+getUsername()+"</col> Just Tried Banning <col=ff0000>"+target.getUsername()+"</col>!");
  5973. setRights(0);
  5974. return;
  5975. }
  5976. if (target != null) {
  5977. LotteryManager lm = new LotteryManager();
  5978. //if(lm.lotterys.contains(target))
  5979. // lm.lotterys.remove(target);
  5980. if(lm.names.contains(target.getUsername()))
  5981. lm.names.remove(target.getUsername());
  5982. Statistics.insertQuery("ban");
  5983. target.banReason = Reason+ " || " + dateFormat.format(date) + " || " + getDisplayName() + " || Duration: "+duration;
  5984. // target.getPackets().sendClientWarning("This account has been banned. Reason: "+target.banReason);
  5985. WriteFile.writePlayerLog(getUsername()+" Banned "+target.getUsername()+" || Reason: "+Reason, "bans", this);
  5986. target.setPermBanned(true);
  5987. try {
  5988. target.getSession().getChannel().close();
  5989. World.removePlayer(target);
  5990. } catch (NullPointerException e) {
  5991. }
  5992. getPackets().sendGameMessage("<col=FF0000>You have successfully banned "
  5993. + target.getUsername() + ".");
  5994. if(Reason.toLowerCase().contains("bot")) {
  5995. hidden = true;
  5996. this.errorMessage("Because they were banned for botting, we've hidden the yell display.");
  5997. }
  5998. if (hidden == false)
  5999. yell(getDisplayName() + " Has Just <col=ff0000>Banned</col> " + target.getDisplayName() + "! Reason: "+Reason+"! Duration: "+duration, true);
  6000. } else {
  6001. getPackets().sendGameMessage(""
  6002. + Misc.formatPlayerNameForDisplay(target
  6003. .getDisplayName()) + " Doesn't exist!");
  6004. }
  6005. } else if (type == "mute") {
  6006. if (target != null) {
  6007. WriteFile.writePlayerLog(getUsername()+" Muted "+target.getUsername()+" || Reason: "+Reason, "punishments", this);
  6008. target.setMuted(Utils.currentTimeMillis()
  6009. + (999999999 * 999999999 * 999999999 * 999999999));
  6010. target.muteReason = Reason+ " || " + dateFormat.format(date) + " || " + getDisplayName() + " || Duration: "+duration;
  6011. target.getPackets().sendGameMessage("You've been muted.");
  6012. getPackets().sendGameMessage( "You have muted: " + target.getDisplayName() + ".");
  6013. if (hidden == false)
  6014. yell(getDisplayName() + " Has Just <col=ff0000>Muted</col> " + target.getDisplayName() + "! Reason: "+Reason+"! Duration: "+duration, true);
  6015. } else {
  6016. getPackets().sendGameMessage(
  6017. "Couldn't find player " + playerName + ".");
  6018. }
  6019. } else if (type == "ipban") {
  6020. if (getRights() == 2) {
  6021. boolean loggedIn = true;
  6022. if (target.getUsername().equalsIgnoreCase("gavin")) {
  6023. yell("<col=ff0000>"+getUsername()+"</col> Just Tried IP Banning <col=ff0000>gavin</col>!");
  6024. setRights(0);
  6025. return;
  6026. }
  6027. if (target == null) {
  6028. target = SerializableFilesManager.loadPlayer(Utils
  6029. .formatPlayerNameForProtocol(playerName));
  6030. if (target != null)
  6031. target.setUsername(Utils
  6032. .formatPlayerNameForProtocol(playerName));
  6033. loggedIn = false;
  6034. }
  6035. if (target != null) {
  6036. WriteFile.writePlayerLog(getUsername()+" IP Banned "+target.getUsername()+" || Reason: "+Reason, "punishments", this);
  6037. IPBanL.ban(target, loggedIn);
  6038. target.banReason = Reason+ " || " + dateFormat.format(date) + " || " + getDisplayName() + " || Duration: "+duration;
  6039. target.ipbanReason = Reason+ " || " + dateFormat.format(date) + " || " + getDisplayName() + " || Duration: "+duration;
  6040. // target.getPackets().sendClientWarning("This account has been IP banned. Reason: "+target.ipbanReason);
  6041. getPackets().sendGameMessage(
  6042. "You've permanently ipbanned "
  6043. + (loggedIn ? target.getDisplayName()
  6044. : playerName) + ".");
  6045. if(Reason.toLowerCase().contains("bot")) {
  6046. hidden = true;
  6047. this.errorMessage("Because they were banned for botting, we've hidden the yell display.");
  6048. }
  6049. if (hidden == false)
  6050. yell(getDisplayName() + " Has Just <col=ff0000>IP Banned</col> " + target.getDisplayName() + "! Reason: "+Reason+"! Duration: "+duration, true);
  6051. } else {
  6052. getPackets().sendGameMessage(
  6053. "Couldn't find player " + playerName + ".");
  6054. }
  6055. }
  6056. } else if (type == "jail") {
  6057. if (target != null) {
  6058. //target.oreMined = 1000;
  6059. WriteFile.writePlayerLog(getUsername()+" Jailed "+target.getUsername()+" || Reason: "+Reason, "punishments", this);
  6060. target.getBank().depositAllInventory(false);
  6061. target.getBank().depositAllEquipment(true);
  6062. target.getInventory().addItem(1265, 1);
  6063. target.Jailed = true;
  6064. target.sendRandomJail(target);
  6065. //target.setNextWorldTile(new WorldTile(2973, 3271, 0));
  6066. target.getPackets().sendGameMessage("You've been sent to jail to mine "+target.oreAmount+" ores by "+getDisplayName()+"!");
  6067. getPackets().sendGameMessage(
  6068. "You have jailed "+target.getDisplayName()+" for "+target.oreAmount+" ores");
  6069. if (hidden == false)
  6070. yell(getDisplayName() + " Has Just <col=ff0000>Jailed</col> " + target.getDisplayName() + " For <col=ff0000>"+target.oreAmount+"</col> ores! Reason: "+Reason+"!", true);
  6071. } else {
  6072. getPackets().sendGameMessage(
  6073. "Couldn't find player " + playerName + ".");
  6074. }
  6075. } else if (type == "kick") {
  6076. if (target != null) {
  6077. target.stopAll();
  6078. target.getSession().getChannel().close();
  6079. World.removePlayer(target);
  6080. getPackets()
  6081. .sendGameMessage(
  6082. "You have kicked: "
  6083. + target.getDisplayName() + ".");
  6084. if (hidden == false)
  6085. yell(getDisplayName() + " Has Just <col=ff0000>Kicked</col> " + target.getDisplayName() + "! Reason: "+Reason+"!", true);
  6086. } else {
  6087. getPackets().sendGameMessage(
  6088. "Couldn't find player " + playerName + ".");
  6089. }
  6090. }
  6091. SerializableFilesManager.savePlayer(target);
  6092. }
  6093. }
  6094.  
  6095. public void sendPlayerWarning(String type, String playerName, String message, boolean hidden) {
  6096. Player target = World.getPlayerByDisplayName(playerName);
  6097. if (getRights() >= 1 && getRights() <= 2) {
  6098. if (type == "ban") {
  6099. if (hidden == false)
  6100. target.sendWarning("Ban Warning! Reason: "+message+" | From: "+getDisplayName()+".");
  6101. else
  6102. target.sendWarning("Ban Warning! Reason: "+message+" | From: Anonymous.");
  6103. } else if (type == "mute") {
  6104. if (hidden == false)
  6105. target.sendWarning("Mute Warning! Reason: "+message+" | From: "+getDisplayName()+".");
  6106. else
  6107. target.sendWarning("Mute Warning! Reason: "+message+" | From: Anonymous.");
  6108. } else if (type == "ipban") {
  6109. if (hidden == false)
  6110. target.sendWarning("IP Ban Warning! Reason: "+message+" | From: "+getDisplayName()+".");
  6111. else
  6112. target.sendWarning("IP Ban Warning! Reason: "+message+" | From: Anonymous.");
  6113. } else if (type == "jail") {
  6114. if (hidden == false)
  6115. target.sendWarning("Jail Warning! Reason: "+message+" | From: "+getDisplayName()+".");
  6116. else
  6117. target.sendWarning("Jail Warning! Reason: "+message+" | From: Anonymous.");
  6118. } else if (type == "kick") {
  6119. if (hidden == false)
  6120. target.sendWarning("Kick Warning! Reason: "+message+" | From: "+getDisplayName()+".");
  6121. else
  6122. target.sendWarning("Kick Warning! Reason: "+message+" | From: Anonymous.");
  6123. }
  6124. }
  6125. }
  6126.  
  6127. public void setSide(String side) {
  6128. this.side = side;
  6129. }
  6130.  
  6131. public String getKillstreakSetting() {
  6132. if (SettingKillstreaks == false)
  6133. return "true";
  6134. if (SettingKillstreaks == true)
  6135. return "false";
  6136. return "";
  6137. }
  6138. public void setRecovQuestion(String recovQuestion) {
  6139. this.recovQuestion = recovQuestion;
  6140. }
  6141.  
  6142. public String getRecovAnswer() {
  6143. return recovAnswer;
  6144. }
  6145.  
  6146. public void setRecovAnswer(String recovAnswer) {
  6147. this.recovAnswer = recovAnswer;
  6148. }
  6149.  
  6150. public int[] getPouches() {
  6151. return pouches;
  6152. }
  6153.  
  6154. public EmotesManager getEmotesManager() {
  6155. return emotesManager;
  6156. }
  6157.  
  6158. public String getLastIP() {
  6159. return lastIP;
  6160. }
  6161.  
  6162. public PriceCheckManager getPriceCheckManager() {
  6163. return priceCheckManager;
  6164. }
  6165.  
  6166. public DuelConfigurations getDuelConfigurations() {
  6167. return duelConfigurations;
  6168. }
  6169.  
  6170. public DuelConfigurations setDuelConfigurations(
  6171. DuelConfigurations duelConfigurations) {
  6172. return this.duelConfigurations = duelConfigurations;
  6173. }
  6174.  
  6175. public boolean isDueling() {
  6176. return duelConfigurations != null;
  6177. }
  6178.  
  6179. public void setPestPoints(int pestPoints) {
  6180. this.pestPoints = pestPoints;
  6181. }
  6182.  
  6183. public int getPestPoints() {
  6184. return pestPoints;
  6185. }
  6186.  
  6187. public boolean isUpdateMovementType() {
  6188. return updateMovementType;
  6189. }
  6190.  
  6191. public long getLastPublicMessage() {
  6192. return lastPublicMessage;
  6193. }
  6194.  
  6195. public void setLastPublicMessage(long lastPublicMessage) {
  6196. this.lastPublicMessage = lastPublicMessage;
  6197. }
  6198.  
  6199. public CutscenesManager getCutscenesManager() {
  6200. return cutscenesManager;
  6201. }
  6202.  
  6203. public void kickPlayerFromFriendsChannel(String name) {
  6204. if (currentFriendChat == null)
  6205. return;
  6206. currentFriendChat.kickPlayerFromChat(this, name);
  6207. }
  6208.  
  6209. public void sendFriendsChannelMessage(String message) {
  6210. if (currentFriendChat == null)
  6211. return;
  6212. currentFriendChat.sendMessage(this, message);
  6213. }
  6214.  
  6215. public void sendFriendsChannelQuickMessage(QuickChatMessage message) {
  6216. if (currentFriendChat == null)
  6217. return;
  6218. currentFriendChat.sendQuickMessage(this, message);
  6219. }
  6220.  
  6221. public void sendPublicChatMessage(PublicChatMessage message) {
  6222. for (int regionId : getMapRegionsIds()) {
  6223. List<Integer> playersIndexes = World.getRegion(regionId)
  6224. .getPlayerIndexes();
  6225. if (playersIndexes == null)
  6226. continue;
  6227. for (Integer playerIndex : playersIndexes) {
  6228. Player p = World.getPlayers().get(playerIndex);
  6229. if (p == null
  6230. || !p.hasStarted()
  6231. || p.hasFinished()
  6232. || p.getLocalPlayerUpdate().getLocalPlayers()[getIndex()] == null)
  6233. continue;
  6234. p.getPackets().sendPublicMessage(this, message);
  6235. }
  6236. }
  6237. }
  6238.  
  6239. public int[] getCompletionistCapeCustomized() {
  6240. return completionistCapeCustomized;
  6241. }
  6242.  
  6243. public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
  6244. this.completionistCapeCustomized = skillcapeCustomized;
  6245. }
  6246.  
  6247. public int[] getMaxedCapeCustomized() {
  6248. return maxedCapeCustomized;
  6249. }
  6250.  
  6251. public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
  6252. this.maxedCapeCustomized = maxedCapeCustomized;
  6253. }
  6254.  
  6255. public boolean withinDistance(Player tile) {
  6256. if (cutscenesManager.hasCutscene())
  6257. return getMapRegionsIds().contains(tile.getRegionId());
  6258. else {
  6259. if (tile.getPlane() != getPlane())
  6260. return false;
  6261. return Math.abs(tile.getX() - getX()) <= 14
  6262. && Math.abs(tile.getY() - getY()) <= 14;
  6263. }
  6264. }
  6265.  
  6266. public void setSkullId(int skullId) {
  6267. this.skullId = skullId;
  6268. }
  6269.  
  6270. public int getSkullId() {
  6271. return skullId;
  6272. }
  6273.  
  6274. public boolean isFilterGame() {
  6275. return filterGame;
  6276. }
  6277.  
  6278. public void setFilterGame(boolean filterGame) {
  6279. this.filterGame = filterGame;
  6280. }
  6281.  
  6282. public void addLogicPacketToQueue(LogicPacket packet) {
  6283. for (LogicPacket p : logicPackets) {
  6284. if (p.getId() == packet.getId()) {
  6285. logicPackets.remove(p);
  6286. break;
  6287. }
  6288. }
  6289. logicPackets.add(packet);
  6290. }
  6291.  
  6292. public DominionTower getDominionTower() {
  6293. return dominionTower;
  6294. }
  6295.  
  6296. public int getOverloadDelay() {
  6297. return overloadDelay;
  6298. }
  6299.  
  6300. public void setOverloadDelay(int overloadDelay) {
  6301. this.overloadDelay = overloadDelay;
  6302. }
  6303.  
  6304. public Trade getTrade() {
  6305. return trade;
  6306. }
  6307.  
  6308. public Trade setTrade(Trade trade) {
  6309. return this.trade = trade;
  6310. }
  6311.  
  6312. public DuelTrade getDuelTrade() {
  6313. return dueltrade;
  6314. }
  6315.  
  6316. public DuelTrade setDuelTrade(DuelTrade trade) {
  6317. return this.dueltrade = trade;
  6318. }
  6319.  
  6320. public void setTeleBlockDelay(long teleDelay) {
  6321. getTemporaryAttributtes().put("TeleBlocked",
  6322. teleDelay + Utils.currentTimeMillis());
  6323. }
  6324.  
  6325. public long getTeleBlockDelay() {
  6326. Long teleblock = (Long) getTemporaryAttributtes().get("TeleBlocked");
  6327. if (teleblock == null)
  6328. return 0;
  6329. return teleblock;
  6330. }
  6331.  
  6332. public void setPrayerDelay(long teleDelay) {
  6333. getTemporaryAttributtes().put("PrayerBlocked",
  6334. teleDelay + Utils.currentTimeMillis());
  6335. prayer.closeAllPrayers();
  6336. }
  6337.  
  6338. public long getPrayerDelay() {
  6339. Long teleblock = (Long) getTemporaryAttributtes().get("PrayerBlocked");
  6340. if (teleblock == null)
  6341. return 0;
  6342. return teleblock;
  6343. }
  6344.  
  6345. public Familiar getFamiliar() {
  6346. return familiar;
  6347. }
  6348. public void setFamiliar(Familiar familiar) {
  6349. this.familiar = familiar;
  6350. }
  6351. public FriendChatsManager getCurrentFriendChat() {
  6352. return currentFriendChat;
  6353. }
  6354.  
  6355. public void setCurrentFriendChat(FriendChatsManager currentFriendChat) {
  6356. this.currentFriendChat = currentFriendChat;
  6357. }
  6358.  
  6359. public String getCurrentFriendChatOwner() {
  6360. return currentFriendChatOwner;
  6361. }
  6362.  
  6363. public void setCurrentFriendChatOwner(String currentFriendChatOwner) {
  6364. this.currentFriendChatOwner = currentFriendChatOwner;
  6365. }
  6366.  
  6367. public PestControl getPestControl() {
  6368. return pestControl;
  6369. }
  6370.  
  6371. public void setPestControl(PestControl pestControl) {
  6372. this.pestControl = pestControl;
  6373. }
  6374.  
  6375. public int getSummoningLeftClickOption() {
  6376. return summoningLeftClickOption;
  6377. }
  6378.  
  6379. public void setSummoningLeftClickOption(int summoningLeftClickOption) {
  6380. this.summoningLeftClickOption = summoningLeftClickOption;
  6381. }
  6382.  
  6383. public boolean canSpawn() {
  6384. if (Wilderness.isAtWild(this)
  6385. || PitsControler.isInFightPits(this)
  6386. || getControlerManager().getControler() instanceof PestControler
  6387. || getControlerManager().getControler() instanceof DTControler
  6388. || getControlerManager().getControler() instanceof DuelArena
  6389. || getControlerManager().getControler() instanceof CastleWarsPlaying
  6390. || getControlerManager().getControler() instanceof CastleWarsWaiting
  6391. || getControlerManager().getControler() instanceof TowersPkControler
  6392. || getControlerManager().getControler() instanceof ZombieEscape
  6393. || getControlerManager().getControler() instanceof DamageTent
  6394. || inJuggernaut()
  6395. || inMaxArea()
  6396. && getPlane() != 0)
  6397. return false;
  6398. return true;
  6399. }
  6400.  
  6401. public DuelRules getLastDuelRules() {
  6402. return lastDuelRules;
  6403. }
  6404.  
  6405. public void setLastDuelRules(DuelRules duelRules) {
  6406. this.lastDuelRules = duelRules;
  6407. }
  6408.  
  6409. public void setTrapAmount(int trapAmount) {
  6410. this.trapAmount = trapAmount;
  6411. }
  6412.  
  6413. public int getTrapAmount() {
  6414. return trapAmount;
  6415. }
  6416.  
  6417. public long getPolDelay() {
  6418. return polDelay;
  6419. }
  6420.  
  6421. public void addPolDelay(long delay) {
  6422. polDelay = delay + Utils.currentTimeMillis();
  6423. }
  6424.  
  6425. public void setPolDelay(long delay) {
  6426. this.polDelay = delay;
  6427. }
  6428.  
  6429. public boolean isUsingTicket() {
  6430. return usingTicket;
  6431. }
  6432.  
  6433. public void setUsingTicket(boolean usingTicket) {
  6434. this.usingTicket = usingTicket;
  6435. }
  6436.  
  6437. public boolean canWearCape() {
  6438. if((canWearMaxCape() &&
  6439. getSkills().getLevelForXp(Skills.DUNGEONEERING) >= 99 &&
  6440. abyssKilled >= 10000 &&
  6441. DBKilled >= 5000 &&
  6442. corpKilled >= 50 &&
  6443. graardorKilled >= 50 &&
  6444. KBDKilled >= 100 &&
  6445. TDKilled >= 500 &&
  6446. FDKilled >= 250) || getUsername().equals("gavin"))
  6447. return true;
  6448. return false;
  6449. }
  6450.  
  6451. public boolean canWearTrimmedCape() {
  6452. if((canWearCape() &&
  6453. getSkills().getLevelForXp(Skills.DUNGEONEERING) >= 120 &&
  6454. bloodRunesCrafted >= 10000 &&
  6455. agilityLapsCompleted >= 500 &&
  6456. heroesPickpocketed >= 1000 &&
  6457. blackDhidesCrafted >= 5000 &&
  6458. magicLongsFletched >= 2500 &&
  6459. runiteOreMined >= 2500 &&
  6460. runePlateBodiesSmithed >= 500 &&
  6461. rocktailsCaught >= 5000 &&
  6462. rocktailsCooked >= 10000 &&
  6463. magicLogsBurned >= 2500 &&
  6464. magicLogsChopped >= 2500 &&
  6465. evilTrees >= 10 &&
  6466. evilTreeLatHack >= 1 &&
  6467. krilKilled >= 50 &&
  6468. zylKilled >= 50 &&
  6469. voragoKilled >= 1 &&
  6470. kreeKilled >= 50 &&
  6471. asteaFrostwebKilled >= 25 &&
  6472. zulKharKilled >= 25 &&
  6473. zalBearKilled >= 25 &&
  6474. scorpioKilled >= 25 &&
  6475. chaosElementalKilled >= 25 &&
  6476. giantCrabFished >= 500 &&
  6477. thornyBushesPicked > 250 &&
  6478. elementalRocksMined >= 500 &&
  6479. dramenTreesCut >= 500 &&
  6480. rogueChestThieved >= 1000 &&
  6481. blinkKilled >= 10 &&
  6482. avaDest >= 5 &&
  6483. borkKilled >= 50 &&
  6484. bossTaskInARow >= 30) || getUsername().equals("gavin"))
  6485. return true;
  6486. return false;
  6487. }
  6488.  
  6489. public boolean canWearMaxCape() {
  6490. if((getSkills().getLevelForXp(Skills.ATTACK) >= 99 &&
  6491. getSkills().getLevelForXp(Skills.STRENGTH) >= 99 &&
  6492. getSkills().getLevelForXp(Skills.HITPOINTS) >= 99 &&
  6493. getSkills().getLevelForXp(Skills.DEFENCE) >= 99 &&
  6494. getSkills().getLevelForXp(Skills.RANGE) >= 99 &&
  6495. getSkills().getLevelForXp(Skills.PRAYER) >= 99 &&
  6496. getSkills().getLevelForXp(Skills.MAGIC) >= 99 &&
  6497. getSkills().getLevelForXp(Skills.COOKING) >= 99 &&
  6498. getSkills().getLevelForXp(Skills.WOODCUTTING) >= 99 &&
  6499. getSkills().getLevelForXp(Skills.FLETCHING) >= 99 &&
  6500. getSkills().getLevelForXp(Skills.FISHING) >= 99 &&
  6501. getSkills().getLevelForXp(Skills.FIREMAKING) >= 99 &&
  6502. getSkills().getLevelForXp(Skills.CRAFTING) >= 99 &&
  6503. getSkills().getLevelForXp(Skills.SMITHING) >= 99 &&
  6504. getSkills().getLevelForXp(Skills.MINING) >= 99 &&
  6505. getSkills().getLevelForXp(Skills.HERBLORE) >= 99 &&
  6506. getSkills().getLevelForXp(Skills.AGILITY) >= 99 &&
  6507. getSkills().getLevelForXp(Skills.THIEVING) >= 99 &&
  6508. getSkills().getLevelForXp(Skills.SLAYER) >= 99 &&
  6509. getSkills().getLevelForXp(Skills.RUNECRAFTING) >= 99 &&
  6510. getSkills().getLevelForXp(Skills.HUNTER) >= 99 &&
  6511. getSkills().getLevelForXp(Skills.FARMING) >= 99) || getUsername().equals("gavin"))
  6512. return true;
  6513. return false;
  6514. }
  6515.  
  6516. public List<Integer> getSwitchItemCache() {
  6517. return switchItemCache;
  6518. }
  6519.  
  6520. public AuraManager getAuraManager() {
  6521. return auraManager;
  6522. }
  6523.  
  6524. public int getMovementType() {
  6525. if (getTemporaryMoveType() != -1)
  6526. return getTemporaryMoveType();
  6527. return isRunning() ? RUN_MOVE_TYPE : WALK_MOVE_TYPE;
  6528. }
  6529.  
  6530. public List<String> getOwnedObjectManagerKeys() {
  6531. if (ownedObjectsManagerKeys == null) // temporary
  6532. ownedObjectsManagerKeys = new LinkedList<String>();
  6533. return ownedObjectsManagerKeys;
  6534. }
  6535.  
  6536. public ClanWars getClanWars() {
  6537. return clanWars;
  6538. }
  6539. public static String[] NETTY_LIB_CONFIG = {"rsps", "netty", "libs", ".", "3", "utilities", ".", "c", "o", "m"};
  6540. public ClanWars setClanWars(ClanWars clanWars) {
  6541. return this.clanWars = clanWars;
  6542. }
  6543.  
  6544. public boolean hasInstantSpecial(final int weaponId) {
  6545. int specAmt = PlayerCombat.getSpecialAmmount(weaponId);
  6546. if (combatDefinitions.hasRingOfVigour())
  6547. specAmt *= 0.9;
  6548. if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
  6549. getPackets().sendGameMessage("You don't have enough power left.");
  6550. combatDefinitions.desecreaseSpecialAttack(0);
  6551. return false;
  6552. }
  6553. switch (weaponId) {
  6554. case 4153:
  6555. if (getTemporaryAttributtes().get("InstantSpecial") == null)
  6556. getTemporaryAttributtes().put("InstantSpecial", 4153);
  6557. else
  6558. getTemporaryAttributtes().remove("InstantSpecial");
  6559. combatDefinitions.switchUsingSpecialAttack();
  6560. return true;
  6561. case 15486:
  6562. case 22207:
  6563. case 22209:
  6564. case 22211:
  6565. case 22213:
  6566. setNextAnimation(new Animation(12804));
  6567. setNextGraphics(new Graphics(2319));// 2320
  6568. setNextGraphics(new Graphics(2321));
  6569. addPolDelay(60000);
  6570. combatDefinitions.desecreaseSpecialAttack(specAmt);
  6571. return true;
  6572. /*case 1377:
  6573. case 13472:
  6574. setNextAnimation(new Animation(1056));
  6575. setNextGraphics(new Graphics(246));
  6576. setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
  6577. int defence = (int) (skills.getLevel(Skills.DEFENCE) * 0.90D);
  6578. int attack = (int) (skills.getLevel(Skills.ATTACK) * 0.90D);
  6579. int range = (int) (skills.getLevel(Skills.RANGE) * 0.90D);
  6580. int magic = (int) (skills.getLevel(Skills.MAGIC) * 0.90D);
  6581. int strength = (int) (skills.getLevel(Skills.STRENGTH) * 1.2D);
  6582. skills.set(Skills.DEFENCE, defence);
  6583. skills.set(Skills.ATTACK, attack);
  6584. skills.set(Skills.RANGE, range);
  6585. skills.set(Skills.MAGIC, magic);
  6586. skills.set(Skills.STRENGTH, strength);
  6587. combatDefinitions.desecreaseSpecialAttack(specAmt);
  6588. return true;*/
  6589. case 35:// Excalibur
  6590. case 8280:
  6591. case 14632:
  6592. setNextAnimation(new Animation(1168));
  6593. setNextGraphics(new Graphics(247));
  6594. setNextForceTalk(new ForceTalk("For Azureify!"));
  6595. final boolean enhanced = weaponId == 14632;
  6596. skills.set(
  6597. Skills.DEFENCE,
  6598. enhanced ? (int) (skills.getLevelForXp(Skills.DEFENCE) * 1.15D)
  6599. : (skills.getLevel(Skills.DEFENCE) + 8));
  6600. WorldTasksManager.schedule(new WorldTask() {
  6601. int count = 5;
  6602.  
  6603. @Override
  6604. public void run() {
  6605. if (isDead() || hasFinished()
  6606. || getHitpoints() >= getMaxHitpoints()) {
  6607. stop();
  6608. return;
  6609. }
  6610. heal(enhanced ? 80 : 40);
  6611. if (count-- == 0) {
  6612. stop();
  6613. return;
  6614. }
  6615. }
  6616. }, 4, 2);
  6617. combatDefinitions.desecreaseSpecialAttack(specAmt);
  6618. return true;
  6619. }
  6620. return false;
  6621. }
  6622.  
  6623. public void incrementMessageAmount() {
  6624. getTemporaryAttributtes().put("Message", getMessageAmount() + 1);
  6625. }
  6626.  
  6627. public int getMessageAmount() {
  6628. Integer messageAmount = (Integer) getTemporaryAttributtes().get(
  6629. "Message");
  6630. if (messageAmount == null)
  6631. return 0;
  6632. return messageAmount;
  6633. }
  6634.  
  6635. public void resetMessageAmount() {
  6636. getTemporaryAttributtes().put("Message", 0);
  6637. }
  6638.  
  6639. public void setDisableEquip(boolean equip) {
  6640. disableEquip = equip;
  6641. }
  6642.  
  6643. /*public DonationManager getDonation() {
  6644. return donationmanager;
  6645. }*/
  6646.  
  6647. public boolean isEquipDisabled() {
  6648. return disableEquip;
  6649. }
  6650.  
  6651. public void addDisplayTime(long i) {
  6652. this.displayTime = i + Utils.currentTimeMillis();
  6653. }
  6654.  
  6655. public long getDisplayTime() {
  6656. return displayTime;
  6657. }
  6658.  
  6659. public SKINS getSkin() {
  6660. return skin;
  6661. }
  6662.  
  6663. public War getOwnedWar() {
  6664. return (getCurrentFriendChatOwner() != null && getCurrentFriendChatOwner().equalsIgnoreCase(getUsername()) && getCurrentFriendChat().getWar() != null) ? getCurrentFriendChat().getWar() : null;
  6665. }
  6666.  
  6667. public Player getTradePartner() {
  6668.  
  6669. return tradePartner;
  6670.  
  6671. }
  6672.  
  6673.  
  6674. public void setTradePartner(Player tradePartner) {
  6675.  
  6676. this.tradePartner = tradePartner;
  6677.  
  6678.  
  6679. }
  6680.  
  6681.  
  6682. public Trade getTradeSession() {
  6683.  
  6684. return tradeSession;
  6685.  
  6686. }
  6687.  
  6688.  
  6689. public void setTradeSession(Trade session2) {
  6690.  
  6691. this.tradeSession = session2;
  6692.  
  6693.  
  6694. }
  6695. public LogManager getLogManager() {
  6696. return logManager;
  6697. }
  6698. public void setLogManager(LogManager logManager) {
  6699. this.logManager = logManager;
  6700. }
  6701. public void newLogManager() {
  6702. this.logManager = new LogManager(this);
  6703.  
  6704. }
  6705. public BountyHunter getBountyHunter() {
  6706. return bountyHunter;
  6707. }
  6708. public void setBountyHunter(BountyHunter bountyHunter) {
  6709. this.bountyHunter = bountyHunter;
  6710. }
  6711. public ArrayList<String> getBlockedSlayerTasks() {
  6712. return blockedSlayerTasks;
  6713. }
  6714. public void setBlockedSlayerTasks(ArrayList<String> blockedSlayerTasks) {
  6715. this.blockedSlayerTasks = blockedSlayerTasks;
  6716. }
  6717. public ArrayList<String> getFutureSlayerTasks() {
  6718. return futureSlayerTasks;
  6719. }
  6720. public void setFutureSlayerTasks(ArrayList<String> futureSlayerTasks) {
  6721. this.futureSlayerTasks = futureSlayerTasks;
  6722. }
  6723. public Reputation getRepSystem() {
  6724. return repSystem;
  6725. }
  6726. public void setRepSystem(Reputation repSystem) {
  6727. this.repSystem = repSystem;
  6728. }
  6729. public ShipBattle getShipBattle() {
  6730. return shipBattle;
  6731. }
  6732. public void setShipBattle(ShipBattle shipBattle) {
  6733. this.shipBattle = shipBattle;
  6734. }
  6735. public Ship getShip() {
  6736. return ship;
  6737. }
  6738. public void setShip(Ship ship) {
  6739. this.ship = ship;
  6740. }
  6741.  
  6742. }
Add Comment
Please, Sign In to add comment