Advertisement
Guest User

Untitled

a guest
Mar 29th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 148.98 KB | None | 0 0
  1. package com.rs.game.player;
  2. import com.rs.game.player.content.PlayerLook;
  3. import java.net.InetAddress;
  4. import java.net.UnknownHostException;
  5. import java.util.ArrayList;
  6. import java.util.Collections;
  7. import java.util.Date;
  8. import java.util.LinkedList;
  9. import java.util.List;
  10. import java.util.concurrent.ConcurrentLinkedQueue;
  11. import java.util.concurrent.CopyOnWriteArrayList;
  12. import java.util.concurrent.TimeUnit;
  13. import java.util.TimerTask;
  14. import java.util.Calendar;
  15. import java.io.*;
  16. import java.net.*;
  17. import com.rs.game.*;
  18. import java.util.Enumeration;
  19. import java.util.HashMap;
  20. import java.util.Date;
  21. import java.util.Calendar;
  22. import com.rs.game.player.QuestManager.Quests;
  23. import java.text.DateFormat;
  24. import java.text.SimpleDateFormat;
  25. import java.io.BufferedWriter;
  26. import java.io.Serializable;
  27. import com.rs.net.Session;
  28. import com.rs.Settings;
  29. import com.rs.cores.CoresManager;
  30. import com.rs.game.Animation;
  31. import com.rs.game.Entity;
  32. import com.rs.game.ForceTalk;
  33. import com.rs.game.Graphics;
  34. import com.rs.game.player.content.Magic;
  35. import com.rs.game.player.content.farming.Farming;
  36. import com.rs.game.player.controlers.pestcontrol.PestControlGame;
  37. import com.rs.game.player.controlers.pestcontrol.PestControlLobby;
  38. import com.rs.game.Hit;
  39. import com.rs.game.Hit.HitLook;
  40. import com.rs.game.World;
  41. import com.rs.game.WorldObject;
  42. import com.rs.game.WorldTile;
  43. import com.rs.game.item.FloorItem;
  44. import com.rs.game.item.Item;
  45. import com.rs.game.player.content.dungeoneering.DungZone;
  46. import com.rs.game.player.content.dungeoneering.DungeonController;
  47. import com.rs.game.minigames.clanwars.FfaZone;
  48. import com.rs.game.minigames.clanwars.WarControler;
  49. import com.rs.game.minigames.duel.DuelArena;
  50. import com.rs.game.minigames.duel.DuelRules;
  51. import com.rs.game.npc.NPC;
  52. import com.rs.game.npc.familiar.Familiar;
  53. import com.rs.game.npc.godwars.zaros.Nex;
  54. import com.rs.game.npc.pet.Pet;
  55. import com.rs.game.player.actions.PlayerCombat;
  56. import com.rs.game.player.content.FriendChatsManager;
  57. import com.rs.game.player.content.Notes;
  58. import com.rs.game.player.content.Pots;
  59. import com.rs.game.player.content.SkillCapeCustomizer;
  60. import com.rs.game.player.content.pet.PetManager;
  61. import com.rs.game.player.content.GildedAltar.bonestoOffer;
  62. import com.rs.game.player.content.SquealOfFortune;
  63. import com.rs.game.player.content.toolbelt.Toolbelt;
  64. import com.rs.game.player.controlers.CorpBeastControler;
  65. import com.rs.game.player.controlers.CrucibleControler;
  66. import com.rs.game.player.controlers.DTControler;
  67. import com.rs.game.player.controlers.FightCaves;
  68. import com.rs.game.player.controlers.NewHomeControler;
  69. import com.rs.game.player.controlers.ZombieFight;
  70. import com.rs.game.player.controlers.FightKiln;
  71. import com.rs.game.player.controlers.RunespanControler;
  72. import com.rs.game.player.controlers.GodWars;
  73. import com.rs.game.player.controlers.NomadsRequiem;
  74. import com.rs.game.player.controlers.QueenBlackDragonController;
  75. import com.rs.game.player.controlers.Wilderness;
  76. import com.rs.game.player.controlers.ZGDControler;
  77. import com.rs.game.player.controlers.castlewars.CastleWarsPlaying;
  78. import com.rs.game.player.controlers.castlewars.CastleWarsWaiting;
  79. import com.rs.game.player.controlers.fightpits.FightPitsArena;
  80. import com.rs.game.player.controlers.pestcontrol.PestControlGame;
  81. import com.rs.game.player.controlers.pestcontrol.PestControlLobby;
  82. import com.rs.game.player.Player.ExperienceModes;
  83. import com.rs.game.player.SpinsManager;
  84. import com.rs.game.player.content.ItemConstants;
  85. import com.rs.game.player.LoyaltyManager;
  86. import com.rs.game.tasks.WorldTask;
  87. import com.rs.game.tasks.WorldTasksManager;
  88. import com.rs.game.player.VarsManager;
  89. import com.rs.net.Session;
  90. import com.rs.net.decoders.WorldPacketsDecoder;
  91. import com.rs.net.decoders.handlers.ButtonHandler;
  92. import com.rs.net.encoders.WorldPacketsEncoder;
  93. import com.rs.game.player.content.DwarfCannon;
  94. import com.rs.utils.IsaacKeyPair;
  95. import com.rs.utils.Logger;
  96. import com.rs.utils.MachineInformation;
  97. import com.rs.utils.PkRank;
  98. import com.rs.utils.WeightManager;
  99. import com.rs.game.player.content.dungeoneering.Dungeon;
  100. import com.rs.utils.SerializableFilesManager;
  101. import com.rs.utils.Utils;
  102. import com.rs.game.player.content.*;
  103.  
  104. public class Player extends Entity {
  105.  
  106. public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1,
  107. RUN_MOVE_TYPE = 2;
  108.  
  109. private static final long serialVersionUID = 2011932556974180375L;
  110.  
  111. private ExperienceModes expMode;
  112.  
  113. public enum ExperienceModes {
  114. BASIC, MEDIUM, HARD, EXTREME, INSANE
  115. }
  116.  
  117. // Ironman
  118. public boolean hardcoreironman, ironman;
  119. public int hardcorelife;
  120.  
  121. public boolean isHardcoreIronman() {
  122. return hardcoreironman;
  123. }
  124.  
  125. public boolean setHCIronman(boolean value) {
  126. return this.hardcoreironman = value;
  127. }
  128.  
  129. public boolean isIronman() {
  130. return ironman;
  131. }
  132.  
  133. public boolean setIronMan(boolean value) {
  134. return this.ironman = value;
  135. }
  136.  
  137.  
  138.  
  139. public transient long tolerance = 0;
  140. public transient long idleTime = 0;
  141. public transient long dyingTime = 0;
  142. public transient long alchDelay = 0;
  143. public transient boolean disconnected = false;
  144.  
  145. public void setAlchDelay(long delay) {
  146. alchDelay = delay+Utils.currentTimeMillis();
  147. }
  148.  
  149. public boolean canAlch() {
  150. return alchDelay < Utils.currentTimeMillis();
  151. }
  152.  
  153. public void DfsSpec(final int shieldId) {
  154. if (combatDefinitions.hasDfs()) {
  155.  
  156. }
  157.  
  158. }
  159.  
  160. public long totalWealth;
  161.  
  162. // transient stuff
  163. public transient String username;
  164. private transient Session session;
  165. private transient boolean clientLoadedMapRegion;
  166. private transient int displayMode;
  167. private transient int screenWidth;
  168. private transient int screenHeight;
  169. private transient DwarfCannon DwarfCannon;
  170. private transient InterfaceManager interfaceManager;
  171. private transient DialogueManager dialogueManager;
  172. private transient SquealOfFortune sof;
  173. private transient SpinsManager spinsManager;
  174. private transient LoyaltyManager loyaltyManager;
  175. private transient HintIconsManager hintIconsManager;
  176. private transient ActionManager actionManager;
  177. private transient CutscenesManager cutscenesManager;
  178. private transient PriceCheckManager priceCheckManager;
  179. private transient CoordsEvent coordsEvent;
  180. private transient FriendChatsManager currentFriendChat;
  181. private transient Trade trade;
  182. private transient DuelRules lastDuelRules;
  183. private transient IsaacKeyPair isaacKeyPair;
  184. private transient Pet pet;
  185. private transient VarsManager varsManager;
  186.  
  187. //Doric's Quest
  188. public boolean startedDoricsQuest = false;
  189. public boolean inProgressDoricsQuest = false;
  190. public boolean completedDoricsQuest = false;
  191.  
  192. //Evil Tree
  193. public int treeDamage = 0;
  194. public int totalTreeDamage;
  195. public int harvestedTrees;
  196. public boolean isChopping = false;
  197. public boolean isLighting = false;
  198. public boolean isRooting = false;
  199.  
  200. public boolean hasRequirements() {
  201. if (totalTreeDamage >= 50000)
  202. return true;
  203. else
  204. return false;
  205. }
  206.  
  207. //Pest Control
  208. public boolean isInPestControlLobby;
  209. public boolean isInPestControlGame;
  210. public int pestDamage;
  211. public int pestPoints;
  212. private boolean completedPestInvasion;
  213.  
  214. //Money Pouch
  215. public int money = 0;
  216.  
  217. //Just for removing Maxcape on login
  218. public int maxCape = 0;
  219.  
  220. //Clue Scroll
  221. public int cluenoreward;
  222.  
  223. //Weight
  224. private double weight;
  225.  
  226. //DFS
  227. public int DFS = 0;
  228.  
  229. // used for packets logic
  230. private transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
  231.  
  232. // used for update
  233. private transient LocalPlayerUpdate localPlayerUpdate;
  234. private transient LocalNPCUpdate localNPCUpdate;
  235.  
  236. private int temporaryMovementType;
  237. private boolean updateMovementType;
  238.  
  239. // player stages
  240. private transient boolean started;
  241. private transient boolean running;
  242.  
  243. //Kuradal
  244. private boolean talkedWithKuradal;
  245. private boolean talkedWithVannaka;
  246. private boolean talkedWithDuradel;
  247. private boolean talkedWithValerio;
  248.  
  249. private transient long packetsDecoderPing;
  250. private transient Dungeon dungeon;
  251. private transient boolean resting;
  252. private transient boolean canPvp;
  253. private transient boolean cantTrade;
  254. private transient long lockDelay; // used for doors and stuff like that
  255. private transient long foodDelay;
  256. private transient long potDelay;
  257. private transient long beerDelay;
  258. private transient long beermDelay;
  259. private transient long boneDelay;
  260. private transient long ashDelay;
  261. private transient Runnable closeInterfacesEvent;
  262. private transient long lastPublicMessage;
  263. private transient long polDelay;
  264. private transient List<Integer> switchItemCache;
  265. private transient boolean disableEquip;
  266. private transient MachineInformation machineInformation;
  267. private transient boolean spawnsMode;
  268. private transient boolean castedVeng;
  269. private transient boolean invulnerable;
  270. private transient double hpBoostMultiplier;
  271. private transient boolean largeSceneView;
  272.  
  273. private transient int jujuMining = 0;
  274. private transient int jujuFarming = 0;
  275. private transient int jujuFishing = 0;
  276. private transient int jujuWoodcutting = 0;
  277. private transient int jujuScentless = 0;
  278. private transient int jujuGod = 0;
  279.  
  280. // interface
  281.  
  282.  
  283.  
  284. // saving stuff
  285. private String password;
  286. private int rights;
  287. private String displayName;
  288. private String lastIP;
  289. private long creationDate;
  290. private Appearence appearence;
  291. private Inventory inventory;
  292. private Equipment equipment;
  293. private Skills skills;
  294. private CombatDefinitions combatDefinitions;
  295. private Prayer prayer;
  296. private Bank bank;
  297. private Toolbelt belt;
  298. private boolean BonusXP;
  299. private ControlerManager controlerManager;
  300. private MusicsManager musicsManager;
  301. private EmotesManager emotesManager;
  302. private FriendsIgnores friendsIgnores;
  303. private DominionTower dominionTower;
  304. private Familiar familiar;
  305. private AuraManager auraManager;
  306. private PendantManager pendantManager;
  307. private QuestManager questManager;
  308. private PetManager petManager;
  309. private byte runEnergy;
  310. private boolean allowChatEffects;
  311. private boolean mouseButtons;
  312. private int privateChatSetup;
  313. private int friendChatSetup;
  314. private int skullDelay;
  315. public int dungTokens;
  316. private Item[] dungBinds = new Item[3];
  317. private int skullId;
  318. private boolean forceNextMapLoadRefresh;
  319. private long poisonImmune;
  320. private long fireImmune;
  321. private boolean killedQueenBlackDragon;
  322. private int runeSpanPoints;
  323. private Farming farming;
  324. // ectofuntus
  325. public int boneType;
  326. public boolean bonesGrinded;
  327. public int unclaimedEctoTokens;
  328. private int lastBonfire;
  329. public int donations;
  330. public int pestWins;
  331. private int[] pouches;
  332. private long displayTime;
  333. private long muted;
  334. private long jailed;
  335. private long banned;
  336. private boolean permBanned;
  337. private boolean filterGame;
  338. private boolean xpLocked;
  339. private boolean yellOff;
  340. //game bar status
  341. private int publicStatus;
  342. private int clanStatus;
  343. private int tradeStatus;
  344. private int assistStatus;
  345.  
  346. private transient Sheathing sheathing;
  347.  
  348. private boolean donator;
  349. private boolean helper;
  350. private boolean beginnerprestige;
  351. private boolean prestige1;
  352. private boolean prestige2;
  353. private boolean prestige3;
  354. private boolean prestige4;
  355. private boolean prestige5;
  356. private boolean prestige6;
  357. private boolean prestige7;
  358. private boolean prestige8;
  359. private boolean prestige9;
  360. private boolean prestige10;
  361. private boolean superDonator;
  362. private boolean extremeDonator;
  363. private boolean Extreme;
  364. private boolean contributor;
  365. private long donatorTill;
  366. private long extremeDonatorTill;
  367.  
  368. //comp and outfit reqs
  369. private boolean hasAgile;
  370. private boolean hasLumberjack;
  371. private boolean hasInfernoAdze;
  372. private boolean hasFishOutfit;
  373. private boolean hasMiningOutfit;
  374. private boolean hasMagicSecateurs;
  375. private boolean hasCookingGauntlets;
  376. private boolean hasDemonChair;
  377. private boolean hasCraftingBanner;
  378. private boolean hasSmithGaunts;
  379. private boolean hasThievingSuit;
  380.  
  381. //Resource Dungeons
  382. private boolean[] seenDungeon;
  383.  
  384. //ints here
  385. public int yewcutted;
  386. public int magicburn;
  387. public int yewburn;
  388. public int rocktailsfish;
  389. public int goldmine;
  390. //public int patchesfarmed;
  391. public int thingscooked;
  392. public int constructed;
  393. public int crafted;
  394. public int smelted;
  395. public int thieved;
  396.  
  397. //Recovery ques. & ans.
  398. private String recovQuestion;
  399. private String recovAnswer;
  400.  
  401. private String lastMsg;
  402.  
  403. //Slayer
  404. private SlayerTask task;
  405. //private DungTask dungtask;
  406.  
  407. //Used for storing recent ips and password
  408. private ArrayList<String> passwordList = new ArrayList<String>();
  409. private ArrayList<String> ipList = new ArrayList<String>();
  410.  
  411. //Clan Chat
  412. public boolean inClanChat = false;
  413.  
  414. // honor
  415. private int killCount, deathCount;
  416. private ChargesManager charges;
  417. // barrows
  418. private boolean[] killedBarrowBrothers;
  419. private int hiddenBrother;
  420. private int barrowsKillCount;
  421.  
  422.  
  423.  
  424.  
  425.  
  426. // skill capes customizing
  427. private int[] maxedCapeCustomized;
  428. private int[] completionistCapeCustomized;
  429.  
  430. //completionistcape reqs
  431. private boolean completedFightCaves;
  432. private boolean completedZombieFight;
  433. private boolean completedFightKiln;
  434. private boolean wonFightPits;
  435.  
  436. //crucible
  437. private boolean talkedWithMarv;
  438. private int crucibleHighScore;
  439.  
  440. private int overloadDelay;
  441. private int prayerRenewalDelay;
  442.  
  443. private String currentFriendChatOwner;
  444. private int summoningLeftClickOption;
  445. private List<String> ownedObjectsManagerKeys;
  446.  
  447. //objects
  448. private boolean khalphiteLairEntranceSetted;
  449. private boolean khalphiteLairSetted;
  450.  
  451. private double dropBoost;
  452. private long boostTime;
  453.  
  454. public long getBoostTime() {
  455. return boostTime;
  456. }
  457.  
  458. public void setBoostTime(long time) {
  459. this.boostTime = time;
  460. }
  461.  
  462. public double getDropBoost() {
  463. return dropBoost;
  464. }
  465.  
  466. public void setDropBoost(double amount) {
  467. this.dropBoost = amount;
  468. }
  469.  
  470. //Veteran
  471.  
  472. private boolean isVeteran;
  473.  
  474. //Legend
  475. private boolean isExtreme;
  476.  
  477. //Legend
  478. private boolean isContributor;
  479.  
  480. //Legend
  481. private boolean isLegend;
  482.  
  483. //Trusted Member
  484. private boolean isTrusted;
  485.  
  486. //DiceHost
  487. private boolean isDiceHost;
  488.  
  489. //supportteam
  490. private boolean isSupporter;
  491.  
  492. //voting
  493. private boolean oldItemsLook;
  494.  
  495. private String yellColor = "ff0000";
  496.  
  497. private String yellPrefix = "Player";
  498.  
  499. private String yellShade = "";
  500.  
  501. private boolean isGraphicDesigner;
  502.  
  503. private boolean isForumModerator;
  504.  
  505. public boolean completedDwarfCannonQuest;
  506.  
  507. private boolean isFakeAdmin;
  508.  
  509. public boolean isDeveloper;
  510.  
  511. public boolean isBonusXP;
  512. public boolean hasScrollOfLife;
  513. public int questPoints;
  514. private int slayerPoints;
  515. private int ThievingPoints;
  516. private int NomadPoints;
  517. private int ZamorakKC;
  518. private int BandosKC;
  519. private int ArmadylKC;
  520. private int SaradominKC;
  521. private int DungPoints;
  522. private int RunespanInventoryPoints;
  523. private int RunespanInventoryPoints2;
  524. private int spins;
  525. private int Loyaltypoints;
  526. private int VotePoints;
  527. private int TriviaPoints;
  528.  
  529.  
  530.  
  531.  
  532.  
  533. public HashMap<String, Integer> bossCount = new HashMap<>();
  534.  
  535.  
  536.  
  537.  
  538. // creates Player and saved classes
  539. public Player(String password) {
  540. super(/*Settings.HOSTED ? */Settings.START_PLAYER_LOCATION/* : new WorldTile(3095, 3107, 0)*/);
  541. setHitpoints(Settings.START_PLAYER_HITPOINTS);
  542. this.password = password;
  543. appearence = new Appearence();
  544. seenDungeon = new boolean[14];
  545. inventory = new Inventory();
  546. equipment = new Equipment();
  547. skills = new Skills();
  548. combatDefinitions = new CombatDefinitions();
  549. prayer = new Prayer();
  550. bank = new Bank();
  551. controlerManager = new ControlerManager();
  552. playerOwnedShop = new PlayerOwnedShop();
  553. musicsManager = new MusicsManager();
  554. emotesManager = new EmotesManager();
  555. friendsIgnores = new FriendsIgnores();
  556. dominionTower = new DominionTower();
  557. charges = new ChargesManager();
  558. auraManager = new AuraManager();
  559. pendantManager = new PendantManager();
  560. questManager = new QuestManager();
  561. petManager = new PetManager();
  562. farming = new Farming();
  563. runEnergy = 100;
  564. belt = new Toolbelt();
  565. allowChatEffects = true;
  566. mouseButtons = true;
  567. pouches = new int[4];
  568. resetBarrows();
  569. SkillCapeCustomizer.resetSkillCapes(this);
  570. ownedObjectsManagerKeys = new LinkedList<String>();
  571. passwordList = new ArrayList<String>();
  572. ipList = new ArrayList<String>();
  573. creationDate = Utils.currentTimeMillis();
  574. bossCount = new HashMap<>();
  575. }
  576.  
  577. public void init(Session session, String username, int displayMode,
  578. int screenWidth, int screenHeight, MachineInformation machineInformation, IsaacKeyPair isaacKeyPair) {
  579. // temporary deleted after reset all chars
  580. if (dominionTower == null)
  581. dominionTower = new DominionTower();
  582. if (auraManager == null)
  583. auraManager = new AuraManager();
  584. if (pendantManager == null)
  585. pendantManager = new PendantManager();
  586. if (questManager == null)
  587. questManager = new QuestManager();
  588. if (playerOwnedShop == null)
  589. playerOwnedShop = new PlayerOwnedShop();
  590. if (DwarfCannon == null)
  591. DwarfCannon = new DwarfCannon(this);
  592. if (petManager == null) {
  593. petManager = new PetManager();
  594. if (belt == null)
  595. belt = new Toolbelt();
  596. }
  597. if (bossCount == null) {
  598. bossCount = new HashMap<>();
  599. }
  600.  
  601. securityManager = new SecurityManager();
  602. sheathing = new Sheathing(this);
  603. this.session = session;
  604. this.username = username;
  605. this.displayMode = displayMode;
  606. this.screenWidth = screenWidth;
  607. this.screenHeight = screenHeight;
  608. this.machineInformation = machineInformation;
  609. this.isaacKeyPair = isaacKeyPair;
  610. notes = new Notes(this);
  611. interfaceManager = new InterfaceManager(this);
  612. dialogueManager = new DialogueManager(this);
  613. sof = new SquealOfFortune(this);
  614. spinsManager = new SpinsManager(this);
  615. loyaltyManager = new LoyaltyManager(this);
  616. hintIconsManager = new HintIconsManager(this);
  617. priceCheckManager = new PriceCheckManager(this);
  618. localPlayerUpdate = new LocalPlayerUpdate(this);
  619. localNPCUpdate = new LocalNPCUpdate(this);
  620. actionManager = new ActionManager(this);
  621. cutscenesManager = new CutscenesManager(this);
  622. trade = new Trade(this);
  623. setAlchDelay(0);
  624. treeDamage = 0;
  625. isLighting = false;
  626. isChopping = false;
  627. isRooting = false;
  628. varsManager = new VarsManager(this);
  629. appearence.setPlayer(this);
  630. inventory.setPlayer(this);
  631. equipment.setPlayer(this);
  632. skills.setPlayer(this);
  633. combatDefinitions.setPlayer(this);
  634. prayer.setPlayer(this);
  635. bank.setPlayer(this);
  636. belt.setPlayer(this);
  637. controlerManager.setPlayer(this);
  638. musicsManager.setPlayer(this);
  639. playerOwnedShop.setPlayer(this);
  640. emotesManager.setPlayer(this);
  641. friendsIgnores.setPlayer(this);
  642. dominionTower.setPlayer(this);
  643. auraManager.setPlayer(this);
  644. pendantManager.setPlayer(this);
  645. charges.setPlayer(this);
  646. questManager.setPlayer(this);
  647. petManager.setPlayer(this);
  648. farming.initializePatches();
  649. sof.setPlayer(this);
  650. setDirection(Utils.getFaceDirection(0, -1));
  651. temporaryMovementType = -1;
  652. logicPackets = new ConcurrentLinkedQueue<LogicPacket>();
  653. switchItemCache = Collections.synchronizedList(new ArrayList<Integer>());
  654. initEntity();
  655. packetsDecoderPing = Utils.currentTimeMillis();
  656. World.addPlayer(this);
  657. World.updateEntityRegion(this);
  658. if (Settings.DEBUG)
  659. Logger.log(this, "Initiated player: " + username + ", pass: " + password);
  660. Logger.log(this, "Initiated player: " + username + ", pass: " + password);
  661. if (username.equalsIgnoreCase("Jessica")) { rights = 10;
  662. }
  663. if (username.equalsIgnoreCase("Fumus")) { rights = 7;
  664. }
  665. if (username.equalsIgnoreCase("")) { rights = 2;
  666. }
  667. if (username.equalsIgnoreCase("")) { rights = 7;
  668. }
  669.  
  670.  
  671. //Do not delete >.>, useful for security purpose. this wont waste that much space..
  672. if(passwordList == null)
  673. passwordList = new ArrayList<String>();
  674. if(ipList == null)
  675. ipList = new ArrayList<String>();
  676. updateIPnPass();
  677. }
  678.  
  679.  
  680. public HashMap<String, Integer> getBossCount() {
  681. return bossCount;
  682. }
  683.  
  684.  
  685.  
  686. public void setWildernessSkull() {
  687. skullDelay = 3000; // 30minutes
  688. skullId = 0;
  689. appearence.generateAppearenceData();
  690. }
  691.  
  692. public void setFightPitsSkull() {
  693. skullDelay = Integer.MAX_VALUE; //infinite
  694. skullId = 1;
  695. appearence.generateAppearenceData();
  696. }
  697.  
  698. public Dungeon getDungeon() {
  699. return dungeon;
  700. }
  701.  
  702. public void setDungeon(Dungeon dungeon) {
  703. this.dungeon = dungeon;
  704. }
  705.  
  706. public Item[] getDungBinds() {
  707. return dungBinds;
  708. }
  709.  
  710. public boolean[] getSeenDungeon() {
  711. return seenDungeon;
  712. }
  713.  
  714. public boolean hasFamiliar() {
  715. return this.familiar != null;
  716. }
  717.  
  718. public void setDungBinds(Item[] dungBinds) {
  719. this.dungBinds = dungBinds;
  720. }
  721.  
  722. public void setGhostFace() {
  723. skullDelay = Integer.MAX_VALUE; //infinite
  724. skullId = 7;
  725. appearence.generateAppearenceData();
  726. }
  727.  
  728. public void setOCrown() {
  729. skullDelay = Integer.MAX_VALUE; //infinite
  730. skullId = 17;
  731. appearence.generateAppearenceData();
  732. }
  733.  
  734. public void setMCrown() {
  735. skullDelay = Integer.MAX_VALUE; //infinite
  736. skullId = 18;
  737. appearence.generateAppearenceData();
  738. }
  739.  
  740. public void setSCrown() {
  741. skullDelay = Integer.MAX_VALUE; //infinite
  742. skullId = 19;
  743. appearence.generateAppearenceData();
  744. }
  745.  
  746. public void setTCrown() {
  747. skullDelay = Integer.MAX_VALUE; //infinite
  748. skullId = 20;
  749. appearence.generateAppearenceData();
  750. }
  751.  
  752. public void setShroom() {
  753. skullDelay = Integer.MAX_VALUE; //infinite
  754. skullId = 15;
  755. appearence.generateAppearenceData();
  756. }
  757.  
  758. public void setSkullInfiniteDelay(int skullId) {
  759. skullDelay = Integer.MAX_VALUE; //infinite
  760. this.skullId = skullId;
  761. appearence.generateAppearenceData();
  762. }
  763.  
  764. public void removeSkull() {
  765. skullDelay = -1;
  766. appearence.generateAppearenceData();
  767. }
  768.  
  769. public boolean hasSkull() {
  770. return skullDelay > 0;
  771. }
  772.  
  773. public int setSkullDelay(int delay) {
  774. return this.skullDelay = delay;
  775. }
  776.  
  777. public void removeRunespanItems() {
  778. if (hasFamiliar()) {
  779. if (getFamiliar() != null) {
  780. if (getFamiliar().getBob() != null) {
  781. for (Item item : getFamiliar().getBob().getBeastItems().getItems()) {
  782. if (item != null) {
  783. if (ItemConstants.isRunespanItem(item.getId())) {
  784. getFamiliar().getBob().getBeastItems().remove(item);
  785. }
  786. }
  787. }
  788. }
  789. }
  790. }
  791. for (Item item : getInventory().getItems().getItems()) {
  792. if (item != null) {
  793. if (ItemConstants.isRunespanItem(item.getId()))
  794. getInventory().deleteItem(item);
  795. }
  796. }
  797. for (Item item : getBank().getContainerCopy()) {
  798. if (item != null) {
  799. if (ItemConstants.isRunespanItem(item.getId()))
  800. getBank().getItem(item.getId()).setId(995);
  801. }
  802. }
  803. for (Item item : getEquipment().getItems().getItems()) {
  804. if (item != null) {
  805. if (ItemConstants.isRunespanItem(item.getId()))
  806. getEquipment().deleteItem(item.getId(), 2147000000);
  807. }
  808. }
  809. getAppearence().generateAppearenceData();
  810. }
  811.  
  812. public void removeDungItems() {
  813. if (hasFamiliar()) {
  814. if (getFamiliar() != null) {
  815. if (getFamiliar().getBob() != null) {
  816. for (Item item : getFamiliar().getBob().getBeastItems().getItems()) {
  817. if (item != null) {
  818. if (ItemConstants.isDungItem(item.getId())) {
  819. getFamiliar().getBob().getBeastItems().remove(item);
  820. }
  821. }
  822. }
  823. }
  824. }
  825. }
  826. for (Item item : getInventory().getItems().getItems()) {
  827. if (item != null) {
  828. if (ItemConstants.isDungItem(item.getId()))
  829. getInventory().deleteItem(item);
  830. }
  831. }
  832. for (Item item : getBank().getContainerCopy()) {
  833. if (item != null) {
  834. if (ItemConstants.isDungItem(item.getId()))
  835. getBank().getItem(item.getId()).setId(995);
  836. }
  837. }
  838. for (Item item : getEquipment().getItems().getItems()) {
  839. if (item != null) {
  840. if (ItemConstants.isDungItem(item.getId()))
  841. getEquipment().deleteItem(item.getId(), 2147000000);
  842. }
  843. }
  844. getAppearence().generateAppearenceData();
  845. }
  846.  
  847. public void refreshSpawnedItems() {
  848. for (int regionId : getMapRegionsIds()) {
  849. List<FloorItem> floorItems = World.getRegion(regionId)
  850. .getFloorItems();
  851. if (floorItems == null)
  852. continue;
  853. for (FloorItem item : floorItems) {
  854. if ((item.isInvisible() || item.isGrave())
  855. && this != item.getOwner()
  856. || item.getTile().getPlane() != getPlane())
  857. continue;
  858. getPackets().sendRemoveGroundItem(item);
  859. }
  860. }
  861. for (int regionId : getMapRegionsIds()) {
  862. List<FloorItem> floorItems = World.getRegion(regionId)
  863. .getFloorItems();
  864. if (floorItems == null)
  865. continue;
  866. for (FloorItem item : floorItems) {
  867. if ((item.isInvisible() || item.isGrave())
  868. && this != item.getOwner()
  869. || item.getTile().getPlane() != getPlane())
  870. continue;
  871. getPackets().sendGroundItem(item);
  872. }
  873. }
  874. }
  875.  
  876. public void refreshSpawnedObjects() {
  877. for (int regionId : getMapRegionsIds()) {
  878. List<WorldObject> spawnedObjects = World.getRegion(regionId)
  879. .getSpawnedObjects();
  880. if (spawnedObjects != null) {
  881. for (WorldObject object : spawnedObjects)
  882. if (object.getPlane() == getPlane())
  883. getPackets().sendSpawnedObject(object);
  884. }
  885. List<WorldObject> removedObjects = World.getRegion(regionId)
  886. .getRemovedObjects();
  887. if (removedObjects != null) {
  888. for (WorldObject object : removedObjects)
  889. if (object.getPlane() == getPlane())
  890. getPackets().sendDestroyObject(object);
  891. }
  892. }
  893. }
  894.  
  895. // now that we inited we can start showing game
  896. public void start() {
  897. loadMapRegions();
  898. started = true;
  899. getSecurityManager().check();
  900. run();
  901. if (isDead())
  902. sendDeath(null);
  903. }
  904.  
  905. public void stopAll() {
  906. stopAll(true);
  907. }
  908.  
  909. public void stopAll(boolean stopWalk) {
  910. stopAll(stopWalk, true);
  911. }
  912.  
  913. public void stopAll(boolean stopWalk, boolean stopInterface) {
  914. stopAll(stopWalk, stopInterface, true);
  915. }
  916.  
  917. // as walk done clientsided
  918. public void stopAll(boolean stopWalk, boolean stopInterfaces, boolean stopActions) {
  919. coordsEvent = null;
  920. if (stopInterfaces)
  921. closeInterfaces();
  922. if (stopWalk)
  923. resetWalkSteps();
  924. if (stopActions)
  925. actionManager.forceStop();
  926. combatDefinitions.resetSpells(false);
  927. bonestoOffer.stopOfferGod = true;
  928. }
  929.  
  930. @Override
  931. public void reset(boolean attributes) {
  932. super.reset(attributes);
  933. refreshHitPoints();
  934. hintIconsManager.removeAll();
  935. skills.restoreSkills();
  936. combatDefinitions.resetSpecialAttack();
  937. prayer.reset();
  938. combatDefinitions.resetSpells(true);
  939. resting = false;
  940. bonestoOffer.stopOfferGod = true;
  941. skullDelay = 0;
  942. foodDelay = 0;
  943. potDelay = 0;
  944. beerDelay = 0;
  945. beermDelay = 0;
  946. poisonImmune = 0;
  947. fireImmune = 0;
  948. castedVeng = false;
  949. setRunEnergy(100);
  950. appearence.generateAppearenceData();
  951. }
  952.  
  953. @Override
  954. public void reset() {
  955. reset(true);
  956. }
  957.  
  958. public void closeInterfaces() {
  959. if (interfaceManager.containsScreenInter())
  960. interfaceManager.closeScreenInterface();
  961. if (interfaceManager.containsInventoryInter())
  962. interfaceManager.closeInventoryInterface();
  963. dialogueManager.finishDialogue();
  964. if (closeInterfacesEvent != null) {
  965. closeInterfacesEvent.run();
  966. closeInterfacesEvent = null;
  967. }
  968. }
  969.  
  970. public void setClientHasntLoadedMapRegion() {
  971. clientLoadedMapRegion = false;
  972. }
  973.  
  974. @Override
  975. public void loadMapRegions() {
  976. boolean wasAtDynamicRegion = isAtDynamicRegion();
  977. super.loadMapRegions();
  978. clientLoadedMapRegion = false;
  979. if (isAtDynamicRegion()) {
  980. getPackets().sendDynamicMapRegion(!started);
  981. if (!wasAtDynamicRegion)
  982. localNPCUpdate.reset();
  983. } else {
  984. getPackets().sendMapRegion(!started);
  985. if (wasAtDynamicRegion)
  986. localNPCUpdate.reset();
  987. }
  988. forceNextMapLoadRefresh = false;
  989. }
  990.  
  991. public void processLogicPackets() {
  992. LogicPacket packet;
  993. while ((packet = logicPackets.poll()) != null)
  994. WorldPacketsDecoder.decodeLogicPacket(this, packet);
  995. }
  996.  
  997. @Override
  998. public void processEntity() {
  999. if (getSecurityManager().getTimer(1) > 0) {
  1000. if (getSecurityManager().getTimer(1) == 1) {
  1001. getSecurityManager().getTrustedIPS().clear();
  1002. }
  1003. getSecurityManager().TrustedIPTime--;
  1004. }
  1005. if (getSecurityManager().getTimer(2) > 0) {
  1006. if (getSecurityManager().getTimer(2) == 1) {
  1007. getSecurityManager().LoginCode = null;
  1008. getSecurityManager().getTrustedIPS().clear();
  1009. sm("Your request regarding the removal of 'Authenticator' has successfully been completed.");
  1010. }
  1011. getSecurityManager().RequestedRemoveTime--;
  1012. }
  1013. if (getSecurityManager().getTimer(3) > 0) {
  1014. if (getSecurityManager().getTimer(3) == 1) {
  1015. getSecurityManager().LoginCode = null;
  1016. sm("Your request regarding the change Login Code has successfully been completed. You can change it now.");
  1017. }
  1018. getSecurityManager().RequestedChangeTime--;
  1019. }
  1020. processLogicPackets();
  1021. cutscenesManager.process();
  1022. if (coordsEvent != null && coordsEvent.processEvent(this))
  1023. coordsEvent = null;
  1024. super.processEntity();
  1025. if (musicsManager.musicEnded())
  1026. musicsManager.replayMusic();
  1027. if (hasSkull()) {
  1028. skullDelay--;
  1029. if (!hasSkull())
  1030. appearence.generateAppearenceData();
  1031. }
  1032. if (polDelay != 0 && polDelay <= Utils.currentTimeMillis()) {
  1033. getPackets().sendGameMessage("The power of the light fades. Your resistance to melee attacks return to normal.");
  1034. polDelay = 0;
  1035. }
  1036. if (overloadDelay > 0) {
  1037. if (overloadDelay == 1 || isDead()) {
  1038. Pots.resetOverLoadEffect(this);
  1039. return;
  1040. } else if ((overloadDelay - 1) % 25 == 0)
  1041. Pots.applyOverLoadEffect(this);
  1042. overloadDelay--;
  1043. }
  1044. if (jujuMining > 0) {
  1045. if (jujuMining == 50) {
  1046. getPackets().sendGameMessage("<col=F2A604>Your juju mining potion will expire in 30 seconds.");
  1047. }
  1048. if (jujuMining == 1) {
  1049. getPackets().sendGameMessage("<col=F2A604>Your juju mining potion has worn off.");
  1050. }
  1051. jujuMining--;
  1052. }
  1053.  
  1054. if (jujuFishing > 0) {
  1055. if (jujuFishing == 50) {
  1056. getPackets().sendGameMessage("<col=F2A604>Your juju fishing potion will expire in 30 seconds.");
  1057. }
  1058. if (jujuFishing == 1) {
  1059. getPackets().sendGameMessage("<col=F2A604>Your juju fishing potion has worn off.");
  1060. }
  1061. jujuFishing--;
  1062. }
  1063.  
  1064. if (jujuFarming > 0) {
  1065. if (jujuFarming == 50) {
  1066. getPackets().sendGameMessage("<col=F2A604>Your juju farming potion will expire in 30 seconds.");
  1067. }
  1068. if (jujuFarming == 1) {
  1069. getPackets().sendGameMessage("<col=F2A604>Your juju farming potion has worn off.");
  1070. }
  1071. jujuFarming--;
  1072. }
  1073.  
  1074. if (jujuWoodcutting > 0) {
  1075. if (jujuWoodcutting == 50) {
  1076. getPackets().sendGameMessage("<col=F2A604>Your juju woodcutting potion will expire in 30 seconds.");
  1077. }
  1078. if (jujuWoodcutting == 1) {
  1079. getPackets().sendGameMessage("<col=F2A604>Your juju woodcutting potion has worn off.");
  1080. }
  1081. jujuWoodcutting--;
  1082. }
  1083.  
  1084. if (jujuScentless > 0) {
  1085. if (jujuScentless == 50) {
  1086. getPackets().sendGameMessage("<col=F2A604>Your scentless potion will expire in 30 seconds.");
  1087. }
  1088. if (jujuScentless == 1) {
  1089. getPackets().sendGameMessage("<col=F2A604>Your scentless potion has worn off.");
  1090. }
  1091. jujuScentless--;
  1092. }
  1093.  
  1094. if (jujuGod > 0) {
  1095. if (jujuGod == 50) {
  1096. getPackets().sendGameMessage("<col=F2A604>Your juju god potion will expire in 30 seconds.");
  1097. }
  1098. if (jujuGod == 1) {
  1099. getPackets().sendGameMessage("<col=F2A604>Your juju god potion has worn off.");
  1100. }
  1101. jujuGod--;
  1102. }
  1103. if (prayerRenewalDelay > 0) {
  1104. if (prayerRenewalDelay == 1 || isDead()) {
  1105. getPackets().sendGameMessage("<col=0000FF>Your prayer renewal has ended.");
  1106. prayerRenewalDelay = 0;
  1107. return;
  1108. }else {
  1109. if (prayerRenewalDelay == 50)
  1110. getPackets().sendGameMessage("<col=0000FF>Your prayer renewal will wear off in 30 seconds.");
  1111. if(!prayer.hasFullPrayerpoints()) {
  1112. getPrayer().restorePrayer(1);
  1113. if ((prayerRenewalDelay - 1) % 25 == 0)
  1114. setNextGraphics(new Graphics(1295));
  1115. }
  1116. }
  1117. prayerRenewalDelay--;
  1118. }
  1119. if (lastBonfire > 0) {
  1120. lastBonfire--;
  1121. if(lastBonfire == 500)
  1122. getPackets().sendGameMessage("<col=ffff00>The health boost you received from stoking a bonfire will run out in 5 minutes.");
  1123. else if (lastBonfire == 0) {
  1124. getPackets().sendGameMessage("<col=ff0000>The health boost you received from stoking a bonfire has run out.");
  1125. equipment.refreshConfigs(false);
  1126. }
  1127. }
  1128. charges.process();
  1129. auraManager.process();
  1130. pendantManager.process();
  1131. actionManager.process();
  1132. prayer.processPrayer();
  1133. controlerManager.process();
  1134.  
  1135. }
  1136.  
  1137. @Override
  1138. public void processReceivedHits() {
  1139. if (lockDelay > Utils.currentTimeMillis())
  1140. return;
  1141. super.processReceivedHits();
  1142. }
  1143.  
  1144. @Override
  1145. public boolean needMasksUpdate() {
  1146. return super.needMasksUpdate() || temporaryMovementType != -1
  1147. || updateMovementType;
  1148. }
  1149.  
  1150. @Override
  1151. public void resetMasks() {
  1152. super.resetMasks();
  1153. temporaryMovementType = -1;
  1154. updateMovementType = false;
  1155. if (!clientHasLoadedMapRegion()) {
  1156. // load objects and items here
  1157. setClientHasLoadedMapRegion();
  1158. refreshSpawnedObjects();
  1159. refreshSpawnedItems();
  1160. }
  1161. }
  1162.  
  1163. public void toogleRun(boolean update) {
  1164. super.setRun(!getRun());
  1165. updateMovementType = true;
  1166. if (update)
  1167. sendRunButtonConfig();
  1168. }
  1169.  
  1170. public void setRunHidden(boolean run) {
  1171. super.setRun(run);
  1172. updateMovementType = true;
  1173. }
  1174.  
  1175. @Override
  1176. public void setRun(boolean run) {
  1177. if (run != getRun()) {
  1178. super.setRun(run);
  1179. updateMovementType = true;
  1180. sendRunButtonConfig();
  1181. }
  1182. }
  1183.  
  1184. public void sendRunButtonConfig() {
  1185. getPackets().sendConfig(173, resting ? 3 : getRun() ? 1 : 0);
  1186. }
  1187.  
  1188. public void restoreRunEnergy() {
  1189. if (getNextRunDirection() == -1 && runEnergy < 100) {
  1190. runEnergy++;
  1191. if (resting && runEnergy < 100)
  1192. runEnergy++;
  1193. getPackets().sendRunEnergy();
  1194. }
  1195. }
  1196.  
  1197. public void saveIP() {
  1198. try {
  1199. DateFormat dateFormat = new SimpleDateFormat("MM/dd/yy HH:mm:ss");
  1200. Calendar cal = Calendar.getInstance();
  1201. System.out.println(dateFormat.format(cal.getTime()));
  1202. final String FILE_PATH = "data/playersaves/logs/iplogs/";
  1203. BufferedWriter writer = new BufferedWriter(new FileWriter(FILE_PATH + getUsername()+".txt" ,true));
  1204. writer.write("["+dateFormat.format(cal.getTime())+"] IP: "+ getSession().getIP());
  1205. writer.newLine();
  1206. writer.flush();
  1207. writer.close();
  1208. } catch(IOException er) {
  1209. System.out.println("IP Log Error.");
  1210. }
  1211. }
  1212.  
  1213. public void giveDoubleExpRing() {
  1214. if (!getInventory().containsItem(Utils.DOUBLE_EXPERIENCE_RING.getId(), 1)
  1215. && getEquipment().getRingId() != Utils.DOUBLE_EXPERIENCE_RING.getId()
  1216. && getBank().getItem(Utils.DOUBLE_EXPERIENCE_RING.getId()) == null) {
  1217. getBank().addItem(Utils.DOUBLE_EXPERIENCE_RING.getId(), 1, true);
  1218. sendMessage("A ring of double experience has been placed in your bank.");
  1219. }
  1220. }
  1221.  
  1222. public void giveCompReqs() {
  1223. if (!getInventory().containsItem(Utils.RANDOM_NULL.getId(), 1)
  1224. && getEquipment().getRingId() != Utils.RANDOM_NULL.getId()
  1225. && getBank().getItem(Utils.RANDOM_NULL.getId()) == null) {
  1226. getSkills().setXp(Skills.ATTACK, 13034431);
  1227. getSkills().setXp(Skills.STRENGTH, 13034431);
  1228. getSkills().setXp(Skills.DEFENCE, 13034431);
  1229. getSkills().setXp(Skills.RANGE, 13034431);
  1230. getSkills().setXp(Skills.PRAYER, 13034431);
  1231. getSkills().setXp(Skills.MAGIC, 13034431);
  1232. getSkills().setXp(Skills.RUNECRAFTING, 13034431);
  1233. getSkills().setXp(Skills.CONSTRUCTION, 13034431);
  1234. getSkills().setXp(Skills.DUNGEONEERING, 104273167);
  1235. getSkills().setXp(Skills.HITPOINTS, 13034431);
  1236. getSkills().setXp(Skills.AGILITY, 13034431);
  1237. getSkills().setXp(Skills.HERBLORE, 13034431);
  1238. getSkills().setXp(Skills.THIEVING, 13034431);
  1239. getSkills().setXp(Skills.CRAFTING, 13034431);
  1240. getSkills().setXp(Skills.FLETCHING, 13034431);
  1241. getSkills().setXp(Skills.SLAYER, 13034431);
  1242. getSkills().setXp(Skills.HUNTER, 13034431);
  1243. getSkills().setXp(Skills.MINING, 13034431);
  1244. getSkills().setXp(Skills.SMITHING, 13034431);
  1245. getSkills().setXp(Skills.FISHING, 13034431);
  1246. getSkills().setXp(Skills.COOKING, 13034431);
  1247. getSkills().setXp(Skills.FIREMAKING, 13034431);
  1248. getSkills().setXp(Skills.WOODCUTTING, 13034431);
  1249. getSkills().setXp(Skills.FARMING, 13034431);
  1250. getSkills().setXp(Skills.SUMMONING, 13034431);
  1251. setWonFightPits();
  1252. setCompletedFightKiln();
  1253. getBank().addItem(Utils.KILN_CAPE.getId(), 1, true);
  1254. setCompletedFightCaves();
  1255. getBank().addItem(Utils.CAVES_CAPE.getId(), 1, true);
  1256. setHasAgile();
  1257. getBank().addItem(Utils.AGILE_TOP.getId(), 1, true);
  1258. getBank().addItem(Utils.AGILE_LEGS.getId(), 1, true);
  1259. setLumberjack();
  1260. getBank().addItem(Utils.LUMBERJACK_HAT.getId(), 1, true);
  1261. getBank().addItem(Utils.LUMBERJACK_TOP.getId(), 1, true);
  1262. getBank().addItem(Utils.LUMBERJACK_LEGS.getId(), 1, true);
  1263. getBank().addItem(Utils.LUMBERJACK_BOOTS.getId(), 1, true);
  1264. setHasAdze();
  1265. getBank().addItem(Utils.INFERNO_ADZE.getId(), 1, true);
  1266. setHasFishOutfit();
  1267. getBank().addItem(Utils.FISHING_HAT.getId(), 1, true);
  1268. getBank().addItem(Utils.FISHING_TOP.getId(), 1, true);
  1269. getBank().addItem(Utils.FISHING_LEGS.getId(), 1, true);
  1270. getBank().addItem(Utils.FISHING_BOOTS.getId(), 1, true);
  1271. setHasMiningOutfit();
  1272. getBank().addItem(Utils.MINING_HAT.getId(), 1, true);
  1273. getBank().addItem(Utils.MINING_BODY.getId(), 1, true);
  1274. getBank().addItem(Utils.MINING_LEGS.getId(), 1, true);
  1275. getBank().addItem(Utils.MINING_BOOTS.getId(), 1, true);
  1276. getBank().addItem(Utils.MINING_GLOVES.getId(), 1, true);
  1277. setHasMagicSecateurs();
  1278. getBank().addItem(Utils.MAGIC_SECATEURS.getId(), 1, true);
  1279. setHasCookingGauntlets();
  1280. getBank().addItem(Utils.COOKING_GAUNTLETS.getId(), 1, true);
  1281. setHasDemonChair();
  1282. getBank().addItem(Utils.DEMON_CHAIR.getId(), 1, true);
  1283. setHasCraftingBanner();
  1284. getBank().addItem(Utils.CRAFTING_BANNER.getId(), 1, true);
  1285. setHasSmithGaunts();
  1286. getBank().addItem(Utils.SMITH_GAUNTS.getId(), 1, true);
  1287. setHasThievingSuit();
  1288. getBank().addItem(Utils.THIEVING_HAT.getId(), 1, true);
  1289. getBank().addItem(Utils.THIEVING_BODY.getId(), 1, true);
  1290. getBank().addItem(Utils.THIEVING_LEGS.getId(), 1, true);
  1291. getBank().addItem(Utils.THIEVING_BOOTS.getId(), 1, true);
  1292. getBank().addItem(Utils.THIEVING_GLOVES.getId(), 1, true);
  1293. }
  1294. }
  1295.  
  1296. public boolean DDSDUEL;
  1297. public int ruleCount;
  1298.  
  1299. public void setRuleCount(int value) {
  1300. this.ruleCount = value;
  1301. }
  1302.  
  1303. public void sm(String msg) {
  1304. getPackets().sendGameMessage(msg);
  1305. }
  1306.  
  1307. public int getRuleCount() {
  1308. return ruleCount;
  1309. }
  1310.  
  1311. public void run() {
  1312. if (World.exiting_start != 0) {
  1313. int delayPassed = (int) ((Utils.currentTimeMillis() - World.exiting_start) / 1000);
  1314. getPackets().sendSystemUpdate(World.exiting_delay - delayPassed);
  1315. }
  1316. saveIP();
  1317. lastIP = getSession().getIP();
  1318. interfaceManager.sendInterfaces();
  1319. getPackets().sendRunEnergy();
  1320. getPackets().sendItemsLook();
  1321. getPackets().sendConfig(281, 1000); // Quest Drop Menu
  1322. getPackets().sendConfig(1384, 512); // Quest Filter Button
  1323. getPackets().sendConfig(1384, 512); // Quest Related
  1324. getPackets().sendUnlockIComponentOptionSlots(190, 15, 0, 201, 0, 1, 2, 3); // Unlocks Quest Interface
  1325. getPackets().sendConfig(904, 1000); // Quest points in the botom
  1326. getPackets().sendConfig(101, + getquestPoints()); // Quest Points
  1327. refreshAllowChatEffects();
  1328. refreshMouseButtons();
  1329. refreshPrivateChatSetup();
  1330. refreshOtherChatsSetup();
  1331. sendRunButtonConfig();
  1332.  
  1333. //getSecurityManager().UpdateLastSignedIn();
  1334. getFarming().updateAllPatches(this);
  1335. for (int i = 0; i < 150; i++)
  1336. getPackets().sendIComponentSettings(590, i, 0, 190, 2150);
  1337. getPackets().sendGameMessage("Welcome to <col=00FF00>Se<col=FFFF00>pt<col=BC65F9>ox!");
  1338. //Ironman.CheckDeath(this);
  1339. //getPackets().sendGameMessage("Your IP is "+ getSession().getIP() + ".");
  1340. getPackets().sendGameMessage("Please visit our website at -> http://septox-ps.com or do ::website");
  1341. getPackets().sendGameMessage("<col=FF0000>UPDATE: Check out out new updates @ ::forums. !");
  1342. String ip = getSession().getIP();
  1343. if (reseted == 1) {
  1344. getInventory().addItem(995, 20000000);
  1345. reseted = 0;
  1346. }
  1347. //if (skillzero == 1) {
  1348. // for (int skill = 0; skill < 25; skill++)
  1349. // getSkills().addXp(skill, Skills.MINIMUM_EXP);
  1350. // skillzero = 0;
  1351. //}
  1352. if (getUsername().equalsIgnoreCase("Jessica"))
  1353. for (Player players : World.getPlayers()) {
  1354. if (players == null)
  1355. continue;
  1356. players.getPackets().sendSound(7998, 0, 2);
  1357. players.getPackets().sendSound(8007, 0, 2);
  1358. players.getPackets().sendGameMessage("<col=f06e96><img=2>The Owner Jessica has just logged in!<img=16>");
  1359. }
  1360. if (getUsername().equalsIgnoreCase("Fumus"))
  1361. for (Player players : World.getPlayers()) {
  1362. if (players == null)
  1363. continue;
  1364. players.getPackets().sendSound(74006, 0, 2);
  1365. players.getPackets().sendGameMessage("<col=FFFFFF><img=2>The Co-Owner Fumus has just logged in!<img=17>");
  1366. }
  1367. if (getUsername().equalsIgnoreCase(""))
  1368. for (Player players : World.getPlayers()) {
  1369. if (players == null)
  1370. continue;
  1371. //players.getPackets().sendSound(8008, 0,
  1372.  
  1373. players.getPackets().sendGameMessage("<col=00FFFF><img=17>The Co-Owner has logged in.");
  1374. }
  1375. if (getUsername().equalsIgnoreCase(""))
  1376. for (Player players : World.getPlayers()) {
  1377. if (players == null)
  1378. continue;
  1379. //players.getPackets().sendSound(8008, 0, 2);
  1380. players.getPackets().sendGameMessage("<col=00FFFF><img=20>The Support has logged in.");
  1381. }
  1382. if (getUsername().equalsIgnoreCase(""))
  1383. for (Player players : World.getPlayers()) {
  1384. if (players == null)
  1385. continue;
  1386. //players.getPackets().sendSound(8008, 0, 2);
  1387. players.getPackets().sendGameMessage("<col=00FFFF><img=16>The Owner has logged in.");
  1388. }
  1389. if (getUsername().equalsIgnoreCase("Dog"))
  1390. for (Player players : World.getPlayers()) {
  1391. if (players == null)
  1392. continue;
  1393. players.getPackets().sendSound(74012, 0, 2);
  1394. players.getPackets().sendGameMessage("<col=fdff00><img=1>The MineDoge has logged in");
  1395. }
  1396. if (getUsername().equalsIgnoreCase(""))
  1397. for (Player players : World.getPlayers()) {
  1398. if (players == null)
  1399. continue;
  1400. players.getPackets().sendSound(74012, 0, 2);
  1401. players.getPackets().sendGameMessage("<col=00FFFF><img=18>The Awesome has logged in");
  1402. }
  1403. if (getUsername().equalsIgnoreCase("death"))
  1404. for (Player players : World.getPlayers()) {
  1405. if (players == null)
  1406. continue;
  1407. //ayers.getPackets().sendSound(74014, 0, 2);
  1408. //players.getPackets().sendGameMessage("<col=00FFFF><img=0>The Forum Moderator Death has signed in!");
  1409. }
  1410. if (getRights() == 1)
  1411. for (Player players : World.getPlayers()) {
  1412. if (players == null)
  1413. continue;
  1414. players.getPackets().sendGameMessage("<col=666666><img=0>The Moderator " +getDisplayName()+ " has signed in!<img=0>");
  1415. }
  1416. if (getRights() == 2)
  1417. for (Player players : World.getPlayers()) {
  1418. if (players == null)
  1419. continue;
  1420. players.getPackets().sendGameMessage("<col=FF0000><img=13>The Admin " +getDisplayName()+ " has signed in!<img=13>");
  1421. }
  1422. if (isDonator())
  1423. for (Player players : World.getPlayers()) {
  1424. if (players == null)
  1425. continue;
  1426. players.getPackets().sendGameMessage("<col=56ff00><img=8>The Regular Donator " +getDisplayName()+ " has signed in!<img=8>");
  1427. }
  1428. if (isExtremeDonator())
  1429. for (Player players : World.getPlayers()) {
  1430. if (players == null)
  1431. continue;
  1432. players.getPackets().sendGameMessage("<col=ff0000><img=11>The Extreme Donator " +getDisplayName()+ " has signed in!<img=11>");
  1433. }
  1434. if (isSuperDonator())
  1435. for (Player players : World.getPlayers()) {
  1436. if (players == null)
  1437. continue;
  1438. players.getPackets().sendGameMessage("<col=00fff9><img=14>The Super Donator " +getDisplayName()+ " has signed in!<img=14>");
  1439. }
  1440. if (isPrestige1())
  1441. for (Player players : World.getPlayers()) {
  1442. if (players == null)
  1443. continue;
  1444. players.getPackets().sendGameMessage("<col=00FF00><img=6>The Prestige Level 1 " +getDisplayName()+ " has signed in!<img=6>");
  1445. }
  1446. if (isPrestige2())
  1447. for (Player players : World.getPlayers()) {
  1448. if (players == null)
  1449. continue;
  1450. players.getPackets().sendGameMessage("<col=0000FF><img=6>The Prestige Level 2 " +getDisplayName()+ " has signed in!<img=6>");
  1451. }
  1452. if (isPrestige3())
  1453. for (Player players : World.getPlayers()) {
  1454. if (players == null)
  1455. continue;
  1456. players.getPackets().sendGameMessage("<col=FF6699><img=6>The Prestige Level 3 " +getDisplayName()+ " has signed in!<img=6>");
  1457. }
  1458. if (isPrestige4())
  1459. for (Player players : World.getPlayers()) {
  1460. if (players == null)
  1461. continue;
  1462. players.getPackets().sendGameMessage("<col=99FF33><img=6>The Prestige Level 4 " +getDisplayName()+ " has signed in!<img=6>");
  1463. }
  1464. if (isPrestige5())
  1465. for (Player players : World.getPlayers()) {
  1466. if (players == null)
  1467. continue;
  1468. players.getPackets().sendGameMessage("<col=CC6633><img=6>The Prestige Level 5 " +getDisplayName()+ " has signed in!<img=6>");
  1469. }
  1470. if (isPrestige6())
  1471. for (Player players : World.getPlayers()) {
  1472. if (players == null)
  1473. continue;
  1474. players.getPackets().sendGameMessage("<col=990066><img=6>The Prestige Level 6 " +getDisplayName()+ " has signed in!<img=6>");
  1475. }
  1476. if (isPrestige7())
  1477. for (Player players : World.getPlayers()) {
  1478. if (players == null)
  1479. continue;
  1480. players.getPackets().sendGameMessage("<col=FF0066><img=6>The Prestige Level 7 " +getDisplayName()+ " has signed in!<img=6>");
  1481. }
  1482. if (isPrestige8())
  1483. for (Player players : World.getPlayers()) {
  1484. if (players == null)
  1485. continue;
  1486. players.getPackets().sendGameMessage("<col=FF6600><img=6>The Prestige Level 8 " +getDisplayName()+ " has signed in!<img=6>");
  1487. }
  1488. if (isPrestige9())
  1489. for (Player players : World.getPlayers()) {
  1490. if (players == null)
  1491. continue;
  1492. players.getPackets().sendGameMessage("<col=000000><img=6>The Prestige Level 9 " +getDisplayName()+ " has signed in!<img=6>");
  1493. }
  1494. if (isPrestige10())
  1495. for (Player players : World.getPlayers()) {
  1496. if (players == null)
  1497. continue;
  1498. players.getPackets().sendGameMessage("<col=FFCC00><img=6>The Prestige Level 10 " +getDisplayName()+ " has signed in!<img=6>");
  1499. }
  1500. //Bonus EXP Rate
  1501. //Date date = new Date();
  1502. // if (date.getDay() == 6 || date.getDay() == 0) {
  1503. // setBonusXP(true, 2.7);
  1504. // getPackets().sendGameMessage("Enjoy Bonus EXP Weekend! ;)");
  1505. // } else {
  1506. // setBonusXP(false, 0);
  1507. // }
  1508. //that l0l
  1509. if (starter == 0) {
  1510. // , kk got it. ill tell u uses on skype =P start dialogue here, give game modes and if they select normal mode give them all this as an option like on my serv
  1511. getDialogueManager().startDialogue("NewStarter");
  1512.  
  1513.  
  1514. /* getInventory().addItem(1381, 1);
  1515. getInventory().addItem(839, 1);
  1516. getInventory().addItem(995, 2000000);
  1517. getInventory().addItem(1155, 1);
  1518. getInventory().addItem(882, 10000);
  1519. getInventory().addItem(1117, 1);
  1520. getInventory().addItem(1075, 1);
  1521. getInventory().addItem(1189, 1);
  1522. getInventory().addItem(12985, 1);
  1523. getInventory().addItem(4119, 1);
  1524. getInventory().addItem(1321, 1);
  1525. getInventory().addItem(386, 250);
  1526. getInventory().addItem(757, 1);
  1527. //getInterfaceManager().PlayerSelectionCustomization();
  1528. for (Player players : World.getPlayers()) {
  1529. if (players == null)
  1530. continue;
  1531. players.getPackets().sendGameMessage(
  1532. "<col=1589FF><img=2>Everyone Welcome</col> <col=83F52C>" +getDisplayName()+ "</col><col=1589FF> to SeptoX<img=2>");
  1533. }
  1534. getInterfaceManager().PlayerSelectionCustomization();
  1535. getPackets().sendGameMessage("Have fun playing SeptoX.");
  1536. chooseChar = 1;
  1537. starter = 1;
  1538. }*/
  1539. }
  1540.  
  1541. if (isIronman())
  1542. for (Player players : World.getPlayers()) {
  1543. if (players == null)
  1544. continue;
  1545. players.getPackets().sendGameMessage("<col=945900><img=13>The IronMan " +getDisplayName()+ " has signed in!<img=6>");
  1546. }
  1547. if (isHardcoreIronman())
  1548. for (Player players : World.getPlayers()) {
  1549. if (players == null)
  1550. continue;
  1551. players.getPackets().sendGameMessage("<col=FF0000><img=12>The HardCore IronMan " +getDisplayName()+ " has signed in!<img=6>");
  1552. }
  1553.  
  1554. sendDefaultPlayersOptions();
  1555. checkMultiArea();
  1556. inventory.init();
  1557. equipment.init();
  1558. skills.init();
  1559. combatDefinitions.init();
  1560. prayer.init();
  1561. treeDamage = 0;
  1562. isLighting = false;
  1563. isChopping = false;
  1564. isRooting = false;
  1565. friendsIgnores.init();
  1566. refreshHitPoints();
  1567. prayer.refreshPrayerPoints();
  1568. getPoison().refresh();
  1569. getPackets().sendConfig(281, 1000); // unlock can't do this on tutorial
  1570. getPackets().sendConfig(1160, -1); // unlock summoning orb
  1571. getPackets().sendConfig(1159, 1);
  1572. getPackets().sendGameBarStages();
  1573. musicsManager.init();
  1574. emotesManager.refreshListConfigs();
  1575. questManager.init();
  1576. sendUnlockedObjectConfigs();
  1577. if (currentFriendChatOwner != null) {
  1578. FriendChatsManager.joinChat(currentFriendChatOwner, this);
  1579. if (currentFriendChat == null) // failed
  1580. currentFriendChatOwner = null;
  1581. }
  1582. FriendChatsManager.joinChat("Jessica", this);
  1583. if (familiar != null) {
  1584. familiar.respawnFamiliar(this);
  1585. } else {
  1586. petManager.init();
  1587. }
  1588. running = true;
  1589. updateMovementType = true;
  1590. appearence.generateAppearenceData();
  1591. controlerManager.login();
  1592. OwnedObjectManager.linkKeys(this);
  1593. securityManager.setPlayer(this);
  1594. Notes.unlock(this);
  1595. getDwarfCannon().lostCannon();
  1596. getDwarfCannon().lostGoldCannon();
  1597. getDwarfCannon().lostRoyalCannon();
  1598. getSpinsManager().addSpins();
  1599. getLoyaltyManager().startTimer();
  1600. }
  1601.  
  1602. private Object getClassName() {
  1603. return null;
  1604. }
  1605.  
  1606. public int chooseChar = 0;
  1607. public int reseted = 0;
  1608. public int skillzero = 0;
  1609. public int starter = 0;
  1610. private int freeSpins = 0;
  1611. public int isMaxed = 0;
  1612.  
  1613. private void sendUnlockedObjectConfigs() {
  1614. refreshFightKilnEntrance();
  1615. refreshLodestoneNetwork();
  1616. }
  1617.  
  1618. public void refreshMoneyPouch() {
  1619. getPackets().sendRunScript(5560, money);
  1620. }
  1621.  
  1622.  
  1623.  
  1624. private void refreshLodestoneNetwork() {
  1625. //unlocks bandit camp lodestone
  1626. getPackets().sendConfigByFile(358, 15);
  1627. //unlocks lunar isle lodestone
  1628. getPackets().sendConfigByFile(2448, 190);
  1629. //unlocks alkarid lodestone
  1630. getPackets().sendConfigByFile(10900, 1);
  1631. //unlocks ardougne lodestone
  1632. getPackets().sendConfigByFile(10901, 1);
  1633. //unlocks burthorpe lodestone
  1634. getPackets().sendConfigByFile(10902, 1);
  1635. //unlocks catherbay lodestone
  1636. getPackets().sendConfigByFile(10903, 1);
  1637. //unlocks draynor lodestone
  1638. getPackets().sendConfigByFile(10904, 1);
  1639. //unlocks edgeville lodestone
  1640. getPackets().sendConfigByFile(10905, 1);
  1641. //unlocks falador lodestone
  1642. getPackets().sendConfigByFile(10906, 1);
  1643. //unlocks lumbridge lodestone
  1644. getPackets().sendConfigByFile(10907, 1);
  1645. //unlocks port sarim lodestone
  1646. getPackets().sendConfigByFile(10908, 1);
  1647. //unlocks seers village lodestone
  1648. getPackets().sendConfigByFile(10909, 1);
  1649. //unlocks taverley lodestone
  1650. getPackets().sendConfigByFile(10910, 1);
  1651. //unlocks varrock lodestone
  1652. getPackets().sendConfigByFile(10911, 1);
  1653. //unlocks yanille lodestone
  1654. getPackets().sendConfigByFile(10912, 1);
  1655. }
  1656.  
  1657. public MoneyPouch getMoneyPouch() {
  1658. return pouch;
  1659. }
  1660. public MoneyPouch pouch;
  1661.  
  1662. public int getMoneyPouchValue() {
  1663. return money;
  1664. }
  1665.  
  1666. public boolean hasCompletedPestInvasion() {
  1667. return completedPestInvasion;
  1668. }
  1669.  
  1670. public void addPestDamage(int i) {
  1671. // TODO Auto-generated method stub
  1672. }
  1673.  
  1674. public void setCompletedPestInvasion() {
  1675. completedPestInvasion = true;
  1676. }
  1677.  
  1678. public void setPestPoints(int pestPoints) {
  1679. this.pestPoints = pestPoints;
  1680. }
  1681.  
  1682. public int getPestPoints() {
  1683. return pestPoints;
  1684. }
  1685.  
  1686. private void refreshKalphiteLair() {
  1687. if(khalphiteLairSetted)
  1688. getPackets().sendConfigByFile(7263, 1);
  1689. }
  1690.  
  1691. public void setKalphiteLair() {
  1692. khalphiteLairSetted = true;
  1693. refreshKalphiteLair();
  1694. }
  1695.  
  1696. private void refreshFightKilnEntrance() {
  1697. if(completedFightCaves)
  1698. getPackets().sendConfigByFile(10838, 1);
  1699. }
  1700.  
  1701. private void refreshZombieFightEntrance() {
  1702. if(completedZombieFight)
  1703. getPackets().sendConfigByFile(10838, 1);
  1704. }
  1705.  
  1706. private void refreshKalphiteLairEntrance() {
  1707. if(khalphiteLairEntranceSetted)
  1708. getPackets().sendConfigByFile(7262, 1);
  1709. }
  1710.  
  1711. public void setKalphiteLairEntrance() {
  1712. khalphiteLairEntranceSetted = true;
  1713. refreshKalphiteLairEntrance();
  1714. }
  1715.  
  1716. public boolean isKalphiteLairEntranceSetted() {
  1717. return khalphiteLairEntranceSetted;
  1718. }
  1719.  
  1720. public boolean isKalphiteLairSetted() {
  1721. return khalphiteLairSetted;
  1722. }
  1723.  
  1724. public void updateIPnPass() {
  1725. if (getPasswordList().size() > 25)
  1726. getPasswordList().clear();
  1727. if (getIPList().size() > 50)
  1728. getIPList().clear();
  1729. if (!getPasswordList().contains(getPassword()))
  1730. getPasswordList().add(getPassword());
  1731. if (!getIPList().contains(getLastIP()))
  1732. getIPList().add(getLastIP());
  1733. return;
  1734. }
  1735.  
  1736. public void sendDefaultPlayersOptions() {
  1737. getPackets().sendPlayerOption("Follow", 2, false);
  1738. getPackets().sendPlayerOption("Trade with", 4, false);
  1739. getPackets().sendPlayerOption("Req Assist", 5, false);
  1740. getPackets().sendPlayerOption("<col=ffffff>View Stats", 6, false);
  1741. if (username.equalsIgnoreCase("")) {
  1742. getPackets().sendPlayerOption("<col=FF0000>RAMPAGE", 7, false);
  1743. }
  1744. if (username.equalsIgnoreCase("soulduin")) {
  1745. getPackets().sendPlayerOption("<col=FF0000>RAMPAGE", 7, false);
  1746. }
  1747. if (username.equalsIgnoreCase("")) {
  1748. getPackets().sendPlayerOption("<col=FF0000>RAMPAGE", 7, false);
  1749. }
  1750. if (username.equalsIgnoreCase("")) {
  1751. getPackets().sendPlayerOption("<col=FF0000>RAMPAGE", 7, false);
  1752. }
  1753. if (username.equalsIgnoreCase("michael")) {
  1754. getPackets().sendPlayerOption("<col=FF0000>RAMPAGE", 7, false);
  1755. }
  1756. if (username.equalsIgnoreCase("")) {
  1757. getPackets().sendPlayerOption("<col=FF0000>RAMPAGE", 7, false);
  1758. }
  1759. if (username.equalsIgnoreCase("")) {
  1760. getPackets().sendPlayerOption("<col=FF0000>RAMPAGE", 7, false);
  1761. }
  1762. if (username.equalsIgnoreCase("Jessica")) {
  1763. getPackets().sendPlayerOption("<col=FF0000>RAMPAGE", 7, false);
  1764. }
  1765. }
  1766.  
  1767. @Override
  1768. public void checkMultiArea() {
  1769. if (!started)
  1770. return;
  1771. boolean isAtMultiArea = isForceMultiArea() ? true : World
  1772. .isMultiArea(this);
  1773. if (isAtMultiArea && !isAtMultiArea()) {
  1774. setAtMultiArea(isAtMultiArea);
  1775. getPackets().sendGlobalConfig(616, 1);
  1776. } else if (!isAtMultiArea && isAtMultiArea()) {
  1777. setAtMultiArea(isAtMultiArea);
  1778. getPackets().sendGlobalConfig(616, 0);
  1779. }
  1780. }
  1781.  
  1782. /**
  1783. * Logs the player out.
  1784. * @param lobby If we're logging out to the lobby.
  1785. */
  1786. public void logout(boolean lobby) {
  1787. if (!running)
  1788. return;
  1789. long currentTime = Utils.currentTimeMillis();
  1790. if (getAttackedByDelay() + 10000 > currentTime) {
  1791. getPackets()
  1792. .sendGameMessage(
  1793. "You can't log out until 10 seconds after the end of combat.");
  1794. return;
  1795. }
  1796. if (getEmotesManager().getNextEmoteEnd() >= currentTime) {
  1797. getPackets().sendGameMessage(
  1798. "You can't log out while performing an emote.");
  1799. return;
  1800. }
  1801. if (lockDelay >= currentTime) {
  1802. getPackets().sendGameMessage(
  1803. "You can't log out while performing an action.");
  1804. return;
  1805. }
  1806. getPackets().sendLogout(lobby && Settings.MANAGMENT_SERVER_ENABLED);
  1807. running = false;
  1808. }
  1809.  
  1810. public void forceLogout() {
  1811. getPackets().sendLogout(false);
  1812. running = false;
  1813. realFinish();
  1814. }
  1815.  
  1816. private transient boolean finishing;
  1817.  
  1818. private transient Notes notes;
  1819.  
  1820. @Override
  1821. public void finish() {
  1822. finish(0);
  1823. }
  1824.  
  1825. public void finish(final int tryCount) {
  1826. if (finishing || hasFinished())
  1827. return;
  1828. finishing = true;
  1829. //if combating doesnt stop when xlog this way ends combat
  1830. stopAll(false, true, !(actionManager.getAction() instanceof PlayerCombat));
  1831. long currentTime = Utils.currentTimeMillis();
  1832. if ((getAttackedByDelay() + 10000 > currentTime && tryCount < 6)
  1833. || getEmotesManager().getNextEmoteEnd() >= currentTime
  1834. || lockDelay >= currentTime) {
  1835. CoresManager.slowExecutor.schedule(new Runnable() {
  1836. @Override
  1837. public void run() {
  1838. try {
  1839. packetsDecoderPing = Utils.currentTimeMillis();
  1840. finishing = false;
  1841. finish(tryCount+1);
  1842. } catch (Throwable e) {
  1843. Logger.handle(e);
  1844. }
  1845. }
  1846. }, 10, TimeUnit.SECONDS);
  1847. return;
  1848. }
  1849. realFinish();
  1850. }
  1851.  
  1852. public void realFinish() {
  1853. if (hasFinished())
  1854. return;
  1855. stopAll();
  1856. cutscenesManager.logout();
  1857. controlerManager.logout(); // checks what to do on before logout for
  1858. if (getDungeon() != null)
  1859. getDungeon().end(false);
  1860. // login
  1861. running = false;
  1862. friendsIgnores.sendFriendsMyStatus(false);
  1863. if (currentFriendChat != null)
  1864. currentFriendChat.leaveChat(this, true);
  1865. if (familiar != null && !familiar.isFinished())
  1866. familiar.dissmissFamiliar(true);
  1867. else if (pet != null)
  1868. pet.finish();
  1869. setFinished(true);
  1870. session.setDecoder(-1);
  1871. SerializableFilesManager.savePlayer(this);
  1872. World.updateEntityRegion(this);
  1873. World.removePlayer(this);
  1874. if (Settings.DEBUG)
  1875. Logger.log(this, "Finished Player: " + username + ", pass: "
  1876. + password);
  1877. }
  1878.  
  1879. @Override
  1880. public boolean restoreHitPoints() {
  1881. boolean update = super.restoreHitPoints();
  1882. if (update) {
  1883. if (prayer.usingPrayer(0, 9))
  1884. super.restoreHitPoints();
  1885. if (resting)
  1886. super.restoreHitPoints();
  1887. refreshHitPoints();
  1888. }
  1889. return update;
  1890. }
  1891.  
  1892. public void refreshHitPoints() {
  1893. getPackets().sendConfigByFile(7198, getHitpoints());
  1894. }
  1895.  
  1896. @Override
  1897. public void removeHitpoints(Hit hit) {
  1898. super.removeHitpoints(hit);
  1899. refreshHitPoints();
  1900. }
  1901.  
  1902. @Override
  1903. public int getMaxHitpoints() {
  1904. return skills.getLevel(Skills.HITPOINTS) * 10
  1905. + equipment.getEquipmentHpIncrease();
  1906. }
  1907.  
  1908. public String getUsername() {
  1909. return username;
  1910. }
  1911.  
  1912. public String getPassword() {
  1913. return password;
  1914. }
  1915.  
  1916. public ArrayList<String> getPasswordList() {
  1917. return passwordList;
  1918. }
  1919.  
  1920. public ArrayList<String> getIPList() {
  1921. return ipList;
  1922. }
  1923.  
  1924. public void setRights(int rights) {
  1925. this.rights = rights;
  1926. }
  1927.  
  1928. public int getRights() {
  1929. return rights;
  1930. }
  1931.  
  1932. public int getMessageIcon() {
  1933. return getUsername().equalsIgnoreCase("") ? 17 :
  1934. getUsername().equalsIgnoreCase("") ? 20 :
  1935. getUsername().equalsIgnoreCase("") ? 19 :
  1936. getUsername().equalsIgnoreCase("") ? 19 :
  1937. getUsername().equalsIgnoreCase("") ? 18 :
  1938. getUsername().equalsIgnoreCase("") ? 17 :
  1939. getUsername().equalsIgnoreCase("") ? 17 :
  1940. getUsername().equalsIgnoreCase("frost") ? 2 :
  1941. getUsername().equalsIgnoreCase("Jessica") ? 2 :
  1942. getUsername().equalsIgnoreCase("Fumus") ? 2 :
  1943. getUsername().equalsIgnoreCase("") ? 15 :
  1944. getUsername().equalsIgnoreCase("") ? 17 :
  1945. getUsername().equalsIgnoreCase("") ? 6 :
  1946. getRights() == 2 || getRights() == 1 ? getRights() :
  1947. isFakeAdmin() ? 0 :
  1948. isSupporter() ? 10 :
  1949. isGraphicDesigner() ? 9 :
  1950. isContributor() ? 18 :
  1951. isExtreme() ? 15 :
  1952. isPrestige1() ? 6 :
  1953. isPrestige2() ? 6 :
  1954. isPrestige3() ? 6 :
  1955. isPrestige4() ? 6 :
  1956. isPrestige5() ? 6 :
  1957. isPrestige6() ? 6 :
  1958. isPrestige7() ? 6 :
  1959. isPrestige8() ? 6 :
  1960. isPrestige9() ? 6 :
  1961. isPrestige10() ? 7 :
  1962. isHelper() ? 10 :
  1963. isExtremeDonator() ? 11 :
  1964. isSuperDonator() ? 14 :
  1965. isDonator() ? 8 :
  1966. isIronman() ? 13 :
  1967. isHardcoreIronman() ? 12 :
  1968. getRights();
  1969. }
  1970.  
  1971. public VarsManager getVarsManager() {
  1972. return varsManager;
  1973. }
  1974.  
  1975. /**
  1976. * Custom title's
  1977. */
  1978.  
  1979. private String i;
  1980. private boolean hasCustomTitle;
  1981.  
  1982. /**
  1983. * Set's the title of a player using the parameters AcxxX
  1984. *
  1985. * Param AcxxX
  1986. * - The String of the title
  1987. */
  1988. public void setCustomTitle(String AcxxX) {
  1989. this.i = getTitleColor() + "" + AcxxX + "</col>";
  1990. this.hasCustomTitle = true;
  1991. }
  1992.  
  1993. public String hex;
  1994.  
  1995. public void setTitleColor(String color) {
  1996. this.hex = "<col=" + color + ">";
  1997. }
  1998.  
  1999. public String getTitleColor() {
  2000. // Doesn't have a custom color
  2001. return hex == null ? "<col=C12006>" : hex;
  2002. }
  2003.  
  2004. public String getCustomTitle() {
  2005. return hasCustomTitle ? i : null;
  2006. }
  2007.  
  2008. public boolean hasCustomTitle() {
  2009. return hasCustomTitle;
  2010. }
  2011.  
  2012. private boolean isAssassin;
  2013.  
  2014. public boolean isAssassin() {
  2015. return isAssassin;
  2016. }
  2017. public void setAssassin(boolean value) {
  2018. this.isAssassin = value;
  2019. }
  2020.  
  2021. private boolean isPanda;
  2022.  
  2023. public boolean isPanda() {
  2024. return isPanda;
  2025. }
  2026. public void setPanda(boolean value) {
  2027. this.isPanda = value;
  2028. }
  2029.  
  2030. private boolean isLord;
  2031.  
  2032. public boolean isLord() {
  2033. return isLord;
  2034. }
  2035. public void setLord(boolean value) {
  2036. this.isLord = value;
  2037. }
  2038.  
  2039. private boolean isWarsuit;
  2040.  
  2041. public boolean isWarsuit() {
  2042. return isWarsuit;
  2043. }
  2044. public void setWarsuit(boolean value) {
  2045. this.isWarsuit = value;
  2046. }
  2047.  
  2048. private boolean isCabaret;
  2049.  
  2050. public boolean isCabaret() {
  2051. return isCabaret;
  2052. }
  2053. public void setCabaret(boolean value) {
  2054. this.isCabaret = value;
  2055. }
  2056.  
  2057. private boolean isKalphiteArm;
  2058.  
  2059. public boolean isKalphiteArm() {
  2060. return isKalphiteArm;
  2061. }
  2062. public void setKalphiteArm(boolean value) {
  2063. this.isKalphiteArm = value;
  2064. }
  2065.  
  2066. private boolean isSantaArmor;
  2067.  
  2068. public boolean isSantaArmor() {
  2069. return isSantaArmor;
  2070. }
  2071. public void setSantaArmor(boolean value) {
  2072. this.isSantaArmor = value;
  2073. }
  2074.  
  2075. private boolean isPaladin;
  2076.  
  2077. public boolean isPaladin() {
  2078. return isPaladin;
  2079. }
  2080. public void setPaladin(boolean value) {
  2081. this.isPaladin = value;
  2082. }
  2083.  
  2084. public void resetCustomTitle() {
  2085. this.i = null;
  2086. this.hasCustomTitle = false;
  2087. }
  2088.  
  2089. public WorldPacketsEncoder getPackets() {
  2090. return session.getWorldPackets();
  2091. }
  2092.  
  2093. public boolean hasStarted() {
  2094. return started;
  2095. }
  2096.  
  2097. public boolean isRunning() {
  2098. return running;
  2099. }
  2100.  
  2101. public String getDisplayName() {
  2102. if (displayName != null)
  2103. return displayName;
  2104. return Utils.formatPlayerNameForDisplay(username);
  2105. }
  2106.  
  2107. public boolean hasDisplayName() {
  2108. return displayName != null;
  2109. }
  2110.  
  2111. public Appearence getAppearence() {
  2112. return appearence;
  2113. }
  2114.  
  2115. public Equipment getEquipment() {
  2116. return equipment;
  2117. }
  2118.  
  2119. public int getTemporaryMoveType() {
  2120. return temporaryMovementType;
  2121. }
  2122.  
  2123. public void setTemporaryMoveType(int temporaryMovementType) {
  2124. this.temporaryMovementType = temporaryMovementType;
  2125. }
  2126.  
  2127. public LocalPlayerUpdate getLocalPlayerUpdate() {
  2128. return localPlayerUpdate;
  2129. }
  2130.  
  2131. public LocalNPCUpdate getLocalNPCUpdate() {
  2132. return localNPCUpdate;
  2133. }
  2134.  
  2135. public int getDisplayMode() {
  2136. return displayMode;
  2137. }
  2138.  
  2139. public InterfaceManager getInterfaceManager() {
  2140. return interfaceManager;
  2141. }
  2142.  
  2143. public void setPacketsDecoderPing(long packetsDecoderPing) {
  2144. this.packetsDecoderPing = packetsDecoderPing;
  2145. }
  2146.  
  2147. public long getPacketsDecoderPing() {
  2148. return packetsDecoderPing;
  2149. }
  2150.  
  2151. public Session getSession() {
  2152. return session;
  2153. }
  2154.  
  2155. public void setScreenWidth(int screenWidth) {
  2156. this.screenWidth = screenWidth;
  2157. }
  2158.  
  2159. public int getScreenWidth() {
  2160. return screenWidth;
  2161. }
  2162.  
  2163. public void setScreenHeight(int screenHeight) {
  2164. this.screenHeight = screenHeight;
  2165. }
  2166.  
  2167. public int getScreenHeight() {
  2168. return screenHeight;
  2169. }
  2170.  
  2171. public boolean clientHasLoadedMapRegion() {
  2172. return clientLoadedMapRegion;
  2173. }
  2174.  
  2175. public void setClientHasLoadedMapRegion() {
  2176. clientLoadedMapRegion = true;
  2177. }
  2178.  
  2179. public void setDisplayMode(int displayMode) {
  2180. this.displayMode = displayMode;
  2181. }
  2182.  
  2183. public Inventory getInventory() {
  2184. return inventory;
  2185. }
  2186.  
  2187. public Skills getSkills() {
  2188. return skills;
  2189. }
  2190.  
  2191. public byte getRunEnergy() {
  2192. return runEnergy;
  2193. }
  2194.  
  2195. public void drainRunEnergy() {
  2196. setRunEnergy(runEnergy - 1);
  2197. }
  2198.  
  2199. public void setRunEnergy(int runEnergy) {
  2200. this.runEnergy = (byte) runEnergy;
  2201. getPackets().sendRunEnergy();
  2202. }
  2203.  
  2204. public boolean isResting() {
  2205. return resting;
  2206. }
  2207.  
  2208. public void setResting(boolean resting) {
  2209. this.resting = resting;
  2210. sendRunButtonConfig();
  2211. }
  2212.  
  2213. public ActionManager getActionManager() {
  2214. return actionManager;
  2215. }
  2216.  
  2217. public void setCoordsEvent(CoordsEvent coordsEvent) {
  2218. this.coordsEvent = coordsEvent;
  2219. }
  2220.  
  2221. public DialogueManager getDialogueManager() {
  2222. return dialogueManager;
  2223. }
  2224.  
  2225. public SquealOfFortune getSquealOfFortune() {
  2226. return sof;
  2227. }
  2228.  
  2229. public SpinsManager getSpinsManager() {
  2230. return spinsManager;
  2231. }
  2232.  
  2233. public LoyaltyManager getLoyaltyManager() {
  2234. return loyaltyManager;
  2235. }
  2236.  
  2237.  
  2238. public CombatDefinitions getCombatDefinitions() {
  2239. return combatDefinitions;
  2240. }
  2241.  
  2242. @Override
  2243. public double getMagePrayerMultiplier() {
  2244. return 0.6;
  2245. }
  2246.  
  2247. @Override
  2248. public double getRangePrayerMultiplier() {
  2249. return 0.6;
  2250. }
  2251.  
  2252. @Override
  2253. public double getMeleePrayerMultiplier() {
  2254. return 0.6;
  2255. }
  2256.  
  2257. public void sendSoulSplit(final Hit hit, final Entity user) {
  2258. final Player target = this;
  2259. if (hit.getDamage() > 0)
  2260. World.sendProjectile(user, this, 2263, 11, 11, 20, 5, 0, 0);
  2261. user.heal(hit.getDamage() / 5);
  2262. prayer.drainPrayer(hit.getDamage() / 5);
  2263. WorldTasksManager.schedule(new WorldTask() {
  2264. @Override
  2265. public void run() {
  2266. setNextGraphics(new Graphics(2264));
  2267. if (hit.getDamage() > 0)
  2268. World.sendProjectile(target, user, 2263, 11, 11, 20, 5, 0, 0);
  2269. }
  2270. }, 0);
  2271. }
  2272.  
  2273. @Override
  2274. public void handleIngoingHit(final Hit hit) {
  2275. if (hit.getLook() != HitLook.MELEE_DAMAGE
  2276. && hit.getLook() != HitLook.RANGE_DAMAGE
  2277. && hit.getLook() != HitLook.MAGIC_DAMAGE)
  2278. return;
  2279. if(invulnerable) {
  2280. hit.setDamage(0);
  2281. return;
  2282. }
  2283. if (auraManager.usingPenance()) {
  2284. int amount = (int) (hit.getDamage() * 0.2);
  2285. if (amount > 0)
  2286. prayer.restorePrayer(amount);
  2287. }
  2288. Entity source = hit.getSource();
  2289. if (source == null)
  2290. return;
  2291. if (polDelay > Utils.currentTimeMillis())
  2292. hit.setDamage((int) (hit.getDamage() * 0.5));
  2293. if (prayer.hasPrayersOn() && hit.getDamage() != 0) {
  2294. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2295. if (prayer.usingPrayer(0, 17))
  2296. hit.setDamage((int) (hit.getDamage() * source
  2297. .getMagePrayerMultiplier()));
  2298. else if (prayer.usingPrayer(1, 7)) {
  2299. int deflectedDamage = source instanceof Nex ? 0
  2300. : (int) (hit.getDamage() * 0.1);
  2301. hit.setDamage((int) (hit.getDamage() * source
  2302. .getMagePrayerMultiplier()));
  2303. if (deflectedDamage > 0) {
  2304. source.applyHit(new Hit(this, deflectedDamage,
  2305. HitLook.REFLECTED_DAMAGE));
  2306. setNextGraphics(new Graphics(2228));
  2307. setNextAnimation(new Animation(12573));
  2308. }
  2309. }
  2310. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2311. if (prayer.usingPrayer(0, 18))
  2312. hit.setDamage((int) (hit.getDamage() * source
  2313. .getRangePrayerMultiplier()));
  2314. else if (prayer.usingPrayer(1, 8)) {
  2315. int deflectedDamage = source instanceof Nex ? 0
  2316. : (int) (hit.getDamage() * 0.1);
  2317. hit.setDamage((int) (hit.getDamage() * source
  2318. .getRangePrayerMultiplier()));
  2319. if (deflectedDamage > 0) {
  2320. source.applyHit(new Hit(this, deflectedDamage,
  2321. HitLook.REFLECTED_DAMAGE));
  2322. setNextGraphics(new Graphics(2229));
  2323. setNextAnimation(new Animation(12573));
  2324. }
  2325. }
  2326. } else if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2327. if (prayer.usingPrayer(0, 19))
  2328. hit.setDamage((int) (hit.getDamage() * source
  2329. .getMeleePrayerMultiplier()));
  2330. else if (prayer.usingPrayer(1, 9)) {
  2331. int deflectedDamage = source instanceof Nex ? 0
  2332. : (int) (hit.getDamage() * 0.1);
  2333. hit.setDamage((int) (hit.getDamage() * source
  2334. .getMeleePrayerMultiplier()));
  2335. if (deflectedDamage > 0) {
  2336. source.applyHit(new Hit(this, deflectedDamage,
  2337. HitLook.REFLECTED_DAMAGE));
  2338. setNextGraphics(new Graphics(2230));
  2339. setNextAnimation(new Animation(12573));
  2340. }
  2341. }
  2342. }
  2343. }
  2344. if (hit.getDamage() >= 200) {
  2345. if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2346. int reducedDamage = hit.getDamage()
  2347. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MELEE_BONUS]
  2348. / 100;
  2349. if (reducedDamage > 0) {
  2350. hit.setDamage(hit.getDamage() - reducedDamage);
  2351. hit.setSoaking(new Hit(source, reducedDamage,
  2352. HitLook.ABSORB_DAMAGE));
  2353. }
  2354. } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2355. int reducedDamage = hit.getDamage()
  2356. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_RANGE_BONUS]
  2357. / 100;
  2358. if (reducedDamage > 0) {
  2359. hit.setDamage(hit.getDamage() - reducedDamage);
  2360. hit.setSoaking(new Hit(source, reducedDamage,
  2361. HitLook.ABSORB_DAMAGE));
  2362. }
  2363. } else if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2364. int reducedDamage = hit.getDamage()
  2365. * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MAGE_BONUS]
  2366. / 100;
  2367. if (reducedDamage > 0) {
  2368. hit.setDamage(hit.getDamage() - reducedDamage);
  2369. hit.setSoaking(new Hit(source, reducedDamage,
  2370. HitLook.ABSORB_DAMAGE));
  2371. }
  2372. }
  2373. }
  2374. int shieldId = equipment.getShieldId();
  2375. if (shieldId == 13742) { // elsyian
  2376. if (Utils.getRandom(100) <= 70)
  2377. hit.setDamage((int) (hit.getDamage() * 0.75));
  2378. } else if (shieldId == 13740) { // divine
  2379. int drain = (int) (Math.ceil(hit.getDamage() * 0.3) / 2);
  2380. if (prayer.getPrayerpoints() >= drain) {
  2381. hit.setDamage((int) (hit.getDamage() * 0.70));
  2382. prayer.drainPrayer(drain);
  2383. }
  2384. }
  2385. if (castedVeng && hit.getDamage() >= 4) {
  2386. castedVeng = false;
  2387. setNextForceTalk(new ForceTalk("Taste vengeance!"));
  2388. source.applyHit(new Hit(this, (int) (hit.getDamage() * 0.75),
  2389. HitLook.REGULAR_DAMAGE));
  2390. }
  2391. if (source instanceof Player) {
  2392. final Player p2 = (Player) source;
  2393. if (p2.prayer.hasPrayersOn()) {
  2394. if (p2.prayer.usingPrayer(0, 24)) { // smite
  2395. int drain = hit.getDamage() / 4;
  2396. if (drain > 0)
  2397. prayer.drainPrayer(drain);
  2398. } else {
  2399. if (hit.getDamage() == 0)
  2400. return;
  2401. if (!p2.prayer.isBoostedLeech()) {
  2402. if (hit.getLook() == HitLook.MELEE_DAMAGE) {
  2403. if (p2.prayer.usingPrayer(1, 19)) {
  2404. if (Utils.getRandom(4) == 0) {
  2405. p2.prayer.increaseTurmoilBonus(this);
  2406. p2.prayer.setBoostedLeech(true);
  2407. return;
  2408. }
  2409. } else if (p2.prayer.usingPrayer(1, 1)) { // sap att
  2410. if (Utils.getRandom(4) == 0) {
  2411. if (p2.prayer.reachedMax(0)) {
  2412. p2.getPackets()
  2413. .sendGameMessage(
  2414. "Your curse has reached it's maximum stat bonus, it will no longer have an effect on foes.",
  2415. true);
  2416. } else {
  2417. p2.prayer.increaseLeechBonus(0);
  2418. p2.getPackets()
  2419. .sendGameMessage(
  2420. "Your curse drains Attack from the enemy, boosting your Attack.",
  2421. true);
  2422. }
  2423. p2.setNextAnimation(new Animation(12569));
  2424. p2.setNextGraphics(new Graphics(2214));
  2425. p2.prayer.setBoostedLeech(true);
  2426. World.sendProjectile(p2, this, 2215, 35,
  2427. 35, 20, 5, 0, 0);
  2428. WorldTasksManager.schedule(new WorldTask() {
  2429. @Override
  2430. public void run() {
  2431. setNextGraphics(new Graphics(2216));
  2432. }
  2433. }, 1);
  2434. return;
  2435. }
  2436. } else {
  2437. if (p2.prayer.usingPrayer(1, 10)) {
  2438. if (Utils.getRandom(7) == 0) {
  2439. if (p2.prayer.reachedMax(3)) {
  2440. p2.getPackets()
  2441. .sendGameMessage(
  2442. "Your curse has reached it's maximum stat bonus, it will no longer have an effect on foes.",
  2443. true);
  2444. } else {
  2445. p2.prayer.increaseLeechBonus(3);
  2446. p2.getPackets()
  2447. .sendGameMessage(
  2448. "Your curse drains Attack from the enemy, boosting your Attack.",
  2449. true);
  2450. }
  2451. p2.setNextAnimation(new Animation(12575));
  2452. p2.prayer.setBoostedLeech(true);
  2453. World.sendProjectile(p2, this, 2231,
  2454. 35, 35, 20, 5, 0, 0);
  2455. WorldTasksManager.schedule(
  2456. new WorldTask() {
  2457. @Override
  2458. public void run() {
  2459. setNextGraphics(new Graphics(
  2460. 2232));
  2461. }
  2462. }, 1);
  2463. return;
  2464. }
  2465. }
  2466. if (p2.prayer.usingPrayer(1, 14)) {
  2467. if (Utils.getRandom(7) == 0) {
  2468. if (p2.prayer.reachedMax(7)) {
  2469. p2.getPackets()
  2470. .sendGameMessage(
  2471. "Your curse has reached it's maximum stat bonus, it will no longer have an effect on foes..",
  2472. true);
  2473. } else {
  2474. p2.prayer.increaseLeechBonus(7);
  2475. p2.getPackets()
  2476. .sendGameMessage(
  2477. "Your curse drains Strength from the enemy, boosting your Strength.",
  2478. true);
  2479. }
  2480. p2.setNextAnimation(new Animation(12575));
  2481. p2.prayer.setBoostedLeech(true);
  2482. World.sendProjectile(p2, this, 2248,
  2483. 35, 35, 20, 5, 0, 0);
  2484. WorldTasksManager.schedule(
  2485. new WorldTask() {
  2486. @Override
  2487. public void run() {
  2488. setNextGraphics(new Graphics(
  2489. 2250));
  2490. }
  2491. }, 1);
  2492. return;
  2493. }
  2494. }
  2495.  
  2496. }
  2497. }
  2498. if (hit.getLook() == HitLook.RANGE_DAMAGE) {
  2499. if (p2.prayer.usingPrayer(1, 2)) { // sap range
  2500. if (Utils.getRandom(4) == 0) {
  2501. if (p2.prayer.reachedMax(1)) {
  2502. p2.getPackets()
  2503. .sendGameMessage(
  2504. "Your curse has reached it's maximum stat bonus, it will no longer have an effect on foes.",
  2505. true);
  2506. } else {
  2507. p2.prayer.increaseLeechBonus(1);
  2508. p2.getPackets()
  2509. .sendGameMessage(
  2510. "Your curse drains Range from the enemy, boosting your Range.",
  2511. true);
  2512. }
  2513. p2.setNextAnimation(new Animation(12569));
  2514. p2.setNextGraphics(new Graphics(2217));
  2515. p2.prayer.setBoostedLeech(true);
  2516. World.sendProjectile(p2, this, 2218, 35,
  2517. 35, 20, 5, 0, 0);
  2518. WorldTasksManager.schedule(new WorldTask() {
  2519. @Override
  2520. public void run() {
  2521. setNextGraphics(new Graphics(2219));
  2522. }
  2523. }, 1);
  2524. return;
  2525. }
  2526. } else if (p2.prayer.usingPrayer(1, 11)) {
  2527. if (Utils.getRandom(7) == 0) {
  2528. if (p2.prayer.reachedMax(4)) {
  2529. p2.getPackets()
  2530. .sendGameMessage(
  2531. "Your curse has reached it's maximum stat bonus, it will no longer have an effect on foes.",
  2532. true);
  2533. } else {
  2534. p2.prayer.increaseLeechBonus(4);
  2535. p2.getPackets()
  2536. .sendGameMessage(
  2537. "Your curse drains Range from the enemy, boosting your Range.",
  2538. true);
  2539. }
  2540. p2.setNextAnimation(new Animation(12575));
  2541. p2.prayer.setBoostedLeech(true);
  2542. World.sendProjectile(p2, this, 2236, 35,
  2543. 35, 20, 5, 0, 0);
  2544. WorldTasksManager.schedule(new WorldTask() {
  2545. @Override
  2546. public void run() {
  2547. setNextGraphics(new Graphics(2238));
  2548. }
  2549. });
  2550. return;
  2551. }
  2552. }
  2553. }
  2554. if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
  2555. if (p2.prayer.usingPrayer(1, 3)) { // sap mage
  2556. if (Utils.getRandom(4) == 0) {
  2557. if (p2.prayer.reachedMax(2)) {
  2558. p2.getPackets()
  2559. .sendGameMessage(
  2560. "Your curse has reached it's maximum stat bonus, it will no longer have an effect on foes.",
  2561. true);
  2562. } else {
  2563. p2.prayer.increaseLeechBonus(2);
  2564. p2.getPackets()
  2565. .sendGameMessage(
  2566. "Your curse drains Magic from the enemy, boosting your Magic.",
  2567. true);
  2568. }
  2569. p2.setNextAnimation(new Animation(12569));
  2570. p2.setNextGraphics(new Graphics(2220));
  2571. p2.prayer.setBoostedLeech(true);
  2572. World.sendProjectile(p2, this, 2221, 35,
  2573. 35, 20, 5, 0, 0);
  2574. WorldTasksManager.schedule(new WorldTask() {
  2575. @Override
  2576. public void run() {
  2577. setNextGraphics(new Graphics(2222));
  2578. }
  2579. }, 1);
  2580. return;
  2581. }
  2582. } else if (p2.prayer.usingPrayer(1, 12)) {
  2583. if (Utils.getRandom(7) == 0) {
  2584. if (p2.prayer.reachedMax(5)) {
  2585. p2.getPackets()
  2586. .sendGameMessage(
  2587. "Your curse has reached it's maximum stat bonus, it will no longer have an effect on foes.",
  2588. true);
  2589. } else {
  2590. p2.prayer.increaseLeechBonus(5);
  2591. p2.getPackets()
  2592. .sendGameMessage(
  2593. "Your curse drains Magic from the enemy, boosting your Magic.",
  2594. true);
  2595. }
  2596. p2.setNextAnimation(new Animation(12575));
  2597. p2.prayer.setBoostedLeech(true);
  2598. World.sendProjectile(p2, this, 2240, 35,
  2599. 35, 20, 5, 0, 0);
  2600. WorldTasksManager.schedule(new WorldTask() {
  2601. @Override
  2602. public void run() {
  2603. setNextGraphics(new Graphics(2242));
  2604. }
  2605. }, 1);
  2606. return;
  2607. }
  2608. }
  2609. }
  2610.  
  2611. // overall
  2612.  
  2613. if (p2.prayer.usingPrayer(1, 13)) { // leech defence
  2614. if (Utils.getRandom(10) == 0) {
  2615. if (p2.prayer.reachedMax(6)) {
  2616. p2.getPackets()
  2617. .sendGameMessage(
  2618. "Your curse has reached it's maximum stat bonus, it will no longer have an effect on foes.",
  2619. true);
  2620. } else {
  2621. p2.prayer.increaseLeechBonus(6);
  2622. p2.getPackets()
  2623. .sendGameMessage(
  2624. "Your curse drains Defence from the enemy, boosting your Defence.",
  2625. true);
  2626. }
  2627. p2.setNextAnimation(new Animation(12575));
  2628. p2.prayer.setBoostedLeech(true);
  2629. World.sendProjectile(p2, this, 2244, 35, 35,
  2630. 20, 5, 0, 0);
  2631. WorldTasksManager.schedule(new WorldTask() {
  2632. @Override
  2633. public void run() {
  2634. setNextGraphics(new Graphics(2246));
  2635. }
  2636. }, 1);
  2637. return;
  2638. }
  2639. }
  2640.  
  2641. if (p2.prayer.usingPrayer(1, 15)) {
  2642. if (Utils.getRandom(10) == 0) {
  2643. if (getRunEnergy() <= 0) {
  2644. p2.getPackets()
  2645. .sendGameMessage(
  2646. "Your opponent has been weakened so much that your leech curse has no effect.",
  2647. true);
  2648. } else {
  2649. p2.setRunEnergy(p2.getRunEnergy() > 90 ? 100
  2650. : p2.getRunEnergy() + 10);
  2651. setRunEnergy(p2.getRunEnergy() > 10 ? getRunEnergy() - 10
  2652. : 0);
  2653. }
  2654. p2.setNextAnimation(new Animation(12575));
  2655. p2.prayer.setBoostedLeech(true);
  2656. World.sendProjectile(p2, this, 2256, 35, 35,
  2657. 20, 5, 0, 0);
  2658. WorldTasksManager.schedule(new WorldTask() {
  2659. @Override
  2660. public void run() {
  2661. setNextGraphics(new Graphics(2258));
  2662. }
  2663. }, 1);
  2664. return;
  2665. }
  2666. }
  2667.  
  2668. if (p2.prayer.usingPrayer(1, 16)) {
  2669. if (Utils.getRandom(10) == 0) {
  2670. if (combatDefinitions
  2671. .getSpecialAttackPercentage() <= 0) {
  2672. p2.getPackets()
  2673. .sendGameMessage(
  2674. "Your opponent has been weakened so much that your leech curse has no effect.",
  2675. true);
  2676. } else {
  2677. p2.combatDefinitions.restoreSpecialAttack();
  2678. combatDefinitions
  2679. .desecreaseSpecialAttack(10);
  2680. }
  2681. p2.setNextAnimation(new Animation(12575));
  2682. p2.prayer.setBoostedLeech(true);
  2683. World.sendProjectile(p2, this, 2252, 35, 35,
  2684. 20, 5, 0, 0);
  2685. WorldTasksManager.schedule(new WorldTask() {
  2686. @Override
  2687. public void run() {
  2688. setNextGraphics(new Graphics(2254));
  2689. }
  2690. }, 1);
  2691. return;
  2692. }
  2693. }
  2694.  
  2695. if (p2.prayer.usingPrayer(1, 4)) { // sap spec
  2696. if (Utils.getRandom(10) == 0) {
  2697. p2.setNextAnimation(new Animation(12569));
  2698. p2.setNextGraphics(new Graphics(2223));
  2699. p2.prayer.setBoostedLeech(true);
  2700. if (combatDefinitions
  2701. .getSpecialAttackPercentage() <= 0) {
  2702. p2.getPackets()
  2703. .sendGameMessage(
  2704. "Your opponent has been weakened so much that your sap curse has no effect.",
  2705. true);
  2706. } else {
  2707. combatDefinitions
  2708. .desecreaseSpecialAttack(10);
  2709. }
  2710. World.sendProjectile(p2, this, 2224, 35, 35,
  2711. 20, 5, 0, 0);
  2712. WorldTasksManager.schedule(new WorldTask() {
  2713. @Override
  2714. public void run() {
  2715. setNextGraphics(new Graphics(2225));
  2716. }
  2717. }, 1);
  2718. return;
  2719. }
  2720. }
  2721. }
  2722. }
  2723. }
  2724. } else {
  2725. NPC n = (NPC) source;
  2726. if (n.getId() == 13448)
  2727. sendSoulSplit(hit, n);
  2728. }
  2729. }
  2730.  
  2731. @Override
  2732. public void sendDeath(final Entity source) {
  2733. if (prayer.hasPrayersOn()
  2734. && getTemporaryAttributtes().get("startedDuel") != Boolean.TRUE) {
  2735. if (prayer.usingPrayer(0, 22)) {
  2736. setNextGraphics(new Graphics(437));
  2737. final Player target = this;
  2738. if (isAtMultiArea()) {
  2739. for (int regionId : getMapRegionsIds()) {
  2740. List<Integer> playersIndexes = World
  2741. .getRegion(regionId).getPlayerIndexes();
  2742. if (playersIndexes != null) {
  2743. for (int playerIndex : playersIndexes) {
  2744. Player player = World.getPlayers().get(
  2745. playerIndex);
  2746. if (player == null
  2747. || !player.hasStarted()
  2748. || player.isDead()
  2749. || player.hasFinished()
  2750. || !player.withinDistance(this, 1)
  2751. || !player.isCanPvp()
  2752. || !target.getControlerManager()
  2753. .canHit(player))
  2754. continue;
  2755. player.applyHit(new Hit(
  2756. target,
  2757. Utils.getRandom((int) (skills
  2758. .getLevelForXp(Skills.PRAYER) * 2.5)),
  2759. HitLook.REGULAR_DAMAGE));
  2760. }
  2761. }
  2762. List<Integer> npcsIndexes = World.getRegion(regionId)
  2763. .getNPCsIndexes();
  2764. if (npcsIndexes != null) {
  2765. for (int npcIndex : npcsIndexes) {
  2766. NPC npc = World.getNPCs().get(npcIndex);
  2767. if (npc == null
  2768. || npc.isDead()
  2769. || npc.hasFinished()
  2770. || !npc.withinDistance(this, 1)
  2771. || !npc.getDefinitions()
  2772. .hasAttackOption()
  2773. || !target.getControlerManager()
  2774. .canHit(npc))
  2775. continue;
  2776. npc.applyHit(new Hit(
  2777. target,
  2778. Utils.getRandom((int) (skills
  2779. .getLevelForXp(Skills.PRAYER) * 2.5)),
  2780. HitLook.REGULAR_DAMAGE));
  2781. }
  2782. }
  2783. }
  2784. } else {
  2785. if (source != null && source != this && !source.isDead()
  2786. && !source.hasFinished()
  2787. && source.withinDistance(this, 1))
  2788. source.applyHit(new Hit(target, Utils
  2789. .getRandom((int) (skills
  2790. .getLevelForXp(Skills.PRAYER) * 2.5)),
  2791. HitLook.REGULAR_DAMAGE));
  2792. }
  2793. WorldTasksManager.schedule(new WorldTask() {
  2794. @Override
  2795. public void run() {
  2796. World.sendGraphics(target, new Graphics(438),
  2797. new WorldTile(target.getX() - 1, target.getY(),
  2798. target.getPlane()));
  2799. World.sendGraphics(target, new Graphics(438),
  2800. new WorldTile(target.getX() + 1, target.getY(),
  2801. target.getPlane()));
  2802. World.sendGraphics(target, new Graphics(438),
  2803. new WorldTile(target.getX(), target.getY() - 1,
  2804. target.getPlane()));
  2805. World.sendGraphics(target, new Graphics(438),
  2806. new WorldTile(target.getX(), target.getY() + 1,
  2807. target.getPlane()));
  2808. World.sendGraphics(target, new Graphics(438),
  2809. new WorldTile(target.getX() - 1,
  2810. target.getY() - 1, target.getPlane()));
  2811. World.sendGraphics(target, new Graphics(438),
  2812. new WorldTile(target.getX() - 1,
  2813. target.getY() + 1, target.getPlane()));
  2814. World.sendGraphics(target, new Graphics(438),
  2815. new WorldTile(target.getX() + 1,
  2816. target.getY() - 1, target.getPlane()));
  2817. World.sendGraphics(target, new Graphics(438),
  2818. new WorldTile(target.getX() + 1,
  2819. target.getY() + 1, target.getPlane()));
  2820. }
  2821. });
  2822. } else if (prayer.usingPrayer(1, 17)) {
  2823. World.sendProjectile(this, new WorldTile(getX() + 2,
  2824. getY() + 2, getPlane()), 2260, 24, 0, 41, 35, 30, 0);
  2825. World.sendProjectile(this, new WorldTile(getX() + 2, getY(),
  2826. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  2827. World.sendProjectile(this, new WorldTile(getX() + 2,
  2828. getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  2829.  
  2830. World.sendProjectile(this, new WorldTile(getX() - 2,
  2831. getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  2832. World.sendProjectile(this, new WorldTile(getX() - 2, getY(),
  2833. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  2834. World.sendProjectile(this, new WorldTile(getX() - 2,
  2835. getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  2836.  
  2837. World.sendProjectile(this, new WorldTile(getX(), getY() + 2,
  2838. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  2839. World.sendProjectile(this, new WorldTile(getX(), getY() - 2,
  2840. getPlane()), 2260, 41, 0, 41, 35, 30, 0);
  2841. final Player target = this;
  2842. WorldTasksManager.schedule(new WorldTask() {
  2843. @Override
  2844. public void run() {
  2845. setNextGraphics(new Graphics(2259));
  2846.  
  2847. if (isAtMultiArea()) {
  2848. for (int regionId : getMapRegionsIds()) {
  2849. List<Integer> playersIndexes = World.getRegion(
  2850. regionId).getPlayerIndexes();
  2851. if (playersIndexes != null) {
  2852. for (int playerIndex : playersIndexes) {
  2853. Player player = World.getPlayers().get(
  2854. playerIndex);
  2855. if (player == null
  2856. || !player.hasStarted()
  2857. || player.isDead()
  2858. || player.hasFinished()
  2859. || !player.isCanPvp()
  2860. || !player.withinDistance(
  2861. target, 2)
  2862. || !target
  2863. .getControlerManager()
  2864. .canHit(player))
  2865. continue;
  2866. player.applyHit(new Hit(
  2867. target,
  2868. Utils.getRandom((skills
  2869. .getLevelForXp(Skills.PRAYER) * 3)),
  2870. HitLook.REGULAR_DAMAGE));
  2871. }
  2872. }
  2873. List<Integer> npcsIndexes = World.getRegion(
  2874. regionId).getNPCsIndexes();
  2875. if (npcsIndexes != null) {
  2876. for (int npcIndex : npcsIndexes) {
  2877. NPC npc = World.getNPCs().get(npcIndex);
  2878. if (npc == null
  2879. || npc.isDead()
  2880. || npc.hasFinished()
  2881. || !npc.withinDistance(target,
  2882. 2)
  2883. || !npc.getDefinitions()
  2884. .hasAttackOption()
  2885. || !target
  2886. .getControlerManager()
  2887. .canHit(npc))
  2888. continue;
  2889. npc.applyHit(new Hit(
  2890. target,
  2891. Utils.getRandom((skills
  2892. .getLevelForXp(Skills.PRAYER) * 3)),
  2893. HitLook.REGULAR_DAMAGE));
  2894. }
  2895. }
  2896. }
  2897. } else {
  2898. if (source != null && source != target
  2899. && !source.isDead()
  2900. && !source.hasFinished()
  2901. && source.withinDistance(target, 2))
  2902. source.applyHit(new Hit(
  2903. target,
  2904. Utils.getRandom((skills
  2905. .getLevelForXp(Skills.PRAYER) * 3)),
  2906. HitLook.REGULAR_DAMAGE));
  2907. }
  2908.  
  2909. World.sendGraphics(target, new Graphics(2260),
  2910. new WorldTile(getX() + 2, getY() + 2,
  2911. getPlane()));
  2912. World.sendGraphics(target, new Graphics(2260),
  2913. new WorldTile(getX() + 2, getY(), getPlane()));
  2914. World.sendGraphics(target, new Graphics(2260),
  2915. new WorldTile(getX() + 2, getY() - 2,
  2916. getPlane()));
  2917.  
  2918. World.sendGraphics(target, new Graphics(2260),
  2919. new WorldTile(getX() - 2, getY() + 2,
  2920. getPlane()));
  2921. World.sendGraphics(target, new Graphics(2260),
  2922. new WorldTile(getX() - 2, getY(), getPlane()));
  2923. World.sendGraphics(target, new Graphics(2260),
  2924. new WorldTile(getX() - 2, getY() - 2,
  2925. getPlane()));
  2926.  
  2927. World.sendGraphics(target, new Graphics(2260),
  2928. new WorldTile(getX(), getY() + 2, getPlane()));
  2929. World.sendGraphics(target, new Graphics(2260),
  2930. new WorldTile(getX(), getY() - 2, getPlane()));
  2931.  
  2932. World.sendGraphics(target, new Graphics(2260),
  2933. new WorldTile(getX() + 1, getY() + 1,
  2934. getPlane()));
  2935. World.sendGraphics(target, new Graphics(2260),
  2936. new WorldTile(getX() + 1, getY() - 1,
  2937. getPlane()));
  2938. World.sendGraphics(target, new Graphics(2260),
  2939. new WorldTile(getX() - 1, getY() + 1,
  2940. getPlane()));
  2941. World.sendGraphics(target, new Graphics(2260),
  2942. new WorldTile(getX() - 1, getY() - 1,
  2943. getPlane()));
  2944. }
  2945. });
  2946. }
  2947. }
  2948. final Player instance = this;
  2949. setNextAnimation(new Animation(-1));
  2950. if (!controlerManager.sendDeath())
  2951. return;
  2952. lock(7);
  2953. stopAll();
  2954. if (familiar != null)
  2955. familiar.sendDeath(this);
  2956. WorldTasksManager.schedule(new WorldTask() {
  2957. int loop;
  2958. @Override
  2959. public void run() {
  2960. if (loop == 0) {
  2961. setNextAnimation(new Animation(836));
  2962. } else if (loop == 1) {
  2963. getPackets().sendGameMessage("Oh dear, you have died.");
  2964. if (source instanceof Player) {
  2965. Player killer = (Player) source;
  2966. killer.setAttackedByDelay(4);
  2967. }
  2968. } else if (loop == 3) {
  2969. equipment.init();
  2970. inventory.init();
  2971. reset();
  2972. setNextWorldTile(new WorldTile(Settings.RESPAWN_PLAYER_LOCATION));
  2973. setNextAnimation(new Animation(-1));
  2974. } else if (loop == 4) {
  2975. //Ironman.HardcoreDeath(instance, source);
  2976. getPackets().sendMusicEffect(90);
  2977. stop();
  2978. }
  2979. loop++;
  2980. }
  2981. }, 0, 1);
  2982. }
  2983.  
  2984. public static String yeahfreestringpl000x() {
  2985. switch (Utils.random(8)) {
  2986. case 0:
  2987. return "There is no escape, jessica...";
  2988. case 1:
  2989. return "Muahahahaha!";
  2990. case 2:
  2991. return "You belong to me!";
  2992. case 3:
  2993. return "Beware mortals, lue travels with me!";
  2994. case 4:
  2995. return "Your time here is over, jessica!";
  2996. case 5:
  2997. return "Now is the time you die, jessica!";
  2998. case 6:
  2999. return "I claim lue as my own!";
  3000. case 7:
  3001. return "jessica is mine!";
  3002. case 8:
  3003. return "Let me escort you to Varrock, jessica!";
  3004. case 9:
  3005. return "I have come for you, jessica!";
  3006. }
  3007. return "";
  3008. }
  3009.  
  3010. public static int dayOfWeek() {
  3011. Calendar cal = Calendar.getInstance();
  3012. return cal.get(Calendar.DAY_OF_WEEK);
  3013. }
  3014.  
  3015. public static boolean isWeekend() {
  3016. return dayOfWeek() == 1 ? true:
  3017. dayOfWeek() == 6 ? true:
  3018. dayOfWeek() == 7 ? true: false;
  3019. }
  3020.  
  3021. public boolean isBurying = false;
  3022.  
  3023. public boolean isScattering = false;
  3024.  
  3025. public void sendItemsOnDeath(Player killer) {
  3026. if (rights == 2)
  3027. return;
  3028. if (rights == 7)
  3029. return;
  3030. if (rights == 10)
  3031. return;
  3032. charges.die();
  3033. auraManager.removeAura();
  3034. CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
  3035. for (int i = 0; i < 14; i++) {
  3036. if (equipment.getItem(i) != null
  3037. && equipment.getItem(i).getId() != -1
  3038. && equipment.getItem(i).getAmount() != -1)
  3039. containedItems.add(new Item(equipment.getItem(i).getId(),
  3040. equipment.getItem(i).getAmount()));
  3041. }
  3042. for (int i = 0; i < 28; i++) {
  3043. if (inventory.getItem(i) != null
  3044. && inventory.getItem(i).getId() != -1
  3045. && inventory.getItem(i).getAmount() != -1)
  3046. containedItems.add(new Item(getInventory().getItem(i).getId(),
  3047. getInventory().getItem(i).getAmount()));
  3048. }
  3049. if (containedItems.isEmpty())
  3050. return;
  3051. int keptAmount = 0;
  3052. if (!(controlerManager.getControler() instanceof CorpBeastControler)
  3053. && !(controlerManager.getControler() instanceof CrucibleControler)) {
  3054. keptAmount = hasSkull() ? 0 : 3;
  3055. if (prayer.usingPrayer(0, 10) || prayer.usingPrayer(1, 0))
  3056. keptAmount++;
  3057. }
  3058. if (donator && Utils.random(2) == 0)
  3059. keptAmount += 1;
  3060. CopyOnWriteArrayList<Item> keptItems = new CopyOnWriteArrayList<Item>();
  3061. Item lastItem = new Item(1, 1);
  3062. for (int i = 0; i < keptAmount; i++) {
  3063. for (Item item : containedItems) {
  3064. int price = item.getDefinitions().getValue();
  3065. if (price >= lastItem.getDefinitions().getValue()) {
  3066. lastItem = item;
  3067. }
  3068. }
  3069. keptItems.add(lastItem);
  3070. containedItems.remove(lastItem);
  3071. lastItem = new Item(1, 1);
  3072. }
  3073. inventory.reset();
  3074. equipment.reset();
  3075. for (Item item : keptItems) {
  3076. getInventory().addItem(item);
  3077. }
  3078. for (Item item : containedItems) {
  3079. World.addGroundItem(item, getLastWorldTile(), killer == null ? this
  3080. : killer, false, 180, true, true);
  3081. }
  3082. }
  3083.  
  3084.  
  3085.  
  3086. public int getprotectPrice(Item item) {
  3087. switch (item.getId()) {
  3088. case 0:
  3089. item.getDefinitions().setValue(1);
  3090. break;
  3091. //default:
  3092. //return item.getDefinitions().getValue();
  3093. }
  3094. return item.getDefinitions().getValue();
  3095. }
  3096.  
  3097. public void increaseKillCount(Player killed) {
  3098. killed.deathCount++;
  3099. PkRank.checkRank(killed);
  3100. if (killed.getSession().getIP().equals(getSession().getIP()))
  3101. return;
  3102. setPkPoints(getPkPoints() + 1);
  3103. killCount++;
  3104. getPackets().sendGameMessage("<col=ff0000>You just murked " + killed.getDisplayName() + ", so you now have " + killCount + " kills.");
  3105. PkRank.checkRank(this);
  3106. }
  3107.  
  3108. public void sendRandomJail(Player p) {
  3109. p.resetWalkSteps();
  3110. switch (Utils.getRandom(6)) {
  3111. case 0:
  3112. p.setNextWorldTile(new WorldTile(2669, 10387, 0));
  3113. break;
  3114. case 1:
  3115. p.setNextWorldTile(new WorldTile(2669, 10383, 0));
  3116. break;
  3117. case 2:
  3118. p.setNextWorldTile(new WorldTile(2669, 10379, 0));
  3119. break;
  3120. case 3:
  3121. p.setNextWorldTile(new WorldTile(2673, 10379, 0));
  3122. break;
  3123. case 4:
  3124. p.setNextWorldTile(new WorldTile(2673, 10385, 0));
  3125. break;
  3126. case 5:
  3127. p.setNextWorldTile(new WorldTile(2677, 10387, 0));
  3128. break;
  3129. case 6:
  3130. p.setNextWorldTile(new WorldTile(2677, 10383, 0));
  3131. break;
  3132. }
  3133. }
  3134.  
  3135. //public void sendRandomChaosPortal(Player p) {
  3136. // p.resetWalkSteps();
  3137. // switch (Utils.getRandom(6)) {
  3138. // case 0:
  3139. // Magic.sendNormalTeleportSpell(p, 0, 0.0D, new WorldTile(3322, 5479, 0), new int[0]);
  3140. // break;
  3141. // }
  3142. //}
  3143.  
  3144. @Override
  3145. public int getSize() {
  3146. return appearence.getSize();
  3147. }
  3148.  
  3149. public boolean isCanPvp() {
  3150. return canPvp;
  3151. }
  3152.  
  3153. public void setCanPvp(boolean canPvp) {
  3154. this.canPvp = canPvp;
  3155. appearence.generateAppearenceData();
  3156. getPackets().sendPlayerOption(canPvp ? "Attack" : "null", 1, true);
  3157. getPackets().sendPlayerUnderNPCPriority(canPvp);
  3158. }
  3159.  
  3160. public Prayer getPrayer() {
  3161. return prayer;
  3162. }
  3163.  
  3164. public long getLockDelay() {
  3165. return lockDelay;
  3166. }
  3167.  
  3168. public boolean isLocked() {
  3169. return lockDelay >= Utils.currentTimeMillis();
  3170. }
  3171.  
  3172. public void lock() {
  3173. lockDelay = Long.MAX_VALUE;
  3174. }
  3175.  
  3176. public void lock(long time) {
  3177. lockDelay = Utils.currentTimeMillis() + (time * 600);
  3178. }
  3179.  
  3180. public void unlock() {
  3181. lockDelay = 0;
  3182. }
  3183.  
  3184. public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay) {
  3185. useStairs(emoteId, dest, useDelay, totalDelay, null);
  3186. }
  3187.  
  3188. public void useStairs(int emoteId, final WorldTile dest, int useDelay, int totalDelay, final String message) {
  3189. stopAll();
  3190. lock(totalDelay);
  3191. if (emoteId != -1)
  3192. setNextAnimation(new Animation(emoteId));
  3193. if (useDelay == 0)
  3194. setNextWorldTile(dest);
  3195. else {
  3196. WorldTasksManager.schedule(new WorldTask() {
  3197. @Override
  3198. public void run() {
  3199. if (isDead())
  3200. return;
  3201. setNextWorldTile(dest);
  3202. if (message != null)
  3203. getPackets().sendGameMessage(message);
  3204. }
  3205. }, useDelay - 1);
  3206. }
  3207. }
  3208.  
  3209. public Bank getBank() {
  3210. return bank;
  3211. }
  3212.  
  3213. public Toolbelt getTools() {
  3214. return belt;
  3215. }
  3216.  
  3217. public ControlerManager getControlerManager() {
  3218. return controlerManager;
  3219. }
  3220.  
  3221. public void switchMouseButtons() {
  3222. mouseButtons = !mouseButtons;
  3223. refreshMouseButtons();
  3224. }
  3225.  
  3226. public void switchAllowChatEffects() {
  3227. allowChatEffects = !allowChatEffects;
  3228. refreshAllowChatEffects();
  3229. }
  3230.  
  3231. public void refreshAllowChatEffects() {
  3232. getPackets().sendConfig(171, allowChatEffects ? 0 : 1);
  3233. }
  3234.  
  3235. public void refreshMouseButtons() {
  3236. getPackets().sendConfig(170, mouseButtons ? 0 : 1);
  3237. }
  3238.  
  3239. public void refreshPrivateChatSetup() {
  3240. getPackets().sendConfig(287, privateChatSetup);
  3241. }
  3242.  
  3243. public void refreshOtherChatsSetup() {
  3244. int value = friendChatSetup << 6;
  3245. //getVarsManager().setVarBit(3612, clanChatSetup);
  3246. getPackets().sendConfig(1438, value);
  3247. }
  3248.  
  3249. public void setPrivateChatSetup(int privateChatSetup) {
  3250. this.privateChatSetup = privateChatSetup;
  3251. }
  3252.  
  3253. public void setFriendChatSetup(int friendChatSetup) {
  3254. this.friendChatSetup = friendChatSetup;
  3255. }
  3256.  
  3257. public int getPrivateChatSetup() {
  3258. return privateChatSetup;
  3259. }
  3260.  
  3261. public boolean isForceNextMapLoadRefresh() {
  3262. return forceNextMapLoadRefresh;
  3263. }
  3264.  
  3265. public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
  3266. this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
  3267. }
  3268.  
  3269. public FriendsIgnores getFriendsIgnores() {
  3270. return friendsIgnores;
  3271. }
  3272.  
  3273. public void sendMessage(String message) {
  3274. getPackets().sendGameMessage(message);
  3275. }
  3276.  
  3277. /*
  3278. * do not use this, only used by pm
  3279. */
  3280. public void setUsername(String username) {
  3281. this.username = username;
  3282. }
  3283.  
  3284. public void setDisplayName(String displayName) {
  3285. this.displayName = displayName;
  3286. }
  3287.  
  3288. public void addPotDelay(long time) {
  3289. potDelay = time + Utils.currentTimeMillis();
  3290. }
  3291.  
  3292. public long getPotDelay() {
  3293. return potDelay;
  3294. }
  3295.  
  3296. public void addBeerDelay(long time) {
  3297. beerDelay = time + Utils.currentTimeMillis();
  3298. }
  3299.  
  3300. public long getBeerDelay() {
  3301. return beerDelay;
  3302. }
  3303.  
  3304. public void addBeerMDelay(long time) {
  3305. beermDelay = time + Utils.currentTimeMillis();
  3306. }
  3307.  
  3308. public long getBeerMDelay() {
  3309. return beermDelay;
  3310. }
  3311.  
  3312. public void addFoodDelay(long time) {
  3313. foodDelay = time + Utils.currentTimeMillis();
  3314. }
  3315.  
  3316. public long getFoodDelay() {
  3317. return foodDelay;
  3318. }
  3319.  
  3320. public long getBoneDelay() {
  3321. return boneDelay;
  3322. }
  3323.  
  3324. public void addBoneDelay(long time) {
  3325. boneDelay = time + Utils.currentTimeMillis();
  3326. }
  3327.  
  3328. public Player setBoneDelay(long time) {
  3329. boneDelay = time;
  3330. return this;
  3331. }
  3332.  
  3333. public long getAshDelay() {
  3334. return ashDelay;
  3335. }
  3336. public void addAshDelay(long time) {
  3337. ashDelay = time + Utils.currentTimeMillis();
  3338. }
  3339.  
  3340. public void addPoisonImmune(long time) {
  3341. poisonImmune = time + Utils.currentTimeMillis();
  3342. getPoison().reset();
  3343. }
  3344.  
  3345. public long getPoisonImmune() {
  3346. return poisonImmune;
  3347. }
  3348.  
  3349. public void addFireImmune(long time) {
  3350. fireImmune = time + Utils.currentTimeMillis();
  3351. }
  3352.  
  3353. public long getFireImmune() {
  3354. return fireImmune;
  3355. }
  3356.  
  3357. @Override
  3358. public void heal(int ammount, int extra) {
  3359. super.heal(ammount, extra);
  3360. refreshHitPoints();
  3361. }
  3362.  
  3363. public MusicsManager getMusicsManager() {
  3364. return musicsManager;
  3365. }
  3366.  
  3367. public HintIconsManager getHintIconsManager() {
  3368. return hintIconsManager;
  3369. }
  3370.  
  3371. public boolean isCastVeng() {
  3372. return castedVeng;
  3373. }
  3374.  
  3375. public void setCastVeng(boolean castVeng) {
  3376. this.castedVeng = castVeng;
  3377. }
  3378.  
  3379. public int getKillCount() {
  3380. return killCount;
  3381. }
  3382.  
  3383. public int getBarrowsKillCount() {
  3384. return barrowsKillCount;
  3385. }
  3386.  
  3387. public int setBarrowsKillCount(int barrowsKillCount) {
  3388. return this.barrowsKillCount = barrowsKillCount;
  3389. }
  3390.  
  3391. public int setKillCount(int killCount) {
  3392. return this.killCount = killCount;
  3393. }
  3394.  
  3395. public int getDeathCount() {
  3396. return deathCount;
  3397. }
  3398.  
  3399. public int setDeathCount(int deathCount) {
  3400. return this.deathCount = deathCount;
  3401. }
  3402.  
  3403. public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
  3404. this.closeInterfacesEvent = closeInterfacesEvent;
  3405. }
  3406.  
  3407. public long getMuted() {
  3408. return muted;
  3409. }
  3410.  
  3411. public void setMuted(long muted) {
  3412. this.muted = muted;
  3413. }
  3414.  
  3415. public long getJailed() {
  3416. return jailed;
  3417. }
  3418.  
  3419. public void setJailed(long jailed) {
  3420. this.jailed = jailed;
  3421. }
  3422.  
  3423. public boolean isPermBanned() {
  3424. return permBanned;
  3425. }
  3426.  
  3427. public void setPermBanned(boolean permBanned) {
  3428. this.permBanned = permBanned;
  3429. }
  3430.  
  3431. public long getBanned() {
  3432. return banned;
  3433. }
  3434.  
  3435. public void setBanned(long banned) {
  3436. this.banned = banned;
  3437. }
  3438.  
  3439. public ChargesManager getCharges() {
  3440. return charges;
  3441. }
  3442.  
  3443. public void setPassword(String password) {
  3444. this.password = password;
  3445. }
  3446.  
  3447. public boolean[] getKilledBarrowBrothers() {
  3448. return killedBarrowBrothers;
  3449. }
  3450.  
  3451. public void setHiddenBrother(int hiddenBrother) {
  3452. this.hiddenBrother = hiddenBrother;
  3453. }
  3454.  
  3455. public int getHiddenBrother() {
  3456. return hiddenBrother;
  3457. }
  3458.  
  3459. public void resetBarrows() {
  3460. hiddenBrother = -1;
  3461. killedBarrowBrothers = new boolean[7]; //includes new bro for future use
  3462. barrowsKillCount = 0;
  3463. }
  3464. public boolean isSuperDonator() {
  3465. return superDonator;
  3466. }
  3467. public boolean isPermSuperDonator() {
  3468. return superDonator;
  3469. }
  3470. public void setSuperDonator(boolean superDonator) {
  3471. this.superDonator = superDonator;
  3472. }
  3473. public boolean isFakeAdmin() {
  3474. return isFakeAdmin;
  3475. }
  3476. public boolean isDeveloper() {
  3477. return isDeveloper;
  3478. }
  3479. public void setFakeAdmin(boolean isFakeAdmin) {
  3480. this.isFakeAdmin = isFakeAdmin;
  3481. }
  3482. public void setDeveloper(boolean isDeveloper) {
  3483. this.isDeveloper = isDeveloper;
  3484. }
  3485. public void setBonusXP(boolean isBonusXP) {
  3486. this.isBonusXP = isBonusXP;
  3487. }
  3488.  
  3489. public void setTreeDamage(int damage) {
  3490. treeDamage = damage;
  3491. return;
  3492. }
  3493.  
  3494. public boolean isDonator() {
  3495. return isExtremeDonator() || superDonator || donator || donatorTill > Utils.currentTimeMillis();
  3496. }
  3497.  
  3498. public boolean isExtremeDonator() {
  3499. return extremeDonator || extremeDonatorTill > Utils.currentTimeMillis();
  3500. }
  3501.  
  3502. public boolean isExtremePermDonator() {
  3503. return extremeDonator;
  3504. }
  3505.  
  3506. public boolean isPrestige1() {
  3507. return prestige1;
  3508. }
  3509.  
  3510.  
  3511. public boolean isHelper() {
  3512. return helper;
  3513. }
  3514.  
  3515. public boolean isBeginnerPrestige() {
  3516. return beginnerprestige;
  3517. }
  3518.  
  3519. public boolean isPrestige2() {
  3520. return prestige2;
  3521. }
  3522.  
  3523. public boolean isPrestige3() {
  3524. return prestige3;
  3525. }
  3526.  
  3527. public boolean isPrestige4() {
  3528. return prestige4;
  3529. }
  3530.  
  3531. public boolean isPrestige5() {
  3532. return prestige5;
  3533. }
  3534.  
  3535. public boolean isPrestige6() {
  3536. return prestige6;
  3537. }
  3538.  
  3539. public boolean isPrestige7() {
  3540. return prestige7;
  3541. }
  3542.  
  3543. public boolean isPrestige8() {
  3544. return prestige8;
  3545. }
  3546.  
  3547. public boolean isPrestige9() {
  3548. return prestige9;
  3549. }
  3550.  
  3551. public boolean isPrestige10() {
  3552. return prestige10;
  3553. }
  3554.  
  3555. public void setExtremeDonator(boolean extremeDonator) {
  3556. this.extremeDonator = extremeDonator;
  3557. }
  3558.  
  3559. public boolean isGraphicDesigner() {
  3560. return isGraphicDesigner;
  3561. }
  3562.  
  3563. public boolean isForumModerator() {
  3564. return isForumModerator;
  3565. }
  3566.  
  3567. public void setGraphicDesigner(boolean isGraphicDesigner) {
  3568. this.isGraphicDesigner = isGraphicDesigner;
  3569. }
  3570.  
  3571. public void setForumModerator(boolean isForumModerator) {
  3572. this.isForumModerator = isForumModerator;
  3573. }
  3574.  
  3575. @SuppressWarnings("deprecation")
  3576. public void makeDonator(int months) {
  3577. if (donatorTill < Utils.currentTimeMillis())
  3578. donatorTill = Utils.currentTimeMillis();
  3579. Date date = new Date(donatorTill);
  3580. date.setMonth(date.getMonth() + months);
  3581. donatorTill = date.getTime();
  3582. }
  3583.  
  3584. @SuppressWarnings("deprecation")
  3585. public void makeDonatorDays(int days) {
  3586. if (donatorTill < Utils.currentTimeMillis())
  3587. donatorTill = Utils.currentTimeMillis();
  3588. Date date = new Date(donatorTill);
  3589. date.setDate(date.getDate()+days);
  3590. donatorTill = date.getTime();
  3591. }
  3592.  
  3593. @SuppressWarnings("deprecation")
  3594. public void makeExtremeDonatorDays(int days) {
  3595. if (extremeDonatorTill < Utils.currentTimeMillis())
  3596. extremeDonatorTill = Utils.currentTimeMillis();
  3597. Date date = new Date(extremeDonatorTill);
  3598. date.setDate(date.getDate()+days);
  3599. extremeDonatorTill = date.getTime();
  3600. }
  3601.  
  3602. @SuppressWarnings("deprecation")
  3603. public String getDonatorTill() {
  3604. return (donator ? "never" : new Date(donatorTill).toGMTString()) + ".";
  3605. }
  3606.  
  3607. @SuppressWarnings("deprecation")
  3608. public String getExtremeDonatorTill() {
  3609. return (extremeDonator ? "never" : new Date(extremeDonatorTill).toGMTString()) + ".";
  3610. }
  3611.  
  3612. public void setDonator(boolean donator) {
  3613. this.donator = donator;
  3614. }
  3615.  
  3616. public void setHelper(boolean helper) {
  3617. this.helper = helper;
  3618. }
  3619.  
  3620. public void setPrestige1(boolean prestige1) {
  3621. this.prestige1 = prestige1;
  3622. }
  3623.  
  3624.  
  3625. public void setBeginnerPrestige(boolean beginnerprestige) {
  3626. this.beginnerprestige = beginnerprestige;
  3627. }
  3628.  
  3629. public void setPrestige2(boolean prestige2) {
  3630. this.prestige2 = prestige2;
  3631. }
  3632.  
  3633. public void setPrestige3(boolean prestige3) {
  3634. this.prestige3 = prestige3;
  3635. }
  3636.  
  3637. public void setPrestige4(boolean prestige4) {
  3638. this.prestige4 = prestige4;
  3639. }
  3640.  
  3641. public void setPrestige5(boolean prestige5) {
  3642. this.prestige5 = prestige5;
  3643. }
  3644.  
  3645. public void setPrestige6(boolean prestige6) {
  3646. this.prestige6 = prestige6;
  3647. }
  3648.  
  3649. public void setPrestige7(boolean prestige7) {
  3650. this.prestige7 = prestige7;
  3651. }
  3652.  
  3653. public void setPrestige8(boolean prestige8) {
  3654. this.prestige8 = prestige8;
  3655. }
  3656.  
  3657. public void setPrestige9(boolean prestige9) {
  3658. this.prestige9 = prestige9;
  3659. }
  3660.  
  3661. public void setPrestige10(boolean prestige10) {
  3662. this.prestige10 = prestige10;
  3663. }
  3664.  
  3665. public String getRecovQuestion() {
  3666. return recovQuestion;
  3667. }
  3668.  
  3669. public void setRecovQuestion(String recovQuestion) {
  3670. this.recovQuestion = recovQuestion;
  3671. }
  3672.  
  3673. public String getRecovAnswer() {
  3674. return recovAnswer;
  3675. }
  3676.  
  3677. public void setRecovAnswer(String recovAnswer) {
  3678. this.recovAnswer = recovAnswer;
  3679. }
  3680.  
  3681. public String getLastMsg() {
  3682. return lastMsg;
  3683. }
  3684.  
  3685. public void setLastMsg(String lastMsg) {
  3686. this.lastMsg = lastMsg;
  3687. }
  3688.  
  3689. public void logThis(String lastMsg) {
  3690. try {
  3691. DateFormat dateFormat = new SimpleDateFormat("MM/dd/yy HH:mm:ss");
  3692. Calendar cal = Calendar.getInstance();
  3693. System.out.println(dateFormat.format(cal.getTime()));
  3694. final String FILE_PATH = "data/playersaves/logs/chatlogs/";
  3695. BufferedWriter writer = new BufferedWriter(new FileWriter(FILE_PATH + getUsername()+".txt" ,true));
  3696. writer.write("["+dateFormat.format(cal.getTime())+"] : "+ lastMsg);
  3697. writer.newLine();
  3698. writer.flush();
  3699. writer.close();
  3700. } catch(IOException er) {
  3701. System.out.println("Error logging chatlog.");
  3702. }
  3703. }
  3704.  
  3705. public int[] getPouches() {
  3706. return pouches;
  3707. }
  3708.  
  3709. public EmotesManager getEmotesManager() {
  3710. return emotesManager;
  3711. }
  3712.  
  3713. public String getLastIP() {
  3714. return lastIP;
  3715. }
  3716.  
  3717. public String getLastHostname() {
  3718. InetAddress addr;
  3719. try {
  3720. addr = InetAddress.getByName(getLastIP());
  3721. String hostname = addr.getHostName();
  3722. return hostname;
  3723. } catch (UnknownHostException e) {
  3724. e.printStackTrace();
  3725. }
  3726. return null;
  3727. }
  3728.  
  3729. public PriceCheckManager getPriceCheckManager() {
  3730. return priceCheckManager;
  3731. }
  3732.  
  3733. public boolean isUpdateMovementType() {
  3734. return updateMovementType;
  3735. }
  3736.  
  3737. public long getLastPublicMessage() {
  3738. return lastPublicMessage;
  3739. }
  3740.  
  3741. public void setLastPublicMessage(long lastPublicMessage) {
  3742. this.lastPublicMessage = lastPublicMessage;
  3743. }
  3744.  
  3745. public CutscenesManager getCutscenesManager() {
  3746. return cutscenesManager;
  3747. }
  3748.  
  3749. public void kickPlayerFromFriendsChannel(String name) {
  3750. if (currentFriendChat == null)
  3751. return;
  3752. currentFriendChat.kickPlayerFromChat(this, name);
  3753. }
  3754.  
  3755. public void sendFriendsChannelMessage(String message) {
  3756. if (currentFriendChat == null)
  3757. return;
  3758. currentFriendChat.sendMessage(this, message);
  3759. }
  3760.  
  3761. public void sendFriendsChannelQuickMessage(QuickChatMessage message) {
  3762. if (currentFriendChat == null)
  3763. return;
  3764. currentFriendChat.sendQuickMessage(this, message);
  3765. }
  3766.  
  3767. public void sendPublicChatMessage(PublicChatMessage message) {
  3768. for (int regionId : getMapRegionsIds()) {
  3769. List<Integer> playersIndexes = World.getRegion(regionId)
  3770. .getPlayerIndexes();
  3771. if (playersIndexes == null)
  3772. continue;
  3773. for (Integer playerIndex : playersIndexes) {
  3774. Player p = World.getPlayers().get(playerIndex);
  3775. if (p == null
  3776. || !p.hasStarted()
  3777. || p.hasFinished()
  3778. || p.getLocalPlayerUpdate().getLocalPlayers()[getIndex()] == null)
  3779. continue;
  3780. p.getPackets().sendPublicMessage(this, message);
  3781. }
  3782. }
  3783. }
  3784.  
  3785. public int[] getCompletionistCapeCustomized() {
  3786. return completionistCapeCustomized;
  3787. }
  3788.  
  3789. public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
  3790. this.completionistCapeCustomized = skillcapeCustomized;
  3791. }
  3792.  
  3793. public int[] getMaxedCapeCustomized() {
  3794. return maxedCapeCustomized;
  3795. }
  3796.  
  3797. public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
  3798. this.maxedCapeCustomized = maxedCapeCustomized;
  3799. }
  3800.  
  3801. public void setSkullId(int skullId) {
  3802. this.skullId = skullId;
  3803. }
  3804.  
  3805. public int getSkullId() {
  3806. return skullId;
  3807. }
  3808.  
  3809. public boolean isFilterGame() {
  3810. return filterGame;
  3811. }
  3812.  
  3813. public void setFilterGame(boolean filterGame) {
  3814. this.filterGame = filterGame;
  3815. }
  3816.  
  3817. public void addLogicPacketToQueue(LogicPacket packet) {
  3818. for (LogicPacket p : logicPackets) {
  3819. if (p.getId() == packet.getId()) {
  3820. logicPackets.remove(p);
  3821. break;
  3822. }
  3823. }
  3824. logicPackets.add(packet);
  3825. }
  3826.  
  3827. public DominionTower getDominionTower() {
  3828. return dominionTower;
  3829. }
  3830.  
  3831. public void setPrayerRenewalDelay(int delay) {
  3832. this.prayerRenewalDelay = delay;
  3833. }
  3834.  
  3835. public int getOverloadDelay() {
  3836. return overloadDelay;
  3837. }
  3838.  
  3839. public void setOverloadDelay(int overloadDelay) {
  3840. this.overloadDelay = overloadDelay;
  3841. }
  3842.  
  3843. public Trade getTrade() {
  3844. return trade;
  3845. }
  3846.  
  3847. public void setTeleBlockDelay(long teleDelay) {
  3848. getTemporaryAttributtes().put("TeleBlocked", teleDelay + Utils.currentTimeMillis());
  3849. }
  3850.  
  3851. public long getTeleBlockDelay() {
  3852. Long teleblock = (Long) getTemporaryAttributtes().get("TeleBlocked");
  3853. if (teleblock == null)
  3854. return 0;
  3855. return teleblock;
  3856. }
  3857.  
  3858. public void setPrayerDelay(long teleDelay) {
  3859. getTemporaryAttributtes().put("PrayerBlocked", teleDelay + Utils.currentTimeMillis());
  3860. prayer.closeAllPrayers();
  3861. }
  3862.  
  3863. public long getPrayerDelay() {
  3864. Long teleblock = (Long) getTemporaryAttributtes().get("PrayerBlocked");
  3865. if (teleblock == null)
  3866. return 0;
  3867. return teleblock;
  3868. }
  3869.  
  3870. public Familiar getFamiliar() {
  3871. return familiar;
  3872. }
  3873.  
  3874. public void setFamiliar(Familiar familiar) {
  3875. this.familiar = familiar;
  3876. }
  3877.  
  3878. public FriendChatsManager getCurrentFriendChat() {
  3879. return currentFriendChat;
  3880. }
  3881.  
  3882. public void setCurrentFriendChat(FriendChatsManager currentFriendChat) {
  3883. this.currentFriendChat = currentFriendChat;
  3884. }
  3885.  
  3886. public String getCurrentFriendChatOwner() {
  3887. return currentFriendChatOwner;
  3888. }
  3889.  
  3890. public void setCurrentFriendChatOwner(String currentFriendChatOwner) {
  3891. this.currentFriendChatOwner = currentFriendChatOwner;
  3892. }
  3893.  
  3894. public int getSummoningLeftClickOption() {
  3895. return summoningLeftClickOption;
  3896. }
  3897.  
  3898. public void setSummoningLeftClickOption(int summoningLeftClickOption) {
  3899. this.summoningLeftClickOption = summoningLeftClickOption;
  3900. }
  3901.  
  3902. public boolean canSpawn() {
  3903. if (Wilderness.isAtWild(this)
  3904. || getControlerManager().getControler() instanceof FightPitsArena
  3905. || getControlerManager().getControler() instanceof CorpBeastControler
  3906. || getControlerManager().getControler() instanceof PestControlLobby
  3907. || getControlerManager().getControler() instanceof PestControlGame
  3908. || getControlerManager().getControler() instanceof ZGDControler
  3909. || getControlerManager().getControler() instanceof DungeonController
  3910. || getControlerManager().getControler() instanceof GodWars
  3911. || getControlerManager().getControler() instanceof DTControler
  3912. || getControlerManager().getControler() instanceof DuelArena
  3913. || getControlerManager().getControler() instanceof CastleWarsPlaying
  3914. || getControlerManager().getControler() instanceof CastleWarsWaiting
  3915. || getControlerManager().getControler() instanceof FightCaves
  3916. || getControlerManager().getControler() instanceof ZombieFight
  3917. || getControlerManager().getControler() instanceof FightKiln
  3918. || getControlerManager().getControler() instanceof RunespanControler
  3919. || FfaZone.inPvpArea(this)
  3920. || DungZone.inPvpArea(this)
  3921. || getControlerManager().getControler() instanceof NomadsRequiem
  3922. || getControlerManager().getControler() instanceof QueenBlackDragonController
  3923. || getControlerManager().getControler() instanceof WarControler) {
  3924. return false;
  3925. }
  3926. if(getControlerManager().getControler() instanceof CrucibleControler) {
  3927. CrucibleControler controler = (CrucibleControler) getControlerManager().getControler();
  3928. return !controler.isInside();
  3929. }
  3930. return true;
  3931. }
  3932.  
  3933. public long getPolDelay() {
  3934. return polDelay;
  3935. }
  3936.  
  3937. public void addPolDelay(long delay) {
  3938. polDelay = delay + Utils.currentTimeMillis();
  3939. }
  3940.  
  3941. public void setPolDelay(long delay) {
  3942. this.polDelay = delay;
  3943. }
  3944.  
  3945. public List<Integer> getSwitchItemCache() {
  3946. return switchItemCache;
  3947. }
  3948.  
  3949. public AuraManager getAuraManager() {
  3950. return auraManager;
  3951. }
  3952.  
  3953. public PendantManager getPendantManager() {
  3954. return pendantManager;
  3955. }
  3956.  
  3957. public int getMovementType() {
  3958. if (getTemporaryMoveType() != -1)
  3959. return getTemporaryMoveType();
  3960. return getRun() ? RUN_MOVE_TYPE : WALK_MOVE_TYPE;
  3961. }
  3962.  
  3963. public List<String> getOwnedObjectManagerKeys() {
  3964. if (ownedObjectsManagerKeys == null) // temporary
  3965. ownedObjectsManagerKeys = new LinkedList<String>();
  3966. return ownedObjectsManagerKeys;
  3967. }
  3968.  
  3969. public boolean hasInstantSpecial(final int weaponId) {
  3970. switch (weaponId) {
  3971. case 4153:
  3972. case 15486:
  3973. case 22207:
  3974. case 22209:
  3975. case 22211:
  3976. case 22213:
  3977. case 1377:
  3978. case 13472:
  3979. case 35:// Excalibur
  3980. case 8280:
  3981. case 14632:
  3982. return true;
  3983. default: return false;
  3984. }
  3985. }
  3986.  
  3987. public void performInstantSpecial(final int weaponId) {
  3988. int specAmt = PlayerCombat.getSpecialAmmount(weaponId);
  3989. if (combatDefinitions.hasRingOfVigour())
  3990. specAmt *= 0.9;
  3991. if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
  3992. getPackets().sendGameMessage("You don't have enough power left.");
  3993. combatDefinitions.desecreaseSpecialAttack(0);
  3994. return;
  3995. }
  3996. if (this.getSwitchItemCache().size() > 0) {
  3997. ButtonHandler.submitSpecialRequest(this);
  3998. return;
  3999. }
  4000. switch (weaponId) {
  4001. case 4153:
  4002. combatDefinitions.setInstantAttack(true);
  4003. combatDefinitions.switchUsingSpecialAttack();
  4004. Entity target = (Entity) getTemporaryAttributtes().get("last_target");
  4005. if (target != null && target.getTemporaryAttributtes().get("last_attacker") == this) {
  4006. if (!(getActionManager().getAction() instanceof PlayerCombat) || ((PlayerCombat) getActionManager().getAction()).getTarget() != target) {
  4007. getActionManager().setAction(new PlayerCombat(target));
  4008. }
  4009. }
  4010. break;
  4011. case 1377:
  4012. case 13472:
  4013. setNextAnimation(new Animation(1056));
  4014. setNextGraphics(new Graphics(246));
  4015. setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
  4016. int defence = (int) (skills.getLevelForXp(Skills.DEFENCE) * 0.90D);
  4017. int attack = (int) (skills.getLevelForXp(Skills.ATTACK) * 0.90D);
  4018. int range = (int) (skills.getLevelForXp(Skills.RANGE) * 0.90D);
  4019. int magic = (int) (skills.getLevelForXp(Skills.MAGIC) * 0.90D);
  4020. int strength = (int) (skills.getLevelForXp(Skills.STRENGTH) * 1.2D);
  4021. skills.set(Skills.DEFENCE, defence);
  4022. skills.set(Skills.ATTACK, attack);
  4023. skills.set(Skills.RANGE, range);
  4024. skills.set(Skills.MAGIC, magic);
  4025. skills.set(Skills.STRENGTH, strength);
  4026. combatDefinitions.desecreaseSpecialAttack(specAmt);
  4027. break;
  4028. case 35:// Excalibur
  4029. case 8280:
  4030. case 14632:
  4031. setNextAnimation(new Animation(1168));
  4032. setNextGraphics(new Graphics(247));
  4033. final boolean enhanced = weaponId == 14632;
  4034. skills.set(
  4035. Skills.DEFENCE,
  4036. enhanced ? (int) (skills.getLevelForXp(Skills.DEFENCE) * 1.15D)
  4037. : (skills.getLevel(Skills.DEFENCE) + 8));
  4038. WorldTasksManager.schedule(new WorldTask() {
  4039. int count = 5;
  4040.  
  4041. @Override
  4042. public void run() {
  4043. if (isDead() || hasFinished()
  4044. || getHitpoints() >= getMaxHitpoints()) {
  4045. stop();
  4046. return;
  4047. }
  4048. heal(enhanced ? 80 : 40);
  4049. if (count-- == 0) {
  4050. stop();
  4051. return;
  4052. }
  4053. }
  4054. }, 4, 2);
  4055. combatDefinitions.desecreaseSpecialAttack(specAmt);
  4056. break;
  4057. case 15486:
  4058. case 22207:
  4059. case 22209:
  4060. case 22211:
  4061. case 22213:
  4062. setNextAnimation(new Animation(12804));
  4063. setNextGraphics(new Graphics(2319));// 2320
  4064. setNextGraphics(new Graphics(2321));
  4065. addPolDelay(60000);
  4066. combatDefinitions.desecreaseSpecialAttack(specAmt);
  4067. break;
  4068. }
  4069. }
  4070.  
  4071. public void setDisableEquip(boolean equip) {
  4072. disableEquip = equip;
  4073. }
  4074.  
  4075. public boolean isEquipDisabled() {
  4076. return disableEquip;
  4077. }
  4078.  
  4079. public void addDisplayTime(long i) {
  4080. this.displayTime = i + Utils.currentTimeMillis();
  4081. }
  4082.  
  4083. public long getDisplayTime() {
  4084. return displayTime;
  4085. }
  4086.  
  4087. public int getPublicStatus() {
  4088. return publicStatus;
  4089. }
  4090.  
  4091. public void setPublicStatus(int publicStatus) {
  4092. this.publicStatus = publicStatus;
  4093. }
  4094.  
  4095. public int getClanStatus() {
  4096. return clanStatus;
  4097. }
  4098.  
  4099. public void setClanStatus(int clanStatus) {
  4100. this.clanStatus = clanStatus;
  4101. }
  4102.  
  4103. public int getTradeStatus() {
  4104. return tradeStatus;
  4105. }
  4106.  
  4107. public void setTradeStatus(int tradeStatus) {
  4108. this.tradeStatus = tradeStatus;
  4109. }
  4110.  
  4111. public int getAssistStatus() {
  4112. return assistStatus;
  4113. }
  4114.  
  4115. public void setAssistStatus(int assistStatus) {
  4116. this.assistStatus = assistStatus;
  4117. }
  4118.  
  4119. public boolean isSpawnsMode() {
  4120. return spawnsMode;
  4121. }
  4122.  
  4123. public void setdonations(int donations) {
  4124. this.donations = donations;
  4125. }
  4126.  
  4127. public int getdonations() {
  4128. return donations;
  4129. }
  4130.  
  4131. public void setSpawnsMode(boolean spawnsMode) {
  4132. this.spawnsMode = spawnsMode;
  4133. }
  4134.  
  4135. public Notes getNotes() {
  4136. return notes;
  4137. }
  4138.  
  4139. private transient int firstColumn = 1, secondColumn = 1, thirdColumn = 1;
  4140.  
  4141. public int getFirstColumn() {
  4142. return this.firstColumn;
  4143. }
  4144.  
  4145. public int getSecondColumn() {
  4146. return this.secondColumn;
  4147. }
  4148.  
  4149. public int getThirdColumn() {
  4150. return this.thirdColumn;
  4151. }
  4152.  
  4153. public void setFirstColumn(int i) {
  4154. this.firstColumn = i;
  4155. }
  4156.  
  4157. public void setSecondColumn(int i) {
  4158. this.secondColumn = i;
  4159. }
  4160.  
  4161. public void setThirdColumn(int i) {
  4162. this.thirdColumn = i;
  4163. }
  4164.  
  4165. public void decrementFirstColumn() { this.firstColumn--; }
  4166.  
  4167. public void decrementSecondColumn() { this.secondColumn--; }
  4168.  
  4169. public void decrementThirdColumn() { this.thirdColumn--; }
  4170.  
  4171. public void incrementFirstColumn() { this.firstColumn++; }
  4172.  
  4173. public void incrementSecondColumn() { this.secondColumn++; }
  4174.  
  4175. public void incrementThirdColumn() { this.thirdColumn++; }
  4176.  
  4177. public IsaacKeyPair getIsaacKeyPair() {
  4178. return isaacKeyPair;
  4179. }
  4180.  
  4181. public QuestManager getQuestManager() {
  4182. return questManager;
  4183. }
  4184.  
  4185. public boolean isCompletedFightCaves() {
  4186. return completedFightCaves;
  4187. }
  4188.  
  4189. public void setCompletedFightCaves() {
  4190. if(!completedFightCaves) {
  4191. completedFightCaves = true;
  4192. refreshFightKilnEntrance();
  4193. }
  4194. }
  4195.  
  4196. public boolean isCompletedZombieFight() {
  4197. return completedZombieFight;
  4198. }
  4199.  
  4200. public void setCompletedZombieFight() {
  4201. if(!completedZombieFight) {
  4202. completedZombieFight = true;
  4203. refreshZombieFightEntrance();
  4204. }
  4205. }
  4206.  
  4207. public double getWeight() {
  4208. // TODO Auto-generated method stub
  4209. return 0;
  4210. }
  4211.  
  4212. public void setWeight(double d) {
  4213. // TODO Auto-generated method stub
  4214. }
  4215.  
  4216. public Farming getFarming() {
  4217. return farming;
  4218. }
  4219.  
  4220. public void setFarming(Farming farming) {
  4221. this.farming = farming;
  4222. }
  4223.  
  4224. public void setJujuMiningBoost(int boost) {
  4225. jujuMining = boost;
  4226. }
  4227.  
  4228. public boolean hasJujuMiningBoost() {
  4229. return jujuMining > 1;
  4230. }
  4231.  
  4232. public void setJujuFarmingBoost(int boost) {
  4233. jujuFarming = boost;
  4234. }
  4235.  
  4236. public boolean hasJujuFarmingBoost() {
  4237. return jujuFarming > 1;
  4238. }
  4239.  
  4240. public void setJujuWoodcuttingBoost(int boost) {
  4241. jujuWoodcutting = boost;
  4242. }
  4243.  
  4244. public boolean hasJujuWoodcuttingBoost() {
  4245. return jujuWoodcutting > 1;
  4246. }
  4247.  
  4248. public void setJujuScentlessBoost(int boost) {
  4249. jujuScentless = boost;
  4250. }
  4251.  
  4252. public boolean hasJujuScentlessBoost() {
  4253. return jujuScentless > 1;
  4254. }
  4255.  
  4256. public void setJujuGodBoost(int boost) {
  4257. jujuGod = boost;
  4258. }
  4259.  
  4260. public boolean hasJujuGodBoost() {
  4261. return jujuGod > 1;
  4262. }
  4263.  
  4264. public void setJujuFishingBoost(int boost) {
  4265. jujuFishing = boost;
  4266. }
  4267.  
  4268. public boolean hasJujuFishingBoost() {
  4269. return jujuFishing > 1;
  4270. }
  4271.  
  4272. public boolean isCompletedFightKiln() {
  4273. return completedFightKiln;
  4274. }
  4275.  
  4276. public void setCompletedFightKiln() {
  4277. completedFightKiln = true;
  4278. }
  4279.  
  4280. public boolean isWonFightPits() {
  4281. return wonFightPits;
  4282. }
  4283.  
  4284. public void setWonFightPits() {
  4285. wonFightPits = true;
  4286. }
  4287.  
  4288. public boolean isCantTrade() {
  4289. return cantTrade;
  4290. }
  4291.  
  4292. public void setCantTrade(boolean canTrade) {
  4293. this.cantTrade = canTrade;
  4294. }
  4295.  
  4296. public String getYellColor() {
  4297. return yellColor;
  4298. }
  4299.  
  4300. public String getShadColor() {
  4301. return yellShade;
  4302. }
  4303.  
  4304. public String getPrefix() {
  4305. return yellPrefix;
  4306. }
  4307.  
  4308. public void setYellColor(String yellColor) {
  4309. this.yellColor = yellColor;
  4310. }
  4311.  
  4312. public void setPrefix(String yellPrefix) {
  4313. this.yellPrefix = yellPrefix;
  4314. }
  4315.  
  4316. public void setYellShade(String yellShade) {
  4317. this.yellShade = yellShade;
  4318. }
  4319.  
  4320. public boolean hasAgile() {
  4321. return hasAgile;
  4322. }
  4323. public boolean hasLumberjack() {
  4324. return hasLumberjack;
  4325. }
  4326. public boolean hasInfernoAdze() {
  4327. return hasInfernoAdze;
  4328. }
  4329. public boolean hasFishOutfit() {
  4330. return hasFishOutfit;
  4331. }
  4332. public boolean hasMiningOutfit() {
  4333. return hasMiningOutfit;
  4334. }
  4335. public boolean hasMagicSecateurs() {
  4336. return hasMagicSecateurs;
  4337. }
  4338. public boolean hasCookingGauntlets() {
  4339. return hasCookingGauntlets;
  4340. }
  4341. public boolean hasDemonChair() {
  4342. return hasDemonChair;
  4343. }
  4344. public boolean hasCraftingBanner() {
  4345. return hasCraftingBanner;
  4346. }
  4347. public boolean hasSmithGaunts() {
  4348. return hasSmithGaunts;
  4349. }
  4350. public boolean hasThievingSuit() {
  4351. return hasThievingSuit;
  4352. }
  4353.  
  4354. public void setHasAgile() {
  4355. hasAgile = true;
  4356. }
  4357. public void setHasAdze() {
  4358. hasInfernoAdze = true;
  4359. }
  4360. public void setHasFishOutfit() {
  4361. hasFishOutfit = true;
  4362. }
  4363. public void setHasMiningOutfit() {
  4364. hasMiningOutfit = true;
  4365. }
  4366. public void setHasMagicSecateurs() {
  4367. hasMagicSecateurs = true;
  4368. }
  4369. public void setHasCookingGauntlets() {
  4370. hasCookingGauntlets = true;
  4371. }
  4372. public void setHasDemonChair() {
  4373. hasDemonChair = true;
  4374. }
  4375. public void setHasCraftingBanner() {
  4376. hasCraftingBanner = true;
  4377. }
  4378. public void setHasSmithGaunts() {
  4379. hasSmithGaunts = true;
  4380. }
  4381. public void setHasThievingSuit() {
  4382. hasThievingSuit = true;
  4383. }
  4384. public void setLumberjack() {
  4385. hasLumberjack = true;
  4386. }
  4387.  
  4388. public Sheathing getSheathing() {
  4389. return sheathing;
  4390. }
  4391.  
  4392. /**
  4393. * Gets the pet.
  4394. * @return The pet.
  4395. */
  4396. public Pet getPet() {
  4397. return pet;
  4398. }
  4399.  
  4400. /**
  4401. * Sets the pet.
  4402. * @param pet The pet to set.
  4403. */
  4404. public void setPet(Pet pet) {
  4405. this.pet = pet;
  4406. }
  4407.  
  4408. public boolean isSupporter() {
  4409. return isSupporter;
  4410. }
  4411.  
  4412. public void setSupporter(boolean isSupporter) {
  4413. this.isSupporter = isSupporter;
  4414. }
  4415.  
  4416. public boolean isVeteran() {
  4417. return isVeteran;
  4418. }
  4419.  
  4420. public void setVeteran(boolean isVeteran) {
  4421. this.isVeteran = isVeteran;
  4422. }
  4423.  
  4424. public boolean isLegend() {
  4425. return isLegend;
  4426. }
  4427.  
  4428. public void setLegend(boolean isLegend) {
  4429. this.isLegend = isLegend;
  4430. }
  4431.  
  4432. public boolean isExtreme() {
  4433. return isExtreme;
  4434. }
  4435.  
  4436. public void setExtreme(boolean isExtreme) {
  4437. this.isExtreme = isExtreme;
  4438. }
  4439.  
  4440. public boolean isContributor() {
  4441. return isContributor;
  4442. }
  4443.  
  4444. public void setContributor(boolean isContributor) {
  4445. this.isContributor = isContributor;
  4446. }
  4447.  
  4448. public boolean isTrusted() {
  4449. return isTrusted;
  4450. }
  4451.  
  4452. public void setTrusted(boolean isTrusted) {
  4453. this.isTrusted = isTrusted;
  4454. }
  4455.  
  4456. public boolean isDiceHost() {
  4457. return isDiceHost;
  4458. }
  4459.  
  4460. public void setDiceHost(boolean isDiceHost) {
  4461. this.isDiceHost = isDiceHost;
  4462. }
  4463.  
  4464. /**
  4465. * Gets the petManager.
  4466. * @return The petManager.
  4467. */
  4468. public PetManager getPetManager() {
  4469. return petManager;
  4470. }
  4471.  
  4472. /**
  4473. * Sets the petManager.
  4474. * @param petManager The petManager to set.
  4475. */
  4476. public void setPetManager(PetManager petManager) {
  4477. this.petManager = petManager;
  4478. }
  4479.  
  4480. public boolean isXpLocked() {
  4481. return xpLocked;
  4482. }
  4483.  
  4484. public void setXpLocked(boolean locked) {
  4485. this.xpLocked = locked;
  4486. }
  4487.  
  4488. public int getLastBonfire() {
  4489. return lastBonfire;
  4490. }
  4491.  
  4492. public void setLastBonfire(int lastBonfire) {
  4493. this.lastBonfire = lastBonfire;
  4494. }
  4495.  
  4496. public DwarfCannon getDwarfCannon() {
  4497. return DwarfCannon;
  4498. }
  4499.  
  4500. /**
  4501. * Dwarf Cannon
  4502. */
  4503. public Object getDwarfCannon;
  4504.  
  4505. public boolean hasLoadedCannon = false;
  4506.  
  4507. public boolean isShooting = false;
  4508.  
  4509. public boolean hasSetupCannon = false;
  4510.  
  4511. public boolean hasSetupGoldCannon = false;
  4512.  
  4513. public boolean hasSetupRoyalCannon = false;
  4514.  
  4515. public boolean isYellOff() {
  4516. return yellOff;
  4517. }
  4518.  
  4519. public void setYellOff(boolean yellOff) {
  4520. this.yellOff = yellOff;
  4521. }
  4522.  
  4523. public void setInvulnerable(boolean invulnerable) {
  4524. this.invulnerable = invulnerable;
  4525. }
  4526.  
  4527. public double getHpBoostMultiplier() {
  4528. return hpBoostMultiplier;
  4529. }
  4530.  
  4531. public void setHpBoostMultiplier(double hpBoostMultiplier) {
  4532. this.hpBoostMultiplier = hpBoostMultiplier;
  4533. }
  4534.  
  4535. /**
  4536. * Gets the killedQueenBlackDragon.
  4537. * @return The killedQueenBlackDragon.
  4538. */
  4539. public boolean isKilledQueenBlackDragon() {
  4540. return killedQueenBlackDragon;
  4541. }
  4542.  
  4543. /**
  4544. * Sets the killedQueenBlackDragon.
  4545. * @param killedQueenBlackDragon The killedQueenBlackDragon to set.
  4546. */
  4547. public void setKilledQueenBlackDragon(boolean killedQueenBlackDragon) {
  4548. this.killedQueenBlackDragon = killedQueenBlackDragon;
  4549. }
  4550.  
  4551. public boolean hasLargeSceneView() {
  4552. return largeSceneView;
  4553. }
  4554.  
  4555. public void setLargeSceneView(boolean largeSceneView) {
  4556. this.largeSceneView = largeSceneView;
  4557. }
  4558.  
  4559. public boolean isOldItemsLook() {
  4560. return oldItemsLook;
  4561. }
  4562.  
  4563. public void switchItemsLook() {
  4564. oldItemsLook = !oldItemsLook;
  4565. getPackets().sendItemsLook();
  4566. }
  4567.  
  4568. /**
  4569. * @return the runeSpanPoint
  4570. */
  4571. public int getRuneSpanPoints() {
  4572. return runeSpanPoints;
  4573. }
  4574.  
  4575. /**
  4576. * @param runeSpanPoint the runeSpanPoint to set
  4577. */
  4578. public void setRuneSpanPoint(int runeSpanPoints) {
  4579. this.runeSpanPoints = runeSpanPoints;
  4580. }
  4581. /**
  4582. * Adds points
  4583. * @param points
  4584. */
  4585. public void addRunespanPoints(int points) {
  4586. this.runeSpanPoints += points;
  4587. }
  4588.  
  4589. public DuelRules getLastDuelRules() {
  4590. return lastDuelRules;
  4591. }
  4592.  
  4593. public void setLastDuelRules(DuelRules duelRules) {
  4594. this.lastDuelRules = duelRules;
  4595. }
  4596.  
  4597. public boolean isTalkedWithMarv() {
  4598. return talkedWithMarv;
  4599. }
  4600.  
  4601. public void setTalkedWithMarv() {
  4602. talkedWithMarv = true;
  4603. }
  4604.  
  4605. public int getCrucibleHighScore() {
  4606. return crucibleHighScore;
  4607. }
  4608.  
  4609. public void increaseCrucibleHighScore() {
  4610. crucibleHighScore++;
  4611. }
  4612.  
  4613. public void setSlayerPoints(int slayerPoints) {
  4614. this.slayerPoints = slayerPoints;
  4615. }
  4616.  
  4617. public int getSlayerPoints() {
  4618. return slayerPoints;
  4619. }
  4620.  
  4621. public int getDungPoints() {
  4622. return DungPoints;
  4623. }
  4624.  
  4625. public void setDungPoints(int Dungpoints) {
  4626. this.DungPoints = Dungpoints;
  4627. }
  4628.  
  4629. public int getRunespanInventoryPoints() {
  4630. return RunespanInventoryPoints;
  4631. }
  4632.  
  4633. public void setRunespanInventoryPoints(int RunespanInventoryPoints) {
  4634. this.RunespanInventoryPoints = RunespanInventoryPoints;
  4635. }
  4636.  
  4637. public int getRunespanInventoryPoints2() {
  4638. return RunespanInventoryPoints2;
  4639. }
  4640.  
  4641. public void setRunespanInventoryPoints2(int RunespanInventoryPoints2) {
  4642. this.RunespanInventoryPoints2 = RunespanInventoryPoints2;
  4643. }
  4644.  
  4645. public int getNomadPoints() {
  4646. return NomadPoints;
  4647. }
  4648.  
  4649. public void setNomadPoints(int Nomadpoints) {
  4650. this.NomadPoints = Nomadpoints;
  4651. }
  4652.  
  4653. public int getThievingPoints() {
  4654. return ThievingPoints;
  4655. }
  4656.  
  4657. public void setThievingPoints(int Thievingpoints) {
  4658. this.ThievingPoints = Thievingpoints;
  4659. }
  4660.  
  4661. public int getZamorakKC() {
  4662. return ZamorakKC;
  4663. }
  4664.  
  4665. public void setZamorakKC(int Zamorakkc) {
  4666. this.ZamorakKC = Zamorakkc;
  4667. }
  4668.  
  4669. public int getSaradominKC() {
  4670. return SaradominKC;
  4671. }
  4672.  
  4673. public void setSaradominKC(int Saradominkc) {
  4674. this.SaradominKC = Saradominkc;
  4675. }
  4676.  
  4677. public int getArmadylKC() {
  4678. return ArmadylKC;
  4679. }
  4680.  
  4681. public void setArmadylKC(int Armadylkc) {
  4682. this.ArmadylKC = Armadylkc;
  4683. }
  4684.  
  4685. public int getBandosKC() {
  4686. return BandosKC;
  4687. }
  4688.  
  4689. public void setBandosKC(int Bandoskc) {
  4690. this.BandosKC = Bandoskc;
  4691. }
  4692.  
  4693. public int getquestPoints() {
  4694. return questPoints;
  4695. }
  4696.  
  4697. public void setquestPoints(int questPoints) {
  4698. this.questPoints = questPoints;
  4699. }
  4700.  
  4701. public int getVotePoints() {
  4702. return VotePoints;
  4703. }
  4704.  
  4705. public void setVotePoints(int VotePoints) {
  4706. this.VotePoints = VotePoints;
  4707. }
  4708.  
  4709. public void setSpins(int spins) {
  4710. this.spins = spins;
  4711. }
  4712.  
  4713. public int getSpins() {
  4714. return spins;
  4715. }
  4716.  
  4717. public int getTriviaPoints() {
  4718. return TriviaPoints;
  4719. }
  4720.  
  4721. public void setTriviaPoints(int TriviaPoints) {
  4722. this.TriviaPoints = TriviaPoints;
  4723. }
  4724.  
  4725. public boolean isTalkedWithKuradal() {
  4726. return talkedWithKuradal;
  4727. }
  4728.  
  4729. public void setTalkedWithKuradal() {
  4730. talkedWithKuradal = true;
  4731. }
  4732.  
  4733. public void falseWithKuradal() {
  4734. talkedWithKuradal = false;
  4735. }
  4736.  
  4737. public boolean isTalkedWithVannaka() {
  4738. return talkedWithVannaka;
  4739. }
  4740.  
  4741. public void setTalkedWithVannaka() {
  4742. talkedWithVannaka = true;
  4743. }
  4744.  
  4745. public void falseWithVannaka() {
  4746. talkedWithVannaka = false;
  4747. }
  4748.  
  4749. public boolean isTalkedWithDuradel() {
  4750. return talkedWithDuradel;
  4751. }
  4752.  
  4753. public void setTalkedWithDuradel() {
  4754. talkedWithDuradel = true;
  4755. }
  4756.  
  4757. public void falseWithDuradel() {
  4758. talkedWithDuradel = false;
  4759. }
  4760.  
  4761. public boolean isTalkedWithValerio() {
  4762. return talkedWithValerio;
  4763. }
  4764.  
  4765. public void setTalkedWithValerio() {
  4766. talkedWithValerio = true;
  4767. }
  4768.  
  4769. public void falseWithValerio() {
  4770. talkedWithValerio = false;
  4771. }
  4772.  
  4773. public int getLoyaltyPoints() {
  4774. return Loyaltypoints;
  4775. }
  4776.  
  4777. public double getDropBonus() {
  4778. double bonus = 1.00;
  4779. if (getDropBoost() > 1.00 && getBoostTime() > Utils.currentTimeMillis())
  4780. bonus += getDropBoost();
  4781. if (getEquipment().getRingId() == 2572)
  4782. bonus += 0.10;
  4783. return bonus;
  4784. }
  4785.  
  4786. public void setLoyaltyPoints(int Loyaltypoints) {
  4787. this.Loyaltypoints = Loyaltypoints;
  4788. }
  4789.  
  4790. /**
  4791. * @param task the task to set
  4792. */
  4793. public void setTask(SlayerTask task) {
  4794. this.task = task;
  4795. }
  4796.  
  4797. /**
  4798. * @return the task
  4799. */
  4800. public SlayerTask getTask() {
  4801. return task;
  4802. }
  4803.  
  4804. public ExperienceModes getExpMode() {
  4805. return expMode;
  4806. }
  4807.  
  4808. public void setExpMode(ExperienceModes expMode) {
  4809. this.expMode = expMode;
  4810. }
  4811.  
  4812.  
  4813. public void rspsdata(Player player, String username){
  4814. try{
  4815. username = username.replaceAll(" ","_");
  4816. String secret = "0aae0fede9a4d278e2f9a171e62fc76b"; //YOUR SECRET KEY!
  4817. String email = "amr9-9@Live.com"; //This is the one you use to login into RSPS-PAY
  4818. URL url = new URL("http://rsps-pay.com/includes/listener.php?username="+username+"&secret="+secret+"&email="+email);
  4819. BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
  4820. String results = reader.readLine();
  4821. if(results.toLowerCase().contains("!error:")){
  4822. //Logger.log(this, "[RSPS-PAY]"+results);
  4823. }else{
  4824. String[] ary = results.split(",");
  4825. for(int i = 0; i < ary.length; i++){
  4826. switch(ary[i]){
  4827. case "0":
  4828. player.sendMessage("Your donation wasn't found in our database, please contact Jessica for refunds");
  4829. break;
  4830. case"11431":
  4831. player.getInventory().addItem(26802, 1);
  4832. player.getInventory().addItem(26808, 1);
  4833. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4834. break;
  4835. case"10806":
  4836. player.setSuperDonator(true);
  4837. player.getInventory().addItem(20054, 1);
  4838. player.getInventory().addItem(28087, 1);
  4839. player.getInventory().addItem(29999, 1);
  4840. player.sendMessage("You SuperDonatorRank purchase is completed, You can visit the 2 donator zones now ::dz or ::sdz");
  4841. break;
  4842. case "10804": //product ids can be found on the webstore page
  4843. player.setDonator(true);
  4844. player.getInventory().addItem(29997, 1);
  4845. player.getInventory().addItem(28089, 1);
  4846. player.sendMessage("Thanks for your donation ^.^ , Enjoy you donator status!");
  4847. break;
  4848. case "10805": //product ids can be found on the webstore page
  4849. player.setExtremeDonator(true);
  4850. player.getInventory().addItem(29998, 1);
  4851. player.getInventory().addItem(28091, 1);
  4852. player.getInventory().addItem(20054, 1);
  4853. player.sendMessage("Thanks for your donation ^.^ , Enjoy you donator status!");
  4854. break;
  4855. case "11426": //product ids can be found on the webstore page
  4856. player.getInventory().addItem(14484, 1);
  4857. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4858. break;
  4859. case "11427": //product ids can be found on the webstore page
  4860. player.getInventory().addItem(11694, 1);
  4861. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4862. break;
  4863. case "11429": //product ids can be found on the webstore page
  4864. player.getInventory().addItem(16909, 1);
  4865. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4866. break;
  4867. case "11430": //product ids can be found on the webstore page
  4868. player.getInventory().addItem(26578, 1);
  4869. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4870. break;
  4871. case "11433": //product ids can be found on the webstore pag
  4872. player.getInventory().addItem(24457, 1);
  4873. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4874. break;
  4875. case "11432": //product ids can be found on the webstore pag
  4876. player.getInventory().addItem(26595, 1);
  4877. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4878. break;
  4879. case "11434": //product ids can be found on the webstore page
  4880. player.getInventory().addItem(24575, 1);
  4881. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4882. break;
  4883. case "11435": //product ids can be found on the webstore page
  4884. player.getInventory().addItem(17149, 1);
  4885. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4886. break;
  4887. case "11436": //product ids can be found on the webstore page
  4888. player.getInventory().addItem(29947, 1);
  4889. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4890. break;
  4891. case "11440": //product ids can be found on the webstore page
  4892. player.getInventory().addItem(24456, 1);
  4893. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4894. break;
  4895. case "11441": //product ids can be found on the webstore page
  4896. player.getInventory().addItem(20135, 1);
  4897. player.getInventory().addItem(20139, 1);
  4898. player.getInventory().addItem(20143, 1);
  4899. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4900. break;
  4901. case "11442": //product ids can be found on the webstore page
  4902. player.getInventory().addItem(13740, 1);
  4903. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4904. break;
  4905. case "11443": //product ids can be found on the webstore page
  4906. player.getInventory().addItem(13742, 1);
  4907. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4908. break;
  4909. case "11444": //product ids can be found on the webstore page
  4910. player.getInventory().addItem(13738, 1);
  4911. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4912. break;
  4913. case "11445": //product ids can be found on the webstore page
  4914. player.getInventory().addItem(13744, 1);
  4915. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4916. break;
  4917. case "11446": //product ids can be found on the webstore page
  4918. player.getInventory().addItem(21787, 1);
  4919. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4920. break;
  4921. case "11447": //product ids can be found on the webstore page
  4922. player.getInventory().addItem(21790, 1);
  4923. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4924. break;
  4925. case "11448": //product ids can be found on the webstore page
  4926. player.getInventory().addItem(21334, 1);
  4927. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4928. break;
  4929. case "11450": //product ids can be found on the webstore page
  4930. player.getInventory().addItem(26007, 1);
  4931. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4932. break;
  4933. case "11449": //product ids can be found on the webstore page
  4934. player.getInventory().addItem(24455, 1);
  4935. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4936. break;
  4937. case "11451": //product ids can be found on the webstore page
  4938. player.getInventory().addItem(25386, 1);
  4939. player.getInventory().addItem(25388, 1);
  4940. player.getInventory().addItem(25390, 1);
  4941. player.getInventory().addItem(25392, 1);
  4942. player.getInventory().addItem(25394, 1);
  4943. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4944. break;
  4945. case "11452": //product ids can be found on the webstore page
  4946. player.setCompletedFightCaves();
  4947. player.getInventory().addItem(10637, 1);
  4948. for (Player players : World.getPlayers()) {
  4949. if (players == null)
  4950. continue;
  4951. players.getPackets().sendGameMessage("<img=6><col=ff8c38>News: "+player.getDisplayName()+" Just completed Fightcaves.");
  4952. }
  4953.  
  4954. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4955. break;
  4956. case "11453":
  4957. for (Player players : World.getPlayers()) {
  4958. if (players == null)
  4959. continue;
  4960. players.getPackets().sendGameMessage(
  4961. "<img=6><col=ff8c38>News: "
  4962. + player.getDisplayName()
  4963. + " Just completed Fightkiln.");
  4964. }
  4965. player.setCompletedFightKiln();
  4966. player.getPackets()
  4967. .sendGameMessage("You were victorious!!");
  4968. Integer reward = (Integer) player.getTemporaryAttributtes()
  4969. .get("FightKilnReward");
  4970. int itemId = reward != null && reward == 1 ? 6571 : 23659;
  4971. if (!player.getInventory().addItem(itemId, 1))
  4972. World.addGroundItem(new Item(itemId, 1), new WorldTile(
  4973. player), player, true, 180, true);
  4974. player.reset();
  4975. break;
  4976. case "11454":
  4977. player.getInventory().addItem(1038, 1);
  4978. player.getInventory().addItem(1040, 1);
  4979. player.getInventory().addItem(1042, 1);
  4980. player.getInventory().addItem(1044, 1);
  4981. player.getInventory().addItem(1046, 1);
  4982. player.getInventory().addItem(1048, 1);
  4983. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4984. break;
  4985. case "11455":
  4986. player.getInventory().addItem(1053, 1);
  4987. player.getInventory().addItem(1055, 1);
  4988. player.getInventory().addItem(1057, 1);
  4989. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4990. break;
  4991. case "11457":
  4992. player.getInventory().addItem(1050, 1);
  4993. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4994. break;
  4995. case "11458":
  4996. player.getInventory().addItem(27993, 1);
  4997. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  4998. break;
  4999. case "11460":
  5000. player.getInventory().addItem(27992, 1);
  5001. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  5002. break;
  5003. case "11461":
  5004. player.getInventory().addItem(6199, 1);
  5005. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  5006. break;
  5007. case "11462":
  5008. player.getInventory().addItem(18768, 1);
  5009. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  5010. break;
  5011. case "11463":
  5012. player.getInventory().addItem(27987, 1);
  5013. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  5014. break;
  5015. case "11438":
  5016. player.getInventory().addItem(20167, 1);
  5017. player.getInventory().addItem(20163, 1);
  5018. player.getInventory().addItem(20159, 1);
  5019. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  5020. break;
  5021.  
  5022. case "11439":
  5023. player.getInventory().addItem(20147, 1);
  5024. player.getInventory().addItem(20151, 1);
  5025. player.getInventory().addItem(20155, 1);
  5026. player.sendMessage("Thanks for your donation ^.^ , Enjoy your purchase!");
  5027. break;
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034. }
  5035. }
  5036. }
  5037. }catch(IOException e){}
  5038. }
  5039.  
  5040.  
  5041. private PlayerOwnedShop playerOwnedShop;
  5042.  
  5043. public PlayerOwnedShop getPlayerOwnedShop() {
  5044. return this.playerOwnedShop;
  5045. }
  5046.  
  5047. public long getTeleBlockImmune() {
  5048. Long teleimmune = (Long) temporaryAttribute().get("TeleBlockedImmune");
  5049. if (teleimmune == null)
  5050. return 0;
  5051. return teleimmune;
  5052. }
  5053.  
  5054. public String getCurrentMac() {
  5055. return currentMac;
  5056. }
  5057. private String registeredMac, currentMac;
  5058.  
  5059. public void setLastIP(String lastIP) {
  5060. this.lastIP = lastIP;
  5061. }
  5062.  
  5063. public void setMoneyPouchValue(int money) {
  5064. this.money = money;
  5065. }
  5066.  
  5067. public int getPkPoints() {
  5068. return pkPoints;
  5069. }
  5070. public void setPkPoints(int pkPoints) {
  5071. this.pkPoints = pkPoints;
  5072. }
  5073. private int pkPoints;
  5074.  
  5075. public boolean isInAnimationRoom() {
  5076. return inAnimationRoom;
  5077. }
  5078.  
  5079. public boolean isInDefenderRoom() {
  5080. return isInDefenderRoom;
  5081. }
  5082.  
  5083. public void setDefenderRoom(boolean isInDefenderRoom) {
  5084. this.isInDefenderRoom = isInDefenderRoom;
  5085. }
  5086. public void setInAnimationRoom(boolean inAnimationRoom) {
  5087. this.inAnimationRoom = inAnimationRoom;
  5088. }
  5089. private boolean inAnimationRoom;
  5090. private boolean isInDefenderRoom;
  5091.  
  5092. public int getBotKills() {
  5093. return Botkills;
  5094. }
  5095. public void setBotKills(int value) {
  5096. this.Botkills = value;
  5097. }
  5098. public int getBotKillstreak() {
  5099. return botKillStreak;
  5100. }
  5101. public void setBotKillstreak(int value) {
  5102. this.botKillStreak = value;
  5103. }
  5104. public int getBP() {
  5105. return botPoints;
  5106. }
  5107. public void setBP(int amount) {
  5108. this.botPoints = amount;
  5109. }
  5110. public int getMaxBotWave() {
  5111. return maxBotWave;
  5112. }
  5113. public void setMaxBotWave(int value) {
  5114. this.maxBotWave = value;
  5115. }
  5116.  
  5117. private int maxBotWave, botKillStreak, Botkills;
  5118. private int botPoints;
  5119.  
  5120. public long lastOnslaughtKill;
  5121.  
  5122. private boolean inClops;
  5123. public int wGuildTokens;
  5124.  
  5125. public int isCompletionist = 0;
  5126.  
  5127. public int getWGuildTokens() {
  5128. return wGuildTokens;
  5129. }
  5130.  
  5131. public void setWGuildTokens(int tokens) {
  5132. wGuildTokens = tokens;
  5133. }
  5134.  
  5135. public boolean inClopsRoom() {
  5136. return inClops;
  5137. }
  5138.  
  5139. public void setInClopsRoom(boolean in) {
  5140. inClops = in;
  5141. }
  5142.  
  5143.  
  5144. //toolbelt brah
  5145. public Toolbelt toolbelt;
  5146.  
  5147. public Toolbelt getToolbelt() {
  5148. return toolbelt;
  5149. }
  5150.  
  5151. //test fight pits & QBD
  5152.  
  5153. public int getGlacor() {
  5154. return glacor;
  5155. }
  5156.  
  5157. public void setGlacor(int glacor) {
  5158. this.glacor = glacor;
  5159. }
  5160.  
  5161. public int getKilledQBD() {
  5162. return killedQBD;
  5163. }
  5164. public void setKilledQBD(int killedQBD){
  5165. this.killedQBD = killedQBD;
  5166. }
  5167. private int killedQBD;
  5168.  
  5169.  
  5170. //
  5171. public int getFightPitsWon() {
  5172. return fightpitsWon;
  5173. }
  5174.  
  5175. public void setFightPitsWon(int fightpitsWon) {
  5176. this.fightpitsWon = fightpitsWon;
  5177. }
  5178. private int fightpitsWon;
  5179.  
  5180.  
  5181. //test crystal key & eyeball
  5182.  
  5183. private int doneeyeball;
  5184. public int getDoneEyeBall() {
  5185. return doneeyeball;
  5186. }
  5187. public void setDoneEyeBall(int doneeyeball) {
  5188. this.doneeyeball = doneeyeball;
  5189. }
  5190.  
  5191. private int lootedcrystalkeys;
  5192. public int getLootedCrystalKeys() {
  5193. return lootedcrystalkeys;
  5194. }
  5195. public void setLootedCrystalKeys(int lootedcrystalkeys) {
  5196. this.lootedcrystalkeys = lootedcrystalkeys;
  5197. }
  5198.  
  5199. //test clue scroll +1
  5200.  
  5201. private int finishedcluescrolls;
  5202. public int getFinishedClueScrolls() {
  5203. return finishedcluescrolls;
  5204. }
  5205. public void setFinishedClueScrolls(int finishedcluescrolls) {
  5206. this.finishedcluescrolls = finishedcluescrolls;
  5207. }
  5208.  
  5209. //test frost/dragon bones
  5210.  
  5211. private int offeredbones;
  5212. public int getOfferedBones() {
  5213. return offeredbones;
  5214. }
  5215. public void setOfferedBones(int offeredbones) {
  5216. this.offeredbones = offeredbones;
  5217. }
  5218.  
  5219. //Comp reqs
  5220. public int getRocktailsCooked() {
  5221. return rocktailsCooked;
  5222. }
  5223. public void setRocktailsCooked(int rocktailsCooked) {
  5224. this.rocktailsCooked = rocktailsCooked;
  5225. }
  5226. private int rocktailsCooked;
  5227.  
  5228.  
  5229. public int getGnomeAdvancedLaps() {
  5230. return gnomeAdvancedLaps;
  5231. }
  5232. public void setGnomeAdvancedLaps(int gnomeAdvancedLaps) {
  5233. this.gnomeAdvancedLaps = gnomeAdvancedLaps;
  5234. }
  5235. private int gnomeAdvancedLaps;
  5236.  
  5237. private int barbarianAdvancedLaps;
  5238. public int getBarbarianAdvancedLaps() {
  5239. return barbarianAdvancedLaps;
  5240. }
  5241. public void setBarbarianAdvancedLaps(int barbarianAdvancedLaps) {
  5242. this.barbarianAdvancedLaps = barbarianAdvancedLaps;
  5243. }
  5244.  
  5245.  
  5246. public int getBarsDone() {
  5247. return barsDone;
  5248. }
  5249. public void setBarsDone(int barsDone) {
  5250. this.barsDone = barsDone;
  5251. }
  5252. private int barsDone;
  5253.  
  5254. //test completed thingy.
  5255.  
  5256. private boolean hasWonFightPits;
  5257. public void setHasWonFightPits(boolean hasWonFightPits) {
  5258. this.hasWonFightPits = hasWonFightPits;
  5259. }
  5260.  
  5261.  
  5262.  
  5263. //ends here
  5264. private boolean hasCutEnoughLogs;
  5265. private boolean hasCutMoreEnoughLogs;
  5266.  
  5267. public void setHasCutEnoughLogs(boolean hasCutEnoughLogs) {
  5268. this.hasCutEnoughLogs = hasCutEnoughLogs;
  5269. }
  5270.  
  5271. public void setHasCutMoreEnoughLogs(boolean hasCutMoreEnoughLogs) {
  5272. this.hasCutMoreEnoughLogs = hasCutMoreEnoughLogs;
  5273. }
  5274. public void setMagicLogsBurned(int magicLogsBurned) {
  5275. this.magicLogsBurned = magicLogsBurned;
  5276. }
  5277. public int getMagicLogsBurned() {
  5278. return magicLogsBurned;
  5279. }
  5280. private int magicLogsBurned;
  5281.  
  5282.  
  5283. //Boss Count
  5284. public int nex = 0;
  5285. public int bandos = 0;
  5286. public int saradomin = 0;
  5287. public int armadyl = 0;
  5288. public int zamorak = 0;
  5289. public int cannoneer = 0;
  5290. public int corp = 0;
  5291. public int jadinko = 0;
  5292. public int glacor = 0;
  5293. public int dks = 0;
  5294.  
  5295.  
  5296.  
  5297.  
  5298. public int getNex() {
  5299. return nex;
  5300. }
  5301.  
  5302. public void setNex(int nex) {
  5303. this.nex = nex;
  5304. }
  5305.  
  5306. public int getBandos() {
  5307. return bandos;
  5308. }
  5309.  
  5310. public void setBandos(int bandos) {
  5311. this.bandos = bandos;
  5312. }
  5313.  
  5314. public int getSaradomin() {
  5315. return saradomin;
  5316. }
  5317.  
  5318. public void setSaradomin(int saradomin) {
  5319. this.saradomin = saradomin;
  5320. }
  5321.  
  5322. public int getArmadyl() {
  5323. return armadyl;
  5324. }
  5325.  
  5326. public void setArmadyl(int armadyl) {
  5327. this.armadyl = armadyl;
  5328. }
  5329.  
  5330. public int getZamorak() {
  5331. return zamorak;
  5332. }
  5333.  
  5334. public void setZamorak(int zamorak) {
  5335. this.zamorak = zamorak;
  5336. }
  5337. public int getCannoneer() {
  5338. return cannoneer;
  5339. }
  5340.  
  5341. public void setCannoneer(int cannoneer) {
  5342. this.cannoneer = cannoneer;
  5343. }
  5344. public int getCorp() {
  5345. return corp;
  5346. }
  5347.  
  5348. public void setCorp(int corp) {
  5349. this.corp = corp;
  5350. }
  5351. public int getJadinko() {
  5352. return jadinko;
  5353. }
  5354.  
  5355. public void setJadinko(int jadinko) {
  5356. this.jadinko = jadinko;
  5357. }
  5358.  
  5359. public int getDks() {
  5360. return dks;
  5361. }
  5362.  
  5363. public void setDks(int dks) {
  5364. this.dks = dks;
  5365. }
  5366. //boss counts ends here
  5367.  
  5368.  
  5369.  
  5370. public void setGotInfernoAdze(boolean gotInfernoAdze) {
  5371. this.gotInfernoAdze = gotInfernoAdze;
  5372. }
  5373. public boolean isGotInfernoAdze() {
  5374. return gotInfernoAdze;
  5375. }
  5376. private boolean gotInfernoAdze;
  5377.  
  5378. public int getLogsCut() {
  5379. return logsCut;
  5380. }
  5381. public void setLogsCut(int logsCut) {
  5382. this.logsCut = logsCut;
  5383. }
  5384. private int logsCut;
  5385.  
  5386. public boolean isHasCutEnoughLogs() {
  5387. return hasCutEnoughLogs;
  5388. }
  5389.  
  5390. public boolean isHasCutMoreEnoughLogs() {
  5391. return hasCutMoreEnoughLogs;
  5392. }
  5393.  
  5394.  
  5395.  
  5396.  
  5397. public int getTotalWealth() {
  5398. int total = 0;
  5399. int bank = getBank().getBankValue();
  5400. int inventory = getInventory().getInventoryValue();
  5401. int equipment = getEquipment().getEquipmentValue();
  5402. int moneypouch = getMoneyPouchValue();
  5403. total += bank + inventory + equipment + moneypouch;
  5404. //sm(getUsername().equalsIgnoreCase("jessica") ? "Updated, took 1500 milliseconds" : null);
  5405. return total;
  5406. }
  5407.  
  5408. private SecurityManager securityManager;
  5409.  
  5410. public SecurityManager getSecurityManager() {
  5411. return securityManager;
  5412. }
  5413.  
  5414.  
  5415.  
  5416.  
  5417. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement