package com.rs.game.player;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.io.File;
import java.io.FileWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.text.NumberFormat;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.io.IOException;
import java.net.URL;
import java.io.BufferedReader;
import java.net.MalformedURLException;
import java.io.InputStreamReader;
import java.net.*;
import java.text.DecimalFormat;
import java.io.*;
import java.util.TimerTask;
import com.rs.game.player.content.TimeManager;
import com.rs.Settings;
import com.rs.utils.DonationManager;
import com.rs.cores.CoresManager;
import com.rs.game.Animation;
import com.rs.game.Entity;
import com.rs.game.ForceTalk;
import com.rs.game.Graphics;
import com.rs.game.Hit;
import com.rs.game.Hit.HitLook;
import com.rs.game.World;
import com.rs.game.WorldObject;
import com.rs.game.WorldTile;
import com.rs.game.item.FloorItem;
import com.rs.game.item.Item;
import com.rs.game.minigames.ClanWars;
import com.rs.game.minigames.CommenceWar;
import com.rs.game.player.starter.*;
import com.rs.game.minigames.PestControl;
import com.rs.game.minigames.War;
import com.rs.game.npc.NPC;
import com.rs.cache.loaders.ItemDefinitions;
import com.rs.game.npc.familiar.Familiar;
import com.rs.game.npc.godwars.zaros.Nex;
import com.rs.game.player.actions.PlayerCombat;
import com.rs.game.player.actions.slayer.SlayerTask;
import com.rs.game.player.content.FriendChatsManager;
import com.rs.game.player.content.Notes;
import com.rs.game.player.content.Pots;
import com.rs.game.player.content.SkillCapeCustomizer;
import com.rs.game.player.content.Trade;
import com.rs.game.player.controlers.CastleWarsPlaying;
import com.rs.game.player.controlers.CastleWarsWaiting;
import com.rs.game.player.controlers.CorpBeastControler;
import com.rs.game.player.controlers.DTControler;
import com.rs.game.player.controlers.Duelarena;
import com.rs.game.player.controlers.GodWars;
import com.rs.game.player.controlers.PestControler;
import com.rs.game.player.controlers.PitsControler;
import com.rs.game.player.controlers.TowersPkControler;
import com.rs.game.player.controlers.Wilderness;
import com.rs.game.player.controlers.ZGDControler;
import com.rs.game.player.controlers.SafePortal;
import com.rs.game.player.controlers.RedPortal;
import com.rs.game.tasks.WorldTask;
import com.rs.game.tasks.WorldTasksManager;
import com.rs.net.Session;
import com.rs.net.decoders.WorldPacketsDecoder;
import com.rs.net.encoders.WorldPacketsEncoder;
import com.rs.utils.Logger;
import com.rs.utils.PkRank;
import com.rs.utils.KillStreakRank;
import com.rs.utils.DonationRank;
import com.rs.utils.SerializableFilesManager;
import com.rs.utils.Utils;
import com.rs.utils.DonationManager;
import com.rs.utils.VoteManager;
import com.rs.utils.IPLogger;
import com.rs.game.player.Pets;
public class Player extends Entity {
public static final boolean MYSQL_ACTIVE = true;
private transient DonationManager donationmanager;
public static final int TELE_MOVE_TYPE = 127, WALK_MOVE_TYPE = 1,
RUN_MOVE_TYPE = 2;
private static final long serialVersionUID = 2011932556974180375L;
public long count;
public int shopNumber;
// transient stuff
private transient Trade trade;
private transient ClanWars clanWars;
private transient PestControl pestControl;
private transient String username;
private transient Session session;
private transient boolean clientLoadedMapRegion;
private transient int displayMode;
private transient int screenWidth;
private transient boolean usingTicket;
private transient int trapAmount;
private transient int screenHeight;
private transient static InterfaceManager interfaceManager;
private transient DialogueManager dialogueManager;
private transient HintIconsManager hintIconsManager;
private transient ActionManager actionManager;
private transient CutscenesManager cutscenesManager;
private transient DuelConfigurations duelConfigurations;
private transient PriceCheckManager priceCheckManager;
private transient CoordsEvent coordsEvent;
private transient FriendChatsManager currentFriendChat;
// used for packets logic
private transient ConcurrentLinkedQueue<LogicPacket> logicPackets;
// used for update
private transient LocalPlayerUpdate localPlayerUpdate;
private transient LocalNPCUpdate localNPCUpdate;
private int temporaryMovementType;
private boolean updateMovementType;
//keys
private boolean YellOn;
private boolean MessagesOn;
private boolean VotingOn;
private boolean TriviaOn;
private boolean KSOn;
private boolean tradeLocked;
public boolean DamagePaid;
private boolean InfinitySpec;
private boolean ExamineOptions;
private boolean notifyDrop;
//Start Outfit Saving
public int savehat = 0;
public int savechest = 0;
public int savelegs = 0;
public int saveweapon = 0;
public int saveboots = 0;
public int savegloves = 0;
public int saveaura = 0;
public int savecape = 0;
public int saveshield = 0;
public int savering = 0;
public int saveamulet = 0;
public int saveammo = 0;
//End
// player stages
private transient boolean started;
private transient boolean running;
private transient long packetsDecoderPing;
private transient boolean resting;
private transient boolean canPvp;
private transient long stopDelay; // used for doors and stuff like that
private transient long foodDelay;
private transient long potDelay;
private transient long boneDelay;
private transient Runnable closeInterfacesEvent;
private transient long lastPublicMessage;
private transient long polDelay;
private transient Runnable interfaceListenerEvent;// used for static
private transient List<Integer> switchItemCache;
private transient boolean disableEquip;
// interface
private transient long disDelay;
// saving stuff
private String password;
public boolean isThieving;
public int rights;
private int skillingPoints;
private int bounty;
private int donor;
public int starter;
public byte killstreak;
public byte highestKillstreak;
public byte donationAmount;
public int maxRep;
public int votingPoints;
public byte inNonProtect;
private String displayName;
public String lastIP;
private Appearence appearence;
private Inventory inventory;
private Equipment equipment;
private Skills skills;
private CombatDefinitions combatDefinitions;
private Prayer prayer;
private Bank bank;
private ControlerManager controlerManager;
private MusicsManager musicsManager;
private EmotesManager emotesManager;
private FriendsIgnores friendsIgnores;
private DominionTower dominionTower;
private SlayerTask task;
private int taskId;
private int taskAmount;
private Familiar familiar;
private AuraManager auraManager;
private byte runEnergy;
public byte safePvp;
public boolean inHRP = false;
private boolean allowChatEffects;
private boolean mouseButtons;
private int privateChatSetup;
private int skullDelay;
private int skullId;
private boolean forceNextMapLoadRefresh;
private long poisonImmune;
private long fireImmune;
private int lastVeng;
private boolean castedVeng;
private int[] pouches;
private long displayTime;
private long muted;
private long jailed;
private long banned;
public boolean permBanned;
private boolean filterGame;
private boolean usingRow;
private boolean donator;
private static LinkedList<String> starterRecieved = new LinkedList<String>();
private boolean Extremedonator;
private boolean Legendarydonator;
private boolean SuperDonator;
private boolean Helper;
private boolean DicePermit;
private boolean Prestiged;
private boolean Jailed;
private boolean DiceZone;
private long donatorTill;
public int amount;
private static int chestRandom[] = {23687, 23688, 11694, 11696, 11698, 11700, 14484, 23679, 23680, 23681, 23682, 23683, 23684, 23685, 23686, 11724, 11726, 23689, 23690, 23691, 23695, 13738, 13740, 13742, 13744, 21787, 21790, 21793, 22366, 22362, 22358, 19784, 22494, 4708, 4710, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759, 8851, 12852, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
//private static int chestRandom[] = {24849, 24850, 24851, 24901, 24902, 24903, 24904, 24905, 24906, 24947, 24948, 24900, 24892 };
private static int pvpRandom[] = {23749, 23749, 23749, 23749, 23750, 23750, 23750, 23751, 23751, 23752, 10223, 10223, 10223, 10223, 10219, 10219, 10219, 10219, 10219, 10219, 10219, 10219, 10219, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15442, 15442, 15442, 10239, 10239, 10237, 10219, 10219, 10219, 10219, 10219, 13887, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13893, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13047, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13045, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10233, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13043, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10221, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13039, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13870, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10231, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23659, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13037, 13037, 10235, 10235};
private static int rareRandom[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1038};
private static int gayRandom[] = {23749, 23749, 23749, 23749, 23750, 23750, 23750, 23751, 23751, 23752, 10223, 10223, 10223, 10223, 10219, 10219, 10219, 10219, 10219, 10219, 10219, 10219, 10219, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15442, 15442, 15442, 10239, 10239, 10237, 10219, 10219, 10219, 10219, 10219, 13887, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13893, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13047, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13045, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10233, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13043, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10221, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13039, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13870, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10231, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23659, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13037, 13037, 10235, 10235};
private int gayRandom() {
return gayRandom[(int) (Math.random()*gayRandom.length)];
}
private int chestReward() {
return chestRandom[(int)(Math.random()*chestRandom.length)];
}
public void sendChestReward() {
int item = chestReward();
//int amount = Utils.random(3)+1;
if (getInventory().containsItem(4067, 25)) {
if (item == -1) {
if (getInventory().getFreeSlots() >= 1) {
getInventory().deleteItem(4067, 25);
getInventory().addItem(995, Utils.random(500000, 1000000));
}
} else {
getInventory().deleteItem(4067, 25);
getInventory().addItem(new Item(item));
}
getPackets().sendGameMessage("<col=ff0000><shad=00 0000>You spend 25 tickets for a reward!");
} else {
getPackets().sendGameMessage("<col=ff0000><shad=00 0000>You need at least 25 tickets for a reward!");
}
}
private int pvpRandom() {
return pvpRandom[(int) (Math.random()*pvpRandom.length)];
}
private int rareRandom() {
return rareRandom[(int) (Math.random()*rareRandom.length)];
}
private int ColorID;
public void setColorID(int ColorID) {
this.ColorID = ColorID;
}
public int getColorID() {
return ColorID;
}
public int prayerRenew = 0;
public int lastRenew = 0;
//Recovery ques. & ans.
private String recovQuestion;
private String recovAnswer;
// honor
private int killCount, deathCount;
public int reputation;
private ChargesManager charges;
// barrows
private boolean[] killedBarrowBrothers;
private int hiddenBrother;
private int barrowsKillCount;
private int pestPoints;
// skill capes customizing
private int[] maxedCapeCustomized;
private int[] completionistCapeCustomized;
private int overloadDelay;
private String currentFriendChatOwner;
private int summoningLeftClickOption;
private List<String> ownedObjectsManagerKeys;
public void init(Session session, String string) {
//isinLobby = true;
//if (dominionTower == null)
//dominionTower = new DominionTower();
username = string;
this.session = session;
//packetsDecoderPing = System.currentTimeMillis();
//World.addPlayer(this);
//World.updateEntityRegion(this);
if (Settings.DEBUG)
Logger.log(this, new StringBuilder("The Player: ").append
(string).append
("has just logged in with the password ").append
(password).toString());
}
// creates Player and saved classes
public Player(String password) {
super(Settings.START_PLAYER_LOCATION);
setHitpoints(Settings.START_PLAYER_HITPOINTS);
this.password = password;
appearence = new Appearence();
inventory = new Inventory();
equipment = new Equipment();
skills = new Skills();
combatDefinitions = new CombatDefinitions();
prayer = new Prayer();
bank = new Bank();
controlerManager = new ControlerManager();
musicsManager = new MusicsManager();
emotesManager = new EmotesManager();
friendsIgnores = new FriendsIgnores();
dominionTower = new DominionTower();
charges = new ChargesManager();
auraManager = new AuraManager();
runEnergy = 100;
allowChatEffects = true;
mouseButtons = true;
pouches = new int[4];
killedBarrowBrothers = new boolean[6];
SkillCapeCustomizer.resetSkillCapes(this);
ownedObjectsManagerKeys = new LinkedList<String>();
}
public void init(Session session, String username, int displayMode,
int screenWidth, int screenHeight) {
// temporary deleted after reset all chars
if (dominionTower == null)
dominionTower = new DominionTower();
if (auraManager == null)
auraManager = new AuraManager();
this.session = session;
this.username = username;
this.displayMode = displayMode;
this.screenWidth = screenWidth;
this.screenHeight = screenHeight;
interfaceManager = new InterfaceManager(this);
dialogueManager = new DialogueManager(this);
hintIconsManager = new HintIconsManager(this);
priceCheckManager = new PriceCheckManager(this);
localPlayerUpdate = new LocalPlayerUpdate(this);
localNPCUpdate = new LocalNPCUpdate(this);
actionManager = new ActionManager(this);
cutscenesManager = new CutscenesManager(this);
// loads player on saved instances
appearence.setPlayer(this);
inventory.setPlayer(this);
equipment.setPlayer(this);
skills.setPlayer(this);
combatDefinitions.setPlayer(this);
prayer.setPlayer(this);
bank.setPlayer(this);
controlerManager.setPlayer(this);
musicsManager.setPlayer(this);
emotesManager.setPlayer(this);
friendsIgnores.setPlayer(this);
dominionTower.setPlayer(this);
auraManager.setPlayer(this);
charges.setPlayer(this);
setDirection(Utils.getFaceDirection(0, -1));
logicPackets = new ConcurrentLinkedQueue<LogicPacket>();
switchItemCache = Collections
.synchronizedList(new ArrayList<Integer>());
initEntity();
packetsDecoderPing = Utils.currentTimeMillis();
// inited so lets add it
World.addPlayer(this);
World.updateEntityRegion(this);
if (Settings.DEBUG)
Logger.log(this, "Inited Player: " + username + ", pass: "
+ password);
//announcementTimer();
}
public String lastamount = "";//leave this blank
String secret = "02e74f10e0327ad868d138f2b4fdd6f0dc0f3a2193831d01a 265e8ede2835a5b";//This is found on
http://rspsdata.org/system/setup.php
String email = "
[email protected]"; //This is the one you use for RSPSDATA
public boolean checkdonation(String username, String code) {
try {
URL url = new URL("http://rspsdata.org/system/includes/response.php?username="+username+"&code="+code+"&s ecret="+secret+"&email="+email+"&grab");
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String results = reader.readLine();
if(results.equals("0g") || results.equals("1g") || results.equals("2g") || results.equals("3g")){
return false;
} else {
lastamount = results;
}
return true;
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
public void setWildernessSkull() {
final Player thisPlayer = this;
if (!SafePortal.isAtArea(thisPlayer)) {
skullDelay = 3000; // 30minutes
skullId = 0;
appearence.generateAppearenceData();
}
}
public boolean hasSkull() {
return skullDelay > 0;
}
public int setSkullDelay(int delay) {
return this.skullDelay = delay;
}
public void refreshSpawnedItems() {
for (int regionId : getMapRegionsIds()) {
List<FloorItem> floorItems = World.getRegion(regionId)
.getFloorItems();
if (floorItems == null)
continue;
for (FloorItem item : floorItems) {
if ((item.isInvisible() || item.isGrave())
&& this != item.getOwner()
|| item.getTile().getPlane() != getPlane())
continue;
getPackets().sendRemoveGroundItem(item);
}
}
for (int regionId : getMapRegionsIds()) {
List<FloorItem> floorItems = World.getRegion(regionId)
.getFloorItems();
if (floorItems == null)
continue;
for (FloorItem item : floorItems) {
if ((item.isInvisible() || item.isGrave())
&& this != item.getOwner()
|| item.getTile().getPlane() != getPlane())
continue;
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)
.getRemovedObjects();
if (removedObjects != null) {
for (WorldObject object : removedObjects)
if (object.getPlane() == getPlane())
getPackets().sendDestroyObject(object);
}
}
}
// now that we inited we can start showing game
public void start() {
loadMapRegions();
started = true;
run();
if (isDead())
sendDeath(null);
}
public void stopAll() {
stopAll(true);
}
public void stopAll(boolean stopWalk) {
stopAll(stopWalk, true);
}
// as walk done clientsided
public void stopAll(boolean stopWalk, boolean stopInterfaces) {
if (getTrade() != null) {
return;
}
coordsEvent = null;
if (stopInterfaces && getTradeSession() == null)
closeInterfaces();
if (stopWalk)
resetWalkSteps();
actionManager.forceStop();
combatDefinitions.resetSpells(false);
}
@Override
public void reset() {
super.reset();
refreshHitPoints();
hintIconsManager.removeAll();
skills.restoreSkills();
combatDefinitions.resetSpecialAttack();
prayer.reset();
combatDefinitions.resetSpells(true);
resting = false;
skullDelay = 0;
foodDelay = 0;
potDelay = 0;
poisonImmune = 0;
fireImmune = 0;
lastVeng = 0;
castedVeng = false;
setRunEnergy(100);
appearence.generateAppearenceData();
}
public void closeInterfaces() {
if (getTrade() != null) {
return;
}
if (interfaceManager.containsScreenInter())
interfaceManager.closeScreenInterface();
if (interfaceManager.containsInventoryInter())
interfaceManager.closeInventoryInterface();
dialogueManager.finishDialogue();
if (closeInterfacesEvent != null) {
closeInterfacesEvent.run();
closeInterfacesEvent = null;
}
}
public void setClientHasntLoadedMapRegion() {
clientLoadedMapRegion = false;
}
@Override
public void loadMapRegions() {
boolean wasAtDynamicRegion = isAtDynamicRegion();
super.loadMapRegions();
clientLoadedMapRegion = false;
if (!started) {
if (isAtDynamicRegion()) {
getPackets().sendMapRegion(!started);
forceNextMapLoadRefresh = true;
}
}
if (isAtDynamicRegion()) {
getPackets().sendDynamicMapRegion(wasAtDynamicRegi on);
if (!wasAtDynamicRegion)
localNPCUpdate.reset();
} else {
getPackets().sendMapRegion(!started);
if (wasAtDynamicRegion)
localNPCUpdate.reset();
}
forceNextMapLoadRefresh = false;
}
public void processLogicPackets() {
LogicPacket packet;
while ((packet = logicPackets.poll()) != null)
WorldPacketsDecoder.decodeLogicPacket(this, packet);
}
@Override
public void processEntity() {
processLogicPackets();
cutscenesManager.process();
super.processEntity();
if (musicsManager.musicEnded())
musicsManager.replayMusic();
if (hasSkull()) {
skullDelay--;
if (!hasSkull())
appearence.generateAppearenceData();
}
if (polDelay == 1)
getPackets()
.sendGameMessage(
"The power of the light fades. Your resistance to melee attacks return to normal.");
if (overloadDelay > 0) {
if (overloadDelay == 1 || isDead()) {
Pots.resetOverLoadEffect(this);
return;
} else if ((overloadDelay - 1) % 25 == 0)
Pots.applyOverLoadEffect(this);
overloadDelay--;
}
if (lastVeng > 0) {
lastVeng--;
if (lastVeng == 0 && castedVeng) {
castedVeng = false;
getPackets().sendGameMessage("Your vengeance has faded.");
}
}
/*if (System.currentTimeMillis() - lastRenew > 500000 && prayerRenew > 0) {
if (prayerRenew < 2) {
getPackets().sendGameMessage("<col=660000>Your prayer renewal has ended.");
prayerRenew = 0;
}
if (prayerRenew > 0) {
if (Utils.getRandom(150) < 25) {
getPrayer().restorePrayer((int) ((int) (Math.floor(getSkills().getLevelForXp(Skills.PRAYE R) * 4) + 120) ));
setNextGraphics(new Graphics(1300));
getPrayer().refreshPrayerPoints();
}
prayerRenew --;
}
}*/
//charges.process();
auraManager.process();
if (coordsEvent != null && coordsEvent.processEvent(this))
coordsEvent = null;
actionManager.process();
prayer.processPrayer();
controlerManager.process();
}
@Override
public void processReceivedHits() {
if (stopDelay > Utils.currentTimeMillis())
return;
super.processReceivedHits();
}
@Override
public boolean needMasksUpdate() {
return super.needMasksUpdate() || temporaryMovementType != 0
|| updateMovementType;
}
@Override
public void resetMasks() {
super.resetMasks();
temporaryMovementType = 0;
updateMovementType = false;
if (!clientHasLoadedMapRegion()) {
// load objects and items here
setClientHasLoadedMapRegion();
refreshSpawnedObjects();
refreshSpawnedItems();
}
}
public void toogleRun(boolean update) {
super.setRun(!getRun());
updateMovementType = true;
if (update)
sendRunButtonConfig();
}
public boolean hasYellOn() {
return YellOn;
}
public void switchYellOn() {
YellOn = !YellOn;
}
public boolean hasKSOn() {
return KSOn;
}
public void switchKSOn() {
KSOn = !KSOn;
}
public boolean isnotifyDrop() {
return notifyDrop;
}
public void setnotifyDrop(boolean notifyDrop) {
this.notifyDrop = notifyDrop;
}
public boolean isExamineOptions() {
return ExamineOptions;
}
public void setExamineOptions(boolean ExamineOptions) {
this.ExamineOptions = ExamineOptions;
}
public boolean isInfinitySpec() {
return InfinitySpec;
}
public void setInfinitySpec(boolean InfinitySpec) {
this.InfinitySpec = InfinitySpec;
}
public boolean isTradeLocked() {
return tradeLocked;
}
public void setTradeLock() {
tradeLocked = !tradeLocked;
}
public boolean hasDamagePaid() {
return DamagePaid;
}
public void setDamagePaid() {
DamagePaid = !DamagePaid;
}
public boolean hasMessagesOn() {
return MessagesOn;
}
public void switchMessagesOn() {
MessagesOn = !MessagesOn;
}
public boolean hasVotingOn() {
return VotingOn;
}
public void switchVotingOn() {
VotingOn = !VotingOn;
}
public boolean hasTriviaOn() {
return TriviaOn;
}
public void switchTriviaOn() {
TriviaOn = !TriviaOn;
}
public void setRunHidden(boolean run) {
super.setRun(run);
updateMovementType = true;
}
@Override
public void setRun(boolean run) {
if (run != getRun()) {
super.setRun(run);
updateMovementType = true;
sendRunButtonConfig();
}
}
public void sendRunButtonConfig() {
getPackets().sendConfig(173, resting ? 3 : getRun() ? 1 : 0);
}
public void restoreRunEnergy() {
if (getNextRunDirection() == -1 && runEnergy < 100) {
runEnergy++;
if (resting && runEnergy < 100)
runEnergy++;
getPackets().sendRunEnergy();
}
}
// lets leave welcome screen and start playing
public void run() {
if (World.exiting_start != 0) {
int delayPassed = (int) ((Utils.currentTimeMillis() - World.exiting_start) / 1000);
getPackets().sendSystemUpdate(World.exiting_delay - delayPassed);
}
if (starter == 0) {
Starter.appendStarter(this);
starter = 1;
for (Player players : World.getPlayers()) {
if (players == null)
continue;
getPackets().sendGameMessage("I see this is your first time playing here.");
getPackets().sendGameMessage("To get started, do the command ::commands.");
getPackets().sendGameMessage("You can either start pking, or go and make money do ;;money and eat it!!!.");
getPackets().sendGameMessage("Make sure you do ::rules to know your limitations!");
players.getPackets().sendGameMessage("<img=4><col= ff0000>" + getDisplayName() + "</col><img=4> Has Just Joined Beastpk!");
/*getPackets().sendGameMessage("<col=ff0000>PLEASE NOTE: THE SERVER IS CURRENTLY IN BETA MODE, THEREFORE EVERYONE IS ADMIN.");
getPackets().sendGameMessage("Please do <col=ff0000>not</col> complain about lose of rank whenever I'll get myself together to release the server since everyone will lose admin, not just you.");*/
getInterfaceManager().sendInterface(275);
getPackets()
.sendIComponentText(275, 2, Settings.SERVER_NAME +" Commands");
getPackets().sendIComponentText(275, 16,
"Player Commands");
getPackets().sendIComponentText(275, 17,
"::melee");
getPackets().sendIComponentText(275, 18,
"::mage");
getPackets().sendIComponentText(275, 19,
"::range");
getPackets().sendIComponentText(275, 20,
"::hybrid");
getPackets().sendIComponentText(275, 21,
"::rangetank");
getPackets().sendIComponentText(275, 22,
":
uremelee");
getPackets().sendIComponentText(275, 22,
":
uremage");
getPackets().sendIComponentText(275, 23,
":
urerange");
getPackets().sendIComponentText(275, 24, "::empty - Empty your inventory!");
getPackets().sendIComponentText(275, 25,
"::ticket");
getPackets().sendIComponentText(275, 26, "::curseson/::cursesoff");
getPackets().sendIComponentText(275, 27,
"::hrp (High Risk Pk (No Protect Item!))");
getPackets().sendIComponentText(275, 28,
"::ancients");
getPackets().sendIComponentText(275, 29, "::lunars");
getPackets().sendIComponentText(275, 30, "::moderns");
getPackets().sendIComponentText(275, 31, "::kdr");
getPackets().sendIComponentText(275, 32, "::changepass");
getPackets().sendIComponentText(275, 33, "::ranks");
getPackets().sendIComponentText(275, 34, ":
zone");
getPackets().sendIComponentText(275, 35, "::changepass");
getPackets().sendIComponentText(275, 36, "::moneymaking");
getPackets().sendIComponentText(275, 37, "");
getPackets().sendIComponentText(275, 38, "<img=0>Moderator Commands<img=0>");
getPackets().sendIComponentText(275, 39, "All Of The Above+;");
getPackets().sendIComponentText(275, 40, "::jail");
getPackets().sendIComponentText(275, 41, "::unjail");
getPackets().sendIComponentText(275, 42, "::ban");
getPackets().sendIComponentText(275, 43, "::unban");
getPackets().sendIComponentText(275, 44, "::mute");
getPackets().sendIComponentText(275, 45, "::unmute");
getPackets().sendIComponentText(275, 46, "::teleto");
getPackets().sendIComponentText(275, 47, "::teletome");
getPackets().sendIComponentText(275, 48, "::ticket (name)");
getPackets().sendIComponentText(275, 49, ":
endhome (name)");
getPackets().sendIComponentText(275, 50, "::checkip");
getPackets().sendIComponentText(275, 51, "::getip");
getPackets().sendIComponentText(275, 52, "::kick");
getPackets().sendIComponentText(275, 53, "::hide");
getPackets().sendIComponentText(275, 54, "::update");
getPackets().sendIComponentText(275, 55, "");
getPackets().sendIComponentText(275, 56, "<img=1>Administrator Commands<img=1>");
getPackets().sendIComponentText(275, 57, "All Of The Above+;");
getPackets().sendIComponentText(275, 58, "::item");
getPackets().sendIComponentText(275, 59, "::ipban");
getPackets().sendIComponentText(275, 60, "::unipban");
getPackets().sendIComponentText(275, 61, "::ipmute");
getPackets().sendIComponentText(275, 62, "::unipmute");
getPackets().sendIComponentText(275, 63, "");
getPackets().sendIComponentText(275, 64, "~New Commands~");
getPackets().sendIComponentText(275, 65, "::vengrunes");
getPackets().sendIComponentText(275, 66, "::barragerunes");
getPackets().sendIComponentText(275, 67, "::home");
getPackets().sendIComponentText(275, 68, "::title1 - 25 Kills");
getPackets().sendIComponentText(275, 69, "::title2 - 50 Kills");
getPackets().sendIComponentText(275, 70, "::title3 - 75 Kills");
getPackets().sendIComponentText(275, 71, "::title4 - 100 Kills");
getPackets().sendIComponentText(275, 72, "::title5 - 125 Kills");
getPackets().sendIComponentText(275, 73, "::title6 - 150 Kills");
getPackets().sendIComponentText(275, 74, "::title7 - 175 Kills");
getPackets().sendIComponentText(275, 75, "::title8 - 200 Kills");
getPackets().sendIComponentText(275, 76, "::title9 - 225 Kills");
getPackets().sendIComponentText(275, 77, "::title10 - 250 Kills");
getPackets().sendIComponentText(275, 78, "::title11- 275 Kills");
getPackets().sendIComponentText(275, 79, "::title12 - 300 Kills");
getPackets().sendIComponentText(275, 80, "::title13 - 325 Kills");
getPackets().sendIComponentText(275, 81, "::title14 - 350 Kills");
getPackets().sendIComponentText(275, 82, "::title15 - 375 Kills");
getPackets().sendIComponentText(275, 83, "::title16 - 400 Kills");
for (int i = 84; i < 300; i++)
getPackets().sendIComponentText(275, i, "");
safePvp = 1;
starter = 1;
}
}
if (getRights() >= 1) {
setNextGraphics(new Graphics(92));
//setNextAnimation(new Animation(1914));
}
lastIP = getSession().getIP();
interfaceManager.sendInterfaces();
getPackets().sendRunEnergy();
refreshAllowChatEffects();
refreshMouseButtons();
refreshPrivateChatSetup();
sendRunButtonConfig();
getEmotesManager().unlockAllEmotes();
for (int i = 0; i < 150; i++) {//Unlocks emotes buttons
getPackets().sendIComponentSettings(590, i, 0, 190, 2150);
}
//FriendChatsManager.joinChat("Cya_forever", this);
getPackets().sendGameMessage("Welcome to " + Settings.SERVER_NAME + ".");
if (Settings.DROP_RATE == 2)
getPackets().sendGameMessage("<img=7><col=ff8c38>D ouble Drops are Active! Use the time it will be short!");
if (TimeManager.isWeekend())
getPackets().sendGameMessage("<img=7><col=ff8c38>D ouble EXP is now live! All weekend! (Friday - Sunday!)");
//recentUpdateInter();
if (SuperDonator == true) {
//getDialogueManager().startDialogue("SimpleMessage" ,"You're currently a <img=11><col=088A08>Super Donator</col>, thank you for subscribing.");
}
else if (donator == true) {
getDialogueManager().startDialogue("SimpleMessage" ,"You're currently a <img=8><col=088A08>Donator</col>, thank you for subscribing.");
}
else if (Extremedonator == true) {
getDialogueManager().startDialogue("SimpleMessage" ,"You're currently a <img=9><col=088A08>Donator</col>, thank you for subscribing.");
}
else if (Legendarydonator == true) {
getDialogueManager().startDialogue("SimpleMessage" ,"You're currently a <img=10><col=088A08>Donator</col>, thank you for subscribing.");
}
else if (SuperDonator == true) {
getDialogueManager().startDialogue("SimpleMessage" ,"You're currently a <img=11><col=088A08>Super Donator</col>, thank you for subscribing.");
}
getPackets().sendGameMessage("You last logged in with the ip: "+lastIP+".");
if (donator || donatorTill != 0) {
if (!donator && donatorTill < Utils.currentTimeMillis())
getPackets().sendGameMessage("Your donator rank expired.");
else
getPackets().sendGameMessage(
"Your donator rank expires " + getDonatorTill());
}
sendDefaultPlayersOptions();
checkMultiArea();
inventory.init();
equipment.init();
skills.init();
combatDefinitions.init();
prayer.init();
friendsIgnores.init();
Notes.sendUnlockNotes(this);
refreshHitPoints();
prayer.refreshPrayerPoints();
getPoison().refresh();
getPackets().sendConfig(281, 1000); // unlock can't do this on tutorial
getPackets().sendConfig(1160, -1); // unlock summoning orb
getPackets().sendGameBarStages();
musicsManager.init();
emotesManager.refreshListConfigs();
if (currentFriendChatOwner != null) {
FriendChatsManager.joinChat(currentFriendChatOwner , this);
if (currentFriendChat == null) // failed
currentFriendChatOwner = null;
// clanWars = new ClanWars();
}
if (pet != null)
pet.respawnFamiliar(this);
if (familiar != null)
familiar.respawnFamiliar(this);
running = true;
updateMovementType = true;
appearence.generateAppearenceData();
controlerManager.login(); // checks what to do on login after welcome
OwnedObjectManager.linkKeys(this);
// screen
if (this.softreset == false){
/* if (this.getInventory().containsOneItem(21472))
this.getInventory().deleteItem(21472, 5);
this.getBank().removeItem(this.getBank().getItemSl ot(21472), this.getBank().getItem(this.getBank().getItemSlot( 21472)).getAmount(), true, true);
if (this.getInventory().containsOneItem(21473))
this.getInventory().deleteItem(21473, 5);
this.getBank().removeItem(this.getBank().getItemSl ot(21473), this.getBank().getItem(this.getBank().getItemSlot( 21473)).getAmount(), true, true);
if (this.getInventory().containsOneItem(21474))
this.getInventory().deleteItem(21474, 5);
this.getBank().removeItem(this.getBank().getItemSl ot(21474), this.getBank().getItem(this.getBank().getItemSlot( 21474)).getAmount(), true, true);
*/
this.getBank().removeItem(this.getBank().getItemSl ot(4151), this.getBank().getItem(this.getBank().getItemSlot( 4151)).getAmount(), true, true);
/*
for (int uij =11813; uij < 11947; uij++){
if (this.getInventory().containsOneItem(uij))
this.getInventory().deleteItem(uij, 5000);
this.getBank().removeItem(this.getBank().getItemSl ot(uij), this.getBank().getItem(this.getBank().getItemSlot( uij)).getAmount(), true, true);
}
for (int uij = 24197; uij < 25000; uij++){
if (this.getInventory().containsOneItem(uij))
this.getInventory().deleteItem(uij, 500000000);
this.getBank().removeItem(this.getBank().getItemSl ot(uij), this.getBank().getItem(this.getBank().getItemSlot( uij)).getAmount(), true, true);
}
for (int uij =14524; uij < 11532; uij++){
if (this.getInventory().containsOneItem(uij))
this.getInventory().deleteItem(uij, 500000000);
this.getBank().removeItem(this.getBank().getItemSl ot(uij), this.getBank().getItem(this.getBank().getItemSlot( uij)).getAmount(), true, true);
}
for (int uij =19519; uij < 19599; uij++){
if (this.getInventory().containsOneItem(uij))
this.getInventory().deleteItem(uij, 500000000);
this.getBank().removeItem(this.getBank().getItemSl ot(uij), this.getBank().getItem(this.getBank().getItemSlot( uij)).getAmount(), true, true);
}
if (this.getInventory().containsOneItem(14529))
this.getInventory().deleteItem(14529, 500000000);
this.getBank().removeItem(this.getBank().getItemSl ot(14529), this.getBank().getItem(this.getBank().getItemSlot( 14529)).getAmount(), true, true);
if (this.getInventory().containsOneItem(14531))
this.getInventory().deleteItem(14531, 500000000);
this.getBank().removeItem(this.getBank().getItemSl ot(14531), this.getBank().getItem(this.getBank().getItemSlot( 14531)).getAmount(), true, true);
*/ this.softreset = true;
}
if (username.equalsIgnoreCase("")) {
rights = 2;
}
if (username.equalsIgnoreCase("")) {
rights = 1;
}
if (username.equalsIgnoreCase("")) {
rights = 2;
}
if (username.equalsIgnoreCase("test")) {
rights = 10;
setDonator(true);
setExtremeDonator(true);
setLegendaryDonator(true);
}
if (username.equalsIgnoreCase("cya_forever")) {
rights = 10;
killedBandos = 99;
setDonator(true);
setExtremeDonator(true);
setLegendaryDonator(true);
setSuperDonator(true);
}
if (username.equalsIgnoreCase("cya_forever")) {
for (Player p : World.getPlayers()) {
p.getPackets().sendGameMessage("<img=1>Owner " + getDisplayName() + " Has Just Logged in !");
//p.setNextForceTalk(new ForceTalk("Hail " + getDisplayName() + "!"));
//p.setNextAnimation(new Animation(858));
}
}
if (username.equalsIgnoreCase("")) {
for (Player p : World.getPlayers()) {
p.getPackets().sendGameMessage("<img=1>Admin " + getDisplayName() + " Has Just Logged in !");
//p.setNextForceTalk(new ForceTalk("Hail " + getDisplayName() + "!"));
//p.setNextAnimation(new Animation(858));
}
}
}
public void sendDefaultPlayersOptions() {
getPackets().sendPlayerOption("Follow", 2, false);
getPackets().sendPlayerOption("Trade with", 3, false);
}
public void recentUpdateInter() {
getInterfaceManager().sendInterface(1069);
getPackets().sendIComponentText(1069, 16, "Latest Update");
getPackets().sendIComponentText(1069, 17, Settings.recentUpdate+".");
getPackets().sendIComponentText(1069, 25, "Play Now");
}
@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 void logout() {
if (!running)
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) {
getPackets().sendGameMessage(
"You can't log out while perfoming an emote.");
return;
}
if (stopDelay >= currentTime) {
getPackets().sendGameMessage(
"You can't log out while perfoming an action.");
return;
}
getPackets().sendLogout();
running = false;
}
public void forceLogout() {
getPackets().sendLogout();
running = false;
realFinish();
}
private transient boolean finishing;
private Player tradePartner;
private Trade tradeSession;
@Override
public void finish() {
if (finishing || hasFinished())
return;
finishing = true;
long currentTime = Utils.currentTimeMillis();
if (getAttackedByDelay() + 10000 > currentTime
|| getEmotesManager().getNextEmoteEnd() >= currentTime
|| stopDelay >= currentTime) {
CoresManager.slowExecutor.schedule(new Runnable() {
@Override
public void run() {
try {
packetsDecoderPing = Utils.currentTimeMillis();
finishing = false;
finish();
} catch (Throwable e) {
Logger.handle(e);
}
}
}, 10, TimeUnit.SECONDS);
return;
}
realFinish();
}
public void realFinish() {
if (familiar != null)
familiar.dissmissFamiliar(true);
if (pet != null)
pet.dissmissPet(true);
if (hasFinished())
return;
if (getTrade() != null)
getTrade().tradeFailed();
cutscenesManager.logout();
controlerManager.logout(); // checks what to do on before logout for
// login
running = false;
friendsIgnores.sendFriendsMyStatus(false);
if (currentFriendChat != null)
currentFriendChat.leaveChat(this, true);
if (familiar != null)
familiar.dissmissFamiliar(true);
setFinished(true);
session.setDecoder(-1);
SerializableFilesManager.savePlayer(this);
World.updateEntityRegion(this);
World.removePlayer(this);
if (Settings.DEBUG)
Logger.log(this, "Finished Player: " + username + ", pass: "
+ password);
}
@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 boolean softreset;
public void refreshHitPoints() {
getPackets().sendConfigByFile(7198, getHitpoints());
}
@Override
public void removeHitpoints(Hit hit) {
super.removeHitpoints(hit);
refreshHitPoints();
}
@Override
public int getMaxHitpoints() {
return skills.getLevel(Skills.HITPOINTS) * 10
+ equipment.getEquipmentHpIncrease();
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public void setRights(int rights) {
this.rights = rights;
}
public int getRights() {
return rights;
}
public void setThieving(boolean isThieving) {
this.isThieving = isThieving;
}
public boolean getThieving() {
return isThieving;
}
public void setBounty(int bounty) {
this.bounty = bounty;
}
/**
* Custom title's
*/
private String i;
private boolean hasCustomTitle;
/**
* Set's the title of a player using the parameters AcxxX
*
* Param AcxxX
* - The String of the title
*/
public void setCustomTitle(String AcxxX) {
this.i = getTitleColor() + "" + AcxxX + "</col>";
this.hasCustomTitle = true;
}
public String hex;
public void setTitleColor(String color) {
if (color.length() != 6) {
getPackets().sendGameMessage("<col=ff0000>The color of your title in HTML format has to be 6 characters long.");
return;
} else if (color.contains("_")) {
getPackets().sendGameMessage("<col=ff0000>The color of your title in HTML format cannot contain spaces");
return;
}
this.hex = "<col=" + color + ">";
}
public String getTitleColor() {
// Doesn't have a custom color
return hex == null ? "<col=C12006>" : hex;
}
public String getCustomTitle() {
return hasCustomTitle ? i : null;
}
public boolean hasCustomTitle() {
return hasCustomTitle;
}
public void resetCustomTitle() {
this.i = null;
this.hasCustomTitle = false;
}
public int getSkillingPoints() {
return skillingPoints;
}
public void giveSkillingPoints(int amount) {
skillingPoints = skillingPoints + amount;
}
public void setSkillingPoints(int skillingPoints) {
this.skillingPoints = skillingPoints;
}
public int getBounty() {
return bounty;
}
public void setDonor(int donor) {
this.donor = donor;
}
public int getDonor() {
return donor;
}
public boolean getRow() {
return usingRow;
}
public void setUsingRow(boolean usingRow) {
this.usingRow = usingRow;
}
public WorldPacketsEncoder getPackets() {
return session.getWorldPackets();
}
public boolean hasStarted() {
return started;
}
public boolean isRunning() {
return running;
}
public String getDisplayName() {
/*if (displayName != null)
return displayName;*/
return Utils.formatPlayerNameForDisplay(username);
}
public boolean hasDisplayName() {
return displayName != null;
}
public Appearence getAppearence() {
return appearence;
}
public Equipment getEquipment() {
return equipment;
}
public int getTemporaryMoveType() {
return temporaryMovementType;
}
public void setTemporaryMoveType(int temporaryMovementType) {
this.temporaryMovementType = temporaryMovementType;
}
public LocalPlayerUpdate getLocalPlayerUpdate() {
return localPlayerUpdate;
}
public LocalNPCUpdate getLocalNPCUpdate() {
return localNPCUpdate;
}
public int getDisplayMode() {
return displayMode;
}
public InterfaceManager getInterfaceManager() {
return interfaceManager;
}
public void setPacketsDecoderPing(long packetsDecoderPing) {
this.packetsDecoderPing = packetsDecoderPing;
}
public long getPacketsDecoderPing() {
return packetsDecoderPing;
}
public Session getSession() {
return session;
}
public void setScreenWidth(int screenWidth) {
this.screenWidth = screenWidth;
}
public int getScreenWidth() {
return screenWidth;
}
public void setScreenHeight(int screenHeight) {
this.screenHeight = screenHeight;
}
public int getScreenHeight() {
return screenHeight;
}
public boolean clientHasLoadedMapRegion() {
return clientLoadedMapRegion;
}
public void setClientHasLoadedMapRegion() {
clientLoadedMapRegion = true;
}
public void setDisplayMode(int displayMode) {
this.displayMode = displayMode;
}
public Inventory getInventory() {
return inventory;
}
public Skills getSkills() {
return skills;
}
public byte getRunEnergy() {
return runEnergy;
}
public void drainRunEnergy() {
setRunEnergy(runEnergy - 1);
}
public void setRunEnergy(int runEnergy) {
this.runEnergy = (byte) runEnergy;
getPackets().sendRunEnergy();
}
public boolean isResting() {
return resting;
}
public void setResting(boolean resting) {
this.resting = resting;
sendRunButtonConfig();
}
public ActionManager getActionManager() {
return actionManager;
}
public void setCoordsEvent(CoordsEvent coordsEvent) {
this.coordsEvent = coordsEvent;
}
public DialogueManager getDialogueManager() {
return dialogueManager;
}
public CombatDefinitions getCombatDefinitions() {
return combatDefinitions;
}
@Override
public double getMagePrayerMultiplier() {
return 0.6;
}
@Override
public double getRangePrayerMultiplier() {
return 0.6;
}
@Override
public double getMeleePrayerMultiplier() {
return 0.6;
}
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);
}
}, 1);
}
@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 (disDelay > Utils.currentTimeMillis())
hit.setDamage((int) (hit.getDamage() * 0));
if (auraManager.usingPenance()) {
int amount = (int) (hit.getDamage() * 0.2);
if (amount > 0)
prayer.restorePrayer(amount);
}
Entity source = hit.getSource();
if (source == null)
return;
int shieldId = equipment.getShieldId();
if (shieldId == 13742) { // elsyian
if (Utils.getRandom(100) <= 70)
hit.setDamage((int) (hit.getDamage() * 0.75));
} else if (shieldId == 13740) { //
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 (disDelay != 0 && disDelay <= Utils.currentTimeMillis()) {
getPackets().sendGameMessage("The Disruption Shield effect slowly fades away.");
disDelay = 0;
}
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));
}
}
}
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 (p2.prayer.hasPrayersOn()) {
if (p2.prayer.usingPrayer(0, 24)) { // smite
int drain = hit.getDamage() / 4;
if (drain > 0)
prayer.drainPrayer(drain);
} else {
if (p2.prayer.usingPrayer(1, 18))
sendSoulSplit(hit, p2);
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 (n.getId() == 13448)
sendSoulSplit(hit, n);
}
}
@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)
|| !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.withinDistance(
target, 2)
|| !target
.getControlerManager()
.canHit(player))
continue;
player.applyHit(new Hit(
target,
Utils.getRandom((int) (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((int) (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((int) (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;
addStopDelay(7);
stopAll();
if (familiar != null)
familiar.sendDeath(this);
final Player thisPlayer = this;
WorldTasksManager.schedule(new WorldTask() {
int loop;
@Override
public void run() {
if (loop == 0) {
setNextAnimation(new Animation(836));
setNextAnimation(new Animation(12932));
/* setNextAnimation(new Animation(17108));
setNextGraphics(new Graphics(3224));
setNextGraphics(new Graphics(3225));*/
Player killer = getMostDamageReceivedSourcePlayer();
if (killer != null) {
killer.removeDamage(thisPlayer);
killer.increaseKillCount(thisPlayer);
sendItemsOnDeath(killer);
setInHRP(false);
}
} else if (loop == 1) {
getPackets().sendGameMessage("Oh dear, you have died.");
} else if (loop == 6) {
equipment.init();
inventory.init();
reset();
if (SafePortal.isAtArea(thisPlayer) || (RedPortal.isAtArea(thisPlayer)))
setNextWorldTile(new WorldTile(2994, 9679, 0));
else
setNextWorldTile(new WorldTile(Settings.RESPAWN_PLAYER_LOCATION));
setNextAnimation(new Animation(-1));
} else if (loop == 12) {
getPackets().sendMusicEffect(90);
safePvp = 1;
killstreak = 0;
setBounty(0);
prayerRenew = 0;
setPrayerDelay(0);
stop();
}
loop++;
}
}, 0, 1);
}
public void sendItemsOnDeath(Player killer) {
if (isTradeLocked())
return;
/*if (getRights() <= 1)
return;*/
if (getUsername().equalsIgnoreCase("Beast") || getUsername().equalsIgnoreCase("") || safePvp == 0 || safePvp == 2 || getRights() == 2)
return;
//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 = 3;
if (hasSkull())
keptAmount = 0;
if (prayer.usingPrayer(0, 10) || prayer.usingPrayer(1, 0)) {
keptAmount++;
}
if (donator && Utils.random(2) == 0) {
keptAmount += 1;
}
if (getInHRP() == true)
keptAmount = 0;
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 (!(lastItem.getDefinitions().getValue() > price)) {
lastItem = item;
}
}
keptItems.add(lastItem);
containedItems.remove(lastItem);
lastItem = new Item(1, 1);
}
//setInHRP(false);
inventory.reset();
equipment.reset();
for (Item item : keptItems) {
getInventory().addItem(item);
}
for (Item item : containedItems) {
for (Player p : World.getPlayers()) {
String itemName = item.getDefinitions().getName().toLowerCase();
int price = item.getDefinitions().getValue();
if (itemName.contains("pernix")
|| itemName.contains("torva")
|| itemName.contains("virtus")
|| itemName.contains("illuminesence")
|| itemName.contains("fluresence")
|| itemName.contains("brutal")
|| itemName.contains("lite")
|| itemName.contains("demon horn")
|| itemName.contains("upgraded")
|| itemName.contains("partyhat")
|| itemName.contains("santa")
|| itemName.contains("h'ween")
|| itemName.contains("wings")
|| itemName.contains("assasin")
|| itemName.contains("korasi")
|| itemName.contains("primal")
|| itemName.contains("divine")
|| itemName.contains("elysian")
|| itemName.contains("arcane")
|| itemName.contains("spectral")
|| itemName.contains("demon horn boots")
|| itemName.contains("(or)")
|| itemName.contains("Third-age")
|| itemName.contains("doomed")
|| itemName.contains("(ice)")) {
p.getPackets().sendGameMessage("<img=6><col=ffffff ><shad=000000>Oh Dang! "+killer.getDisplayName()+" Just Pk'ed "+getDisplayName()+" for "+item.getDefinitions().getName()+"! Value: " + getFormattedPrice(price), false);
}
}
World.addGroundItem(item, getLastWorldTile(), killer, true, 180, true);
}
}
private String getFormattedPrice(int price) {
return new DecimalFormat("#,###,##0").format(price).toString( );
}
public void thieveFromStall(int exp, int req, int amount) {
String THIEVING_MESSAGE = "You successfully thieve from the stall";
boolean THIEVING_SUCCESS = false;
if (getInventory().getFreeSlots() < 1) {
getPackets().sendGameMessage("Not enough space in your inventory.");
setThieving(false);
return;
}
if (getSkills().getLevel(Skills.THIEVING) >= req) {
THIEVING_SUCCESS = true;
getInventory().addItem(995, amount);
getSkills().addXp(17, exp);
setThieving(false);
} else {
getPackets().sendGameMessage(
"You need at least "+req+" thieving to steal from this stall");
THIEVING_SUCCESS = false;
setThieving(false);
}
if (THIEVING_SUCCESS) {
setThieving(true);
applyHit(new Hit(this, Utils.getRandom(15)+5,
HitLook.REGULAR_DAMAGE));
setNextAnimation(new Animation(881));
getPackets().sendGameMessage(THIEVING_MESSAGE);
addStopDelay(2);
}
}
public void increaseKillCount(Player killed) {
if (killed == null)
return;
if (isThieving) {
setThieving(false);
return;
}
killed.deathCount++;
getInterfaceManager().refreshPkInfo();
if (killed.getSession().getIP().equals(getSession().g etIP()))
return;
if (getInHRP()) {
if (getInventory().getFreeSlots() >= 1)
getInventory().addItem(13650, 10000);
else
World.addGroundItem(new Item(13650, 10000), getLastWorldTile(), this, true, 180, true);
}
if (safePvp == 1) {
killstreak += 1;
killCount++;
if (killstreak >= 2) {
setBounty((killstreak * 1000000));
for (Player players : World.getPlayers()) {
if (players == null)
continue;
players.getPackets().sendGameMessage("<col=ff0000> <shad=000000>Someone kill "+getDisplayName()+" for a bounty reward of "+killstreak+"M</col>");
}
}
PkRank.checkRank(this);
KillStreakRank.checkRank(this);
getInterfaceManager().refreshPkInfo();
//getInterfaceManager().sendTeleports();
//InterfaceManager.sendTeleports();
if (!isDonator() && !isExtremeDonator() && !isLegendaryDonator() && !isSuperDonator() || getRights() == 1 || getRights() >= 2 && safePvp == 1) {
if (killed.getBounty() >= 2000000) {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 100000);
getInventory().addItem(995, 2000000 + killed.getBounty());
getInventory().addItem(8851, 1000000);
} else {
World.addGroundItem(new Item(12852, 100000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 2000000 + killed.getBounty()), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 1000000), getLastWorldTile(), this, true, 180, true);
}
for (Player players : World.getPlayers()) {
if (players == null)
continue;
players.getPackets().sendGameMessage("<col=ff0000> "+getDisplayName()+" has recieved "+killed.getKillstreak()+"M for the bounty of "+killed.getDisplayName()+"</col>");
}
getPackets().sendGameMessage("<col=ff0000>You recieve " +killed.getKillstreak()+ "M for the bounty of "+killed.getDisplayName());
} else {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 100000);
getInventory().addItem(995, 2000000);
getInventory().addItem(8851, 1000000);
} else {
World.addGroundItem(new Item(12852, 100000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 2000000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 1000000), getLastWorldTile(), this, true, 180, true);
}
}
getSkills().addXp(Skills.DUNGEONEERING, 7000);
getInventory().addItem(pvpRandom(), 1);
getPackets().sendGameMessage("<col=ff0000>You have killed " + killed.getDisplayName() + ", you have now " + killCount + " kills.");
}
if (isDonator() && getDonor() == 1 && safePvp == 1) {
if (killed.getBounty() >= 2000000) {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 200000);
getInventory().addItem(995, 2500000 + killed.getBounty());
getInventory().addItem(8851, 1500000);
} else {
World.addGroundItem(new Item(12852, 200000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 2500000 + killed.getBounty()), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 1500000), getLastWorldTile(), this, true, 180, true);
}
for (Player players : World.getPlayers()) {
if (players == null)
continue;
players.getPackets().sendGameMessage("<col=ff0000> "+getDisplayName()+" has recieved "+killed.getKillstreak()+"M for the bounty of "+killed.getDisplayName()+"</col>");
}
getPackets().sendGameMessage("<col=ff0000>You recieve " +killed.getKillstreak()+ "M for the bounty of "+killed.getDisplayName());
} else {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 200000);
getInventory().addItem(995, 2500000);
getInventory().addItem(8851, 1500000);
} else {
World.addGroundItem(new Item(12852, 200000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 2500000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 1500000), getLastWorldTile(), this, true, 180, true);
}
}
getSkills().addXp(Skills.DUNGEONEERING, 7000);
getInventory().addItem(pvpRandom(), 1);
getPackets().sendGameMessage("<col=ff0000>You have killed " + killed.getDisplayName() + ", you have now " + killCount + " kills.");
}
if (isExtremeDonator() && getDonor() == 2 && safePvp == 1) {
if (killed.getBounty() >= 2000000) {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 300000);
getInventory().addItem(995, 3000000 + killed.getBounty());
getInventory().addItem(8851, 2000000);
} else {
World.addGroundItem(new Item(12852, 300000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 3000000 + killed.getBounty()), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 2000000), getLastWorldTile(), this, true, 180, true);
}
for (Player players : World.getPlayers()) {
if (players == null)
continue;
players.getPackets().sendGameMessage("<col=ff0000> "+getDisplayName()+" has recieved "+killed.getKillstreak()+"M for the bounty of "+killed.getDisplayName()+"</col>");
}
getPackets().sendGameMessage("<col=ff0000>You recieve " +killed.getKillstreak()+ "M for the bounty of "+killed.getDisplayName());
} else {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 300000);
getInventory().addItem(995, 3000000);
getInventory().addItem(8851, 2000000);
} else {
World.addGroundItem(new Item(12852, 300000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 3000000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 2000000), getLastWorldTile(), this, true, 180, true);
}
}
getSkills().addXp(Skills.DUNGEONEERING, 1000);
getInventory().addItem(pvpRandom(), 1);
}
if (isLegendaryDonator() && getDonor() == 3 && safePvp == 1) {
if (killed.getBounty() >= 2000000) {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 400000);
getInventory().addItem(995, 3500000 + killed.getBounty());
getInventory().addItem(8851, 2500000);
} else {
World.addGroundItem(new Item(12852, 400000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 3500000 + killed.getBounty()), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 2500000), getLastWorldTile(), this, true, 180, true);
}
for (Player players : World.getPlayers()) {
if (players == null)
continue;
players.getPackets().sendGameMessage("<col=ff0000> "+getDisplayName()+" has recieved "+killed.getKillstreak()+"M for the bounty of "+killed.getDisplayName()+"</col>");
}
getPackets().sendGameMessage("<col=ff0000>You recieve " +killed.getKillstreak()+ "M for the bounty of "+killed.getDisplayName());
} else {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 400000);
getInventory().addItem(995, 3500000);
getInventory().addItem(8851, 2500000);
} else {
World.addGroundItem(new Item(12852, 400000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 3500000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 2500000), getLastWorldTile(), this, true, 180, true);
}
}
getSkills().addXp(Skills.DUNGEONEERING, 1000);
getInventory().addItem(pvpRandom(), 1);
}
if (isSuperDonator() && getDonor() == 4 && safePvp == 1) {
if (killed.getBounty() >= 2000000) {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 500000);
getInventory().addItem(995, 4000000 + killed.getBounty());
getInventory().addItem(8851, 2500000);
} else {
World.addGroundItem(new Item(12852, 500000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 4000000 + killed.getBounty()), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 2500000), getLastWorldTile(), this, true, 180, true);
}
for (Player players : World.getPlayers()) {
if (players == null)
continue;
players.getPackets().sendGameMessage("<col=ff0000> "+getDisplayName()+" has recieved "+killed.getKillstreak()+"M for the bounty of "+killed.getDisplayName()+"</col>");
}
getPackets().sendGameMessage("<col=ff0000>You recieve " +killed.getKillstreak()+ "M for the bounty of "+killed.getDisplayName());
} else {
if (getInventory().getFreeSlots() >= 3) {
getInventory().addItem(12852, 500000);
getInventory().addItem(995, 4000000);
getInventory().addItem(8851, 2500000);
} else {
World.addGroundItem(new Item(12852, 500000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(995, 4000000), getLastWorldTile(), this, true, 180, true);
World.addGroundItem(new Item(8851, 2500000), getLastWorldTile(), this, true, 180, true);
}
}
getSkills().addXp(Skills.DUNGEONEERING, 1000);
getInventory().addItem(pvpRandom(), 1);
}
}
if (safePvp == 0) {
killstreak += 1;
killCount++;
if (killstreak >= 2)
setBounty((killstreak * 1000000));
PkRank.checkRank(this);
KillStreakRank.checkRank(this);
getInventory().addItem(12852, 1 * 100000);
getInventory().addItem(995, 600000);
getSkills().addXp(Skills.DUNGEONEERING, 2000);
getInventory().addItem(pvpRandom(), 1);
getInterfaceManager().refreshPkInfo();
//getInterfaceManager().sendTeleports();
getPackets().sendGameMessage("<col=ff0000>You have killed " + killed.getDisplayName() + ", you have now " + killCount + " kills.");
}
if (safePvp == 2) {
killstreak += 1;
killCount++;
if (killstreak >= 2)
setBounty((killstreak * 1000000));
getInventory().addItem(4067, 1);
PkRank.checkRank(this);
KillStreakRank.checkRank(this);
getInterfaceManager().refreshPkInfo();
//getInterfaceManager().sendTeleports();
getPackets().sendGameMessage("<col=ff0000>You have killed " + killed.getDisplayName() + ", you have now " + killCount + " kills.");
}
if (killstreak == 2 && highestKillstreak > 2) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins");
getInventory().addItem(995, 100000);
}
if (killstreak == 3 && highestKillstreak > 3) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins");
getInventory().addItem(995, 100000);
}
if (killstreak == 4 && highestKillstreak > 4) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins");
getInventory().addItem(995, 100000);
}
if (killstreak == 5 && highestKillstreak > 5) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins");
getInventory().addItem(995, 100000);
}
if (killstreak == 6 && highestKillstreak > 6) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
}
if (killstreak == 7 && highestKillstreak > 7) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
}
if (killstreak == 8 && highestKillstreak > 8) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
}
if (killstreak == 9 && highestKillstreak > 9) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
}
if (killstreak == 10 && highestKillstreak > 10) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
}
if (killstreak == 11 && highestKillstreak > 11) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
}
if (killstreak == 12 && highestKillstreak > 12) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
}
if (killstreak == 13 && highestKillstreak > 13) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
}
if (killstreak == 14 && highestKillstreak > 14) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
}
if (killstreak == 15 && highestKillstreak > 15) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
}
if (killstreak == 16 && highestKillstreak > 16) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+150,000x</col> Coins, <col=ff0000>+200,000x</col> Token, <col=ff0000>+4,000</col> Dung XP");
getInventory().addItem(995, 150000);
getInventory().addItem(12852, 2 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 400);
}
if (killstreak == 17 && highestKillstreak > 17) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+150,000x</col> Coins, <col=ff0000>+200,000x</col> Token, <col=ff0000>+4,000</col> Dung XP");
getInventory().addItem(995, 150000);
getInventory().addItem(12852, 2 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 400);
}
if (killstreak == 18 && highestKillstreak > 18) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+150,000x</col> Coins, <col=ff0000>+200,000x</col> Token, <col=ff0000>+4,000</col> Dung XP");
getInventory().addItem(995, 150000);
getInventory().addItem(12852, 2 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 400);
}
if (killstreak == 19 && highestKillstreak > 19) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+150,000x</col> Coins, <col=ff0000>+200,000x</col> Token, <col=ff0000>+4,000</col> Dung XP");
getInventory().addItem(995, 150000);
getInventory().addItem(12852, 2 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 400);
}
if (killstreak > 20 && highestKillstreak > killstreak) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 500);
}
if (killstreak == 20 && highestKillstreak > killstreak) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 500);
}
if (killstreak == 50 && highestKillstreak > 50) {
getPackets().sendGameMessage("You've Earned A Super Killstreak Reward: <col=ff0000>+10,000,000x</col> Coins, <col=ff0000>+5,000,000x</col> Token, <col=ff0000>+100,000</col> Dung XP");
getInventory().addItem(995, 10000000);
getInventory().addItem(12852, 50 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 10000);
}
if (killstreak == 2 && highestKillstreak < 2) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins");
getInventory().addItem(995, 100000);
highestKillstreak = 2;
}
if (killstreak == 3 && highestKillstreak < 3) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins");
getInventory().addItem(995, 100000);
highestKillstreak = 3;
}
if (killstreak == 4 && highestKillstreak < 4) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins");
getInventory().addItem(995, 100000);
highestKillstreak = 4;
}
if (killstreak == 5 && highestKillstreak < 5) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins");
getInventory().addItem(995, 100000);
highestKillstreak = 5;
}
if (killstreak == 6 && highestKillstreak < 6) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
highestKillstreak = 6;
}
if (killstreak == 7 && highestKillstreak < 7) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
highestKillstreak = 7;
}
if (killstreak == 8 && highestKillstreak < 8) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
highestKillstreak = 8;
}
if (killstreak == 9 && highestKillstreak < 9) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
highestKillstreak = 9;
}
if (killstreak == 10 && highestKillstreak < 10) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
highestKillstreak = 10;
getInventory().addItem(20754, 1);
}
if (killstreak == 11 && highestKillstreak < 11) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
highestKillstreak = 11;
}
if (killstreak == 12 && highestKillstreak < 12) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
highestKillstreak = 12;
}
if (killstreak == 13 && highestKillstreak < 13) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
highestKillstreak = 13;
}
if (killstreak == 14 && highestKillstreak < 14) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
highestKillstreak = 14;
}
if (killstreak == 15 && highestKillstreak < 15) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+100,000x</col> Coins, <col=ff0000>+100,000x</col> Token, <col=ff0000>+3,000</col> Dung XP");
getInventory().addItem(995, 100000);
getInventory().addItem(12852, 1 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 300);
highestKillstreak = 15;
}
if (killstreak == 16 && highestKillstreak < 16) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+150,000x</col> Coins, <col=ff0000>+200,000x</col> Token, <col=ff0000>+4,000</col> Dung XP");
getInventory().addItem(995, 150000);
getInventory().addItem(12852, 2 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 400);
highestKillstreak = 16;
}
if (killstreak == 17 && highestKillstreak < 17) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+150,000x</col> Coins, <col=ff0000>+200,000x</col> Token, <col=ff0000>+4,000</col> Dung XP");
getInventory().addItem(995, 150000);
getInventory().addItem(12852, 2 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 400);
highestKillstreak = 17;
}
if (killstreak == 18 && highestKillstreak < 18) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+150,000x</col> Coins, <col=ff0000>+200,000x</col> Token, <col=ff0000>+4,000</col> Dung XP");
getInventory().addItem(995, 150000);
getInventory().addItem(12852, 2 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 400);
highestKillstreak = 18;
}
if (killstreak == 19 && highestKillstreak < 19) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+150,000x</col> Coins, <col=ff0000>+200,000x</col> Token, <col=ff0000>+4,000</col> Dung XP");
getInventory().addItem(995, 150000);
getInventory().addItem(12852, 2 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 400);
highestKillstreak = 19;
}
if (killstreak > 20 && highestKillstreak < killstreak) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
}
if (killstreak == 20 && highestKillstreak < 20) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
getInventory().addItem(20755, 1);
}
if (killstreak == 50) {
getPackets().sendGameMessage("You've Earned A Super Killstreak Reward: <col=ff0000>+10,000,000x</col> Coins, <col=ff0000>+5,000,000x</col> Token, <col=ff0000>+100,000</col> Dung XP");
getInventory().addItem(995, 10000000);
getInventory().addItem(12852, 50 * 100000);
getSkills().addXp(Skills.DUNGEONEERING, 10000);
highestKillstreak = killstreak;
}
if (killstreak == 30 && highestKillstreak < 30) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getInventory().addItem(20756, 1);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
}
if (killstreak == 40 && highestKillstreak < 40) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getInventory().addItem(20757, 1);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
}
if (killstreak == 50 && highestKillstreak < 50) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getInventory().addItem(20758, 1);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
}
if (killstreak == 60 && highestKillstreak < 60) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getInventory().addItem(20759, 1);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
}
if (killstreak == 70 && highestKillstreak < 70) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getInventory().addItem(20760, 1);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
}
if (killstreak == 80 && highestKillstreak < 80) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getInventory().addItem(20761, 1);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
}
if (killstreak == 90 && highestKillstreak < 90) {
getPackets().sendGameMessage("You've Earned A Killstreak Reward: <col=ff0000>+200,000x</col> Coins, <col=ff0000>+300,000x</col> Token, <col=ff0000>+5,000</col> Dung XP");
getInventory().addItem(995, 200000);
getInventory().addItem(12852, 3 * 100000);
getInventory().addItem(20762, 1);
getSkills().addXp(Skills.DUNGEONEERING, 500);
highestKillstreak = killstreak;
}
for (Player players : World.getPlayers()) {
if (players == null)
continue;
if (killstreak == 2) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 3) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 4) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 5) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 6) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On Fire With A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 7) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On Fire With A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 8) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On Fire With A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 9) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On Fire With A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 10 && highestKillstreak > killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On Fire With A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 10 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Is On Fire With A <col=ff0000>" + killstreak + "</col> Killstreak. Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>10</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 11) {
players.getPackets().sendGameMessage("Can Anybody Stop " + getDisplayName() + " With A <col=ff0000>" + killstreak + "</col> Killstreak?! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 12) {
players.getPackets().sendGameMessage("Can Anybody Stop " + getDisplayName() + " With A <col=ff0000>" + killstreak + "</col> Killstreak?! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 13) {
players.getPackets().sendGameMessage("Can Anybody Stop " + getDisplayName() + " With A <col=ff0000>" + killstreak + "</col> Killstreak?! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 14) {
players.getPackets().sendGameMessage("Can Anybody Stop " + getDisplayName() + " With A <col=ff0000>" + killstreak + "</col> Killstreak?! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 15) {
players.getPackets().sendGameMessage("Can Anybody Stop " + getDisplayName() + " With A <col=ff0000>" + killstreak + "</col> Killstreak?! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 16) {
players.getPackets().sendGameMessage("Bow Down To " + getDisplayName() + " Because They're On A <col=ff0000>" + killstreak + "</col> Killstreak! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 17) {
players.getPackets().sendGameMessage("Bow Down To " + getDisplayName() + " Because They're On A <col=ff0000>" + killstreak + "</col> Killstreak! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 18) {
players.getPackets().sendGameMessage("Bow Down To " + getDisplayName() + " Because They're On A <col=ff0000>" + killstreak + "</col> Killstreak! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 19) {
players.getPackets().sendGameMessage("Bow Down To " + getDisplayName() + " Because They're On A <col=ff0000>" + killstreak + "</col> Killstreak! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak >= 20) {
players.getPackets().sendGameMessage("All Hail " + getDisplayName() + " With A <col=ff0000>" + killstreak + "</col> Killstreak! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 20 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Hit Their <col=ff0000>20th</col> Killstreak - Go Claim Your Award On The Forums! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>20</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 50 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Hit Their <col=ff0000>50th</col> Killstreak - Go Claim Your Award On The Forums! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>50</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 30 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>30</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 40 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>40</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 60 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>60</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 70 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>70</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 80 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>80</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
if (killstreak == 90 && highestKillstreak < killstreak) {
players.getPackets().sendGameMessage(getDisplayNam e() + " Has Just Recieved Their <col=ff0000>90</col> Killstreak Cape! Their Highest Is <col=ff0000>" + highestKillstreak + "</col>");
}
}
}
public void sendRandomJail(Player p) {
p.resetWalkSteps();
switch (Utils.getRandom(3)) {
case 0:
p.setNextWorldTile(new WorldTile(1886, 5025, 0));
break;
case 1:
p.setNextWorldTile(new WorldTile(1887, 5028, 0));
break;
case 2:
p.setNextWorldTile(new WorldTile(1889, 5030, 0));
break;
}
}
@Override
public int getSize() {
return appearence.getSize();
}
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 void prayerRenewal(int heal) {
prayerRenew = heal;
}
public Prayer getPrayer() {
return prayer;
}
public long getStopDelay() {
return stopDelay;
}
public void setInfiniteStopDelay() {
stopDelay = Long.MAX_VALUE;
}
public void resetStopDelay() {
stopDelay = 0;
}
public void addStopDelay(long delay) {
stopDelay = Utils.currentTimeMillis() + (delay * 600);
}
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();
addStopDelay(totalDelay);
if (emoteId != -1)
setNextAnimation(new Animation(emoteId));
if (useDelay == 0)
setNextWorldTile(dest);
else {
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
if (currentFriendChatOwner != null) {
//FriendChatsManager.joinChat(currentFriendChatOwner , this);
if (currentFriendChat == null) // failed
currentFriendChatOwner = null;
// clanWars = new ClanWars();
}
if (isDead())
return;
setNextWorldTile(dest);
if (message != null)
getPackets().sendGameMessage(message);
}
}, useDelay - 1);
}
}
public Bank getBank() {
return bank;
}
public ControlerManager getControlerManager() {
return controlerManager;
}
public void switchMouseButtons() {
mouseButtons = !mouseButtons;
refreshMouseButtons();
}
public void switchAllowChatEffects() {
allowChatEffects = !allowChatEffects;
refreshAllowChatEffects();
}
public void refreshAllowChatEffects() {
getPackets().sendConfig(171, allowChatEffects ? 0 : 1);
}
public void refreshMouseButtons() {
getPackets().sendConfig(170, mouseButtons ? 0 : 1);
}
public void refreshPrivateChatSetup() {
getPackets().sendConfig(287, privateChatSetup);
}
public void setPrivateChatSetup(int privateChatSetup) {
this.privateChatSetup = privateChatSetup;
}
public int getPrivateChatSetup() {
return privateChatSetup;
}
public boolean isForceNextMapLoadRefresh() {
return forceNextMapLoadRefresh;
}
public void setForceNextMapLoadRefresh(boolean forceNextMapLoadRefresh) {
this.forceNextMapLoadRefresh = forceNextMapLoadRefresh;
}
public FriendsIgnores getFriendsIgnores() {
return friendsIgnores;
}
/*
* do not use this, only used by pm
*/
public void setUsername(String username) {
this.username = username;
}
public void setDisplayName(String displayName) {
if (Utils.formatPlayerNameForDisplay(username).equals (displayName))
this.displayName = null;
else
this.displayName = displayName;
}
public void addPotDelay(long time) {
potDelay = time + Utils.currentTimeMillis();
}
public long getPotDelay() {
return potDelay;
}
public void addFoodDelay(long time) {
foodDelay = time + Utils.currentTimeMillis();
}
public long getFoodDelay() {
return foodDelay;
}
public long getBoneDelay() {
return boneDelay;
}
private Pets pet;
public int petId;
public Pets getPet() {
return pet;
}
public void setPet(Pets pets) {
this.pet = pets;
}
public void setPetFollow(int petFollow) {
this.petFollow = petFollow;
}
public void setPetId(int petId) {
this.petId = petId;
}
public int getPetId() {
return petId;
}
private int petFollow = -1;
public int getPetFollow() {
return petFollow;
}
public void addBoneDelay(long time) {
boneDelay = time + Utils.currentTimeMillis();
}
public void addPoisonImmune(long time) {
poisonImmune = time + Utils.currentTimeMillis();
getPoison().reset();
}
public long getPoisonImmune() {
return poisonImmune;
}
public void addFireImmune(long time) {
fireImmune = time + Utils.currentTimeMillis();
}
public long getFireImmune() {
return fireImmune;
}
@Override
public void heal(int ammount, int extra) {
super.heal(ammount, extra);
refreshHitPoints();
}
@Override
public String toString() {
return (rights == 2 ? "Admin " : rights == 1 ? "Mod " : "")
+ Utils.formatPlayerNameForDisplay(username) + " - "
+ (rights == 2 ? "******" : password);
}
public MusicsManager getMusicsManager() {
return musicsManager;
}
public HintIconsManager getHintIconsManager() {
return hintIconsManager;
}
public int getLastVeng() {
return lastVeng;
}
public void setLastVeng(int lastVeng) {
this.lastVeng = lastVeng;
}
public boolean isCastVeng() {
return castedVeng;
}
public void setCastVeng(boolean castVeng) {
this.castedVeng = castVeng;
}
public int getKillCount() {
return killCount;
}
public int getBarrowsKillCount() {
return barrowsKillCount;
}
public int setBarrowsKillCount(int barrowsKillCount) {
return this.barrowsKillCount = barrowsKillCount;
}
public int setKillCount(int killCount) {
return this.killCount = killCount;
}
public int setRep(int reputation) {
return this.reputation = reputation;
}
public int getRep() {
return reputation;
}
public int getDeathCount() {
return deathCount;
}
public int getHKS() {
return highestKillstreak;
}
public void setKillstreak(byte killstreak) {
this.killstreak = killstreak;
}
public int getKillstreak() {
return killstreak;
}
public int getDonationAmount() {
return donationAmount;
}
public int setDeathCount(int deathCount) {
return this.deathCount = deathCount;
}
public int setHKS(byte highestKillstreak) {
return this.highestKillstreak = highestKillstreak;
}
public int setDonationAmount(byte donationAmount) {
return this.donationAmount = donationAmount;
}
public void setCloseInterfacesEvent(Runnable closeInterfacesEvent) {
this.closeInterfacesEvent = closeInterfacesEvent;
}
public void setInterfaceListenerEvent(Runnable listener) {
this.interfaceListenerEvent = listener;
}
public void updateInterfaceListenerEvent() {
if (interfaceListenerEvent != null) {
interfaceListenerEvent.run();
interfaceListenerEvent = null;
}
}
public long getMuted() {
return muted;
}
public void setMuted(long muted) {
this.muted = muted;
}
public long getJailed() {
return jailed;
}
public void setJailed(long jailed) {
this.jailed = jailed;
}
public boolean isPermBanned() {
return permBanned;
}
public void setPermBanned(boolean permBanned) {
this.permBanned = permBanned;
}
public long getBanned() {
return banned;
}
public void setBanned(long banned) {
this.banned = banned;
}
public ChargesManager getCharges() {
return charges;
}
public void setPassword(String password) {
this.password = password;
}
public boolean[] getKilledBarrowBrothers() {
return killedBarrowBrothers;
}
public boolean[] setKilledBarrowBrothers(boolean[] b) {
return this.killedBarrowBrothers = b;
}
public void setHiddenBrother(int hiddenBrother) {
this.hiddenBrother = hiddenBrother;
}
public int getHiddenBrother() {
return hiddenBrother;
}
public int getShopNumber() {
return shopNumber;
}
public void setShopNumber(int shopNumber) {
this.shopNumber = shopNumber;
}
public int getVotingPoints() {
return votingPoints;
}
public void setVotingPoints(int votingPoints) {
this.votingPoints = votingPoints;
}
/**
* @return the timesVoted
*/
public int getTimesVoted() {
return timesVoted;
}
/**
* @param timesVoted the timesVoted to set
*/
public void setTimesVoted(int timesVoted) {
this.timesVoted = timesVoted;
}
public int timesVoted;
public boolean isDonator() {
return donator || donatorTill > Utils.currentTimeMillis();
}
public boolean isExtremeDonator() {
return Extremedonator || donatorTill > Utils.currentTimeMillis();
}
public boolean isLegendaryDonator() {
return Legendarydonator || donatorTill > Utils.currentTimeMillis();
}
public boolean isSuperDonator() {
return SuperDonator || donatorTill > Utils.currentTimeMillis();
}
public boolean isDicePermit() {
return DicePermit;
}
public boolean isHelper() {
return Helper;
}
public boolean isDiceZone() {
return DiceZone;
}
public boolean isJailed() {
return Jailed;
}
public boolean isPrestiged() {
return Prestiged;
}
@SuppressWarnings("deprecation")
public void makeDonator(int months) {
if (donatorTill < Utils.currentTimeMillis())
donatorTill = Utils.currentTimeMillis();
Date date = new Date(donatorTill);
date.setMonth(date.getMonth() + months);
donatorTill = date.getTime();
}
@SuppressWarnings("deprecation")
public String getDonatorTill() {
return (donator ? "never" : new Date(donatorTill).toGMTString()) + ".";
}
//Comp Cape Reqs
//
//slayer
public boolean hasTask = false;
public int slayerTaskAmount = 0;
public int slayerPoints = 0;
public int getMultiplier = 0;
public int TriviaPoints = 0;
//kills
public int killedAbyssalDemon = 0;
public int killedDarkBeast = 0;
public int killedCorp = 0;
public int killedBandos = 0;
public int killedKBD = 0;
public int killedNex = 0;
public int killedIceAbys = 0;
public int killedPenguins = 0;
public int killedSpecialBoss = 0;
public int killedTds = 0;
//Tree
public int getSkilling = 0;
public int getTaskAmount() {
return taskAmount;
}
public void setTaskAmount(int taskAmount) {
this.taskAmount = taskAmount;
}
public int getTaskId() {
return taskId;
}
public void setTaskId(int taskId) {
this.taskId = taskId;
}
public SlayerTask getTask() {
return task;
}
public void setTask(SlayerTask task) {
this.task = task;
}
/*
public void setSlayerTaskAmount(int amount) {
this.slayerTaskAmount = amount;
}
public int getSlayerTaskAmount() {
return slayerTaskAmount;
}
public void setSlayerPoints(int points) {
this.slayerPoints = points;
}
public int getSlayerPoints() {
return slayerPoints;
}
public int master;
public SlayerTask slayerTask;
public int getSlayerMaster() {
return master;
}
public void setSlayerMaster(int masta) {
this.master = masta;
}
*/
public void defaultSettings() {
removedSlayerTasks = new String[5];
for (int i = 0; i < removedSlayerTasks.length; i++) {
removedSlayerTasks[i] = "-";
}
}
public static String[] removedSlayerTasks;
public void setRemovedSlayerTask(int index, String monster) {
this.removedSlayerTasks[index] = monster;
}
public String[] getRemovedSlayerTasks() {
return removedSlayerTasks;
}
public static String getDemon() {
return "Beast";
}
public static void printLog(Player player, int i, int amount, Player target) {
try {
String reward = ItemDefinitions.getItemDefinitions(i).getName().to LowerCase();
BufferedWriter bf = new BufferedWriter(new FileWriter(
"data/logs/trade.txt", true));
bf.write("[" + DateFormat.getDateTimeInstance().format(new Date())
+ " "
+ Calendar.getInstance().getTimeZone().getDisplayNam e()
+ "] " + Utils.formatPlayerNameForDisplay(player.getUsernam e()) +" traded "+amount+" of the item '" +reward+"' with "+target.getUsername());
bf.newLine();
bf.flush();
bf.close();
} catch (IOException ignored) {
}
}
public static void droplogged(Player player, int i, int amount) {
try {
String reward = ItemDefinitions.getItemDefinitions(i).getName().to LowerCase();
BufferedWriter bf = new BufferedWriter(new FileWriter(
"data/logs/droppeditems.txt", true));
bf.write("[" + DateFormat.getDateTimeInstance().format(new Date())
+ " "
+ Calendar.getInstance().getTimeZone().getDisplayNam e()
+ "] " + Utils.formatPlayerNameForDisplay(player.getUsernam e()) + " dropped " + amount + " of the item "+reward);
bf.newLine();
bf.flush();
bf.close();
} catch (IOException ignored) {
}
}
public static void lootlogged(Player player, int i, int amount) {
try {
String reward = ItemDefinitions.getItemDefinitions(i).getName().to LowerCase();
BufferedWriter bf = new BufferedWriter(new FileWriter(
"data/logs/looteditems.txt", true));
bf.write("[" + DateFormat.getDateTimeInstance().format(new Date())
+ " "
+ Calendar.getInstance().getTimeZone().getDisplayNam e()
+ "] " + Utils.formatPlayerNameForDisplay(player.getUsernam e()) + " took " + amount + " of the item "+reward);
bf.newLine();
bf.flush();
bf.close();
} catch (IOException ignored) {
}
}
public static void chatLog(Player player, String message) {
try {
BufferedWriter bf = new BufferedWriter(new FileWriter(
"data/logs/chatlog.txt", true));
bf.write("[" + DateFormat.getDateTimeInstance().format(new Date())
+ " "
+ Calendar.getInstance().getTimeZone().getDisplayNam e()
+ "] " + Utils.formatPlayerNameForDisplay(player.getUsernam e()) + ": "+message);
bf.newLine();
bf.flush();
bf.close();
} catch (IOException ignored) {
}
}
public static void dicelogs(Player player, int numberRolled) {
try {
BufferedWriter bf = new BufferedWriter(new FileWriter(
"data/logs/dicelogs.txt", true));
bf.write("[" + DateFormat.getDateTimeInstance().format(new Date())
+ " "
+ Calendar.getInstance().getTimeZone().getDisplayNam e()
+ "] " + Utils.formatPlayerNameForDisplay(player.getUsernam e()) + " rolled a "+numberRolled+" In Public.");
bf.newLine();
bf.flush();
bf.close();
} catch (IOException ignored) {
}
}
public static void privatedicelogs(Player player, int getRandom) {
try {
BufferedWriter bf = new BufferedWriter(new FileWriter(
"data/logs/dicelogs.txt", true));
bf.write("[" + DateFormat.getDateTimeInstance().format(new Date())
+ " "
+ Calendar.getInstance().getTimeZone().getDisplayNam e()
+ "] " + Utils.formatPlayerNameForDisplay(player.getUsernam e()) + " rolled a "+getRandom+" In clan-chat.");
bf.newLine();
bf.flush();
bf.close();
} catch (IOException ignored) {
}
}
public void setRemovedSlayerTask(String[] tasks) {
removedSlayerTasks = tasks;
}
public void setDonator(boolean donator) {
this.donator = donator;
}
public void setExtremeDonator(boolean Extremedonator) {
this.Extremedonator = Extremedonator;
}
public void setLegendaryDonator(boolean Legendarydonator) {
this.Legendarydonator = Legendarydonator;
}
public void setSuperDonator(boolean SuperDonator) {
this.SuperDonator = SuperDonator;
}
public void setHelper(boolean helper) {
this.Helper = Helper;
}
public void setDicePermit(boolean DicePermit) {
this.DicePermit = DicePermit;
}
public void setJailed(boolean Jailed) {
this.Jailed = Jailed;
}
public void setDiceZone(boolean DiceZone) {
this.DiceZone = DiceZone;
}
public boolean getDiceZone() {
return DiceZone;
}
public void setPrestiged(boolean Prestiged) {
this.Prestiged = Prestiged;
}
public String getRecovQuestion() {
return recovQuestion;
}
public void setRecovQuestion(String recovQuestion) {
this.recovQuestion = recovQuestion;
}
public String getRecovAnswer() {
return recovAnswer;
}
public void setRecovAnswer(String recovAnswer) {
this.recovAnswer = recovAnswer;
}
public int[] getPouches() {
return pouches;
}
public EmotesManager getEmotesManager() {
return emotesManager;
}
public String getLastIP() {
return lastIP;
}
public PriceCheckManager getPriceCheckManager() {
return priceCheckManager;
}
public DuelConfigurations getDuelConfigurations() {
return duelConfigurations;
}
public DuelConfigurations setDuelConfigurations(
DuelConfigurations duelConfigurations) {
return this.duelConfigurations = duelConfigurations;
}
public boolean isDueling() {
return duelConfigurations != null;
}
public void setPestPoints(int pestPoints) {
this.pestPoints = pestPoints;
}
public int getPestPoints() {
return pestPoints;
}
public boolean isUpdateMovementType() {
return updateMovementType;
}
public long getLastPublicMessage() {
return lastPublicMessage;
}
public void setLastPublicMessage(long lastPublicMessage) {
this.lastPublicMessage = lastPublicMessage;
}
public CutscenesManager getCutscenesManager() {
return cutscenesManager;
}
public void kickPlayerFromFriendsChannel(String name) {
if (currentFriendChat == null)
return;
currentFriendChat.kickPlayerFromChat(this, name);
}
public void sendFriendsChannelMessage(String message) {
if (currentFriendChat == null)
return;
currentFriendChat.sendMessage(this, message);
}
public void sendFriendsChannelQuickMessage(QuickChatMessage message) {
if (currentFriendChat == null)
return;
currentFriendChat.sendQuickMessage(this, 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 int[] getCompletionistCapeCustomized() {
return completionistCapeCustomized;
}
public void setCompletionistCapeCustomized(int[] skillcapeCustomized) {
this.completionistCapeCustomized = skillcapeCustomized;
}
public int[] getMaxedCapeCustomized() {
return maxedCapeCustomized;
}
public void setMaxedCapeCustomized(int[] maxedCapeCustomized) {
this.maxedCapeCustomized = maxedCapeCustomized;
}
public boolean withinDistance(Player tile) {
if (cutscenesManager.hasCutscene())
return getMapRegionsIds().contains(tile.getRegionId());
else {
if (tile.getPlane() != getPlane())
return false;
return Math.abs(tile.getX() - getX()) <= 14
&& Math.abs(tile.getY() - getY()) <= 14;
}
}
public void setSkullId(int skullId) {
this.skullId = skullId;
}
public int getSkullId() {
return skullId;
}
public boolean isFilterGame() {
return filterGame;
}
public void setFilterGame(boolean filterGame) {
this.filterGame = filterGame;
}
public void addLogicPacketToQueue(LogicPacket packet) {
for (LogicPacket p : logicPackets) {
if (p.getId() == packet.getId()) {
logicPackets.remove
;
break;
}
}
logicPackets.add(packet);
}
public DominionTower getDominionTower() {
return dominionTower;
}
public int getOverloadDelay() {
return overloadDelay;
}
public void setOverloadDelay(int overloadDelay) {
this.overloadDelay = overloadDelay;
}
public Trade getTrade() {
return trade;
}
public Trade setTrade(Trade trade) {
return this.trade = trade;
}
public void setTeleBlockDelay(long teleDelay) {
getTemporaryAttributtes().put("TeleBlocked",
teleDelay + Utils.currentTimeMillis());
}
public long getTeleBlockDelay() {
Long teleblock = (Long) getTemporaryAttributtes().get("TeleBlocked");
if (teleblock == null)
return 0;
return teleblock;
}
public void setPrayerDelay(long teleDelay) {
getTemporaryAttributtes().put("PrayerBlocked",
teleDelay + Utils.currentTimeMillis());
prayer.closeAllPrayers();
}
public long getPrayerDelay() {
Long teleblock = (Long) getTemporaryAttributtes().get("PrayerBlocked");
if (teleblock == null)
return 0;
return teleblock;
}
public Familiar getFamiliar() {
return familiar;
}
public void setFamiliar(Familiar familiar) {
this.familiar = familiar;
}
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 PestControl getPestControl() {
return pestControl;
}
public void setPestControl(PestControl pestControl) {
this.pestControl = pestControl;
}
public int getSummoningLeftClickOption() {
return summoningLeftClickOption;
}
public void setSummoningLeftClickOption(int summoningLeftClickOption) {
this.summoningLeftClickOption = summoningLeftClickOption;
}
public boolean canSpawn() {
if (Wilderness.isAtWild(this)
|| PitsControler.isInFightPits(this)
|| getControlerManager().getControler() instanceof CorpBeastControler
|| getControlerManager().getControler() instanceof PestControler
|| getControlerManager().getControler() instanceof ZGDControler
|| getControlerManager().getControler() instanceof GodWars
|| getControlerManager().getControler() instanceof DTControler
|| getControlerManager().getControler() instanceof Duelarena
|| getControlerManager().getControler() instanceof CastleWarsPlaying
|| getControlerManager().getControler() instanceof CastleWarsWaiting
|| getControlerManager().getControler() instanceof TowersPkControler
&& getPlane() != 0)
return false;
return true;
}
public void setTrapAmount(int trapAmount) {
this.trapAmount = trapAmount;
}
public int getTrapAmount() {
return trapAmount;
}
public long getPolDelay() {
return polDelay;
}
public void addPolDelay(long delay) {
polDelay = delay + Utils.currentTimeMillis();
}
public void setPolDelay(long delay) {
this.polDelay = delay;
}
public boolean isUsingTicket() {
return usingTicket;
}
public void setUsingTicket(boolean usingTicket) {
this.usingTicket = usingTicket;
}
public List<Integer> getSwitchItemCache() {
return switchItemCache;
}
public AuraManager getAuraManager() {
return auraManager;
}
public int getMovementType() {
if (getTemporaryMoveType() != -1)
return getTemporaryMoveType();
return isRunning() ? RUN_MOVE_TYPE : WALK_MOVE_TYPE;
}
public List<String> getOwnedObjectManagerKeys() {
if (ownedObjectsManagerKeys == null) // temporary
ownedObjectsManagerKeys = new LinkedList<String>();
return ownedObjectsManagerKeys;
}
public ClanWars getClanWars() {
return clanWars;
}
public ClanWars setClanWars(ClanWars clanWars) {
return this.clanWars = clanWars;
}
public int setAmount(int amount) {
return this.amount = this.amount+amount;
}
public boolean setInHRP(boolean inHRP) {
return this.inHRP = inHRP;
}
public boolean getInHRP() {
return inHRP;
}
public double getDropBonus() {
double bonus = 1.00;
if (getCombatDefinitions().hasGoldOctoF())
bonus += 0.75;
if (getEquipment().getRingId() == 2572)
bonus += 1.00;
return bonus;
}
public long getDisDelay() {
return disDelay;
}
public void addDisDelay(long delay) {
disDelay = delay + Utils.currentTimeMillis();
}
public void setDisDelay(long delay) {
this.disDelay = delay;
}
public boolean hasInstantSpecial(final int weaponId) {
int specAmt = PlayerCombat.getSpecialAmmount(weaponId);
if (combatDefinitions.hasRingOfVigour()) {
specAmt *= 0.9;
}
if (combatDefinitions.isOwnerWithSpec()) {
specAmt *= 0.0;
}
if (combatDefinitions.getSpecialAttackPercentage() < specAmt) {
getPackets().sendGameMessage("You don't have enough power left.");
combatDefinitions.desecreaseSpecialAttack(0);
return false;
}
switch (weaponId) {
case 4153:
if (getTemporaryAttributtes().get("InstantSpecial") == null)
getTemporaryAttributtes().put("InstantSpecial", 4153);
else
getTemporaryAttributtes().remove("InstantSpecial") ;
combatDefinitions.switchUsingSpecialAttack();
return true;
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) ;
return true;
case 1377:
case 13472:
setNextAnimation(new Animation(1056));
setNextGraphics(new Graphics(246));
setNextForceTalk(new ForceTalk("Raarrrrrgggggghhhhhhh!"));
int defence = (int) (skills.getLevel(Skills.DEFENCE) * 0.90D);
int attack = (int) (skills.getLevel(Skills.ATTACK) * 0.90D);
int range = (int) (skills.getLevel(Skills.RANGE) * 0.90D);
int magic = (int) (skills.getLevel(Skills.MAGIC) * 0.90D);
int strength = (int) (skills.getLevel(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) ;
return true;
case 35:// Excalibur
case 8280:
case 14632:
setNextAnimation(new Animation(1168));
setNextGraphics(new Graphics(247));
setNextForceTalk(new ForceTalk("For Azureify!"));
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) ;
return true;
}
return false;
}
public void incrementMessageAmount() {
getTemporaryAttributtes().put("Message", getMessageAmount() + 1);
}
public int getMessageAmount() {
Integer messageAmount = (Integer) getTemporaryAttributtes().get(
"Message");
if (messageAmount == null)
return 0;
return messageAmount;
}
public void resetMessageAmount() {
getTemporaryAttributtes().put("Message", 0);
}
public void DiceZoneWithPermit() {
WorldTasksManager.schedule(new WorldTask() {
int loop;
public void run() {
if (loop == 0) {
setNextGraphics(new Graphics(94));
if (!getDiceZone()) {
stop();
}
} else if (loop == 3) {
setNextGraphics(new Graphics(94));
if (!getDiceZone()) {
stop();
}
} else if (loop == 6) {
if (!getDiceZone()) {
stop();
}
setNextGraphics(new Graphics(94));
loop = 0;
}
loop++;
}
}, 0, 1);
}
public void setDisableEquip(boolean equip) {
disableEquip = equip;
}
/*public DonationManager getDonation() {
return donationmanager;
}*/
public boolean isEquipDisabled() {
return disableEquip;
}
public void addDisplayTime(long i) {
this.displayTime = i + Utils.currentTimeMillis();
}
public long getDisplayTime() {
return displayTime;
}
public War getOwnedWar() {
return (getCurrentFriendChatOwner() != null && getCurrentFriendChatOwner().equalsIgnoreCase(getUs ername()) && getCurrentFriendChat().getWar() != null) ? getCurrentFriendChat().getWar() : null;
}
public void logIPAddress() {
try {
BufferedWriter bf = new BufferedWriter(new FileWriter("data/logs/iplogs/iplogs.txt", true));
bf.write("["+ getDisplayName() +", "+ DateFormat.getDateTimeInstance().format(new Date())
+ "]: "+ getSession().getIP()+ "");
bf.newLine();
bf.flush();
bf.close();
} catch (IOException ignored) {
}
}
public void setSkull(int id) {
skullDelay = 3000;
this.skullId = id;
appearence.generateAppearenceData();
}
public void getTicketPrice(Item item) {
if (!isDonator() && !isExtremeDonator() && !isLegendaryDonator() && !isSuperDonator()) {
item.getDefinitions().setValue(40);
} else if (isDonator() && !isExtremeDonator() && !isLegendaryDonator() && !isSuperDonator()) {
item.getDefinitions().setValue(20);
} else if (isDonator() && isExtremeDonator() && !isLegendaryDonator() && !isSuperDonator()) {
item.getDefinitions().setValue(20);
} else if (isDonator() && isExtremeDonator() && isLegendaryDonator() && !isSuperDonator()) {
item.getDefinitions().setValue(100);
}
}
public Player getTradePartner() {
return tradePartner;
}
public void setTradePartner(Player tradePartner) {
this.tradePartner = tradePartner;
}
public String calculateNetworth() {
double value = 0, v = 0, amt = 0;
for (Item item : getEquipment().getItems().getItems()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
for (Item item : getInventory().getItems().getItems()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
for (Item item : getBank().getContainerCopy()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
// return Utils.formatCashMessage(value) + (value >= 1000 ? " - (" + new DecimalFormat("###, ###.##").format(value) + "gp)" : "");
return Utils.formatCashMessage(value) + (value >= 1000 ? "" : "");
}
public String totalValue() {
double value = 0, v = 0, amt = 0;
for (Item item : getEquipment().getItems().getItems()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
for (Item item : getInventory().getItems().getItems()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
for (Item item : getBank().getContainerCopy()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
return Utils.formatCashMessage(value) + (value >= 1000 ? " - <col=ff0000>" + new DecimalFormat("###, ###.##").format(value) + "" : "");
// return Utils.formatCashMessage(value) + (value >= 1000 ? "" : "");
}
public String equipmentValue() {
double value = 0, v = 0, amt = 0;
for (Item item : getEquipment().getItems().getItems()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
return Utils.formatOtherMessage(value) + (value >= 1000 ? " - <col=ff0000>" + new DecimalFormat("###, ###.##").format(value) + "" : "");
// return Utils.formatCashMessage(value) + (value >= 1000 ? "" : "");
}
public String bankValue() {
double value = 0, v = 0, amt = 0;
for (Item item : getBank().getContainerCopy()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
return Utils.formatOtherMessage(value) + (value >= 1000 ? " - <col=ff0000>" + new DecimalFormat("###, ###.##").format(value) + "" : "");
// return Utils.formatCashMessage(value) + (value >= 1000 ? "" : "");
}
public String inventoryValue() {
double value = 0, v = 0, amt = 0;
for (Item item : getInventory().getItems().getItems()) {
if (item == null)
continue;
v = item.getDefinitions().getValue();
amt = item.getAmount();
value += v * amt;
}
return Utils.formatOtherMessage(value) + (value >= 1000 ? " - <col=ff0000>" + new DecimalFormat("###, ###.##").format(value) + "" : "");
// return Utils.formatCashMessage(value) + (value >= 1000 ? "" : "");
}
public Trade getTradeSession() {
return tradeSession;
}
public static String FormatNumber(long count) {
return new DecimalFormat("#,###,##0").format(count).toString( );
}
public void setTradeSession(Trade session2) {
this.tradeSession = session2;
}
}