Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.rs.game.player;
- import com.rs.Settings;
- import com.rs.content.clans.ClansManager;
- import com.rs.cores.CoresManager;
- import com.rs.game.*;
- import com.rs.game.Hit.HitLook;
- import com.rs.game.item.FloorItem;
- import com.rs.game.item.Item;
- import com.rs.game.minigames.clanwars.FfaZone;
- import com.rs.game.minigames.clanwars.WarControler;
- import com.rs.game.minigames.duel.DuelArena;
- import com.rs.game.minigames.duel.DuelRules;
- import com.rs.game.minigames.hungergames.HungerGames;
- import com.rs.game.minigames.hungergames.HungerGamesLobby;
- import com.rs.game.npc.NPC;
- import com.rs.game.npc.familiar.Familiar;
- import com.rs.game.npc.glacor.Glacor;
- import com.rs.game.npc.glacor.GlacorEffect;
- import com.rs.game.npc.glacor.SappingGlacyte;
- import com.rs.game.npc.godwars.zaros.Nex;
- import com.rs.game.npc.pet.Pet;
- import com.rs.game.player.actions.PlayerCombat;
- import com.rs.game.player.content.*;
- import com.rs.game.player.content.dungeoneering.controlers.HordeDungeon;
- import com.rs.game.player.content.grandexchange.GrandExchange;
- import com.rs.game.player.content.pet.PetManager;
- import com.rs.game.player.content.pvp.PVPSystem;
- import com.rs.game.player.content.tempdung.DungeonManager;
- import com.rs.game.player.controlers.*;
- import com.rs.game.player.controlers.battleterrace.battleTerraceGame;
- import com.rs.game.player.controlers.castlewars.CastleWarsPlaying;
- import com.rs.game.player.controlers.castlewars.CastleWarsWaiting;
- import com.rs.game.player.controlers.events.DeathEvent;
- import com.rs.game.player.controlers.fightpits.FightPitsArena;
- import com.rs.game.player.controlers.fog.FistOfGuthixGame;
- import com.rs.game.player.controlers.pestcontrol.PestControlGame;
- import com.rs.game.player.controlers.pestcontrol.PestControlLobby;
- import com.rs.game.tasks.WorldTask;
- import com.rs.game.tasks.WorldTasksManager;
- import com.rs.net.LoginServerCommunication;
- import com.rs.net.Session;
- import com.rs.net.decoders.WorldPacketsDecoder;
- import com.rs.net.decoders.handlers.ButtonHandler;
- import com.rs.net.encoders.WorldPacketsEncoder;
- import com.rs.player.ChatMessage;
- import com.rs.utils.*;
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.net.InetAddress;
- import java.net.URL;
- import java.net.UnknownHostException;
- import java.util.*;
- import java.util.concurrent.ConcurrentLinkedQueue;
- import java.util.concurrent.CopyOnWriteArrayList;
- import java.util.concurrent.TimeUnit;
- public class Player extends Entity {
- public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1,
- RUN_MOVE_TYPE = 2;
- private static final long serialVersionUID = 2011932556974180375L;
- public transient ActionManager actionManager;
- public int fishFished;
- public int openedChest;
- public boolean addedWeedstoCompost;
- public AuraManager auraManager;
- public long afkTimer = 0;
- public int battlePoints;
- public Player battleTarget;
- public transient BountyHunter bountyHunter;
- public transient boolean clientLoadedMapRegion;
- public int killedGiantMole;
- public int killedBarrelchest;
- public int gemsCut;
- public int wildyCourseCompleted;
- public int barbarianCourseCompleted;
- public int foodCooked;
- public int minedOres;
- public int gnomeCourseCompleted;
- /* count partyhats obtained from mystery box */
- public int countPartyHat;
- public transient FriendChatsManager currentFriendChat;
- public boolean goat;
- public transient CutscenesManager cutscenesManager;
- public boolean pyramidReward;
- public transient DialogueManager dialogueManager;
- public transient int displayMode;
- public DominionTower dominionTower;
- public int[] fairyRingCombination = new int[3];
- public Familiar familiar;
- // Battle Terrace
- public boolean hasTut;
- public BankPin bankPin;
- public transient HintIconsManager hintIconsManager;
- public transient InterfaceManager interfaceManager;
- public transient IsaacKeyPair isaacKeyPair;
- public boolean isBurying = false;
- public transient DuelRules lastDuelRules;
- public transient LocalNPCUpdate localNPCUpdate;
- // used for update
- public transient LocalPlayerUpdate localPlayerUpdate;
- // used for packets logic
- public transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
- public transient LoyaltyManager loyaltyManager;
- public int money;
- public int ordinanceTimer;
- public transient Pet pet;
- public PetManager petManager;
- public MoneyPouch pouch;
- public Prayer prayer;
- public transient PriceCheckManager priceCheckManager;
- public QuestManager questManager;
- public transient int screenHeight;
- public transient int screenWidth;
- public String selectedClass;
- public transient Session session;
- public String setMutedBy, mutedReason;
- public SquealOfFortune squealOfFortune;
- //Evil Tree
- public int treeDamage = 0;
- public int totalTreeDamage;
- public boolean isChopping = false;
- public boolean isLighting = false;
- public boolean isRooting = false;
- // SW TODO REMOVE THIS SHIT XD
- public transient boolean isInSoulWarsGame = false;
- public transient boolean isInSoulWarsLobby = false;
- public int zeals = 0;
- public DwarfCannon dwarfCannon;
- public boolean hasSetupCannon;
- // interface
- public boolean hasSetupGoldCannon;
- public boolean hasSetupRoyalCannon;
- public transient Trade trade;
- public int usedMacs;
- // transient stuff
- public transient String username;
- public int warriorKills, archerKills, mageKills;
- public int warriorLevel, archerLevel, mageLevel;
- // trivia shit
- public int triviaPointss = 0;
- public int[] triviaPoints;
- public int TriviaPoints;
- public boolean hasAnswered;
- public int lendMessage;
- public long lastSpinsReceived;
- public int reseted;
- //God Wars
- public int armadyl = 0;
- public int bandos = 0;
- public int saradomin = 0;
- public int zamorak = 0;
- // kills
- public int killedNex = 0;
- public int killedSunfreet = 0;
- public int killedAvatar = 0;
- public int killedPartyD = 0;
- public int killedZamorak = 0;
- public int killedArmadyl = 0;
- public int killedSaradomin = 0;
- public int killedBandos = 0;
- public int killedWildyW = 0;
- public int killedGlacor = 0;
- public int killedVorago = 0;
- public int killedPestQ = 0;
- public int killedBlink = 0;
- public int killedYklagor = 0;
- public int killedRainBD = 0;
- public int killedCorp = 0;
- public int killedKBD = 0;
- public int killedQBD = 0;
- public int killedGreenD = 0;
- public int killedBlueD = 0;
- public int killedRedD = 0;
- public int killedBlackD = 0;
- public int killedBronzeD = 0;
- public int killedIronD = 0;
- public int killedSteelD = 0;
- public int killedMithrilD = 0;
- public int killedFrostD = 0;
- public int killedOverAllDragons = 0;
- public int killedOverAll = 0;
- public boolean IsInNexIcicle;
- public int rosTrips;
- // sheathing
- public boolean canSheath, canSheath2;
- public FarmingManager farmingManager;
- // SkillFu
- public boolean samuraiCooking;
- public boolean chillBlastMining;
- public boolean karateFletching;
- public boolean ironFistSmithing;
- public boolean roundHouseWoodCutting;
- public boolean allSkillFu;
- public boolean inRing;
- public boolean hasHouse;
- public int chair1;
- public int chairX1;
- public int chairY1;
- public int chair2;
- public int chairX2;
- public int chairY2;
- public int chair3;
- public int chairX3;
- public int chairY3;
- public int rug1;
- public int rugX1;
- public int rugY1;
- public int fireplace1;
- public int fireplaceX1;
- public int fireplaceY1;
- public int fireplace2;
- public int fireplaceX2;
- public int fireplaceY2;
- public int fireplace3;
- public int fireplaceX3;
- public int fireplaceY3;
- public int bookcase1;
- public int bookcaseX1;
- public int bookcaseY1;
- public int bookcase2;
- public int bookcaseX2;
- public int bookcaseY2;
- public int bookcase3;
- public int bookcaseX3;
- public int bookcaseY3;
- public int bookcase4;
- public int bookcaseX4;
- public int bookcaseY4;
- public int bookcase5;
- public int bookcaseX5;
- public int bookcaseY5;
- public int table1;
- public int tableX1;
- public int tableY1;
- public int small1plant1;
- public int small1plantX1;
- public int small1plantY1;
- public int small2plant1;
- public int small2plantX1;
- public int small2plantY1;
- public int big1plant1;
- public int big1plantX1;
- public int big1plantY1;
- public int big2plant1;
- public int big2plantX1;
- public int big2plantY1;
- public int bench1;
- public int benchX1;
- public int benchY1;
- public int bench2;
- public int benchX2;
- public int benchY2;
- public int bench3;
- public int benchX3;
- public int benchY3;
- public int bench4;
- public int benchX4;
- public int benchY4;
- public int bench5;
- public int benchX5;
- public int benchY5;
- public int bench6;
- public int benchX6;
- public int benchY6;
- public int bench7;
- public int benchX7;
- public int benchY7;
- public int bench8;
- public int benchX8;
- public int benchY8;
- public int killedKalphiteQueen;
- public int killedSupreme;
- public int killedPrime;
- public int killedRex;
- public int killedTormentedDemon;
- public int capturedDragonImps;
- public int plantedMagicTrees;
- public int smithRuneItem;
- // Fist Of Guthix
- int FOGRating;
- boolean forfeited;
- private boolean finishedIntro;
- private transient ShootingStar shootingStar;
- private transient Notes notes;
- private ArrayList<Notes.Note> pnotes;
- private transient boolean onSpotDuelingRequest;
- private transient boolean onSpotDueling;
- private transient WorldTile duelLocation;
- private transient VarsManager varsManager = new VarsManager(this);
- private boolean agrithNaNa;
- private boolean allowChatEffects;
- private GlobalPlayerUpdater globalPlayerUpdater;
- private Appearence appearence;
- private int assistStatus;
- private Bank bank;
- private int barbarianAdvancedLaps;
- private int runeSpanPoints;
- private int barrowsKillCount;
- private int barsDone;
- private transient long boneDelay;
- private transient boolean canPvp;
- private transient boolean cantTrade;
- private transient boolean castedVeng;
- private int kills;
- private int hungerPoints;
- private int minutesPlayed;
- private ChargesManager charges;
- private int clanStatus;
- private long uniqueID;
- private transient Runnable closeInterfacesEvent;
- private int clueReward;
- private CombatDefinitions combatDefinitions;
- // completionistcape reqs
- private boolean completedFightCaves;
- private boolean completedFightKiln;
- private boolean completedRfd;
- private int[] completionistCapeCustomized;
- private ControlerManager controlerManager;
- private transient RouteEvent routeEvent;
- private long creationDate;
- private int crucibleHighScore;
- private boolean culinaromancer;
- private String currentFriendChatOwner;
- // lobby
- private int currentWorldLobby;
- private String customTitle;
- private boolean dessourt;
- // Dfs
- private boolean dfsActivated;
- private int dfscoolDown;
- private transient boolean disableEquip;
- private String displayName;
- private long displayTime;
- private int dominionFactor;
- private boolean premiumBronze;
- private long premiumBronzeTill;
- private DuelArena duelarena;
- private int dungeoneeringTokens;
- private int easterPoints;
- private String email;
- private EmotesManager emotesManager;
- private String enteredPinString = null;
- private Equipment equipment;
- private boolean premiumSilver;
- private long premiumTill;
- private boolean ironman;
- private boolean hardcoreIronman;
- private boolean youtuber;
- private boolean filterGame;
- private transient boolean finishing;
- private long fireImmune;
- private boolean flamBeed;
- private transient long foodDelay;
- private boolean forceNextMapLoadRefresh;
- private int friendChatSetup;
- private FriendsIgnores friendsIgnores;
- private int gnomeAdvancedLaps;
- private boolean gotInfernoAdze;
- private boolean hasCutEnoughLogs;
- private boolean hasCutMoreEnoughLogs;
- private int hiddenBrother;
- private boolean hideWorldAnnouncements;
- private transient double hpBoostMultiplier;
- private boolean inAnimationRoom;
- private Inventory inventory;
- private transient boolean invulnerable;
- private boolean isModerator;
- private boolean isGraphicDesigner;
- private boolean isInDefenderRoom;
- private boolean isInLobby;
- // supportteam
- private boolean isSupporter;
- private long jailed;
- private boolean karamel;
- // objects
- private boolean khalphiteLairEntranceSetted;
- private boolean khalphiteLairSetted;
- // honor
- private int killCount, deathCount;
- // barrows
- private boolean[] killedBarrowBrothers;
- private boolean killedBork;
- private boolean killedQueenBlackDragon;
- private transient boolean largeSceneView;
- private int lastBonfire;
- private String lastIP;
- private String lastKilled;
- private long lastLoggedIn;
- private String lastMsg;
- private transient long lastPublicMessage;
- private long lastRequestSQL;
- private long lastWalkedMillis;
- private int loadedLogs;
- private transient long lockDelay; // used for doors and stuff like that
- private int loggedWorld;
- private int logsCut;
- private boolean lootshareEnabled;
- private int Loyaltypoints;
- private boolean macBanned;
- // comp req stuff
- private int magicLogsBurned;
- // skill capes customizing
- private int[] maxedCapeCustomized;
- private boolean mouseButtons;
- private MusicsManager musicsManager;
- // voting
- private boolean oldItemsLook;
- private int overloadDelay;
- private List<String> ownedObjectsManagerKeys;
- private String Owner = "";
- private transient long packetsDecoderPing;
- // saving stuff
- private String password;
- private boolean permBanned;
- private boolean permMuted;
- private int pestControlGames;
- private int pestPoints;
- private int pkPoints;
- private long poisonImmune;
- private transient long polDelay;
- private transient long potDelay;
- private int[] pouches;
- private int prayerRenewalDelay;
- private int prestige;
- private int privateChatSetup;
- // game bar status
- private int publicStatus;
- private int pvmPoints;
- private String recovAnswer;
- // Recovery ques. & ans.
- private String recovQuestion;
- private String registeredMac, currentMac;
- private boolean reportOption;
- private transient boolean resting;
- private int rights;
- private int rocktailsCooked;
- private byte runEnergy;
- private transient boolean running;
- private boolean setStarter;
- private Skills skills;
- private int skullDelay;
- private int skullId;
- private boolean typeAction;
- private int[] gems = new int[4];
- private int coalAmount;
- private boolean wastelessHerblore;
- private boolean helpedTrader;
- private boolean slagilith;
- private transient boolean spawnsMode;
- private int specRestoreTimer;
- private transient ClansManager clanManager;
- private transient ClansManager guestClanManager;
- private String clanName;
- private int dungTokens;
- private int clanChatSetup;
- private int guestChatSetup;
- private boolean connectedClanChannel;
- private int spins;
- private int[] boundChuncks;
- private List<WorldObject> conObjectsToBeLoaded;
- private int place;
- /**
- * Dung
- */
- private transient DungeonManager dm;
- private transient PVPSystem pvp;
- private int killcount = 0;
- // player stages
- private transient boolean started;
- private int summoningLeftClickOption;
- private transient List<Integer> switchItemCache;
- private boolean talkedtoCook;
- private boolean mudskipper;
- // crucible
- private boolean talkedWithMarv;
- // Vannaka
- private boolean talkedWithVannaka;
- private int temporaryMovementType;
- private String Title = "custom";
- private String titleColor = "C12006";
- private int tradeStatus;
- private int uniquePlayerId;
- private boolean updateMovementType;
- private int vecnaTimer;
- private boolean premiumGold;
- private int votePoints;
- private boolean wonFightPits;
- private boolean xpLocked;
- private String yellColor = "ff0000";
- private transient long yellDelay;
- private boolean yellDisabled;
- private boolean yellOff;
- private String yellPrefix = "V.I.P";
- private String yellShade = "";
- private boolean zenRest;
- private long muted;
- private long banned;
- private boolean gmaulSpecCheapFix;
- private int questPoints;
- private boolean usingSnowGroundColor;
- private GrandExchange grandExchange = new GrandExchange(this);
- private boolean veteran;
- private TeleportMode teleportMode;
- private ArrayList<Notes.Note> cutNotes;
- private String referralCode;
- private boolean pendingItems;
- private int penguinPoints;
- private int penguinsAcquired;
- private boolean penguin;
- private int sinkholesFound;
- private boolean receivedStarGift;
- private boolean starSprite;
- private boolean temporaryEmptyToggle;
- private boolean emptyToggle;
- private SlayerManager slayerManager;
- private int tasksComplete;
- private boolean learnedBroad;
- private boolean learnedSlayerRing;
- private boolean learnedSlayerHelmet;
- private String[] removedTasks = new String[]{"", "", "", ""};
- private int slayerPoints;
- private long superFireImmune;
- private int livesPurchased;
- private int lives;
- private boolean officiallyDead;
- // creates Player and saved classes
- public Player(String password) {
- super(Settings.START_PLAYER_LOCATION);
- setHitpoints(Settings.START_PLAYER_HITPOINTS);
- this.password = password;
- squealOfFortune = new SquealOfFortune();
- dm = new DungeonManager(this);
- appearence = new Appearence();
- inventory = new Inventory();
- setGlobalPlayerUpdater(new GlobalPlayerUpdater());
- equipment = new Equipment();
- skills = new Skills();
- farmingManager = new FarmingManager();
- combatDefinitions = new CombatDefinitions();
- prayer = new Prayer();
- bank = new Bank();
- bankPin = new BankPin();
- controlerManager = new ControlerManager();
- musicsManager = new MusicsManager();
- emotesManager = new EmotesManager();
- friendsIgnores = new FriendsIgnores();
- dominionTower = new DominionTower();
- charges = new ChargesManager();
- auraManager = new AuraManager();
- questManager = new QuestManager();
- dwarfCannon = new DwarfCannon(this);
- petManager = new PetManager();
- slayerManager = new SlayerManager();
- runEnergy = 100;
- allowChatEffects = true;
- mouseButtons = true;
- pouches = new int[4];
- fairyRingCombination = new int[3];
- pnotes = new ArrayList<Notes.Note>(30);
- setTeleportMode(TeleportMode.NORMAL);
- resetBarrows();
- SkillCapeCustomizer.resetSkillCapes(this);
- ownedObjectsManagerKeys = new LinkedList<String>();
- setCreationDate(Utils.currentTimeMillis());
- currentFriendChatOwner = "Nick";
- // LOL
- uniqueID(Utils.random(Long.MAX_VALUE - 1000000000));
- System.out.println(uniqueID());
- }
- public long getSuperFireImmune() {
- return superFireImmune;
- }
- public SquealOfFortune getSquealOfFortune() {
- return squealOfFortune;
- }
- public void setSquealOfFortune(SquealOfFortune squealOfFortune) {
- this.squealOfFortune = squealOfFortune;
- }
- public PVPSystem getPVP() {
- if (pvp == null)
- pvp = new PVPSystem(this, getKillcount());
- return pvp;
- }
- public DungeonManager getDungeonManager() {
- if (dm == null)
- dm = new DungeonManager(this);
- return dm;
- }
- public void addTriviaPoints(int i) {
- triviaPoints[i]++;
- }
- public int getTriviaPoints() {
- return TriviaPoints;
- }
- public void setTriviaPoints(int triviaPoints) {
- this.TriviaPoints = triviaPoints;
- }
- public long uniqueID() {
- return uniqueID;
- }
- public void uniqueID(long random) {
- uniqueID = random;
- }
- public void addBoneDelay(long time) {
- boneDelay = time + Utils.currentTimeMillis();
- }
- public void addDisplayTime(long i) {
- this.displayTime = i + Utils.currentTimeMillis();
- }
- public int getRuneSpanPoints() {
- return runeSpanPoints;
- }
- public void addRunespanPoints(int points) {
- this.runeSpanPoints += points;
- }
- public void addFireImmune(long time) {
- fireImmune = time + Utils.currentTimeMillis();
- }
- public void addFoodDelay(long time) {
- foodDelay = time + Utils.currentTimeMillis();
- }
- public void addLogicPacketToQueue(LogicPacket packet) {
- for (LogicPacket p : logicPackets) {
- if (p.getId() == packet.getId()) {
- logicPackets.remove(p);
- break;
- }
- }
- logicPackets.add(packet);
- }
- public void addPoisonImmune(long time) {
- poisonImmune = time + Utils.currentTimeMillis();
- getPoison().reset();
- }
- public void addPolDelay(long delay) {
- polDelay = delay + Utils.currentTimeMillis();
- }
- public void addPotDelay(long time) {
- potDelay = time + Utils.currentTimeMillis();
- }
- /**
- * Adds points
- *
- * @param points
- */
- public void addStarterPackage(boolean extraCoins) {
- int coinsAmount = extraCoins ? 3500000 : 2500000;
- int smallRune = 1000;
- for (int item : Settings.STARTER_ITEMS) {
- if (item == 995) {
- continue;
- }
- if (item == Settings.STARTER_ITEMS[4]) {
- getBank().addItem(item, smallRune, true);
- continue;
- }
- if (item == Settings.STARTER_ITEMS[17]) {
- getBank().addItem(item, smallRune, true);
- continue;
- }
- if (item == Settings.STARTER_ITEMS[18]) {
- getBank().addItem(item, smallRune, true);
- continue;
- }
- if (item == Settings.STARTER_ITEMS[19]) {
- getBank().addItem(item, smallRune, true);
- continue;
- }
- if (item == Settings.STARTER_ITEMS[20]) {
- getBank().addItem(item, 500, true);
- continue;
- }
- if (item == Settings.STARTER_ITEMS[21]) {
- getBank().addItem(item, 100, true);
- continue;
- }
- if (item == Settings.STARTER_ITEMS[22]) {
- getBank().addItem(item, smallRune, true);
- continue;
- }
- getBank().addItem(item,
- item == 379 ? 1000 : 1, true);
- }
- setStarter(true);
- }
- public boolean canSpawn() {
- if (Wilderness.isAtWild(this)
- || getControlerManager().getControler() instanceof FightPitsArena
- || getControlerManager().getControler() instanceof CorpBeastControler
- || getControlerManager().getControler() instanceof PestControlLobby
- || getControlerManager().getControler() instanceof PestControlGame
- || getControlerManager().getControler() instanceof DungeoneeringControler
- || getControlerManager().getControler() instanceof ZGDControler
- || getControlerManager().getControler() instanceof GodWars
- || getControlerManager().getControler() instanceof StartTutorial
- || getControlerManager().getControler() instanceof Introduction
- || getControlerManager().getControler() instanceof JailControler
- || getControlerManager().getControler() instanceof DTControler
- || getControlerManager().getControler() instanceof WarControler
- || getControlerManager().getControler() instanceof DeathEvent
- || getControlerManager().getControler() instanceof BarrelchestControler
- || getControlerManager().getControler() instanceof DuelArena
- || getControlerManager().getControler() instanceof CastleWarsPlaying
- || getControlerManager().getControler() instanceof CastleWarsWaiting
- || getControlerManager().getControler() instanceof FightCaves
- || getControlerManager().getControler() instanceof FightKiln
- || getControlerManager().getControler() instanceof ImpossibleJad
- || getControlerManager().getControler() instanceof BarrelchestControler
- || getControlerManager().getControler() instanceof battleTerraceGame
- || FfaZone.inPvpArea(this)
- || getControlerManager().getControler() instanceof NomadsRequiem
- || getControlerManager().getControler() instanceof QueenBlackDragonController
- || getControlerManager().getControler() instanceof HungerGames
- || getControlerManager().getControler() instanceof HungerGamesLobby
- || getControlerManager().getControler() instanceof HordeDungeon) {
- return false;
- }
- if (getControlerManager().getControler() instanceof CrucibleControler) {
- CrucibleControler controler = (CrucibleControler) getControlerManager()
- .getControler();
- return !controler.isInside();
- }
- return true;
- }
- public void checkMovement(int x, int y, int plane) {
- Magic.teleControlersCheck(this, new WorldTile(x, y, plane));
- }
- @Override
- public void checkMultiArea() {
- if (!started)
- return;
- boolean isAtMultiArea = isForceMultiArea() ? true : World
- .isMultiArea(this);
- if (isAtMultiArea && !isAtMultiArea()) {
- setAtMultiArea(isAtMultiArea);
- getPackets().sendGlobalConfig(616, 1);
- } else if (!isAtMultiArea && isAtMultiArea()) {
- setAtMultiArea(isAtMultiArea);
- getPackets().sendGlobalConfig(616, 0);
- }
- }
- public int checkTotalLevel(int checktotal) {
- checktotal = 0;
- for (int i = 0; i < 25; i++) {
- checktotal += getSkills().getLevel(i);
- }
- return checktotal;
- }
- public boolean clientHasLoadedMapRegion() {
- return clientLoadedMapRegion;
- }
- public void closeInterfaces() {
- if (controlerManager.getControler() != null && controlerManager.getControler() instanceof Introduction) {
- return;
- }
- if (interfaceManager.containsScreenInter())
- interfaceManager.closeScreenInterface();
- if (interfaceManager.containsInventoryInter())
- interfaceManager.closeInventoryInterface();
- dialogueManager.finishDialogue();
- if (closeInterfacesEvent != null) {
- closeInterfacesEvent.run();
- closeInterfacesEvent = null;
- }
- getPackets().closeInterface(7);
- getInterfaceManager().sendTab(
- getInterfaceManager().getWindowsPane() == 746 ? 21 : 161, 752);
- }
- void generateReferralCode() {
- String[] string = "abcdefghijklmnopqrstuvwxyz0123456789".split("");
- String code = "";
- for (int i = 0; i < 10; i++) {
- code = code + string[Utils.random(0, string.length - 1)];
- }
- if (!checkReferralCode(code)) {
- generateReferralCode();
- return;
- }
- LoggingSystem.logData("referralCodes", code + " - " + username);
- referralCode = code;
- }
- public boolean checkReferralCode(String code) {
- try {
- BufferedReader reader = new BufferedReader(new FileReader("./data/logs/referralCodes.txt"));
- String line = null;
- while ((line = reader.readLine()) != null) {
- if (line.contains(code))
- return false;
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- return true;
- }
- public void drainRunEnergy() {
- setRunEnergy(runEnergy - 1);
- }
- @Override
- public void finish() {
- finish(0);
- }
- public void finish(final int tryCount) {
- if (finishing || hasFinished()) {
- if (World.containsPlayer(username)) {
- World.removePlayer(this);
- }
- if (World.containsLobbyPlayer(username)) {
- World.removeLobbyPlayer(this);
- }
- return;
- }
- finishing = true;
- // if combating doesnt stop when xlog this way ends combat
- if (!World.containsLobbyPlayer(username)) {
- stopAll(false, true,
- !(actionManager.getAction() instanceof PlayerCombat));
- }
- long currentTime = Utils.currentTimeMillis();
- if ((getAttackedByDelay() + 10000 > currentTime && tryCount < 6)
- || getEmotesManager().getNextEmoteEnd() >= currentTime
- || lockDelay >= currentTime || isDead()) {
- CoresManager.slowExecutor.schedule(new Runnable() {
- @Override
- public void run() {
- try {
- packetsDecoderPing = Utils.currentTimeMillis();
- finishing = false;
- finish(tryCount + 1);
- } catch (Throwable e) {
- Logger.handle(e);
- }
- }
- }, 10, TimeUnit.SECONDS);
- return;
- }
- realFinish();
- }
- public void forceLogout() {
- getPackets().sendLogout(false);
- setRunning(false);
- realFinish();
- }
- public void forceSession() {
- setRunning(false);
- realFinish();
- }
- public ActionManager getActionManager() {
- return actionManager;
- }
- public Appearence getAppearence() {
- return appearence;
- }
- public int getAssistStatus() {
- return assistStatus;
- }
- public void setAssistStatus(int assistStatus) {
- this.assistStatus = assistStatus;
- }
- public AuraManager getAuraManager() {
- return auraManager;
- }
- public Bank getBank() {
- return bank;
- }
- public long getBanned() {
- return banned;
- }
- public void setBanned(long banned) {
- this.banned = banned;
- }
- public int getBarbarianAdvancedLaps() {
- return barbarianAdvancedLaps;
- }
- public void setBarbarianAdvancedLaps(int barbarianAdvancedLaps) {
- this.barbarianAdvancedLaps = barbarianAdvancedLaps;
- }
- public int getBarrowsKillCount() {
- return barrowsKillCount;
- }
- public int getBarsDone() {
- return barsDone;
- }
- public void setBarsDone(int barsDone) {
- this.barsDone = barsDone;
- }
- public long getBoneDelay() {
- return boneDelay;
- }
- public BountyHunter getBountyHunter() {
- return bountyHunter;
- }
- public ChargesManager getCharges() {
- return charges;
- }
- public int getClanStatus() {
- return clanStatus;
- }
- public void setClanStatus(int clanStatus) {
- this.clanStatus = clanStatus;
- }
- public int getClueReward() {
- return clueReward;
- }
- public void setClueReward(int clueReward) {
- this.clueReward = clueReward;
- }
- public CombatDefinitions getCombatDefinitions() {
- return combatDefinitions;
- }
- public int[] getCompletionistCapeCustomized() {
- return completionistCapeCustomized;
- }
- public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
- this.completionistCapeCustomized = skillcapeCustomized;
- }
- public ControlerManager getControlerManager() {
- return controlerManager;
- }
- public long getCreationDate() {
- return creationDate;
- }
- public void setCreationDate(long creationDate) {
- this.creationDate = creationDate;
- }
- public int getCrucibleHighScore() {
- return crucibleHighScore;
- }
- public FriendChatsManager getCurrentFriendChat() {
- return currentFriendChat;
- }
- public void setCurrentFriendChat(FriendChatsManager currentFriendChat) {
- this.currentFriendChat = currentFriendChat;
- }
- public String getCurrentFriendChatOwner() {
- return currentFriendChatOwner;
- }
- public void setCurrentFriendChatOwner(String currentFriendChatOwner) {
- this.currentFriendChatOwner = currentFriendChatOwner;
- }
- public String getCurrentMac() {
- return currentMac;
- }
- public void setCurrentMac(String currentMac) {
- this.currentMac = currentMac;
- }
- public int getCurrentWorldLobby() {
- return currentWorldLobby;
- }
- public void setCurrentWorldLobby(int currentWorldLobby) {
- this.currentWorldLobby = currentWorldLobby;
- }
- public String getCustomTitle() {
- return customTitle;
- }
- public void setCustomTitle(String customTitle) {
- this.customTitle = customTitle;
- }
- public CutscenesManager getCutscenesManager() {
- return cutscenesManager;
- }
- // LOL, bad way to do it, dont complain
- public int getDeathCount() {
- return deathCount;
- }
- public int getdfscoolDown() {
- return dfscoolDown;
- }
- public DialogueManager getDialogueManager() {
- return dialogueManager;
- }
- public int getDisplayMode() {
- return displayMode;
- }
- public void setDisplayMode(int displayMode) {
- this.displayMode = displayMode;
- }
- public String getDisplayName() {
- if (displayName != null)
- return displayName;
- return Utils.formatPlayerNameForDisplay(username);
- }
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
- public long getDisplayTime() {
- return displayTime;
- }
- public int getDominionFactor() {
- return dominionFactor;
- }
- public void setDominionFactor(int dominionFactor) {
- this.dominionFactor = dominionFactor;
- }
- public DominionTower getDominionTower() {
- return dominionTower;
- }
- @SuppressWarnings("deprecation")
- public String getPremiumBronzeTill() {
- return (premiumBronze ? "never" : new Date(premiumBronzeTill)
- .toGMTString()) + ".";
- }
- public DuelArena getDuelArena() {
- return duelarena;
- }
- public int getDungeoneeringTokens() {
- return dungeoneeringTokens;
- }
- public void setDungeoneeringTokens(int dungeoneeringTokens) {
- this.dungeoneeringTokens = dungeoneeringTokens;
- }
- public int getEasterPoints() {
- return easterPoints;
- }
- public void setEasterPoints(int easterPoints) {
- this.easterPoints = easterPoints;
- }
- public String getEmailAttached() {
- return email;
- }
- public void setEmailAttached(String email) {
- this.email = email;
- }
- public EmotesManager getEmotesManager() {
- return emotesManager;
- }
- public String getEnteredBankPin() {
- return enteredPinString;
- }
- public void setEnteredBankPin(String enteredPinString) {
- this.enteredPinString = enteredPinString;
- }
- public Equipment getEquipment() {
- return equipment;
- }
- @SuppressWarnings("deprecation")
- public String getPremiumTill() {
- return (premiumSilver ? "never" : new Date(premiumTill).toGMTString())
- + ".";
- }
- public int[] getFairyRingCombination() {
- return fairyRingCombination;
- }
- public Familiar getFamiliar() {
- return familiar;
- }
- public void setFamiliar(Familiar familiar) {
- this.familiar = familiar;
- }
- public FarmingManager getFarming() {
- return farmingManager;
- }
- public long getFireImmune() {
- return fireImmune;
- }
- public long getFoodDelay() {
- return foodDelay;
- }
- public FriendsIgnores getFriendsIgnores() {
- return friendsIgnores;
- }
- public int getGnomeAdvancedLaps() {
- return gnomeAdvancedLaps;
- }
- public void setGnomeAdvancedLaps(int gnomeAdvancedLaps) {
- this.gnomeAdvancedLaps = gnomeAdvancedLaps;
- }
- public int getHiddenBrother() {
- return hiddenBrother;
- }
- public void setHiddenBrother(int hiddenBrother) {
- this.hiddenBrother = hiddenBrother;
- }
- public HintIconsManager getHintIconsManager() {
- return hintIconsManager;
- }
- public double getHpBoostMultiplier() {
- return hpBoostMultiplier;
- }
- public void setHpBoostMultiplier(double hpBoostMultiplier) {
- this.hpBoostMultiplier = hpBoostMultiplier;
- }
- public InterfaceManager getInterfaceManager() {
- return interfaceManager;
- }
- public Inventory getInventory() {
- return inventory;
- }
- public IsaacKeyPair getIsaacKeyPair() {
- return isaacKeyPair;
- }
- public boolean getIsInLobby() {
- return isInLobby;
- }
- public void setIsInLobby(boolean isInLobby) {
- this.isInLobby = isInLobby;
- }
- public long getJailed() {
- return jailed;
- }
- public void setJailed(long jailed) {
- this.jailed = jailed;
- }
- public int getKillCount() {
- return killCount;
- }
- public boolean[] getKilledBarrowBrothers() {
- return killedBarrowBrothers;
- }
- public int getLastBonfire() {
- return lastBonfire;
- }
- public void setLastBonfire(int lastBonfire) {
- this.lastBonfire = lastBonfire;
- }
- /**
- * END RFD
- */
- public DuelRules getLastDuelRules() {
- return lastDuelRules;
- }
- public void setLastDuelRules(DuelRules duelRules) {
- this.lastDuelRules = duelRules;
- }
- public String getLastHostname() {
- InetAddress addr;
- try {
- addr = InetAddress.getByName(getLastIP());
- String hostname = addr.getHostName();
- return hostname;
- } catch (UnknownHostException e) {
- e.printStackTrace();
- }
- return null;
- }
- public String getLastIP() {
- return lastIP;
- }
- public void setLastIP(String lastIP) {
- this.lastIP = lastIP;
- }
- public long getLastLoggedIn() {
- // TODO Auto-generated method stub
- return lastLoggedIn;
- }
- public String getLastMsg() {
- return lastMsg;
- }
- public void setLastMsg(String lastMsg) {
- this.lastMsg = lastMsg;
- }
- public long getLastPublicMessage() {
- return lastPublicMessage;
- }
- public void setLastPublicMessage(long lastPublicMessage) {
- this.lastPublicMessage = lastPublicMessage;
- }
- public long getLastRequestSQL() {
- // TODO Auto-generated method stub
- return lastRequestSQL;
- }
- public void setLastRequestSQL(long lastRequestSQL) {
- // TODO Auto-generated method stub
- this.lastRequestSQL = lastRequestSQL;
- }
- public long getLastWalked() {
- // TODO Auto-generated method stub
- return lastWalkedMillis;
- }
- public void setLastWalked(long lastWalkedMillis) {
- // TODO Auto-generated method stub
- this.lastWalkedMillis = lastWalkedMillis;
- }
- public int getLoadedLogs() {
- return loadedLogs;
- }
- public void setLoadedLogs(int loadedLogs) {
- this.loadedLogs = loadedLogs;
- }
- public LocalNPCUpdate getLocalNPCUpdate() {
- return localNPCUpdate;
- }
- public LocalPlayerUpdate getLocalPlayerUpdate() {
- return localPlayerUpdate;
- }
- public long getLockDelay() {
- return lockDelay;
- }
- public int getLoggedInWorld() {
- // TODO Auto-generated method stub
- return loggedWorld;
- }
- public void setLoggedInWorld(int loggedWorld) {
- this.loggedWorld = loggedWorld;
- }
- public int getLogsCut() {
- return logsCut;
- }
- public void setLogsCut(int logsCut) {
- this.logsCut = logsCut;
- }
- public LoyaltyManager getLoyaltyManager() {
- return loyaltyManager;
- }
- public int getLoyaltyPoints() {
- return Loyaltypoints;
- }
- public void setLoyaltyPoints(int Loyaltypoints) {
- this.Loyaltypoints = Loyaltypoints;
- }
- @Override
- public double getMagePrayerMultiplier() {
- return 0.6;
- }
- public int getMagicLogsBurned() {
- return magicLogsBurned;
- }
- public void setMagicLogsBurned(int magicLogsBurned) {
- this.magicLogsBurned = magicLogsBurned;
- }
- public int[] getMaxedCapeCustomized() {
- return maxedCapeCustomized;
- }
- public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
- this.maxedCapeCustomized = maxedCapeCustomized;
- }
- @Override
- public int getMaxHitpoints() {
- return skills.getLevel(Skills.HITPOINTS) * 10
- + equipment.getEquipmentHpIncrease();
- }
- @Override
- public double getMeleePrayerMultiplier() {
- return 0.6;
- }
- public int getMessageIcon() {
- return getRights() == 2
- || getRights() == 1 ? getRights()
- : isModerator() ? 10
- : isSupporter ? 14
- : isPremiumGold() ? 12
- : isPremiumSilver() ? 11
- : isPremiumBronze() ? 8
- : isIronman() ? 13
- : isHardcoreIronman() ? 10
- : getRights();
- }
- public MoneyPouch getMoneyPouch() {
- return pouch;
- }
- public int getMoneyPouchValue() {
- return money;
- }
- public void setMoneyPouchValue(int money) {
- this.money = money;
- }
- public int getMovementType() {
- if (getTemporaryMoveType() != -1)
- return getTemporaryMoveType();
- return getRun() ? RUN_MOVE_TYPE : WALK_MOVE_TYPE;
- }
- public MusicsManager getMusicsManager() {
- return musicsManager;
- }
- public long getMuted() {
- return muted;
- }
- public void setMuted(long muted) {
- this.muted = muted;
- }
- public ArrayList<Notes.Note> getCurNotes() {
- return pnotes;
- }
- public Notes getNotes() {
- return notes;
- }
- public void setNotes(Notes notes) {
- this.notes = notes;
- }
- public int getOverloadDelay() {
- return overloadDelay;
- }
- public void setOverloadDelay(int overloadDelay) {
- this.overloadDelay = overloadDelay;
- }
- public List<String> getOwnedObjectManagerKeys() {
- if (ownedObjectsManagerKeys == null) // temporary
- ownedObjectsManagerKeys = new LinkedList<String>();
- return ownedObjectsManagerKeys;
- }
- public String getOwner() {
- return Owner;
- }
- public WorldPacketsEncoder getPackets() {
- return session.getWorldPackets();
- }
- public long getPacketsDecoderPing() {
- return packetsDecoderPing;
- }
- public void setPacketsDecoderPing(long packetsDecoderPing) {
- this.packetsDecoderPing = packetsDecoderPing;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public int getPestControlGames() {
- return pestControlGames;
- }
- public void setPestControlGames(int pestControlGames) {
- this.pestControlGames = pestControlGames;
- }
- public int getPestPoints() {
- return pestPoints;
- }
- public void setPestPoints(int pestPoints) {
- this.pestPoints = pestPoints;
- }
- /**
- * Gets the pet.
- *
- * @return The pet.
- */
- public Pet getPet() {
- return pet;
- }
- /**
- * Sets the pet.
- *
- * @param pet The pet to set.
- */
- public void setPet(Pet pet) {
- this.pet = pet;
- }
- /**
- * Gets the petManager.
- *
- * @return The petManager.
- */
- public PetManager getPetManager() {
- return petManager;
- }
- /**
- * Sets the petManager.
- *
- * @param petManager The petManager to set.
- */
- public void setPetManager(PetManager petManager) {
- this.petManager = petManager;
- }
- public int getPkPoints() {
- return pkPoints;
- }
- public void setPkPoints(int pkPoints) {
- this.pkPoints = pkPoints;
- }
- public long getPoisonImmune() {
- return poisonImmune;
- }
- public long getPolDelay() {
- return polDelay;
- }
- public void setPolDelay(long delay) {
- this.polDelay = delay;
- }
- public long getPotDelay() {
- return potDelay;
- }
- public int[] getPouches() {
- return pouches;
- }
- public Prayer getPrayer() {
- return prayer;
- }
- public long getPrayerDelay() {
- Long teleblock = (Long) getTemporaryAttributtes().get("PrayerBlocked");
- if (teleblock == null)
- return 0;
- return teleblock;
- }
- public void setPrayerDelay(long teleDelay) {
- getTemporaryAttributtes().put("PrayerBlocked",
- teleDelay + Utils.currentTimeMillis());
- prayer.closeAllPrayers();
- }
- public String getPrefix() {
- return yellPrefix;
- }
- public void setPrefix(String yellPrefix) {
- this.yellPrefix = yellPrefix;
- }
- public int getPrestige() {
- return prestige;
- }
- public void setPrestige(int prestige) {
- this.prestige = prestige;
- }
- public PriceCheckManager getPriceCheckManager() {
- return priceCheckManager;
- }
- public int getPrivateChatSetup() {
- return privateChatSetup;
- }
- public void setPrivateChatSetup(int privateChatSetup) {
- this.privateChatSetup = privateChatSetup;
- }
- public int getPublicStatus() {
- return publicStatus;
- }
- public void setPublicStatus(int publicStatus) {
- this.publicStatus = publicStatus;
- }
- public int getPvmPoints() {
- return pvmPoints;
- }
- public void setPvmPoints(int pvmPoints) {
- this.pvmPoints = pvmPoints;
- }
- public QuestManager getQuestManager() {
- return questManager;
- }
- @Override
- public double getRangePrayerMultiplier() {
- return 0.6;
- }
- public String getRecovAnswer() {
- return recovAnswer;
- }
- public void setRecovAnswer(String recovAnswer) {
- this.recovAnswer = recovAnswer;
- }
- public String getRecovQuestion() {
- return recovQuestion;
- }
- public void setRecovQuestion(String recovQuestion) {
- this.recovQuestion = recovQuestion;
- }
- public String getRegisteredMac() {
- return registeredMac;
- }
- public void setRegisteredMac(String registeredMac) {
- this.registeredMac = registeredMac;
- }
- public int getRights() {
- return rights;
- }
- public void setRights(int rights) {
- this.rights = rights;
- appearence.generateAppearenceData();
- }
- public int getRocktailsCooked() {
- return rocktailsCooked;
- }
- public void setRocktailsCooked(int rocktailsCooked) {
- this.rocktailsCooked = rocktailsCooked;
- }
- public byte getRunEnergy() {
- return runEnergy;
- }
- public void setRunEnergy(int runEnergy) {
- this.runEnergy = (byte) runEnergy;
- getPackets().sendRunEnergy();
- }
- /**
- * @return the runeSpanPoint
- */
- public int getScreenHeight() {
- return screenHeight;
- }
- public void setScreenHeight(int screenHeight) {
- this.screenHeight = screenHeight;
- }
- public int getScreenWidth() {
- return screenWidth;
- }
- public void setScreenWidth(int screenWidth) {
- this.screenWidth = screenWidth;
- }
- public Session getSession() {
- return session;
- }
- public String getShadColor() {
- return yellShade;
- }
- @Override
- public int getSize() {
- return appearence.getSize();
- }
- public Skills getSkills() {
- return skills;
- }
- public int getSkullId() {
- return skullId;
- }
- public void setSkullId(int skullId) {
- this.skullId = skullId;
- }
- public int getSpecRestoreTimer() {
- return specRestoreTimer;
- }
- public void setSpecRestoreTimer(int specRestoreTimer) {
- this.specRestoreTimer = specRestoreTimer;
- }
- public int getSpins() {
- return spins;
- }
- public void setSpins(int spins) {
- this.spins = spins;
- }
- public int getSummoningLeftClickOption() {
- return summoningLeftClickOption;
- }
- public void setSummoningLeftClickOption(int summoningLeftClickOption) {
- this.summoningLeftClickOption = summoningLeftClickOption;
- }
- public List<Integer> getSwitchItemCache() {
- return switchItemCache;
- }
- public void setSwitchItemCache(List<Integer> switchItemCache) {
- this.switchItemCache = switchItemCache;
- }
- public long getTeleBlockDelay() {
- Long teleblock = (Long) getTemporaryAttributtes().get("TeleBlocked");
- if (teleblock == null)
- return 0;
- return teleblock;
- }
- public void setTeleBlockDelay(long teleDelay) {
- getTemporaryAttributtes().put("TeleBlocked",
- teleDelay + Utils.currentTimeMillis());
- }
- public int getTemporaryMovementType() {
- return temporaryMovementType;
- }
- public void setTemporaryMovementType(int temporaryMovementType) {
- this.temporaryMovementType = temporaryMovementType;
- }
- public int getTemporaryMoveType() {
- return getTemporaryMovementType();
- }
- public void setTemporaryMoveType(int temporaryMovementType) {
- this.setTemporaryMovementType(temporaryMovementType);
- }
- public String getTitle() {
- return Title;
- }
- public void setTitle(String Title) {
- this.Title = Title;
- }
- public String getTitleColor() {
- return titleColor;
- }
- public Trade getTrade() {
- return trade;
- }
- public int getTradeStatus() {
- return tradeStatus;
- }
- public void setTradeStatus(int tradeStatus) {
- this.tradeStatus = tradeStatus;
- }
- public int getUniquePlayerId() {
- return uniquePlayerId;
- }
- public void setUniquePlayerId(int uniquePlayerId) {
- this.uniquePlayerId = uniquePlayerId;
- }
- public String getUsername() {
- return username;
- }
- /*
- * do not use this, only used by pm
- */
- public void setUsername(String username) {
- this.username = username;
- }
- public int getVecnaTimer() {
- return vecnaTimer;
- }
- public void setVecnaTimer(int vecnaTimer) {
- this.vecnaTimer = vecnaTimer;
- }
- public int getVotePoints() {
- return votePoints;
- }
- public void setVotePoints(int votePoints) {
- this.votePoints = votePoints;
- }
- public String getYellColor() {
- return yellColor;
- }
- public void setYellColor(String yellColor) {
- this.yellColor = yellColor;
- }
- public long getYellDelay() {
- return yellDelay;
- }
- public void setYellDelay(long l) {
- yellDelay = l;
- }
- @Override
- public void handleIngoingHit(final Hit hit) {
- if (hit.getLook() != HitLook.MELEE_DAMAGE
- && hit.getLook() != HitLook.RANGE_DAMAGE
- && hit.getLook() != HitLook.MAGIC_DAMAGE)
- return;
- if (invulnerable) {
- hit.setDamage(0);
- return;
- }
- if (auraManager.usingPenance()) {
- int amount = (int) (hit.getDamage() * 0.2);
- if (amount > 0)
- prayer.restorePrayer(amount);
- }
- Entity source = hit.getSource();
- if (source == null)
- return;
- if (polDelay > Utils.currentTimeMillis())
- hit.setDamage((int) (hit.getDamage() * 0.5));
- if (prayer.hasPrayersOn() && hit.getDamage() != 0) {
- if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
- if (prayer.usingPrayer(0, 17))
- hit.setDamage((int) (hit.getDamage() * source
- .getMagePrayerMultiplier()));
- else if (prayer.usingPrayer(1, 7)) {
- int deflectedDamage = source instanceof Nex ? 0
- : (int) (hit.getDamage() * 0.1);
- hit.setDamage((int) (hit.getDamage() * source
- .getMagePrayerMultiplier()));
- if (deflectedDamage > 0) {
- source.applyHit(new Hit(this, deflectedDamage,
- HitLook.REFLECTED_DAMAGE));
- setNextGraphics(new Graphics(2228));
- setNextAnimation(new Animation(12573));
- }
- }
- } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
- if (prayer.usingPrayer(0, 18))
- hit.setDamage((int) (hit.getDamage() * source
- .getRangePrayerMultiplier()));
- else if (prayer.usingPrayer(1, 8)) {
- int deflectedDamage = source instanceof Nex ? 0
- : (int) (hit.getDamage() * 0.1);
- hit.setDamage((int) (hit.getDamage() * source
- .getRangePrayerMultiplier()));
- if (deflectedDamage > 0) {
- source.applyHit(new Hit(this, deflectedDamage,
- HitLook.REFLECTED_DAMAGE));
- setNextGraphics(new Graphics(2229));
- setNextAnimation(new Animation(12573));
- }
- }
- } else if (hit.getLook() == HitLook.MELEE_DAMAGE) {
- if (prayer.usingPrayer(0, 19))
- hit.setDamage((int) (hit.getDamage() * source
- .getMeleePrayerMultiplier()));
- else if (prayer.usingPrayer(1, 9)) {
- int deflectedDamage = source instanceof Nex ? 0
- : (int) (hit.getDamage() * 0.1);
- hit.setDamage((int) (hit.getDamage() * source
- .getMeleePrayerMultiplier()));
- if (deflectedDamage > 0) {
- source.applyHit(new Hit(this, deflectedDamage,
- HitLook.REFLECTED_DAMAGE));
- setNextGraphics(new Graphics(2230));
- setNextAnimation(new Animation(12573));
- }
- }
- }
- }
- if (hit.getDamage() >= 200) {
- if (hit.getLook() == HitLook.MELEE_DAMAGE) {
- int reducedDamage = hit.getDamage()
- * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MELEE_BONUS]
- / 100;
- if (reducedDamage > 0) {
- hit.setDamage(hit.getDamage() - reducedDamage);
- hit.setSoaking(new Hit(source, reducedDamage,
- HitLook.ABSORB_DAMAGE));
- }
- } else if (hit.getLook() == HitLook.RANGE_DAMAGE) {
- int reducedDamage = hit.getDamage()
- * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_RANGE_BONUS]
- / 100;
- if (reducedDamage > 0) {
- hit.setDamage(hit.getDamage() - reducedDamage);
- hit.setSoaking(new Hit(source, reducedDamage,
- HitLook.ABSORB_DAMAGE));
- }
- } else if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
- int reducedDamage = hit.getDamage()
- * combatDefinitions.getBonuses()[CombatDefinitions.ABSORVE_MAGE_BONUS]
- / 100;
- if (reducedDamage > 0) {
- hit.setDamage(hit.getDamage() - reducedDamage);
- hit.setSoaking(new Hit(source, reducedDamage,
- HitLook.ABSORB_DAMAGE));
- }
- }
- }
- int shieldId = equipment.getShieldId();
- if (shieldId == 13742 || shieldId == 23699) { // elsyian
- if (Utils.getRandom(100) <= 70)
- hit.setDamage((int) (hit.getDamage() * 0.75));
- } else if (shieldId == 13740 || shieldId == 23698) { // divine
- int drain = (int) (Math.ceil(hit.getDamage() * 0.3) / 2);
- if (prayer.getPrayerpoints() >= drain) {
- hit.setDamage((int) (hit.getDamage() * 0.70));
- prayer.drainPrayer(drain);
- }
- }
- if (castedVeng && hit.getDamage() >= 4) {
- castedVeng = false;
- setNextForceTalk(new ForceTalk("Taste vengeance!"));
- source.applyHit(new Hit(this, (int) (hit.getDamage() * 0.75),
- HitLook.REGULAR_DAMAGE));
- }
- if (source instanceof Player) {
- final Player p2 = (Player) source;
- if (getControlerManager().getControler() instanceof FistOfGuthixGame) {
- FistOfGuthixGame controler = (FistOfGuthixGame) getControlerManager()
- .getControler();
- if (controler != null) {
- if (controler.hunter) {
- hit.setDamage((int) (hit.getDamage() * 0.6));
- // System.out.println("Recieved lowered hits from the huntedby.");
- }
- }
- }
- if (p2.prayer.hasPrayersOn()) {
- if (p2.prayer.usingPrayer(0, 24)) { // smite
- int drain = hit.getDamage() / 4;
- if (drain > 0)
- prayer.drainPrayer(drain);
- } else {
- if (hit.getDamage() == 0)
- return;
- if (!p2.prayer.isBoostedLeech()) {
- if (hit.getLook() == HitLook.MELEE_DAMAGE) {
- if (p2.prayer.usingPrayer(1, 19)) {
- if (Utils.getRandom(4) == 0) {
- p2.prayer.increaseTurmoilBonus(this);
- p2.prayer.setBoostedLeech(true);
- return;
- }
- } else if (p2.prayer.usingPrayer(1, 1)) { // sap att
- if (Utils.getRandom(4) == 0) {
- if (p2.prayer.reachedMax(0)) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your sap curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(0);
- p2.getPackets()
- .sendGameMessage(
- "Your curse drains Attack from the enemy, boosting your Attack.",
- true);
- }
- p2.setNextAnimation(new Animation(12569));
- p2.setNextGraphics(new Graphics(2214));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2215, 35,
- 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2216));
- }
- }, 1);
- return;
- }
- } else {
- if (p2.prayer.usingPrayer(1, 10)) {
- if (Utils.getRandom(7) == 0) {
- if (p2.prayer.reachedMax(3)) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(3);
- p2.getPackets()
- .sendGameMessage(
- "Your curse drains Attack from the enemy, boosting your Attack.",
- true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2231,
- 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(
- new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(
- 2232));
- }
- }, 1);
- return;
- }
- }
- if (p2.prayer.usingPrayer(1, 14)) {
- if (Utils.getRandom(7) == 0) {
- if (p2.prayer.reachedMax(7)) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(7);
- p2.getPackets()
- .sendGameMessage(
- "Your curse drains Strength from the enemy, boosting your Strength.",
- true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2248,
- 35, 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(
- new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(
- 2250));
- }
- }, 1);
- return;
- }
- }
- }
- }
- if (hit.getLook() == HitLook.RANGE_DAMAGE) {
- if (p2.prayer.usingPrayer(1, 2)) { // sap range
- if (Utils.getRandom(4) == 0) {
- if (p2.prayer.reachedMax(1)) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your sap curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(1);
- p2.getPackets()
- .sendGameMessage(
- "Your curse drains Range from the enemy, boosting your Range.",
- true);
- }
- p2.setNextAnimation(new Animation(12569));
- p2.setNextGraphics(new Graphics(2217));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2218, 35,
- 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2219));
- }
- }, 1);
- return;
- }
- } else if (p2.prayer.usingPrayer(1, 11)) {
- if (Utils.getRandom(7) == 0) {
- if (p2.prayer.reachedMax(4)) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(4);
- p2.getPackets()
- .sendGameMessage(
- "Your curse drains Range from the enemy, boosting your Range.",
- true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2236, 35,
- 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2238));
- }
- });
- return;
- }
- }
- }
- if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
- if (p2.prayer.usingPrayer(1, 3)) { // sap mage
- if (Utils.getRandom(4) == 0) {
- if (p2.prayer.reachedMax(2)) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your sap curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(2);
- p2.getPackets()
- .sendGameMessage(
- "Your curse drains Magic from the enemy, boosting your Magic.",
- true);
- }
- p2.setNextAnimation(new Animation(12569));
- p2.setNextGraphics(new Graphics(2220));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2221, 35,
- 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2222));
- }
- }, 1);
- return;
- }
- } else if (p2.prayer.usingPrayer(1, 12)) {
- if (Utils.getRandom(7) == 0) {
- if (p2.prayer.reachedMax(5)) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(5);
- p2.getPackets()
- .sendGameMessage(
- "Your curse drains Magic from the enemy, boosting your Magic.",
- true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2240, 35,
- 35, 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2242));
- }
- }, 1);
- return;
- }
- }
- }
- // overall
- if (p2.prayer.usingPrayer(1, 13)) { // leech defence
- if (Utils.getRandom(10) == 0) {
- if (p2.prayer.reachedMax(6)) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.prayer.increaseLeechBonus(6);
- p2.getPackets()
- .sendGameMessage(
- "Your curse drains Defence from the enemy, boosting your Defence.",
- true);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2244, 35, 35,
- 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2246));
- }
- }, 1);
- return;
- }
- }
- if (p2.prayer.usingPrayer(1, 15)) {
- if (Utils.getRandom(10) == 0) {
- if (getRunEnergy() <= 0) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.setRunEnergy(p2.getRunEnergy() > 90 ? 100
- : p2.getRunEnergy() + 10);
- setRunEnergy(p2.getRunEnergy() > 10 ? getRunEnergy() - 10
- : 0);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2256, 35, 35,
- 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2258));
- }
- }, 1);
- return;
- }
- }
- if (p2.prayer.usingPrayer(1, 16)) {
- if (Utils.getRandom(10) == 0) {
- if (combatDefinitions
- .getSpecialAttackPercentage() <= 0) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your leech curse has no effect.",
- true);
- } else {
- p2.combatDefinitions.restoreSpecialAttack();
- combatDefinitions
- .desecreaseSpecialAttack(10);
- }
- p2.setNextAnimation(new Animation(12575));
- p2.prayer.setBoostedLeech(true);
- World.sendProjectile(p2, this, 2252, 35, 35,
- 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2254));
- }
- }, 1);
- return;
- }
- }
- if (p2.prayer.usingPrayer(1, 4)) { // sap spec
- if (Utils.getRandom(10) == 0) {
- p2.setNextAnimation(new Animation(12569));
- p2.setNextGraphics(new Graphics(2223));
- p2.prayer.setBoostedLeech(true);
- if (combatDefinitions
- .getSpecialAttackPercentage() <= 0) {
- p2.getPackets()
- .sendGameMessage(
- "Your opponent has been weakened so much that your sap curse has no effect.",
- true);
- } else {
- combatDefinitions
- .desecreaseSpecialAttack(10);
- }
- World.sendProjectile(p2, this, 2224, 35, 35,
- 20, 5, 0, 0);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2225));
- }
- }, 1);
- return;
- }
- }
- }
- }
- }
- } else {
- NPC n = (NPC) source;
- if (prayer.usingPrayer(1, 19)) {
- if (Utils.getRandom(4) == 0) {
- prayer.increaseTurmoilBonus(n);
- prayer.setBoostedLeech(true);
- }
- }
- if (n.getId() == 13448)
- sendSoulSplit(hit, n);
- if (n instanceof Glacor) {
- Glacor glacor = (Glacor) n;
- if (glacor.getEffect() == GlacorEffect.SAPPING) {
- this.getPrayer().drainPrayer(
- (int) Utils.getPercent(10, this.getPrayer()
- .getPrayerpoints()));
- }
- } else if (n instanceof SappingGlacyte) {
- this.getPrayer().drainPrayer(
- (int) Utils.getPercent(5, this.getPrayer()
- .getPrayerpoints()));
- }
- }
- }
- public boolean hasDisabledYell() {
- return yellDisabled;
- }
- public boolean hasDisplayName() {
- return displayName != null;
- }
- public boolean hasInstantSpecial(final int weaponId) {
- switch (weaponId) {
- case 4153:
- case 15486:
- case 22207:
- case 22209:
- case 22211:
- case 22213:
- case 1377:
- case 13472:
- case 35:// Excalibur
- case 8280:
- case 14632:
- return true;
- default:
- return false;
- }
- }
- public boolean hasLargeSceneView() {
- return largeSceneView;
- }
- public boolean hasRecievedStarter() {
- return setStarter;
- }
- public boolean hasSkull() {
- return skullDelay > 0;
- }
- public boolean hasStarted() {
- return started;
- }
- public boolean hasTalkedtoCook() {
- return talkedtoCook;
- }
- @Override
- public void heal(int ammount, int extra) {
- super.heal(ammount, extra);
- refreshHitPoints();
- }
- public void increaseKillCount(Player killed) {
- if (lastKilled == killed.getUsername()) {
- sendMessage("You haven't been awarded any pk points for killing; "
- + killed.getDisplayName() + " twice.");
- return;
- }
- killed.deathCount++;
- PkRank.checkRank(killed);
- lastKilled = killed.getUsername();
- if (killed.getSession().getIP().equals(getSession().getIP()))
- return;
- int points = isPremiumGold() ? getPkPoints() + 15 : Wilderness.isAtWild(this) ? getPkPoints() + 10
- : getPkPoints() + 3;
- killCount++;
- sendMessage("<shad=000000><col=ff0000>You have been awarded " + points
- + " pk point for killing; " + killed.getDisplayName() + ".");
- setPkPoints(points);
- PkRank.checkRank(this);
- }
- public void init(Session session, String string, IsaacKeyPair isaacKeyPair) {
- username = string;
- this.session = session;
- this.isaacKeyPair = isaacKeyPair;
- afkTimer = Utils.currentTimeMillis() + (1000 * 60 * 5);
- afkTime();
- World.addLobbyPlayer(this);// .addLobbyPlayer(this);
- setLoggedInWorld(3); // LOBBY STAGE
- SerializableFilesManager.savePlayer(this);
- if (Settings.DEBUG) {
- Logger.log(this,
- new StringBuilder("Lobby Inited Player: ").append(string)
- .append(", pass: ").append(password).toString());
- }
- }
- public void afkTime() {
- CoresManager.slowExecutor.schedule(new Runnable() {
- public void run() {
- if (afkTimer < Utils.currentTimeMillis()) {
- forceLogout();
- }
- afkTime();
- }
- }, 1, TimeUnit.MINUTES);
- }
- public boolean isAdmin() {
- if (isOwner()) {
- return false;
- }
- return getRights() == 2;
- }
- public boolean isApeAtoll() {
- return (getX() >= 2693 && getX() <= 2821 && getY() >= 2693 && getY() <= 2817);
- }
- public boolean isCanPvp() {
- return canPvp;
- }
- public void setCanPvp(boolean canPvp) {
- this.canPvp = canPvp;
- appearence.generateAppearenceData();
- getPackets().sendPlayerOption(canPvp ? "Attack" : "null", 1, true);
- getPackets().sendPlayerUnderNPCPriority(canPvp);
- }
- public boolean isCantTrade() {
- return cantTrade;
- }
- public void setCantTrade(boolean canTrade) {
- this.cantTrade = canTrade;
- }
- public boolean isCastVeng() {
- return castedVeng;
- }
- public void setCastVeng(boolean castVeng) {
- this.castedVeng = castVeng;
- }
- public boolean isCompletedFightCaves() {
- return completedFightCaves;
- }
- public boolean isCompletedFightKiln() {
- return completedFightKiln;
- }
- public boolean isCompletedRfd() {
- return completedRfd;
- }
- public boolean isDfsActivated() {
- return dfsActivated;
- }
- public void setDfsActivated(boolean dfsActivated) {
- this.dfsActivated = dfsActivated;
- }
- public boolean isPremiumBronze() {
- return isPremiumSilver() || premiumBronze || getRights() == 3
- || premiumBronzeTill > Utils.currentTimeMillis();
- }
- public void setPremiumBronze(boolean premiumBronze) {
- if (getRights() < 6)
- setRights(3);
- this.premiumBronze = premiumBronze;
- }
- /**
- * For if all premiums can do something
- */
- public boolean isPremium() {
- return isPremiumBronze() || isPremiumSilver() || isPremiumGold();
- }
- public boolean isEquipDisabled() {
- return disableEquip;
- }
- public boolean isPremiumSilver() {
- return premiumSilver || getRights() == 4 || premiumTill > Utils.currentTimeMillis();
- }
- public void setPremiumSilver(boolean premiumSilver) {
- if (getRights() < 6)
- setRights(4);
- this.premiumSilver = premiumSilver;
- }
- public boolean isExtremePermDonator() {
- return premiumSilver;
- }
- public boolean isFilterGame() {
- return filterGame;
- }
- public void setFilterGame(boolean filterGame) {
- this.filterGame = filterGame;
- }
- public boolean isForceNextMapLoadRefresh() {
- return forceNextMapLoadRefresh;
- }
- public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
- this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
- }
- public boolean isModerator() {
- return isModerator;
- }
- public void setModerator(boolean isModerator) {
- this.isModerator = isModerator;
- }
- public boolean isGotInfernoAdze() {
- return gotInfernoAdze;
- }
- public void setGotInfernoAdze(boolean gotInfernoAdze) {
- this.gotInfernoAdze = gotInfernoAdze;
- }
- public boolean isGraphicDesigner() {
- return isGraphicDesigner;
- }
- public void setGraphicDesigner(boolean isGraphicDesigner) {
- this.isGraphicDesigner = isGraphicDesigner;
- }
- public boolean isHasCutEnoughLogs() {
- return hasCutEnoughLogs;
- }
- public void setHasCutEnoughLogs(boolean hasCutEnoughLogs) {
- this.hasCutEnoughLogs = hasCutEnoughLogs;
- }
- public boolean isHasCutMoreEnoughLogs() {
- return hasCutMoreEnoughLogs;
- }
- public void setHasCutMoreEnoughLogs(boolean hasCutMoreEnoughLogs) {
- this.hasCutMoreEnoughLogs = hasCutMoreEnoughLogs;
- }
- public boolean isHidden() {
- // TODO Auto-generated method stub
- return true;
- }
- public boolean isHidingWorldMessages() {
- return hideWorldAnnouncements;
- }
- public boolean isInAnimationRoom() {
- return inAnimationRoom;
- }
- public void setInAnimationRoom(boolean inAnimationRoom) {
- this.inAnimationRoom = inAnimationRoom;
- }
- public boolean isInDefenderRoom() {
- return isInDefenderRoom;
- }
- public boolean isKalphiteLairEntranceSetted() {
- return khalphiteLairEntranceSetted;
- }
- public boolean isKalphiteLairSetted() {
- return khalphiteLairSetted;
- }
- public boolean isKilledAgrithNaNa() {
- return agrithNaNa;
- }
- public void setKilledAgrithNaNa(boolean agrithNaNa) {
- this.agrithNaNa = agrithNaNa;
- }
- public boolean isKilledBork() {
- return killedBork;
- }
- public void setKilledBork(boolean killedBork) {
- this.killedBork = killedBork;
- }
- /**
- * RFD
- */
- public boolean isKilledCulinaromancer() {
- return culinaromancer;
- }
- public void setKilledCulinaromancer(boolean culinaromancer) {
- this.culinaromancer = culinaromancer;
- }
- public boolean isKilledDessourt() {
- return dessourt;
- }
- public void setKilledDessourt(boolean dessourt) {
- this.dessourt = dessourt;
- }
- public boolean isKilledFlambeed() {
- return flamBeed;
- }
- public boolean isKilledKaramel() {
- return karamel;
- }
- public void setKilledKaramel(boolean karamel) {
- this.karamel = karamel;
- }
- /**
- * Gets the killedQueenBlackDragon.
- *
- * @return The killedQueenBlackDragon.
- */
- public boolean isKilledQueenBlackDragon() {
- return killedQueenBlackDragon;
- }
- /**
- * Sets the killedQueenBlackDragon.
- *
- * @param killedQueenBlackDragon The killedQueenBlackDragon to set.
- */
- public void setKilledQueenBlackDragon(boolean killedQueenBlackDragon) {
- this.killedQueenBlackDragon = killedQueenBlackDragon;
- }
- public boolean isLocked() {
- return lockDelay >= Utils.currentTimeMillis();
- }
- public boolean isMacBanned() {
- return macBanned;
- }
- public void setMacBanned(boolean macBanned) {
- this.macBanned = macBanned;
- }
- public boolean isOldItemsLook() {
- return oldItemsLook;
- }
- public boolean isOwner() {
- boolean o = false;
- for (String owner : Settings.MAIN_ACESSS) {
- if (getUsername().equalsIgnoreCase(owner)) {
- o = true;
- break;
- }
- }
- return o;
- }
- public void setOwner(String Owner) {
- this.Owner = Owner;
- }
- public boolean isPermBanned() {
- return permBanned;
- }
- public void setPermBanned(boolean permBanned) {
- this.permBanned = permBanned;
- }
- public boolean isPermMuted() {
- return permMuted;
- }
- public void setPermMuted(boolean permMuted) {
- this.permMuted = permMuted;
- }
- public boolean isResting() {
- return resting;
- }
- public void setResting(boolean resting) {
- this.resting = resting;
- sendRunButtonConfig();
- }
- public boolean isRunning() {
- return running;
- }
- public void setRunning(boolean running) {
- this.running = running;
- }
- public boolean isSpawnsMode() {
- return spawnsMode;
- }
- public void setSpawnsMode(boolean spawnsMode) {
- this.spawnsMode = spawnsMode;
- }
- public boolean isSupporter() {
- return isSupporter;
- }
- public void setSupporter(boolean isSupporter) {
- this.isSupporter = isSupporter;
- }
- public boolean isTalkedWithMarv() {
- return talkedWithMarv;
- }
- public boolean isTalkedWithVannaka() {
- return talkedWithVannaka;
- }
- public void setTalkedWithVannaka(boolean talkedWithVannaka) {
- this.talkedWithVannaka = talkedWithVannaka;
- }
- public boolean isUpdateMovementType() {
- return updateMovementType;
- }
- public void setUpdateMovementType(boolean updateMovementType) {
- this.updateMovementType = updateMovementType;
- }
- public boolean isUsingReportOption() {
- return reportOption;
- }
- public void setUsingReportOption(boolean option) {
- reportOption = option;
- }
- public boolean isUsingZenRest() {
- // TODO Auto-generated method stub
- return zenRest;
- }
- public void setUsingZenRest(boolean zenRest) {
- this.zenRest = zenRest;
- }
- public boolean isPremiumGold() {
- return premiumGold || getRights() == 5;
- }
- public void setPremiumGold(boolean premiumGold) {
- if (getRights() < 6)
- setRights(5);
- this.premiumGold = premiumGold;
- }
- public boolean isWonFightPits() {
- return wonFightPits;
- }
- public boolean isXpLocked() {
- return xpLocked;
- }
- public void setXpLocked(boolean locked) {
- this.xpLocked = locked;
- }
- public boolean isYellOff() {
- return yellOff;
- }
- public void setYellOff(boolean yellOff) {
- this.yellOff = yellOff;
- }
- public void kickPlayerFromFriendsChannel(String name) {
- if (currentFriendChat == null)
- return;
- currentFriendChat.kickPlayerFromChat(this, name);
- }
- @Override
- public void loadMapRegions() {
- boolean wasAtDynamicRegion = isAtDynamicRegion();
- super.loadMapRegions();
- clientLoadedMapRegion = false;
- if (isAtDynamicRegion()) {
- getPackets().sendDynamicMapRegion(!started);
- if (!wasAtDynamicRegion)
- localNPCUpdate.reset();
- } else {
- getPackets().sendMapRegion(!started);
- if (wasAtDynamicRegion)
- localNPCUpdate.reset();
- }
- forceNextMapLoadRefresh = false;
- }
- public void lock() {
- lockDelay = Long.MAX_VALUE;
- }
- public void lock(long time) {
- lockDelay = Utils.currentTimeMillis() + (time * 600);
- }
- /**
- * Logs the player out.
- *
- * @param lobby If we're logging out to the lobby.
- */
- public void logout(boolean lobby) {
- if (!isRunning())
- return;
- long currentTime = Utils.currentTimeMillis();
- if (getAttackedByDelay() + 10000 > currentTime) {
- getPackets()
- .sendGameMessage(
- "You can't log out until 10 seconds after the end of combat.");
- return;
- }
- if (getEmotesManager().getNextEmoteEnd() >= currentTime) {
- sendMessage("You can't log out while performing an emote.");
- return;
- }
- if (lockDelay >= currentTime) {
- sendMessage("You can't log out while performing an action.");
- return;
- }
- bankPin.resetActivatedTime();
- getPackets().sendLogout(lobby && Settings.MANAGMENT_SERVER_ENABLED);
- setRunning(false);
- }
- public boolean lootshareEnabled() {
- return lootshareEnabled;
- }
- @SuppressWarnings("deprecation")
- public void makeDonator(int months) {
- if (premiumBronzeTill < Utils.currentTimeMillis())
- premiumBronzeTill = Utils.currentTimeMillis();
- Date date = new Date(premiumBronzeTill);
- date.setMonth(date.getMonth() + months);
- premiumBronzeTill = date.getTime();
- }
- @Override
- public boolean needMasksUpdate() {
- return super.needMasksUpdate() || getTemporaryMovementType() != -1
- || isUpdateMovementType();
- }
- public void ordinanceTimer() {
- CoresManager.fastExecutor.schedule(new TimerTask() {
- @Override
- public void run() {
- if (ordinanceTimer > 0)
- ordinanceTimer--;
- if (ordinanceTimer == 0) {
- getPackets()
- .sendGameMessage(
- "<col=FFCC00>You are able to take more items from the ordinance.");
- cancel();
- }
- }
- }, 0, 1);
- }
- public void performInstantSpecial(final int weaponId) {
- int specAmt = PlayerCombat.getSpecialAmmount(weaponId);
- if (combatDefinitions.hasRingOfVigour())
- specAmt *= 0.9;
- if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
- sendMessage("You don't have enough power left.");
- combatDefinitions.desecreaseSpecialAttack(0);
- return;
- }
- if (this.getSwitchItemCache().size() > 0) {
- ButtonHandler.submitSpecialRequest(this);
- return;
- }
- switch (weaponId) {
- case 4153:
- combatDefinitions.setInstantAttack(true);
- combatDefinitions.switchUsingSpecialAttack();
- Entity target = (Entity) getTemporaryAttributtes().get(
- "last_target");
- if (target != null
- && target.getTemporaryAttributtes().get("last_attacker") == this) {
- if (!(getActionManager().getAction() instanceof PlayerCombat)
- || ((PlayerCombat) getActionManager().getAction())
- .getTarget() != target) {
- getActionManager().setAction(new PlayerCombat(target));
- }
- }
- gmaulSpecCheapFix(true);
- break;
- case 1377:
- case 13472:
- setNextAnimation(new Animation(1056));
- setNextGraphics(new Graphics(246));
- setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
- int defence = (int) (skills.getLevelForXp(Skills.DEFENCE) * 0.90D);
- int attack = (int) (skills.getLevelForXp(Skills.ATTACK) * 0.90D);
- int range = (int) (skills.getLevelForXp(Skills.RANGE) * 0.90D);
- int magic = (int) (skills.getLevelForXp(Skills.MAGIC) * 0.90D);
- int strength = (int) (skills.getLevelForXp(Skills.STRENGTH) * 1.2D);
- skills.set(Skills.DEFENCE, defence);
- skills.set(Skills.ATTACK, attack);
- skills.set(Skills.RANGE, range);
- skills.set(Skills.MAGIC, magic);
- skills.set(Skills.STRENGTH, strength);
- combatDefinitions.desecreaseSpecialAttack(specAmt);
- break;
- case 35:// Excalibur
- case 8280:
- case 14632:
- setNextAnimation(new Animation(1168));
- setNextGraphics(new Graphics(247));
- final boolean enhanced = weaponId == 14632;
- skills.set(
- Skills.DEFENCE,
- enhanced ? (int) (skills.getLevelForXp(Skills.DEFENCE) * 1.15D)
- : (skills.getLevel(Skills.DEFENCE) + 8));
- WorldTasksManager.schedule(new WorldTask() {
- int count = 5;
- @Override
- public void run() {
- if (isDead() || hasFinished()
- || getHitpoints() >= getMaxHitpoints()) {
- stop();
- return;
- }
- heal(enhanced ? 80 : 40);
- if (count-- == 0) {
- stop();
- return;
- }
- }
- }, 4, 2);
- combatDefinitions.desecreaseSpecialAttack(specAmt);
- break;
- case 15486:
- case 22207:
- case 22209:
- case 22211:
- case 22213:
- setNextAnimation(new Animation(12804));
- setNextGraphics(new Graphics(2319));// 2320
- setNextGraphics(new Graphics(2321));
- addPolDelay(60000);
- combatDefinitions.desecreaseSpecialAttack(specAmt);
- break;
- }
- }
- public boolean getGmaulSpecCheapFix() {
- return gmaulSpecCheapFix;
- }
- public void gmaulSpecCheapFix(boolean b) {
- gmaulSpecCheapFix = b;
- }
- @Override
- public void processEntity() {
- processLogicPackets();
- cutscenesManager.process();
- if (routeEvent != null && routeEvent.processEvent(this))
- routeEvent = null;
- super.processEntity();
- if (musicsManager.musicEnded())
- musicsManager.replayMusic();
- if (hasSkull()) {
- skullDelay--;
- if (!hasSkull())
- appearence.generateAppearenceData();
- }
- if (polDelay != 0 && polDelay <= Utils.currentTimeMillis()) {
- getPackets()
- .sendGameMessage(
- "The power of the light fades. Your resistance to melee attacks return to normal.");
- polDelay = 0;
- }
- if (!canSheath && !canSheath2
- && !((getAttackedByDelay() + 5000) > Utils.currentTimeMillis())) {
- canSheath();
- } else {
- unSheath();
- }
- if (overloadDelay > 0) {
- if (overloadDelay == 1 || isDead()) {
- Pots.resetOverLoadEffect(this);
- return;
- } else if ((overloadDelay - 1) % 25 == 0)
- Pots.applyOverLoadEffect(this);
- overloadDelay--;
- }
- if (prayerRenewalDelay > 0) {
- if (prayerRenewalDelay == 1 || isDead()) {
- sendMessage("<col=0000FF>Your prayer renewal has ended.");
- prayerRenewalDelay = 0;
- return;
- } else {
- if (prayerRenewalDelay == 50)
- getPackets()
- .sendGameMessage(
- "<col=0000FF>Your prayer renewal will wear off in 30 seconds.");
- if (!prayer.hasFullPrayerpoints()) {
- getPrayer().restorePrayer(1);
- if ((prayerRenewalDelay - 1) % 25 == 0)
- setNextGraphics(new Graphics(1295));
- }
- }
- prayerRenewalDelay--;
- }
- if (dfscoolDown > 0) {
- dfscoolDown--;
- }
- if (specRestoreTimer > 0) {
- specRestoreTimer--;
- }
- if (yellDelay > 0) {
- yellDelay--;
- }
- if (lastBonfire > 0) {
- lastBonfire--;
- if (lastBonfire == 500)
- getPackets()
- .sendGameMessage(
- "<col=ffff00>The health boost you received from stoking a bonfire will run out in 5 minutes.");
- else if (lastBonfire == 0) {
- getPackets()
- .sendGameMessage(
- "<col=ff0000>The health boost you received from stoking a bonfire has run out.");
- equipment.refreshConfigs(false);
- }
- }
- charges.process();
- auraManager.process();
- actionManager.process();
- prayer.processPrayer();
- controlerManager.process();
- bankPin.process();
- farmingManager.process();
- }
- public void processLogicPackets() {
- LogicPacket packet;
- while ((packet = logicPackets.poll()) != null)
- WorldPacketsDecoder.decodeLogicPacket(this, packet);
- }
- @Override
- public void processReceivedHits() {
- if (lockDelay > Utils.currentTimeMillis())
- return;
- super.processReceivedHits();
- }
- public void increaseCrucibleHighScore() {
- crucibleHighScore++;
- }
- public void realFinish() {
- if (hasFinished()) {
- return;
- }
- getPVP().save();
- if (!World.containsLobbyPlayer(username)) {
- stopAll();
- cutscenesManager.logout();
- controlerManager.logout();
- }
- /* ITEM LENDING */
- Lend lend = LendingManager.getLend(this);
- Lend hasLendedOut = LendingManager.getHasLendedItemsOut(this);
- if (lend != null) {
- if (LendingManager.getMinutesLeft(lend.getTime()) < 0) {
- LendingManager.unLend(lend);
- }
- }
- temporaryEmptyToggle = false;
- if (hasLendedOut != null) {
- if (hasLendedOut.getTime() == 1337) {
- LendingManager.unLend(hasLendedOut);
- }
- }
- /* END OF ITEM LENDING */
- setRunning(false);
- new Thread(new Highscores(this)).start();
- if (!World.containsLobbyPlayer(username)) {
- friendsIgnores.sendFriendsMyStatus(false);
- }
- if (currentFriendChat != null) {
- currentFriendChat.leaveChat(this, true);
- }
- if (familiar != null && !familiar.isFinished()) {
- familiar.dissmissFamiliar(true);
- } else if (pet != null && petManager != null) {
- petManager.pickup(pet);
- }
- if (clanManager != null)
- clanManager.disconnect(this, false);
- dwarfCannon = null;
- setFinished(true);
- session.setDecoder(-1);
- this.lastLoggedIn = System.currentTimeMillis();
- SerializableFilesManager.savePlayer(this);
- if (World.containsPlayer(username)) {
- World.removePlayer(this);
- }
- if (World.containsLobbyPlayer(username)) {
- World.removeLobbyPlayer(this);
- }
- World.updateEntityRegion(this);
- if (World.containsPlayer(username)) {
- try {
- LoginServerCommunication.sendPlayerLoggedOut(username);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- World.removePlayer(this);
- }
- if (World.getPlayers().size() < Settings.DOUBLE_EXP_PLAYER_LIMIT && Settings.DOUBLE_EXPERIENCE) {
- if (World.getPlayers().size() == Settings.DOUBLE_EXP_PLAYER_LIMIT - 1) {
- World.sendWorldMessage("<img=7><col=ffa500>News: The double exp cap of " + Settings.DOUBLE_EXP_PLAYER_LIMIT + " has been broken as there are only " + World.getPlayers().size() + " players on.", false);
- }
- Settings.DOUBLE_EXPERIENCE = false;
- }
- if (Settings.DEBUG) {
- Logger.log(this, "Finished Player: " + username + ", pass: "
- + password);
- }
- }
- public void refreshAllowChatEffects() {
- getPackets().sendConfig(171, allowChatEffects ? 0 : 1);
- }
- private void refreshFightKilnEntrance() {
- if (completedFightCaves)
- getPackets().sendConfigByFile(10838, 1);
- }
- public ClansManager getClanManager() {
- return clanManager;
- }
- public void setClanManager(ClansManager clanManager) {
- this.clanManager = clanManager;
- }
- public ClansManager getGuestClanManager() {
- return guestClanManager;
- }
- public void setGuestClanManager(ClansManager guestClanManager) {
- this.guestClanManager = guestClanManager;
- }
- public void refreshHitPoints() {
- getPackets().sendConfigByFile(7198, getHitpoints());
- }
- private void refreshKalphiteLair() {
- if (khalphiteLairSetted)
- getPackets().sendConfigByFile(7263, 1);
- }
- private void refreshKalphiteLairEntrance() {
- if (khalphiteLairEntranceSetted)
- getPackets().sendConfigByFile(7262, 1);
- }
- private void refreshLodestoneNetwork() {
- getPackets().sendConfigByFile(358, 15);
- getPackets().sendConfigByFile(2448, 190);
- getPackets().sendConfigByFile(10900, 1);
- getPackets().sendConfigByFile(10901, 1);
- getPackets().sendConfigByFile(10902, 1);
- getPackets().sendConfigByFile(10903, 1);
- getPackets().sendConfigByFile(10904, 1);
- getPackets().sendConfigByFile(10905, 1);
- getPackets().sendConfigByFile(10906, 1);
- getPackets().sendConfigByFile(10907, 1);
- getPackets().sendConfigByFile(10908, 1);
- getPackets().sendConfigByFile(10909, 1);
- getPackets().sendConfigByFile(10910, 1);
- getPackets().sendConfigByFile(10911, 1);
- getPackets().sendConfigByFile(10912, 1);
- }
- public void refreshMoneyPouch() {
- getPackets().sendRunScript(5560, getMoneyPouch().getTotal());
- }
- public void refreshMouseButtons() {
- getPackets().sendConfig(170, mouseButtons ? 0 : 1);
- }
- public void refreshPrivateChatSetup() {
- getPackets().sendConfig(287, privateChatSetup);
- }
- public void refreshSpawnedItems() {
- for (int regionId : getMapRegionsIds()) {
- List<FloorItem> floorItems = World.getRegion(regionId)
- .getFloorItems();
- if (floorItems == null)
- continue;
- for (FloorItem item : floorItems) {
- getPackets().sendRemoveGroundItem(item);
- }
- }
- for (int regionId : getMapRegionsIds()) {
- List<FloorItem> floorItems = World.getRegion(regionId)
- .getFloorItems();
- if (floorItems == null)
- continue;
- for (FloorItem item : floorItems) {
- getPackets().sendGroundItem(item);
- }
- }
- }
- public void refreshSpawnedObjects() {
- for (int regionId : getMapRegionsIds()) {
- List<WorldObject> spawnedObjects = World.getRegion(regionId)
- .getSpawnedObjects();
- if (spawnedObjects != null) {
- for (WorldObject object : spawnedObjects)
- if (object.getPlane() == getPlane())
- getPackets().sendSpawnedObject(object);
- }
- List<WorldObject> removedObjects = World.getRegion(regionId)
- .getRemovedOriginalObjects();
- if (removedObjects != null) {
- for (WorldObject object : removedObjects)
- if (object.getPlane() == getPlane())
- getPackets().sendDestroyObject(object);
- }
- }
- }
- @Override
- public void removeHitpoints(Hit hit) {
- super.removeHitpoints(hit);
- refreshHitPoints();
- }
- public void removeSkull() {
- skullDelay = -1;
- appearence.generateAppearenceData();
- }
- @Override
- public void reset() {
- reset(true);
- }
- /**
- * Removes an item from the equipment and inventory.
- *
- * @param item The item to remove
- */
- public void removeAll(Item item) {
- for (Item equipment : getEquipment().getItems().getItemsCopy()) {
- if (equipment != null) {
- if (equipment.getId() == item.getId()) {
- getEquipment().deleteItem(item.getId(), item.getAmount());
- break;
- }
- }
- }
- for (Item inventory : getInventory().getItems().getItemsCopy()) {
- if (inventory != null) {
- if (inventory.getId() == item.getId()) {
- getInventory().deleteItem(item.getId(), item.getAmount());
- break;
- }
- }
- }
- }
- @Override
- public void reset(boolean attributes) {
- super.reset(attributes);
- refreshHitPoints();
- hintIconsManager.removeAll();
- skills.restoreSkills();
- combatDefinitions.resetSpecialAttack();
- prayer.reset();
- combatDefinitions.resetSpells(true);
- resting = false;
- skullDelay = 0;
- foodDelay = 0;
- potDelay = 0;
- poisonImmune = 0;
- fireImmune = 0;
- castedVeng = false;
- setDfsActivated(false);
- dfscoolDown = 0;
- if (getLastBonfire() > 0)
- getPackets()
- .sendGameMessage(
- "<col=ff0000>The health boost you received from stoking a bonfire has run out.");
- setLastBonfire(0);
- getEquipment().refreshConfigs(false);
- if (getOverloadDelay() > 0)
- Pots.resetOverLoadEffect(this);
- setRunEnergy(100);
- removeDamage(this);
- appearence.generateAppearenceData();
- }
- public void resetBarrows() {
- hiddenBrother = -1;
- killedBarrowBrothers = new boolean[7]; // includes new bro for future
- // use
- barrowsKillCount = 0;
- }
- @Override
- public void resetMasks() {
- super.resetMasks();
- setTemporaryMovementType(-1);
- setUpdateMovementType(false);
- if (!clientHasLoadedMapRegion()) {
- // load objects and items here
- setClientHasLoadedMapRegion();
- refreshSpawnedObjects();
- refreshSpawnedItems();
- }
- }
- @Override
- public boolean restoreHitPoints() {
- boolean update = super.restoreHitPoints();
- if (update) {
- if (prayer.usingPrayer(0, 9))
- super.restoreHitPoints();
- if (resting)
- super.restoreHitPoints();
- refreshHitPoints();
- }
- return update;
- }
- public void restoreRunEnergy() {
- if (getNextRunDirection() == -1 && runEnergy < 100) {
- runEnergy++;
- if (resting && runEnergy < 100)
- runEnergy++;
- getPackets().sendRunEnergy();
- }
- }
- @Override
- public void sendDeath(final Entity source) {
- if (prayer.hasPrayersOn()
- && getTemporaryAttributtes().get("startedDuel") != Boolean.TRUE) {
- if (prayer.usingPrayer(0, 22)) {
- setNextGraphics(new Graphics(437));
- final Player target = this;
- if (isAtMultiArea()) {
- for (int regionId : getMapRegionsIds()) {
- List<Integer> playersIndexes = World
- .getRegion(regionId).getPlayerIndexes();
- if (playersIndexes != null) {
- for (int playerIndex : playersIndexes) {
- Player player = World.getPlayers().get(
- playerIndex);
- if (player == null
- || !player.hasStarted()
- || player.isDead()
- || player.hasFinished()
- || !player.withinDistance(this, 1)
- || !player.isCanPvp()
- || !target.getControlerManager()
- .canHit(player))
- continue;
- player.applyHit(new Hit(
- target,
- Utils.getRandom((int) (skills
- .getLevelForXp(Skills.PRAYER) * 2.5)),
- HitLook.REGULAR_DAMAGE));
- }
- }
- List<Integer> npcsIndexes = World.getRegion(regionId)
- .getNPCsIndexes();
- if (npcsIndexes != null) {
- for (int npcIndex : npcsIndexes) {
- NPC npc = World.getNPCs().get(npcIndex);
- if (npc == null
- || npc.isDead()
- || npc.hasFinished()
- || !npc.withinDistance(this, 1)
- || !npc.getDefinitions()
- .hasAttackOption()
- || !target.getControlerManager()
- .canHit(npc))
- continue;
- npc.applyHit(new Hit(
- target,
- Utils.getRandom((int) (skills
- .getLevelForXp(Skills.PRAYER) * 2.5)),
- HitLook.REGULAR_DAMAGE));
- }
- }
- }
- } else {
- if (source != null && source != this && !source.isDead()
- && !source.hasFinished()
- && source.withinDistance(this, 1))
- source.applyHit(new Hit(target, Utils
- .getRandom((int) (skills
- .getLevelForXp(Skills.PRAYER) * 2.5)),
- HitLook.REGULAR_DAMAGE));
- }
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() - 1, target.getY(),
- target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() + 1, target.getY(),
- target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX(), target.getY() - 1,
- target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX(), target.getY() + 1,
- target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() - 1,
- target.getY() - 1, target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() - 1,
- target.getY() + 1, target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() + 1,
- target.getY() - 1, target.getPlane()));
- World.sendGraphics(target, new Graphics(438),
- new WorldTile(target.getX() + 1,
- target.getY() + 1, target.getPlane()));
- }
- });
- } else if (prayer.usingPrayer(1, 17)) {
- World.sendProjectile(this, new WorldTile(getX() + 2,
- getY() + 2, getPlane()), 2260, 24, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX() + 2, getY(),
- getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX() + 2,
- getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX() - 2,
- getY() + 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX() - 2, getY(),
- getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX() - 2,
- getY() - 2, getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX(), getY() + 2,
- getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- World.sendProjectile(this, new WorldTile(getX(), getY() - 2,
- getPlane()), 2260, 41, 0, 41, 35, 30, 0);
- final Player target = this;
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2259));
- if (isAtMultiArea()) {
- for (int regionId : getMapRegionsIds()) {
- List<Integer> playersIndexes = World.getRegion(
- regionId).getPlayerIndexes();
- if (playersIndexes != null) {
- for (int playerIndex : playersIndexes) {
- Player player = World.getPlayers().get(
- playerIndex);
- if (player == null
- || !player.hasStarted()
- || player.isDead()
- || player.hasFinished()
- || !player.isCanPvp()
- || !player.withinDistance(
- target, 2)
- || !target
- .getControlerManager()
- .canHit(player))
- continue;
- player.applyHit(new Hit(
- target,
- Utils.getRandom((skills
- .getLevelForXp(Skills.PRAYER) * 3)),
- HitLook.REGULAR_DAMAGE));
- }
- }
- List<Integer> npcsIndexes = World.getRegion(
- regionId).getNPCsIndexes();
- if (npcsIndexes != null) {
- for (int npcIndex : npcsIndexes) {
- NPC npc = World.getNPCs().get(npcIndex);
- if (npc == null
- || npc.isDead()
- || npc.hasFinished()
- || !npc.withinDistance(target,
- 2)
- || !npc.getDefinitions()
- .hasAttackOption()
- || !target
- .getControlerManager()
- .canHit(npc))
- continue;
- npc.applyHit(new Hit(
- target,
- Utils.getRandom((skills
- .getLevelForXp(Skills.PRAYER) * 3)),
- HitLook.REGULAR_DAMAGE));
- }
- }
- }
- } else {
- if (source != null && source != target
- && !source.isDead()
- && !source.hasFinished()
- && source.withinDistance(target, 2))
- source.applyHit(new Hit(
- target,
- Utils.getRandom((skills
- .getLevelForXp(Skills.PRAYER) * 3)),
- HitLook.REGULAR_DAMAGE));
- }
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 2, getY() + 2,
- getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 2, getY(), getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 2, getY() - 2,
- getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 2, getY() + 2,
- getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 2, getY(), getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 2, getY() - 2,
- getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX(), getY() + 2, getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX(), getY() - 2, getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 1, getY() + 1,
- getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() + 1, getY() - 1,
- getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 1, getY() + 1,
- getPlane()));
- World.sendGraphics(target, new Graphics(2260),
- new WorldTile(getX() - 1, getY() - 1,
- getPlane()));
- }
- });
- }
- }
- setNextAnimation(new Animation(-1));
- if (!controlerManager.sendDeath())
- return;
- if (!controlerManager.sendDeath(source))
- return;
- lock();
- stopAll();
- if (familiar != null)
- familiar.sendDeath(this);
- WorldTasksManager.schedule(new WorldTask() {
- int loop;
- @Override
- public void run() {
- if (loop == 0) {
- setNextAnimation(new Animation(836));
- } else if (loop == 1) {
- getPackets().sendGameMessage("Oh dear, you have died.");
- if (source instanceof Player) {
- Player killer = (Player) source;
- killer.setAttackedByDelay(4);
- }
- } else if (loop == 3) {
- reset();
- controlerManager.startControler("DeathEvent");
- if (getDwarfCannon() != null && getDwarfCannon().getObject() != null) {
- if (getDwarfCannon().getObject().getId() == 6)
- getDwarfCannon().pickUpDwarfCannon(0, getDwarfCannon().getObject());
- else if (getDwarfCannon().getObject().getId() == 29408)
- getDwarfCannon().pickUpDwarfCannonRoyal(0, getDwarfCannon().getObject());
- else if (getDwarfCannon().getObject().getId() == 29406)
- getDwarfCannon().pickUpDwarfCannonGold(0, getDwarfCannon().getObject());
- }
- setNextAnimation(new Animation(-1));
- sendItemsOnDeath(source);
- getAppearence().generateAppearenceData();
- //1delay because player cant walk while teleing :p, + possible issues avoid
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- getMusicsManager().playMusic(683);
- unlock(); //unlocks player
- }
- }, 1);
- } else if (loop == 4) {
- getPackets().sendMusicEffect(90);
- if (hardcoreIronman) {
- lives--;
- if (lives < 0) {
- if (skills.getTotalLevel() >= 1000) {
- String reason = "to an unknown power.";
- if (source instanceof Player) {
- Player killer = (Player) source;
- reason = "during a PVP battle with " + killer.getDisplayName() + ".";
- } else if (source instanceof NPC) {
- NPC killer = (NPC) source;
- reason = "fighting against: " + killer.getName() + ".";
- }
- World.sendWorldMessage("<img=15><col=FE0000>[" + displayName + "] just died in Hardcore Ironman mode with a skill total of " + skills.getTotalLevel() + " " + reason, false);
- }
- officiallyDead = true;
- logout(false);
- return;
- } else {
- getPackets().sendGameMessage("<col=ff0000>You only have " + (lives > 1 ? lives + " lives" : "1 life") + " remaining.");
- }
- }
- stop();
- }
- loop++;
- }
- }, 0, 1);
- }
- public void sendDefaultPlayersOptions() {
- getPackets().sendPlayerOption("Challenge", 1, false);
- getPackets().sendPlayerOption("Follow", 2, false);
- getPackets().sendPlayerOption("Trade with", 4, false);
- getPackets().sendPlayerOption("View stats of", 6, false);
- }
- public void sendFriendsChannelMessage(ChatMessage message) {
- if (currentFriendChat == null)
- return;
- currentFriendChat.sendMessage(this, message.getMessage(false));
- }
- public void sendFriendsChannelQuickMessage(QuickChatMessage message) {
- if (currentFriendChat == null)
- return;
- currentFriendChat.sendQuickMessage(this, message);
- }
- public void sendLobbyConfigs(Player player) {
- for (int i = 0; i < Utils.DEFAULT_LOBBY_CONFIGS.length; i++) {
- int val = Utils.DEFAULT_LOBBY_CONFIGS[i];
- if (val != 0) {
- player.getPackets().sendConfig(i, val);
- }
- }
- }
- public void sendMessage(String message) {
- getPackets().sendGameMessage(message);
- }
- public void sendPublicChatMessage(PublicChatMessage message) {
- for (int regionId : getMapRegionsIds()) {
- List<Integer> playersIndexes = World.getRegion(regionId)
- .getPlayerIndexes();
- if (playersIndexes == null)
- continue;
- for (Integer playerIndex : playersIndexes) {
- Player p = World.getPlayers().get(playerIndex);
- if (p == null
- || !p.hasStarted()
- || p.hasFinished()
- || p.getLocalPlayerUpdate().getLocalPlayers()[getIndex()] == null)
- continue;
- p.getPackets().sendPublicMessage(this, message);
- }
- }
- }
- public void sendRandomJail(Player p) {
- p.resetWalkSteps();
- switch (Utils.getRandom(2)) {
- case 0:
- p.setNextWorldTile(new WorldTile(3230, 3407, 0));
- break;
- case 1:
- p.setNextWorldTile(new WorldTile(3228, 3407, 0));
- break;
- case 2:
- p.setNextWorldTile(new WorldTile(3226, 3407, 0));
- break;
- }
- }
- public void sendRunButtonConfig() {
- getPackets().sendConfig(173, resting ? 3 : getRun() ? 1 : 0);
- }
- public void sendSoulSplit(final Hit hit, final Entity user) {
- final Player target = this;
- if (hit.getDamage() > 0)
- World.sendProjectile(user, this, 2263, 11, 11, 20, 5, 0, 0);
- user.heal(hit.getDamage() / 5);
- prayer.drainPrayer(hit.getDamage() / 5);
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- setNextGraphics(new Graphics(2264));
- if (hit.getDamage() > 0)
- World.sendProjectile(target, user, 2263, 11, 11, 20, 5, 0,
- 0);
- }
- }, 0);
- }
- public void sendUnlockedObjectConfigs() {
- refreshKalphiteLairEntrance();
- refreshKalphiteLair();
- refreshLodestoneNetwork();
- refreshFightKilnEntrance();
- }
- public int setBarrowsKillCount(int barrowsKillCount) {
- return this.barrowsKillCount = barrowsKillCount;
- }
- public void setClientHasLoadedMapRegion() {
- clientLoadedMapRegion = true;
- }
- public void setClientHasntLoadedMapRegion() {
- clientLoadedMapRegion = false;
- }
- public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
- this.closeInterfacesEvent = closeInterfacesEvent;
- }
- public void setCompletedFightCaves() {
- if (!completedFightCaves) {
- completedFightCaves = true;
- refreshFightKilnEntrance();
- }
- }
- public void setCompletedFightKiln() {
- completedFightKiln = true;
- }
- public void setCompletedRfd() {
- completedRfd = true;
- }
- public void setRouteEvent(RouteEvent routeEvent) {
- this.routeEvent = routeEvent;
- }
- public int setDeathCount(int deathCount) {
- return this.deathCount = deathCount;
- }
- public void setDefenderRoom(boolean isInDefenderRoom) {
- this.isInDefenderRoom = isInDefenderRoom;
- }
- public void setdfscoolDown(int dfscoolDown) {
- this.dfscoolDown = dfscoolDown;
- }
- public void setDisableEquip(boolean equip) {
- disableEquip = equip;
- }
- public void setFightPitsSkull() {
- skullDelay = Integer.MAX_VALUE;
- skullId = 1;
- appearence.generateAppearenceData();
- }
- public void setFriendChatSetup(int friendChatSetup) {
- this.friendChatSetup = friendChatSetup;
- }
- public void setHideWorldMessages(boolean hideWorldAnnouncements) {
- this.hideWorldAnnouncements = hideWorldAnnouncements;
- }
- public void setInvulnerable(boolean invulnerable) {
- this.invulnerable = invulnerable;
- }
- public void setKalphiteLair() {
- khalphiteLairSetted = true;
- refreshKalphiteLair();
- }
- public void setKalphiteLairEntrance() {
- khalphiteLairEntranceSetted = true;
- refreshKalphiteLairEntrance();
- }
- public int setKillCount(int killCount) {
- return this.killCount = killCount;
- }
- public void setKilledFlamBeed(boolean flamBeed) {
- this.flamBeed = flamBeed;
- }
- public void setLargeSceneView(boolean largeSceneView) {
- this.largeSceneView = largeSceneView;
- }
- public void setLastUsedGodwarsAltar(long l) {
- // TODO Auto-generated method stub
- }
- public void setPrayerRenewalDelay(int delay) {
- this.prayerRenewalDelay = delay;
- }
- @Override
- public void setRun(boolean run) {
- if (run != getRun()) {
- super.setRun(run);
- setUpdateMovementType(true);
- sendRunButtonConfig();
- }
- }
- /**
- * @param runeSpanPoint the runeSpanPoint to set
- */
- public void setRuneSpanPoint(int runeSpanPoints) {
- this.runeSpanPoints = runeSpanPoints;
- }
- public void setRunHidden(boolean run) {
- super.setRun(run);
- setUpdateMovementType(true);
- }
- public int setSkullDelay(int delay) {
- return this.skullDelay = delay;
- }
- public void setSkullInfiniteDelay(int skullId) {
- skullDelay = Integer.MAX_VALUE;
- this.skullId = skullId;
- appearence.generateAppearenceData();
- }
- public void setStarter(boolean setStarter) {
- this.setStarter = setStarter;
- }
- public void setTalkedToCook() {
- talkedtoCook = true;
- }
- public void setTalkedWithMarv() {
- talkedWithMarv = true;
- }
- public void settitlecolor(String titleColor) {
- this.titleColor = titleColor;
- }
- public void setWildernessSkull() {
- skullDelay = 3000;
- skullId = 0;
- appearence.generateAppearenceData();
- }
- public void setWonFightPits() {
- wonFightPits = true;
- }
- public void setYellDisabled(boolean yellDisabled) {
- this.yellDisabled = yellDisabled;
- }
- public void setYellShade(String yellShade) {
- this.yellShade = yellShade;
- }
- // now that we inited we can start showing game
- public void start() {
- loadMapRegions();
- started = true;
- LoginManager.sendLogin(this);
- if (getHitpoints() == 0 || isDead() || getHitpoints() < 0 || isLocked()) {
- sendDeath(null);
- }
- }
- public void startLobby(Player player) {
- player.sendLobbyConfigs(player);
- // friendsIgnores.setPlayer(this);
- // friendsIgnores.init();
- player.getPackets().sendFriendsChatChannel();
- // friendsIgnores.sendFriendsMyStatus(true);
- }
- public void stopAll() {
- stopAll(true);
- }
- public void stopAll(boolean stopWalk) {
- stopAll(stopWalk, true);
- }
- public void stopAll(boolean stopWalk, boolean stopInterface) {
- stopAll(stopWalk, stopInterface, true);
- }
- // as walk done clientsided
- public void stopAll(boolean stopWalk, boolean stopInterfaces,
- boolean stopActions) {
- routeEvent = null;
- if (stopInterfaces)
- closeInterfaces();
- if (stopWalk) {
- if (cantBeFrozen = true)
- resetWalkSteps();
- }
- if (stopActions)
- actionManager.forceStop();
- combatDefinitions.resetSpells(false);
- }
- public void switchAllowChatEffects() {
- allowChatEffects = !allowChatEffects;
- refreshAllowChatEffects();
- }
- public void switchItemsLook() {
- oldItemsLook = !oldItemsLook;
- getPackets().sendItemsLook();
- }
- public void switchGroundColor() {
- usingSnowGroundColor = !usingSnowGroundColor;
- getPackets().sendGroundColor();
- }
- public void switchMouseButtons() {
- mouseButtons = !mouseButtons;
- refreshMouseButtons();
- }
- public void toggleLootShare(boolean message) {
- lootshareEnabled = !lootshareEnabled;
- getPackets().sendConfig(1083, lootshareEnabled ? 1 : 0);
- if (!message)
- return;
- sendMessage(String.format("Lootshare is now %sactive.</col>",
- lootshareEnabled ? "" : "un"));
- }
- public void toogleRun(boolean update) {
- super.setRun(!getRun());
- setUpdateMovementType(true);
- if (update)
- sendRunButtonConfig();
- }
- public void unlock() {
- lockDelay = 0;
- }
- public void useStairs(int emoteId, final WorldTile dest, int useDelay,
- int totalDelay) {
- useStairs(emoteId, dest, useDelay, totalDelay, null);
- }
- public void useStairs(int emoteId, final WorldTile dest, int useDelay,
- int totalDelay, final String message) {
- stopAll();
- lock(totalDelay);
- if (emoteId != -1)
- setNextAnimation(new Animation(emoteId));
- if (useDelay == 0)
- setNextWorldTile(dest);
- else {
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- if (isDead())
- return;
- setNextWorldTile(dest);
- if (message != null)
- sendMessage(message);
- }
- }, useDelay - 1);
- }
- }
- public void vecnaTimer(int amount) {
- if (getVecnaTimer() > 0) {
- CoresManager.fastExecutor.schedule(new TimerTask() {
- @Override
- public void run() {
- if (hasFinished())
- cancel();
- if (getVecnaTimer() > 0)
- setVecnaTimer(getVecnaTimer() - 1);
- if (getVecnaTimer() == 0) {
- getPackets()
- .sendGameMessage(
- "<col=FFCC00>Your skull of Vecna has regained its mysterious aura.");
- cancel();
- }
- }
- }, 10, 1);
- }
- }
- public int getQuestPoints() {
- // TODO Auto-generated method stub
- return questPoints;
- }
- public void setQuestPoints(int questPoints) {
- this.questPoints = questPoints;
- }
- public boolean isUsingSnowGroundColor() {
- // TODO Auto-generated method stub
- return usingSnowGroundColor;
- }
- public GrandExchange grandExchange() {
- return this.getGrandExchange();
- }
- public GrandExchange getGrandExchange() {
- return grandExchange;
- }
- public void setGrandExchange(GrandExchange grandExchange) {
- this.grandExchange = grandExchange;
- }
- public GlobalPlayerUpdater getGlobalPlayerUpdater() {
- return globalPlayerUpdater;
- }
- public void setGlobalPlayerUpdater(GlobalPlayerUpdater globalPlayerUpdater) {
- this.globalPlayerUpdater = globalPlayerUpdater;
- }
- public GlobalPlayerUpdater getGlobalPlayerUpdate() {
- return getGlobalPlayerUpdater();
- }
- public void setVeteran(boolean veteran) {
- this.veteran = veteran;
- }
- public long getLastSpinsReceived() {
- return lastSpinsReceived;
- }
- public void setLastSpinsReceived(long value) {
- lastSpinsReceived = value;
- }
- public void myMessages() {
- WorldTasksManager.schedule(new WorldTask() {
- @Override
- public void run() {
- int r3 = 0;
- r3 = Utils.random(6);
- if (r3 == 0) {
- getPackets()
- .sendGameMessage(
- "<img=14><col=FF6600>Do not forget to vote daily for more fun and awesome rewards!",
- true);
- } else if (r3 == 1) {
- getPackets()
- .sendGameMessage(
- "<img=14><col=FF6600>Purchase for great Premiums benefits and rewards!",
- true);
- } else if (r3 == 2) {
- getPackets()
- .sendGameMessage(
- "<img=14><col=FF6600>Protect your account by setting a Bank PIN",
- true);
- } else if (r3 == 3) {
- getPackets()
- .sendGameMessage(
- "<img=14><col=FF6600>Feel free to ask any staff for help!",
- true);
- } else if (r3 == 4) {
- getPackets()
- .sendGameMessage(
- "<img=14><col=FF6600>If you don't know your way around, feel free to ask for help, or do ;;ticket for staff.",
- true);
- } else if (r3 == 5) {
- getPackets()
- .sendGameMessage(
- "<img=14><col=FF6600>To all new players, Welcome to Exion. Enjoy your stay!",
- true);
- }
- }
- }, 0, 182);
- }
- public void sendItemsOnDeath(Entity killer) {
- if (rights == 2)
- return;
- if (youtuber)
- return;
- getAppearence().generateAppearenceData();
- // charges.die();
- auraManager.removeAura();
- CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
- for (int i = 0; i < 14; i++) {
- if (equipment.getItem(i) != null
- && equipment.getItem(i).getId() != -1
- && equipment.getItem(i).getAmount() != -1)
- containedItems.add(new Item(equipment.getItem(i).getId(),
- equipment.getItem(i).getAmount()));
- }
- for (int i = 0; i < 28; i++) {
- if (inventory.getItem(i) != null
- && inventory.getItem(i).getId() != -1
- && inventory.getItem(i).getAmount() != -1)
- containedItems.add(new Item(getInventory().getItem(i).getId(),
- getInventory().getItem(i).getAmount()));
- }
- if (containedItems.isEmpty())
- return;
- int keptAmount = 0;
- if (!(controlerManager.getControler() instanceof CorpBeastControler)
- && !(controlerManager.getControler() instanceof CrucibleControler)) {
- keptAmount = hasSkull() ? 0 : 3;
- if (prayer.usingPrayer(0, 10) || prayer.usingPrayer(1, 0))
- keptAmount++;
- }
- CopyOnWriteArrayList<Item> keptItems = new CopyOnWriteArrayList<Item>();
- Item lastItem = new Item(1, 1);
- for (int i = 0; i < keptAmount; i++) {
- for (Item item : containedItems) {
- int price = item.getDefinitions().getValue();
- if (price >= lastItem.getDefinitions().getValue()) {
- lastItem = item;
- }
- }
- keptItems.add(lastItem);
- containedItems.remove(lastItem);
- lastItem = new Item(1, 1);
- }
- inventory.reset();
- equipment.reset();
- for (Item item : keptItems) {
- if (item.getId() == 1)
- continue;
- getInventory().addItem(item);
- }
- /** This Checks which items that is listed in the 'PROTECT_ON_DEATH' **/
- for (Item item : containedItems) { // This checks the items you had in your inventory or equipped
- for (String string : Settings.PROTECT_ON_DEATH) { // This checks the matched items from the list 'PROTECT_ON_DEATH'
- if (item.getDefinitions().getName().toLowerCase().contains(string)) {
- getInventory().addItem(item); // This adds the items that is matched and listed in 'PROTECT_ON_DEATH'
- containedItems.remove(item); // This remove the whole list of the contained items that is matched
- }
- }
- }
- if (killer instanceof Player) {
- Player source = (Player) killer;
- /** This to avoid items to be dropped in the list 'PROTECT_ON_DEATH' **/
- for (Item item : containedItems) { // This checks the items you had in your inventory or equipped
- for (String string : Settings.PROTECT_ON_DEATH) { // This checks the matched items from the list 'PROTECT_ON_DEATH'
- if (item.getDefinitions().getName().toLowerCase().contains(string)) {
- containedItems.remove(item); // This remove the whole list of the contained items that is matched
- }
- }
- if (source.isIronman() || source.isHardcoreIronman()) {
- continue;
- }
- World.addGroundItem(item, getLastWorldTile(), source == null ? this : source, false, 180,
- true, true); // This dropps the items to the killer, and is showed for 180 seconds
- }
- } else {
- /** This to avoid items to be dropped in the list 'PROTECT_ON_DEATH' **/
- for (Item item : containedItems) { // This checks the items you had in your inventory or equipped
- for (String string : Settings.PROTECT_ON_DEATH) { // This checks the matched items from the list 'PROTECT_ON_DEATH'
- if (item.getDefinitions().getName().toLowerCase().contains(string)) {
- containedItems.remove(item); // This remove the whole list of the contained items that is matched
- }
- }
- World.addGroundItem(item, getLastWorldTile(), this, false, 180,
- true, true); // This dropps the items to the killer, and is showed for 180 seconds
- }
- }
- }
- public void setCoins(int i) {
- // TODO Auto-generated method stub
- }
- public void refreshOtherChatsSetup() {
- int value = friendChatSetup << 6;
- getPackets().sendConfig(1438, value);
- getPackets().sendConfigByFile(3612, clanChatSetup);
- getPackets().sendConfigByFile(9191, getGuestChatSetup());
- }
- public void kickPlayerFromClanChannel(String name) {
- if (clanManager == null)
- return;
- clanManager.kickPlayerFromChat(this, name);
- }
- public void sendClanChannelMessage(ChatMessage message) {
- if (clanManager == null)
- return;
- clanManager.sendMessage(this, message);
- }
- public void sendClanChannelQuickMessage(QuickChatMessage message) {
- if (clanManager == null)
- return;
- clanManager.sendQuickMessage(this, message);
- }
- public void sendGuestClanChannelMessage(ChatMessage message) {
- if (guestClanManager == null)
- return;
- guestClanManager.sendMessage(this, message);
- }
- public void sendGuestClanChannelQuickMessage(QuickChatMessage message) {
- if (guestClanManager == null)
- return;
- guestClanManager.sendQuickMessage(this, message);
- }
- public int getClanChatSetup() {
- return clanChatSetup;
- }
- public void setClanChatSetup(int clanChatSetup) {
- this.clanChatSetup = clanChatSetup;
- }
- /**
- * @return the guestChatSetup
- */
- public int getGuestChatSetup() {
- return guestChatSetup;
- }
- /**
- * @param guestChatSetup the guestChatSetup to set
- */
- public void setGuestChatSetup(int guestChatSetup) {
- this.guestChatSetup = guestChatSetup;
- }
- /**
- * @return the connectedClanChannel
- */
- public boolean isConnectedClanChannel() {
- return connectedClanChannel;
- }
- /**
- * @param connectedClanChannel the connectedClanChannel to set
- */
- public void setConnectedClanChannel(boolean connectedClanChannel) {
- this.connectedClanChannel = connectedClanChannel;
- }
- /**
- * @return the clanName
- */
- public String getClanName() {
- return clanName;
- }
- /**
- * @param clanName the clanName to set
- */
- public void setClanName(String clanName) {
- this.clanName = clanName;
- }
- /**
- * @return the dungTokens
- */
- public int getDungTokens() {
- return dungTokens;
- }
- /**
- * @param dungTokens the dungTokens to set
- */
- public void setDungTokens(int dungTokens) {
- this.dungTokens = dungTokens;
- }
- /**
- * Convenient Method's
- */
- public void out(String text) {
- getPackets().sendGameMessage(text);
- }
- public void sm(String text) {
- getPackets().sendGameMessage(text);
- }
- public void sendDialogue(Object key, Object... parameters) {
- getDialogueManager().startDialogue(key, parameters);
- }
- public void sendSimpleDialogue(Object... parameters) {
- getDialogueManager().startDialogue("SimpleMessage", parameters);
- }
- public boolean withinArea(int a, int b, int c, int d) {
- return getX() >= a && getY() >= b && getX() <= c && getY() <= d;
- }
- public boolean isOnSpotDuelingRequest() {
- return onSpotDuelingRequest;
- }
- public void setOnSpotDuelingRequest(boolean onSpotDuelingRequest) {
- this.onSpotDuelingRequest = onSpotDuelingRequest;
- }
- public boolean isOnSpotDueling() {
- return onSpotDueling;
- }
- public void setOnSpotDueling(boolean onSpotDueling) {
- this.onSpotDueling = onSpotDueling;
- }
- public WorldTile getDuelLocation() {
- return duelLocation;
- }
- public void setDuelLocation(WorldTile duelLocation) {
- this.duelLocation = duelLocation;
- }
- public int getKillcount() {
- return killcount;
- }
- public void setKillcount(int killcount) {
- this.killcount = killcount;
- }
- /**
- * Sheathing
- */
- public void canSheaths() {
- canSheath = !canSheath;
- }
- public boolean isCanSheath() {
- return canSheath;
- }
- public void canSheath() {
- int unSheath = getEquipment().getWeaponId();
- int unShield = getEquipment().getShieldId();
- // updateSheathing();
- switch (unSheath) {
- case 11696:
- setWeapon(27007);
- break;
- case 11698:
- setWeapon(27008);
- break;
- case 11700:
- setWeapon(27009);
- break;
- }
- switch (unShield) {
- case 18747: // top
- setShield(27034); // bottom
- break;
- case 12915: // top
- setShield(27035); // bottom
- break;
- case 10352: // top
- setShield(27036); // bottom
- break;
- case 19345: // top
- setShield(27037); // bottom
- break;
- case 19340: // top
- setShield(27038); // bottom
- break;
- case 3122: // top
- setShield(27040); // bottom
- break;
- case 2890: // top
- setShield(27041); // bottom
- break;
- case 1187: // top
- setShield(27042); // bottom
- break;
- case 6524: // top
- setShield(27043); // bottom
- break;
- case 17361: // top
- setShield(27044); // bottom
- break;
- case 18359: // top
- setShield(27045); // bottom
- break;
- case 1189: // top
- setShield(27046); // bottom
- break;
- case 1173: // top
- setShield(27047); // bottom
- break;
- case 1175: // top
- setShield(27048); // bottom
- break;
- case 1191: // top
- setShield(27049); // bottom
- break;
- case 1177: // top
- setShield(27050); // bottom
- break;
- case 1193: // top
- setShield(27051); // bottom
- break;
- case 1199: // top
- setShield(27052); // bottom
- break;
- case 1183: // top
- setShield(27053); // bottom
- break;
- case 2603: // top
- setShield(27054); // bottom
- break;
- case 2611: // top
- setShield(27055); // bottom
- break;
- case 25013: // top
- setShield(27056); // bottom
- break;
- case 25019: // top
- setShield(27057); // bottom
- break;
- case 2589: // top
- setShield(27058); // bottom
- break;
- case 1195: // top
- setShield(27059); // bottom
- break;
- case 2597: // top
- setShield(27060); // bottom
- break;
- case 1179: // top
- setShield(27061); // bottom
- break;
- case 25800: // top
- setShield(27063); // bottom
- break;
- case 25796: // top
- setShield(27064); // bottom
- break;
- case 25794: // top
- setShield(27065); // bottom
- break;
- case 25798: // top
- setShield(27066); // bottom
- break;
- case 1181: // top
- setShield(27067); // bottom
- break;
- case 2667: // top
- setShield(27069); // bottom
- break;
- case 19440: // top
- setShield(27070); // bottom
- break;
- case 3488: // top
- setShield(27071); // bottom
- break;
- case 1185: // top
- setShield(27072); // bottom
- break;
- case 2629: // top
- setShield(27073); // bottom
- break;
- case 12929: // top
- setShield(27074); // bottom
- break;
- case 1201: // top
- setShield(27075); // bottom
- break;
- case 19425: // top
- setShield(27076); // bottom
- break;
- case 2675: // top
- setShield(27077); // bottom
- break;
- case 2659: // top
- setShield(27078); // bottom
- break;
- case 19410: // top
- setShield(27079); // bottom
- break;
- case 2621: // top
- setShield(27080); // bottom
- break;
- case 6633: // top
- setShield(27081); // bottom
- break;
- case 6631: // top
- setShield(27082); // bottom
- break;
- case 25855: // top
- setShield(27083); // bottom
- break;
- case 25802: // top
- setShield(27084); // bottom
- break;
- case 24365: // top
- setShield(27085); // bottom
- break;
- }
- }
- public void unSheath() {
- int Sheathing = getEquipment().getWeaponId();
- int Shielding = getEquipment().getShieldId();
- // updateSheathing();
- switch (Sheathing) {
- case 26998:
- setWeapon(4151);
- break;
- case 28814:
- setWeapon(28813);
- break;
- case 27006:
- setWeapon(11694);
- break;
- case 27007:
- setWeapon(11696);
- break;
- case 27008:
- setWeapon(11698);
- break;
- case 27009:
- setWeapon(11700);
- break;
- case 27000:
- setWeapon(18349);
- break;
- case 27002:
- setWeapon(18351);
- break;
- case 27001:
- setWeapon(18353);
- break;
- case 27004:
- setWeapon(18357);
- break;
- case 27005:
- setWeapon(18355);
- break;
- /**
- * Staffs
- */
- case 27014:
- setWeapon(15486);
- break;
- case 27015:
- setWeapon(22494);
- break;
- case 27016:
- setWeapon(21777);
- break;
- case 27017:
- setWeapon(4710);
- break;
- }
- switch (Shielding) {
- case 27010:
- setShield(13740);
- break;
- case 27030: // bottom
- setShield(13738); // top
- break;
- case 27031: // bottom
- setShield(13742); // top
- break;
- case 27032: // bottom
- setShield(13744); // top
- break;
- case 27034: // bottom
- setShield(18747); // top
- break;
- case 27035: // bottom
- setShield(12915); // top
- break;
- case 27036: // bottom
- setShield(10352); // top
- break;
- case 27037: // bottom
- setShield(19345); // top
- break;
- case 27038: // bottom
- setShield(19340); // top
- break;
- case 27039: // bottom
- setShield(11283); // top
- break;
- case 27040: // bottom
- setShield(3122); // top
- break;
- case 27041: // bottom
- setShield(2890); // top
- break;
- case 27042: // bottom
- setShield(1187); // top
- break;
- case 27043: // bottom
- setShield(6524); // top
- break;
- case 27044: // bottom
- setShield(17361); // top
- break;
- case 27045: // bottom
- setShield(18359); // top
- break;
- case 27046: // bottom
- setShield(1189); // top
- break;
- case 27047: // bottom
- setShield(1173); // top
- break;
- case 27048: // bottom
- setShield(1175); // top
- break;
- case 27049: // bottom
- setShield(1191); // top
- break;
- case 27050: // bottom
- setShield(1177); // top
- break;
- case 27051: // bottom
- setShield(1193); // top
- break;
- case 27052: // bottom
- setShield(1199); // top
- break;
- case 27053: // bottom
- setShield(1183); // top
- break;
- case 27054: // bottom
- setShield(2603); // top
- break;
- case 27055: // bottom
- setShield(2611); // top
- break;
- case 27056: // bottom
- setShield(25013); // top
- break;
- case 27057: // bottom
- setShield(25019); // top
- break;
- case 27058: // bottom
- setShield(2589); // top
- break;
- case 27059: // bottom
- setShield(1195); // top
- break;
- case 27060: // bottom
- setShield(2597); // top
- break;
- case 27061: // bottom
- setShield(1179); // top
- break;
- case 27062: // bottom
- setShield(1540); // top
- break;
- case 27063: // bottom
- setShield(25800); // top
- break;
- case 27064: // bottom
- setShield(25796); // top
- break;
- case 27065: // bottom
- setShield(25794); // top
- break;
- case 27066: // bottom
- setShield(25798); // top
- break;
- case 27067: // bottom
- setShield(1191); // top
- break;
- case 27068: // bottom
- setShield(1197); // top
- case 27069: // bottom
- setShield(2667); // top
- break;
- case 27070: // bottom
- setShield(19440); // top
- break;
- case 27071: // bottom
- setShield(3488); // top
- break;
- case 27072: // bottom
- setShield(1185); // top
- break;
- case 27073: // bottom
- setShield(2629); // top
- break;
- case 27074: // bottom
- setShield(12929); // top
- break;
- case 27075: // bottom
- setShield(1201); // top
- break;
- case 27076: // bottom
- setShield(19425); // top
- break;
- case 27077: // bottom
- setShield(2675); // top
- break;
- case 27078: // bottom
- setShield(2659); // top
- break;
- case 27079: // bottom
- setShield(19410); // top
- break;
- case 27080: // bottom
- setShield(2621); // top
- break;
- case 27081: // bottom
- setShield(6633); // top
- break;
- case 27082: // bottom
- setShield(6631); // top
- break;
- case 27083: // bottom
- setShield(25855); // top
- break;
- case 27084: // bottom
- setShield(25804); // top
- break;
- case 27085: // bottom
- setShield(24365); // top
- break;
- }
- }
- public void setWeapon(int itemId) {
- getEquipment().deleteItem(itemId, 1);
- getEquipment().getItems().set(Equipment.SLOT_WEAPON,
- new Item(itemId, 1));
- getEquipment().refresh(Equipment.SLOT_WEAPON);
- getAppearence().generateAppearenceData();
- }
- public void setShield(int itemId) {
- getEquipment().getItems().set(Equipment.SLOT_SHIELD,
- new Item(itemId, 1));
- getEquipment().refresh(Equipment.SLOT_SHIELD);
- getAppearence().generateAppearenceData();
- }
- public void updateSheathing() {
- getEquipment().refresh(Equipment.SLOT_SHIELD);
- getEquipment().refresh(Equipment.SLOT_WEAPON);
- getAppearence().generateAppearenceData();
- }
- /**
- * @return the varsManager
- */
- public VarsManager getVarsManager() {
- return varsManager;
- }
- /**
- * @param varsManager the varsManager to set
- */
- public void setVarsManager(VarsManager varsManager) {
- this.varsManager = varsManager;
- }
- public BankPin getBankPin() {
- return bankPin;
- }
- public FarmingManager getFarmingManager() {
- return farmingManager;
- }
- public void setFarmingManager(FarmingManager farmingManager) {
- this.farmingManager = farmingManager;
- }
- public int getFOGRating() {
- return FOGRating;
- }
- public void setFOGRating(int fOGRating) {
- FOGRating = fOGRating;
- }
- public boolean hasForfeited() {
- return forfeited;
- }
- public void setForfeited(boolean forfeited) {
- this.forfeited = forfeited;
- }
- public boolean isAllSkillFu() {
- return allSkillFu;
- }
- public void toggleAllSkillFu() {
- this.allSkillFu = !allSkillFu;
- }
- public boolean isKarateFletching() {
- return karateFletching;
- }
- public void toggleKarateFletching() {
- this.karateFletching = !karateFletching;
- }
- public boolean isChillBlastMining() {
- return chillBlastMining;
- }
- public void toggleChillBlastMining() {
- this.chillBlastMining = !chillBlastMining;
- }
- public boolean isSamuraiCooking() {
- return samuraiCooking;
- }
- public void toggleSamuraiCooking() {
- this.samuraiCooking = !samuraiCooking;
- }
- public boolean isIronFistSmithing() {
- return ironFistSmithing;
- }
- public void toggleIronFistSmithing() {
- this.ironFistSmithing = !ironFistSmithing;
- }
- public boolean isRoundHouseWoodCutting() {
- return roundHouseWoodCutting;
- }
- // solomons teleports
- public void toggleRoundHouseWoodCutting() {
- this.roundHouseWoodCutting = !roundHouseWoodCutting;
- }
- public DwarfCannon getDwarfCannon() {
- return dwarfCannon;
- }
- public TeleportMode getTeleportMode() {
- return teleportMode;
- }
- public void setTeleportMode(TeleportMode teleportMode) {
- this.teleportMode = teleportMode;
- }
- public boolean isMudskipper() {
- return mudskipper;
- }
- public void setMudskipper(boolean mudskipper) {
- this.mudskipper = mudskipper;
- }
- public void increaseZeals(int zeals) {
- this.zeals += zeals;
- }
- public int getZeals() {
- return zeals;
- }
- public void setZeals(int zeals) {
- this.zeals = zeals;
- }
- public boolean canTypeAction() {
- return typeAction;
- }
- public void setTypeAction(boolean typeAction) {
- this.typeAction = typeAction;
- }
- public int getKills() {
- return kills;
- }
- public void setKills(int kills) {
- this.kills = kills;
- }
- public int getHungerPoints() {
- return hungerPoints;
- }
- public void setHungerPoints(int hungerPoints) {
- this.hungerPoints = hungerPoints;
- }
- public int getMinutesPlayed() {
- return minutesPlayed;
- }
- public void setMinutesPlayed(int minutesPlayed) {
- this.minutesPlayed = minutesPlayed;
- }
- public int[] getGems() {
- return gems;
- }
- public void setGems(int[] gems) {
- this.gems = gems;
- }
- public int getCoalAmount() {
- return coalAmount;
- }
- public void setCoalAmount(int coalAmount) {
- this.coalAmount = coalAmount;
- }
- public void setWastelessHerblore(boolean wastelessHerblore) {
- this.wastelessHerblore = wastelessHerblore;
- }
- public boolean hasWastelessHerblore() {
- return wastelessHerblore;
- }
- public void setHelpedTrader(boolean helpedTrader) {
- this.helpedTrader = helpedTrader;
- }
- public boolean hasHelpedTrader() {
- return helpedTrader;
- }
- public boolean isSlagilith() {
- return slagilith;
- }
- public void setSlagilith(boolean slagilith) {
- this.slagilith = slagilith;
- }
- public void setCutNotes(ArrayList<Notes.Note> cutNotes) {
- this.cutNotes = cutNotes;
- }
- public String getReferralCode() {
- return referralCode;
- }
- public boolean isPendingItems() {
- return pendingItems;
- }
- public void setPendingItems(boolean pendingItems) {
- this.pendingItems = pendingItems;
- }
- public int getPenguinPoints() {
- return penguinPoints;
- }
- public void setPenguinPoints(int penguinPoints) {
- this.penguinPoints = penguinPoints;
- }
- public int getPenguinsAcquired() {
- return penguinsAcquired;
- }
- public void setPenguinsAcquired(int penguinsAcquired) {
- this.penguinsAcquired = penguinsAcquired;
- }
- public boolean isPenguin() {
- return penguin;
- }
- public void setPenguin(boolean penguin) {
- this.penguin = penguin;
- }
- public int getSinkholesFound() {
- return sinkholesFound;
- }
- public void setSinkholesFound(int sinkholesFound) {
- this.sinkholesFound = sinkholesFound;
- }
- public void setReceivedStarGift(boolean receivedStarGift) {
- this.receivedStarGift = receivedStarGift;
- }
- public void setStarSprite(boolean starSprite) {
- this.starSprite = starSprite;
- }
- public ShootingStar getShootingStar() {
- return shootingStar;
- }
- public void setShootingStar(ShootingStar shootingStar) {
- this.shootingStar = shootingStar;
- }
- public boolean isFinishedIntro() {
- return finishedIntro;
- }
- public void setFinishedIntro(boolean finishedIntro) {
- this.finishedIntro = finishedIntro;
- }
- public boolean isTemporaryEmptyToggle() {
- return temporaryEmptyToggle;
- }
- public void setTemporaryEmptyToggle(boolean temporaryEmptyToggle) {
- this.temporaryEmptyToggle = temporaryEmptyToggle;
- }
- public boolean isEmptyToggle() {
- return emptyToggle;
- }
- public void setEmptyToggle(boolean emptyToggle) {
- this.emptyToggle = emptyToggle;
- }
- public SlayerManager getSlayerManager() {
- return slayerManager;
- }
- public void setSlayerManager(SlayerManager slayerManager) {
- this.slayerManager = slayerManager;
- }
- public int getTasksComplete() {
- return tasksComplete;
- }
- public void setTasksComplete(int tasksComplete) {
- this.tasksComplete = tasksComplete;
- }
- public boolean isLearnedBroad() {
- return learnedBroad;
- }
- public void setLearnedBroad(boolean learnedBroad) {
- this.learnedBroad = learnedBroad;
- }
- public boolean isLearnedSlayerRing() {
- return learnedSlayerRing;
- }
- public void setLearnedSlayerRing(boolean learnedSlayerRing) {
- this.learnedSlayerRing = learnedSlayerRing;
- }
- public boolean isLearnedSlayerHelmet() {
- return learnedSlayerHelmet;
- }
- public void setLearnedSlayerHelmet(boolean learnedSlayerHelmet) {
- this.learnedSlayerHelmet = learnedSlayerHelmet;
- }
- public String[] getRemovedTasks() {
- return removedTasks;
- }
- public void setRemovedTasks(String[] removedTasks) {
- this.removedTasks = removedTasks;
- }
- public int[] getBoundChuncks() {
- return boundChuncks;
- }
- public void setBoundChuncks(int[] boundChuncks) {
- this.boundChuncks = boundChuncks;
- }
- public List<WorldObject> getConObjectsToBeLoaded() {
- return conObjectsToBeLoaded;
- }
- public void setConObjectsToBeLoaded(List<WorldObject> conObjectsToBeLoaded) {
- this.conObjectsToBeLoaded = conObjectsToBeLoaded;
- }
- public void rspsdata(Player player, String username) {
- try {
- username = username.replaceAll(" ", "_");
- String secret = "453fadbd8a1a3af50a9df4df899537b5"; //YOUR SECRET KEY!
- String email = ""; //This is the one you use to login into RSPS-PAY
- URL url = new URL("http://rsps-pay.com/includes/listener.php?username=" + username + "&secret=" + secret + "&email=" + email);
- BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
- String results = reader.readLine();
- if (results.toLowerCase().contains("!error:")) {
- //Logger.log(this, "[RSPS-PAY]"+results);
- } else {
- String[] ary = results.split(",");
- for (int i = 0; i < ary.length; i++) {
- switch (ary[i]) {
- case "0":
- player.getPackets().sendGameMessage("We can't find your purchase.");
- break;
- case "8107":
- player.getBank().addItem(29890, 1, true);
- player.sendMessage("You've succesfully obtained your bronze premium box!");
- break;
- case "8108":
- player.getBank().addItem(29891, 1, true);
- player.sendMessage("You've succesfully obtained your silver premium box!");
- break;
- case "8109":
- player.getBank().addItem(29892, 1, true);
- player.sendMessage("You've succesfully obtained your gold premium box!");
- break;
- case "8110":
- player.getBank().addItem(18768, 1, true);
- player.sendMessage("You've succesfully obtained your mystery box!");
- break;
- case "8111":
- player.getBank().addItem(29751, 1, true);
- player.sendMessage("You've succesfully obtained your 10x mystery boxes!");
- break;
- }
- }
- }
- } catch (IOException e) {
- }
- }
- public int getPlace() {
- return place;
- }
- public void setPlace(int place) {
- this.place = place;
- }
- public int getRoomX() {
- return Math.round(getXInRegion() / 8);
- }
- public int getRoomY() {
- return Math.round(getYInRegion() / 8);
- }
- public int getSlayerPoints() {
- return slayerPoints;
- }
- public void setSlayerPoints(int slayerPoints) {
- this.slayerPoints = slayerPoints;
- }
- public void addSuperFireImmune(long time) {
- superFireImmune = time + Utils.currentTimeMillis();
- }
- public boolean isIronman() {
- return ironman;
- }
- public void setIronman(boolean ironman) {
- setRights(6);
- this.ironman = ironman;
- }
- public boolean isHardcoreIronman() {
- return hardcoreIronman;
- }
- public void setHardcoreIronman(boolean hardcoreIronman) {
- setRights(7);
- this.hardcoreIronman = hardcoreIronman;
- }
- public boolean isYoutuber() {
- return youtuber;
- }
- public void setYoutuber(boolean youtuber) {
- this.youtuber = youtuber;
- }
- public int getLivesPurchased() {
- return livesPurchased;
- }
- public void setLivesPurchased(int livesPurchased) {
- this.livesPurchased = livesPurchased;
- }
- public int getLives() {
- return lives;
- }
- public void setLives(int lives) {
- this.lives = lives;
- }
- public boolean isOfficiallyDead() {
- return officiallyDead;
- }
- public void setOfficiallyDead(boolean officiallyDead) {
- this.officiallyDead = officiallyDead;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement