All pastes #73228 Raw Edit

Miscellany

public java v1 · immutable
#73228 ·published 2006-06-27 16:20 UTC
rendered paste body
pcstat.java---------------------------------------------------------------------------------------------------------------------package net.sf.l2j.gameserver.model.actor.stat;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.util.logging.Logger;import net.sf.l2j.Config;import net.sf.l2j.L2DatabaseFactory;import net.sf.l2j.gameserver.instancemanager.ZoneManager;import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;import net.sf.l2j.gameserver.model.base.Experience;import net.sf.l2j.gameserver.serverpackets.PledgeShowMemberListAdd;import net.sf.l2j.gameserver.serverpackets.SocialAction;import net.sf.l2j.gameserver.serverpackets.StatusUpdate;import net.sf.l2j.gameserver.serverpackets.SystemMessage;import net.sf.l2j.gameserver.serverpackets.UserInfo;public class PcStat extends PlayableStat{	private static Logger _log = Logger.getLogger(L2PcInstance.class.getName());    // =========================================================    // Data Field    private int _OldMaxHp;      // stats watch    private int _OldMaxMp;      // stats watch        // =========================================================    // Constructor    public PcStat(L2PcInstance[] activeChar)    {        super(activeChar);    }    // =========================================================    // Method - Public    public boolean addExp(int value)    {        if (!super.addExp(value)) return false;        // Set new karma        if (getActiveChar().getKarma() > 0 && (getActiveChar().isGM() || !ZoneManager.getInstance().checkIfInZonePvP(getActiveChar())))        {            int karmaLost = getActiveChar().calculateKarmaLost(value);            if (karmaLost > 0) getActiveChar().setKarma(getActiveChar().getKarma() - karmaLost);        }        StatusUpdate su = new StatusUpdate(getActiveChar().getObjectId());        su.addAttribute(StatusUpdate.EXP, getExp());        getActiveChar().sendPacket(su);        return true;    }    /**     * Add Experience and SP rewards to the L2PcInstance, remove its Karma (if necessary) and Launch increase level task.<BR><BR>     *     * <B><U> Actions </U> :</B><BR><BR>     * <li>Remove Karma when the player kills L2MonsterInstance</li>     * <li>Send a Server->Client packet StatusUpdate to the L2PcInstance</li>     * <li>Send a Server->Client System Message to the L2PcInstance </li>     * <li>If the L2PcInstance increases it's level, send a Server->Client packet SocialAction (broadcast) </li>     * <li>If the L2PcInstance increases it's level, manage the increase level task (Max MP, Max MP, Recommandation, Expertise and beginner skills...) </li>     * <li>If the L2PcInstance increases it's level, send a Server->Client packet UserInfo to the L2PcInstance </li><BR><BR>     *     * @param addToExp The Experience value to add     * @param addToSp The SP value to add     */    public boolean addExpAndSp(int addToExp, int addToSp)    {    	if (!super.addExpAndSp(addToExp, addToSp)) return false;        // Send a Server->Client System Message to the L2PcInstance        SystemMessage sm = new SystemMessage(SystemMessage.YOU_EARNED_S1_EXP_AND_S2_SP);        sm.addNumber(addToExp);        sm.addNumber(addToSp);        getActiveChar().sendPacket(sm);        return true;    }    public final boolean addLevel(int value)    {        if (getLevel() + value > 80) return false;        boolean levelIncreased = super.addLevel(value);                if (levelIncreased)        {			/**			 * If there are no characters on the server, the bonuses will be applied to the first character that becomes level 6			 *   and end if this character reaches level 25 or above.			 * If the first character that becomes level 6 is deleted, the rest of the characters may not receive the new character bonus			 * If the first character to become level 6 loses a level, and the player makes another character level 6,			 *   the bonus will be applied to only the first character to achieve level 6.			 * If the character loses a level after reaching level 25, the character may not receive the bonus.			 */        	if (!Config.ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE)        	{	        	if (getActiveChar().getLevel() >= 6 && getActiveChar().getLevel() < 25 && !getActiveChar().isNewbie())	        	{	        		java.sql.Connection con = null;					try					{						con = L2DatabaseFactory.getInstance().getConnection();						PreparedStatement statement;												statement = con.prepareStatement("SELECT value FROM account_data WHERE (account_name=?) AND (var='newbie_char')");						statement.setString(1, getActiveChar().getAccountName());						ResultSet rset = statement.executeQuery();												if (!rset.next())						{							PreparedStatement statement1;							statement1 = con.prepareStatement("INSERT INTO account_data (account_name, var, value) VALUES (?, 'newbie_char', ?)");                            statement1.setString(1, getActiveChar().getAccountName());							statement1.setInt(2, getActiveChar().getObjectId());							statement1.executeUpdate();							statement1.close();                            							getActiveChar().setNewbie(true);							if (Config.DEBUG) _log.info("New newbie character: " + getActiveChar().getCharId());						};						rset.close();						statement.close();					}					catch (SQLException e)					{						_log.warning("Could not check character for newbie: " + e);					}					finally					{						try { con.close(); } catch (Exception e) {}					}	        	};		        	if (getActiveChar().getLevel() >= 25 && getActiveChar().isNewbie())	        	{	        		getActiveChar().setNewbie(false);					if (Config.DEBUG) _log.info("Newbie character ended: " + getActiveChar().getCharId());	        	};        	};        	        	getActiveChar().setCurrentCp(getMaxCp());            getActiveChar().broadcastPacket(new SocialAction(getActiveChar().getObjectId(), 15));            getActiveChar().sendPacket(new SystemMessage(SystemMessage.YOU_INCREASED_YOUR_LEVEL));        }        getActiveChar().rewardSkills(); // Give Expertise skill of this level        if (getActiveChar().getClan() != null)        {        	getActiveChar().getClan().updateClanMember(getActiveChar());        	getActiveChar().getClan().broadcastToOtherOnlineMembers(new PledgeShowMemberListAdd(getActiveChar()), getActiveChar());        }        if (getActiveChar().isInParty()) getActiveChar().getParty().recalculatePartyLevel(); // Recalculate the party level        StatusUpdate su = new StatusUpdate(getActiveChar().getObjectId());        su.addAttribute(StatusUpdate.LEVEL, getLevel());        su.addAttribute(StatusUpdate.MAX_CP, getMaxCp());        su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());        su.addAttribute(StatusUpdate.MAX_MP, getMaxMp());        getActiveChar().sendPacket(su);                    // Send a Server->Client packet UserInfo to the L2PcInstance        getActiveChar().sendPacket(new UserInfo(getActiveChar()));        return levelIncreased;    }    public boolean addSp(int value)    {        if (!super.addSp(value)) return false;        StatusUpdate su = new StatusUpdate(getActiveChar().getObjectId());        su.addAttribute(StatusUpdate.SP, getSp());        getActiveChar().sendPacket(su);        return true;    }    public final int getExpForLevel(int level) { return Experience.LEVEL[level]; }    // =========================================================    // Method - Private    // =========================================================    // Property - Public    public final L2PcInstance getActiveChar() { return (L2PcInstance)super.getActiveChar(); }    public final int getExp()    {        if (getActiveChar().isSubClassActive()) 	        return getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).getExp();                return super.getExp();    }        public final void setExp(int value)    {        if (getActiveChar().isSubClassActive())            getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).setExp(value);        else            super.setExp(value);    }    public final int getLevel()    {        if (getActiveChar().isSubClassActive())         	return getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).getLevel();        	        return super.getLevel();    }    public final void setLevel(int value)    {        if (value > 80)         	value = 80;        	        if (getActiveChar().isSubClassActive())            getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).setLevel(value);        else            super.setLevel(value);    }    public final int getMaxHp()    {        // Get the Max HP (base+modifier) of the L2PcInstance        int val = super.getMaxHp();        if (val != _OldMaxHp)        {            _OldMaxHp = val;            // Launch a regen task if the new Max HP is higher than the old one            if (getActiveChar().getStatus().getCurrentHp() != val) getActiveChar().getStatus().setCurrentHp(getActiveChar().getStatus().getCurrentHp()); // trigger start of regeneration        }        return val;    }    public final int getMaxMp()    {        // Get the Max MP (base+modifier) of the L2PcInstance        int val = super.getMaxMp();                if (val != _OldMaxMp)        {            _OldMaxMp = val;            // Launch a regen task if the new Max MP is higher than the old one            if (getActiveChar().getStatus().getCurrentMp() != val)             	getActiveChar().getStatus().setCurrentMp(getActiveChar().getStatus().getCurrentMp()); // trigger start of regeneration        }        return val;    }    public final int getSp()    {        if (getActiveChar().isSubClassActive())         	return getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).getSp();        	        return super.getSp();    }    public final void setSp(int value)    {        if (getActiveChar().isSubClassActive())            getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).setSp(value);        else            super.setSp(value);    }}---------------------------------------------------------------------------------------------------------------------Playablestat.java---------------------------------------------------------------------------------------------------------------------package net.sf.l2j.gameserver.model.actor.stat;import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;public class PlayableStat extends CharStat{    // =========================================================    // Data Field        // =========================================================    // Constructor    public PlayableStat(L2PlayableInstance[] activeChar)    {        super(activeChar);    }    // =========================================================    // Method - Public    public boolean addExp(int value)    {        if ((getExp() + value) < 0 || getExp() == (getExpForLevel(81) - 1))             return true;                if (getExp() + value >= getExpForLevel(81))             value = getExpForLevel(81) - 1 - getExp();        setExp(getExp() + value);        int level;        for (level = 1; level <= 81; level++)        {        	if (getExp() >= getExpForLevel(level)) continue;        	level--;        	break;        }        if (level != getLevel()) addLevel(level - getLevel());        return true;    }    public boolean addExpAndSp(int addToExp, int addToSp)    {    	boolean expAdded = false;    	boolean spAdded = false;    	if (addToExp > 0) expAdded = addExp(addToExp);    	if (addToSp > 0) spAdded = addSp(addToSp);    	return expAdded || spAdded;    }        public boolean addLevel(int value)    {        if (getLevel() + value > 80)        {        	if (getLevel() < 80)        		value = 80 - getLevel();        	else        		return false;        }        boolean levelIncreased = (getLevel() + value > getLevel());        value += getLevel();        setLevel(value);        // Sync up exp with current level        if (getExp() >= getExpForLevel(getLevel() + 1) || getExpForLevel(getLevel()) > getExp()) setExp(getExpForLevel(getLevel()));        if (!levelIncreased) return false;                getActiveChar().getStatus().setCurrentHp(getActiveChar().getStat().getMaxHp());        getActiveChar().getStatus().setCurrentMp(getActiveChar().getStat().getMaxMp());        return true;    }    public boolean addSp(int value)    {        setSp(getSp() + value);        return true;    }        public int getExpForLevel(int level) { return level; }    // =========================================================    // Method - Private    // =========================================================    // Property - Public    public L2PlayableInstance getActiveChar() { return (L2PlayableInstance)super.getActiveChar(); }}---------------------------------------------------------------------------------------------------------------------Experience.java---------------------------------------------------------------------------------------------------------------------/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */package net.sf.l2j.gameserver.model.base;/** *  * */public class Experience{    public final static int LEVEL[]=    {        0,  // level 0        1,                69,               364,              1169,             2885 ,            6039  ,           11288  ,          19424   ,         31379    ,        48230    ,  //level 10        71203    ,        101678   ,          141194   ,        191455   ,        254331   ,        331868   ,        426289   ,        540001   ,        675597   ,        835863   ,  //level 20        1023785  ,        1242547  ,        1495544  ,        1786380  ,        2118877  ,        2497078  ,        2925251  ,        3407898  ,        3949755  ,        4555797  ,  //level 30        5231247  ,        5981577  ,        6812514  ,        7730045  ,        8740423  ,        9850167  ,        11066073 ,        12395216 ,        13844952 ,        15422930 ,  //level 40        17137088 ,        18995666 ,        21007204 ,        23180551 ,        25524869 ,        28049636 ,        30764655 ,        33680053 ,        36806290 ,        40154163 ,  //level 50        45525134 ,        51262491 ,        57383989 ,        63907912 ,        70853090 ,        80700832 ,        91162655 ,        102265882,        114038596,        126509653,  //level 60        146308200,        167244337,        189364894,        212717908,        237352644,        271975263,        308443198,        346827154,        387199547,        429634523,  //level 70        474207979,        532694979,        606322775,        696381369,        804225364,  //level 75        931275364,        1151264834,        1511257834,        2099305233 //this is here just to allow further exp gaining after level 78        //1788937098, //level 80        //1999999999    };}---------------------------------------------------------------------------------------------------------------------Subclass.java---------------------------------------------------------------------------------------------------------------------/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */package net.sf.l2j.gameserver.model.base;/** * Character Sub-Class Definition * <BR> * Used to store key information about a character's sub-class. *  * @author Tempy */public final class SubClass {    private PlayerClass _class;    private int _exp = Experience.LEVEL[40];    private int _sp = 0;    private int _level = 40;        private int _classIndex = 1;        public SubClass(int classId, int exp, int sp, int level, int classIndex)    {        _class = PlayerClass.values()[classId];        _exp = exp;        _sp = sp;        _level = level;        _classIndex = classIndex;    }        public SubClass(int classId, int classIndex)    {        // Used for defining a sub class using default values for XP, SP and player level.        _class = PlayerClass.values()[classId];        _classIndex = classIndex;    }        public SubClass()    {        // Used for specifying ALL attributes of a sub class directly,         // using the preset default values.    }        public PlayerClass getClassDefinition()    {        return _class;    }        public int getClassId()    {        return _class.ordinal();    }        public int getExp()    {        return _exp;    }        public int getSp()    {        return _sp;    }        public int getLevel()    {        return _level;    }        public int getClassIndex()     {        return _classIndex;    }        public void setClassId(int classId)    {        _class = PlayerClass.values()[classId];    }        public void setExp(int expValue)    {        if (expValue > Experience.LEVEL[81])            expValue = Experience.LEVEL[81];                _exp = expValue;    }        public void setSp(int spValue)    {        _sp = spValue;    }        public void setClassIndex(int classIndex)     {        _classIndex = classIndex;    }        public void setLevel(int levelValue)    {        if (levelValue > 80)            levelValue = 80;        else if (levelValue < 40)            levelValue = 40;                    _level = levelValue;    }        public void incLevel()    {        if (getLevel() == 80)            return;                _level++;        setExp(Experience.LEVEL[getLevel()]);    }        public void decLevel()    {        if (getLevel() == 40)            return;                _level--;        setExp(Experience.LEVEL[getLevel()]);    }}---------------------------------------------------------------------------------------------------------------------this is the error in the server console:java.lang.ArrayIndexOutOfBoundsException: 81        at net.sf.l2j.gameserver.model.actor.stat.PcStat.getExpForLevel(PcStat.java:182)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExp(PlayableStat.java:21)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExp(PcStat.java:40)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExpAndSp(PlayableStat.java:45)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExpAndSp(PcStat.java:72)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.addExpAndSp(L2PcInstance.java:7749)        at net.sf.l2j.gameserver.model.L2Attackable.calculateRewards(L2Attackable.java:560)        at net.sf.l2j.gameserver.model.L2Attackable.doDie(L2Attackable.java:387)        at net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance.doDie(L2MonsterInstance.java:193)        at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:151)        at net.sf.l2j.gameserver.model.actor.status.NpcStatus.reduceHp(NpcStatus.java:29)        at net.sf.l2j.gameserver.model.L2Character.reduceCurrentHp(L2Character.java:4839)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:359)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:312)        at net.sf.l2j.gameserver.handler.skillhandlers.Mdam.useSkill(Mdam.java:158)        at net.sf.l2j.gameserver.model.L2Character.callSkill(L2Character.java:4611)        at net.sf.l2j.gameserver.model.L2Character.onMagicUseTimer(L2Character.java:4382)        at net.sf.l2j.gameserver.model.L2Character$MagicUseTask.run(L2Character.java:1525)        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)        at java.util.concurrent.FutureTask.run(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)        at java.lang.Thread.run(Unknown Source)java.lang.ArrayIndexOutOfBoundsException: 81        at net.sf.l2j.gameserver.model.actor.stat.PcStat.getExpForLevel(PcStat.java:182)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExp(PlayableStat.java:21)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExp(PcStat.java:40)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExpAndSp(PlayableStat.java:45)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExpAndSp(PcStat.java:72)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.addExpAndSp(L2PcInstance.java:7749)        at net.sf.l2j.gameserver.model.L2Attackable.calculateRewards(L2Attackable.java:560)        at net.sf.l2j.gameserver.model.L2Attackable.doDie(L2Attackable.java:387)        at net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance.doDie(L2MonsterInstance.java:193)        at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:151)        at net.sf.l2j.gameserver.model.actor.status.NpcStatus.reduceHp(NpcStatus.java:29)        at net.sf.l2j.gameserver.model.L2Character.reduceCurrentHp(L2Character.java:4839)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:359)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:312)        at net.sf.l2j.gameserver.handler.skillhandlers.Mdam.useSkill(Mdam.java:158)        at net.sf.l2j.gameserver.model.L2Character.callSkill(L2Character.java:4611)        at net.sf.l2j.gameserver.model.L2Character.onMagicUseTimer(L2Character.java:4382)        at net.sf.l2j.gameserver.model.L2Character$MagicUseTask.run(L2Character.java:1525)        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)        at java.util.concurrent.FutureTask.run(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)        at java.lang.Thread.run(Unknown Source)java.lang.ArrayIndexOutOfBoundsException: 81        at net.sf.l2j.gameserver.model.actor.stat.PcStat.getExpForLevel(PcStat.java:182)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExp(PlayableStat.java:21)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExp(PcStat.java:40)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExpAndSp(PlayableStat.java:45)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExpAndSp(PcStat.java:72)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.addExpAndSp(L2PcInstance.java:7749)        at net.sf.l2j.gameserver.model.L2Attackable.calculateRewards(L2Attackable.java:560)        at net.sf.l2j.gameserver.model.L2Attackable.doDie(L2Attackable.java:387)        at net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance.doDie(L2MonsterInstance.java:193)        at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:151)        at net.sf.l2j.gameserver.model.actor.status.NpcStatus.reduceHp(NpcStatus.java:29)        at net.sf.l2j.gameserver.model.L2Character.reduceCurrentHp(L2Character.java:4839)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:359)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:312)        at net.sf.l2j.gameserver.model.L2Character.onHitTimer(L2Character.java:3892)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.onHitTimer(L2PcInstance.java:2987)        at net.sf.l2j.gameserver.model.L2Character$HitTask.run(L2Character.java:1500)        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)        at java.util.concurrent.FutureTask.run(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)        at java.lang.Thread.run(Unknown Source)java.lang.ArrayIndexOutOfBoundsException: 81        at net.sf.l2j.gameserver.model.actor.stat.PcStat.getExpForLevel(PcStat.java:182)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExp(PlayableStat.java:21)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExp(PcStat.java:40)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExpAndSp(PlayableStat.java:45)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExpAndSp(PcStat.java:72)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.addExpAndSp(L2PcInstance.java:7749)        at net.sf.l2j.gameserver.model.L2Attackable.calculateRewards(L2Attackable.java:560)        at net.sf.l2j.gameserver.model.L2Attackable.doDie(L2Attackable.java:387)        at net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance.doDie(L2MonsterInstance.java:193)        at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:151)        at net.sf.l2j.gameserver.model.actor.status.NpcStatus.reduceHp(NpcStatus.java:29)        at net.sf.l2j.gameserver.model.L2Character.reduceCurrentHp(L2Character.java:4839)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:359)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:312)        at net.sf.l2j.gameserver.model.L2Character.onHitTimer(L2Character.java:3892)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.onHitTimer(L2PcInstance.java:2987)        at net.sf.l2j.gameserver.model.L2Character$HitTask.run(L2Character.java:1500)        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)        at java.util.concurrent.FutureTask.run(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)        at java.lang.Thread.run(Unknown Source)java.lang.ArrayIndexOutOfBoundsException: 81        at net.sf.l2j.gameserver.model.actor.stat.PcStat.getExpForLevel(PcStat.java:182)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExp(PlayableStat.java:21)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExp(PcStat.java:40)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExpAndSp(PlayableStat.java:45)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExpAndSp(PcStat.java:72)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.addExpAndSp(L2PcInstance.java:7749)        at net.sf.l2j.gameserver.model.L2Attackable.calculateRewards(L2Attackable.java:560)        at net.sf.l2j.gameserver.model.L2Attackable.doDie(L2Attackable.java:387)        at net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance.doDie(L2MonsterInstance.java:193)        at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:151)        at net.sf.l2j.gameserver.model.actor.status.NpcStatus.reduceHp(NpcStatus.java:29)        at net.sf.l2j.gameserver.model.L2Character.reduceCurrentHp(L2Character.java:4839)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:359)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:312)        at net.sf.l2j.gameserver.model.L2Character.onHitTimer(L2Character.java:3892)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.onHitTimer(L2PcInstance.java:2987)        at net.sf.l2j.gameserver.model.L2Character$HitTask.run(L2Character.java:1500)        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)        at java.util.concurrent.FutureTask.run(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)        at java.lang.Thread.run(Unknown Source)java.lang.ArrayIndexOutOfBoundsException: 81        at net.sf.l2j.gameserver.model.actor.stat.PcStat.getExpForLevel(PcStat.java:182)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExp(PlayableStat.java:21)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExp(PcStat.java:40)        at net.sf.l2j.gameserver.model.actor.stat.PlayableStat.addExpAndSp(PlayableStat.java:45)        at net.sf.l2j.gameserver.model.actor.stat.PcStat.addExpAndSp(PcStat.java:72)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.addExpAndSp(L2PcInstance.java:7749)        at net.sf.l2j.gameserver.model.L2Attackable.calculateRewards(L2Attackable.java:560)        at net.sf.l2j.gameserver.model.L2Attackable.doDie(L2Attackable.java:387)        at net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance.doDie(L2MonsterInstance.java:193)        at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:151)        at net.sf.l2j.gameserver.model.actor.status.NpcStatus.reduceHp(NpcStatus.java:29)        at net.sf.l2j.gameserver.model.L2Character.reduceCurrentHp(L2Character.java:4839)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:359)        at net.sf.l2j.gameserver.model.L2Attackable.reduceCurrentHp(L2Attackable.java:312)        at net.sf.l2j.gameserver.model.L2Character.onHitTimer(L2Character.java:3892)        at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.onHitTimer(L2PcInstance.java:2987)        at net.sf.l2j.gameserver.model.L2Character$HitTask.run(L2Character.java:1500)        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)        at java.util.concurrent.FutureTask.run(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)        at java.lang.Thread.run(Unknown Source)