Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_Server
- Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 6242)
- +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -328,9 +328,9 @@
- private static final String DELETE_ITEM_REUSE_SAVE = "DELETE FROM character_item_reuse_save WHERE charId=?";
- // Character Character SQL String Definitions:
- - private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=? WHERE charId=?";
- - private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, lvl_joined_academy, apprentice, sponsor, clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createDate,language FROM characters WHERE charId=?";
- + private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createDate,customherotime) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=?,customherotime=? WHERE charId=?";
- + private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, lvl_joined_academy, apprentice, sponsor, clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createDate,language,customherotime FROM characters WHERE charId=?";
- // Character Teleport Bookmark:
- private static final String INSERT_TP_BOOKMARK = "INSERT INTO character_tpbookmark (charId,Id,x,y,z,icon,tag,name) values (?,?,?,?,?,?,?,?)";
- @@ -504,6 +509,7 @@
- private int _eventEffectId = 0;
- private boolean _isInSiege;
- private boolean _isInHideoutSiege = false;
- + public long customherotime = -1;
- public enum PunishLevel
- {
- @@ -7567,6 +7573,7 @@
- statement.setInt(35, isNoble() ? 1 : 0);
- statement.setLong(36, 0);
- statement.setDate(37, new Date(getCreateDate().getTimeInMillis()));
- + statement.setLong(38, customherotime);
- statement.executeUpdate();
- }
- catch (Exception e)
- @@ -7758,6 +7765,7 @@
- // Language
- player.setLang(rset.getString("language"));
- + player.customherotime = rset.getLong("customherotime");
- // Retrieve the name and ID of the other characters assigned to this account.
- try (PreparedStatement stmt = con.prepareStatement("SELECT charId, char_name FROM characters WHERE account_name=? AND charId<>?"))
- @@ -8207,7 +8215,8 @@
- statement.setInt(49, getBookMarkSlot());
- statement.setInt(50, getVitalityPoints());
- statement.setString(51, getLang());
- - statement.setInt(52, getObjectId());
- + statement.setLong(52, customherotime);
- + statement.setInt(53, getObjectId());
- statement.execute();
- statement.close();
- Index: java/com/custom/CustomHero.java
- ===================================================================
- --- java/com/custom/CustomHero.java (revision 0)
- +++ java/com/custom/CustomHero.java (working copy)
- @@ -0,0 +1,79 @@
- +/*
- + * Copyright (C) 2004-2013 L2J Server
- + *
- + * This file is part of L2J Server.
- + *
- + * L2J Server 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 3 of the License, or
- + * (at your option) any later version.
- + *
- + * L2J Server 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, see <http://www.gnu.org/licenses/>.
- + */
- +package com.custom;
- +
- +import java.util.Calendar;
- +import java.util.StringTokenizer;
- +
- +import com.l2jserver.gameserver.handler.IAdminCommandHandler;
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +
- +/*
- + * @author Wyatt
- + */
- +
- +public class CustomHero implements IAdminCommandHandler
- +{
- + private static final String[] ADMIN_COMMANDS =
- + {
- + "admin_customhero"
- + };
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if (command.toLowerCase().startsWith("admin_customhero"))
- + {
- + StringTokenizer st = new StringTokenizer(command);
- + st.nextToken();
- + int days = 0;
- + L2PcInstance player = ((L2PcInstance) activeChar.getTarget());
- +
- + if (st.hasMoreTokens())
- + {
- + days = Integer.parseInt(st.nextToken());
- + }
- +
- + if (player != null)
- + {
- + if (days != 0)
- + {
- + player.customherotime = Calendar.getInstance().getTimeInMillis() + (86400000 * days);
- + }
- + else
- + {
- + player.customherotime = 0;
- + }
- + player.setHero(true);
- + player.broadcastUserInfo();
- + }
- + else
- + {
- + activeChar.sendMessage("You must target a player.");
- + }
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +}
- Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (revision 6242)
- +++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -19,6 +19,7 @@
- package com.l2jserver.gameserver.network.clientpackets;
- import java.io.UnsupportedEncodingException;
- +import java.util.Calendar;
- import javolution.util.FastList;
- @@ -579,6 +580,15 @@
- TvTEvent.onLogin(activeChar);
- + if ((activeChar.customherotime == 0) || (activeChar.customherotime > Calendar.getInstance().getTimeInMillis()))
- + {
- + activeChar.setHero(true);
- + }
- + else
- + {
- + activeChar.customherotime = -1;
- + }
- +
- if (Config.WELCOME_MESSAGE_ENABLED)
- {
- activeChar.sendPacket(new ExShowScreenMessage(Config.WELCOME_MESSAGE_TEXT, Config.WELCOME_MESSAGE_TIME));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement