Jump to content

KaLeDoR

Members
  • Posts

    53
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by KaLeDoR

  1. Hi guys i tried an old version shared from rizel of the Phoenix Event Engine. I implented the code smoothly with no errors patches/sql/skills/xml configs but when i spawn the eventmanager npc it doesnt work. I tested pop up and events run smootly but i cant find a fix for the npc with eventmanager instance type. I see a lot of people asking for help but i didnt find any solution shared. Anyone with good will to help me? Thanks a lot. I use l2jfrozen source and if you want i can share the EventManagerInstance.java if you want more info.
  2. hi guys i'm using a l2jfrozen pack and i'm a bit new to java coding... I have this vip system but i wanna add to vips x2 drop not only xp /sp. how can i do this? any help and tip would be soooo helpfull Index: config/head/other.properties =================================================================== --- config/head/other.properties (revision 900) +++ config/head/other.properties (working copy) @@ -225,5 +225,21 @@ # Aio Buffers can speak to Class Master? AllowAioUseClassMaster = false + +# --------------------------------------- +# Vip System +# --------------------------------------- +# Enable / Disable Name Color +AllowVipNameColor = True +VipNameColor = 0088FF +# Enable / Disable Title Color +AllowVipTitleColor = True +VipTitleColor = 0088FF + +# if True Player Vip gain Xp*VipMulXp and Sp*VipMulSp +# Note only works if player not in party +AllowVipMulXpSp = True +VipMulXp = 2 +VipMulSp = 2 # Announce castle lords on enter game. default = false AnnounceCastleLords = False \ No newline at end of file Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (revision 900) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (working copy) @@ -101,9 +101,9 @@ { private static Logger _log = Logger.getLogger(EnterWorld.class.getName()); - private static final SimpleDateFormat fmt = new SimpleDateFormat("H:mm."); + private static final SimpleDateFormat fmt = new SimpleDateFormat("HH:mm."); private long _daysleft; - SimpleDateFormat df = new SimpleDateFormat("dd MM yyyy"); + SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); public TaskPriority getPriority() { @@ -599,8 +599,17 @@ if (activeChar.isAio()) onEnterAio(activeChar); - activeChar.updateNameTitleColor(); + if(Config.ALLOW_VIP_NCOLOR && activeChar.isVip()) + activeChar.getAppearance().setNameColor(Config.VIP_NCOLOR); + if(Config.ALLOW_VIP_TCOLOR && activeChar.isVip()) + activeChar.getAppearance().setTitleColor(Config.VIP_TCOLOR); + + if(activeChar.isVip()) + onEnterVip(activeChar); + + activeChar.updateNameTitleColor(); + sendPacket(new UserInfo(activeChar)); sendPacket(new HennaInfo(activeChar)); sendPacket(new FriendList(activeChar)); @@ -638,6 +647,32 @@ } } + private void onEnterVip(L2PcInstance activeChar) + { + long curDay = Calendar.getInstance().getTimeInMillis(); + long endDay = activeChar.getVipEndTime(); + if(curDay > endDay) + { + activeChar.setVip(false); + activeChar.setVipEndTime(0); + activeChar.sendMessage("[Vip System]: Removed your Vip stats... period ends "); + } + else + { + Date dt = new Date(endDay); + _daysleft = (endDay - curDay) / 86400000; + if(_daysleft > 30) + activeChar.sendMessage("[Vip System]: Vip period ends in " + df.format(dt) + ". enjoy the Game"); + else if(_daysleft > 0) + activeChar.sendMessage("[Vip System]: Left " + (int)_daysleft + " days for Vip period ends"); + else if(_daysleft < 1) + { + long hour = (endDay - curDay) / 3600000; + activeChar.sendMessage("[Vip System]: Left " + (int)hour + " hours to Vip period ends"); + } + } + } + /** * @param activeChar */ Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 900) +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -410,7 +410,7 @@ * =?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=? * ,char_name=?,death_penalty_level=?,good=?,evil=?,gve_kills=? WHERE obj_id=? **/ - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,pc_point=?,name_color=?,title_color=?,aio=?,aio_end=? WHERE obj_id=?"; + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,pc_point=?,name_color=?,title_color=?,aio=?,aio_end=?,vip=?,vip_end=? WHERE obj_id=?"; /** * SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, @@ -423,7 +423,7 @@ * FROM characters WHERE obj_id=? **/ //private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pc_point,banchat_time,name_color,title_color,first_log,aio,aio_end FROM characters WHERE obj_id=?"; - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon,punish_level,punish_timer,"+/* in_jail, jail_timer,*/ "newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pc_point"+/*,banchat_time*/",name_color,title_color,first_log,aio,aio_end FROM characters WHERE obj_id=?"; + private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon,punish_level,punish_timer,"+/* in_jail, jail_timer,*/ "newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pc_point"+/*,banchat_time*/",name_color,title_color,first_log,aio,aio_end,vip,vip_end FROM characters WHERE obj_id=?"; private static final String STATUS_DATA_GET = "SELECT hero, noble, donator, hero_end_date FROM characters_custom_data WHERE obj_Id = ?"; @@ -665,7 +665,10 @@ private boolean _isAio = false; private long _aio_endTime = 0; - + + private boolean _isVip = false; + private long _vip_endTime = 0; + /** Event parameters */ public int eventX; public int eventY; @@ -8359,7 +8362,7 @@ { con = L2DatabaseFactory.getInstance().getConnection(false); PreparedStatement statement; - statement = con.prepareStatement("INSERT INTO characters " + "(account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp," + "acc,crit,evasion,mAtk,mDef,mSpd,pAtk,pDef,pSpd,runSpd,walkSpd," + "str,con,dex,_int,men,wit,face,hairStyle,hairColor,sex," + "movement_multiplier,attack_speed_multiplier,colRad,colHeight," + "exp,sp,karma,pvpkills,pkkills,clanid,maxload,race,classid,deletetime," + "cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace," + "base_class,newbie,nobless,power_grade,last_recom_date"/*,banchat_time,*/+",name_color,title_color,aio,aio_end) " + "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); + statement = con.prepareStatement("INSERT INTO characters " + "(account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp," + "acc,crit,evasion,mAtk,mDef,mSpd,pAtk,pDef,pSpd,runSpd,walkSpd," + "str,con,dex,_int,men,wit,face,hairStyle,hairColor,sex," + "movement_multiplier,attack_speed_multiplier,colRad,colHeight," + "exp,sp,karma,pvpkills,pkkills,clanid,maxload,race,classid,deletetime," + "cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace," + "base_class,newbie,nobless,power_grade,last_recom_date"/*,banchat_time,*/+",name_color,title_color,aio,aio_end,vip,vip_end) " + "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); statement.setString(1, _accountName); statement.setInt(2, getObjectId()); statement.setString(3, getName()); @@ -8427,6 +8430,8 @@ statement.setString(59, StringToHex(Integer.toHexString(getAppearance().getTitleColor()).toUpperCase())); statement.setInt(60, isAio() ? 1 :0); statement.setLong(61, 0); + statement.setInt(62, isVip() ? 1 :0); + statement.setLong(63, 0); statement.executeUpdate(); statement.close(); @@ -8660,6 +8665,8 @@ player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level")); player.setAio(rset.getInt("aio") == 1 ? true : false); player.setAioEndTime(rset.getLong("aio_end")); + player.setVip(rset.getInt("vip") == 1 ? true : false); + player.setVipEndTime(rset.getLong("vip_end")); // Add the L2PcInstance object in _allObjects //L2World.getInstance().storeObject(player); @@ -9123,8 +9130,11 @@ statement.setInt(60, isAio() ? 1 : 0); statement.setLong(61, getAioEndTime()); - - statement.setInt(62, getObjectId()); + + statement.setInt(62, isVip() ? 1 : 0); + statement.setLong(63, getVipEndTime()); + + statement.setInt(64, getObjectId()); //statement.setLong(58, getChatBanTimer()); @@ -16035,69 +16045,91 @@ _aio_endTime = val; } - public void setEndTime(String process, int val) - { - if (val > 0) - { - long end_day; - Calendar calendar = Calendar.getInstance(); - if (val >= 30) - { - while(val >= 30) - { - if(calendar.get(Calendar.MONTH)== 11) - calendar.roll(Calendar.YEAR, true); - calendar.roll(Calendar.MONTH, true); - val -= 30; - } - } - if (val < 30 && val > 0) - { - while(val > 0) - { - if(calendar.get(Calendar.DATE)== 28 && calendar.get(Calendar.MONTH) == 1) - calendar.roll(Calendar.MONTH, true); - if(calendar.get(Calendar.DATE)== 30) - { - if(calendar.get(Calendar.MONTH) == 11) - calendar.roll(Calendar.YEAR, true); - calendar.roll(Calendar.MONTH, true); - - } - calendar.roll(Calendar.DATE, true); - val--; - } - } - - end_day = calendar.getTimeInMillis(); - if(process.equals("aio")) - _aio_endTime = end_day; - - else - { - System.out.println("process "+ process + "no Known while try set end date"); - return; - } - Date dt = new Date(end_day); - System.out.println(""+process +" end time for player " + getName() + " is " + dt); - } - else - { - if(process.equals("aio")) - _aio_endTime = 0; - - else - { - System.out.println("process "+ process + "no Known while try set end date"); - return; - } - } - } - public long getAioEndTime() { return _aio_endTime; } + + /** Vip System Start */ + public boolean isVip() + { + return _isVip; + } + + public void setVip(boolean val) + { + _isVip = val; + } + + public void setVipEndTime(long val) + { + _vip_endTime = val; + } + + public long getVipEndTime() + { + return _vip_endTime; + } + + public void setEndTime(String process, int val) + { + if (val > 0) + { + long end_day; + Calendar calendar = Calendar.getInstance(); + if (val >= 30) + { + while(val >= 30) + { + if(calendar.get(Calendar.MONTH)== 11) + calendar.roll(Calendar.YEAR, true); + calendar.roll(Calendar.MONTH, true); + val -= 30; + } + } + if (val < 30 && val > 0) + { + while(val > 0) + { + if(calendar.get(Calendar.DATE)== 28 && calendar.get(Calendar.MONTH) == 1) + calendar.roll(Calendar.MONTH, true); + if(calendar.get(Calendar.DATE)== 30) + { + if(calendar.get(Calendar.MONTH) == 11) + calendar.roll(Calendar.YEAR, true); + calendar.roll(Calendar.MONTH, true); + } + calendar.roll(Calendar.DATE, true); + val--; + } + } + end_day = calendar.getTimeInMillis(); + if(process.equals("aio")) + _aio_endTime = end_day; + else if(process.equals("vip")) + _vip_endTime = end_day; + else + { + System.out.println("Process " + process + " no Known while try set end date."); + return; + } + Date dt = new Date(end_day); + System.out.println("" + process + " end time for player " + getName() + " is " + dt + "."); + } + else + { + if(process.equals("aio")) + _aio_endTime = 0; + else if(process.equals("vip")) + _vip_endTime = 0; + else + { + System.out.println("Process " + process + " no Known while try set end date."); + return; + } + } + } + public long getOfflineStartTime() { return _offlineShopStart; Index: head-src/com/l2jfrozen/gameserver/model/L2Attackable.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/L2Attackable.java (revision 900) +++ head-src/com/l2jfrozen/gameserver/model/L2Attackable.java (working copy) @@ -823,12 +823,18 @@ player.sendPacket(new SystemMessage(SystemMessageId.OVER_HIT)); exp += calculateOverhitExp(exp); } + if(player.isDonator()) { exp = (long) (exp * Config.DONATOR_XPSP_RATE); sp = (int) (sp * Config.DONATOR_XPSP_RATE); } + if (player.isVip() && Config.ALLOW_VIP_XPSP) + { + exp *= Config.VIP_XP; + sp *= Config.VIP_SP; + } player = null; } Index: head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java =================================================================== --- head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (revision 900) +++ head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (working copy) @@ -91,6 +91,7 @@ import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminTvTEngine; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminUnblockIp; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminVIPEngine; +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminVip; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminZone; /** @@ -185,6 +186,7 @@ registerAdminCommandHandler(new AdminNoble()); registerAdminCommandHandler(new AdminBuffs()); registerAdminCommandHandler(new AdminAio()); + registerAdminCommandHandler(new AdminVip()); //ATTENTION: adding new command handlers, you have to change the //sql file containing the access levels rights Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminVip.java =================================================================== --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminVip.java (revision 900) +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminVip.java (working copy) @@ -0,0 +1,273 @@ +/* + * 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 com.l2jfrozen.gameserver.handler.admincommandhandlers; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.util.StringTokenizer; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.l2jfrozen.Config; +import com.l2jfrozen.gameserver.datatables.GmListTable; +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler; +import com.l2jfrozen.gameserver.model.L2World; +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.network.serverpackets.EtcStatusUpdate; +import com.l2jfrozen.util.CloseUtil; +import com.l2jfrozen.util.database.L2DatabaseFactory; + +/** + * Give / Take Status Vip to Player + * Changes name color and title color if enabled + * + * Uses: + * setvip [<player_name>] [<time_duration in days>] + * removevip [<player_name>] + * + * If <player_name> is not specified, the current target player is used. + * + * + * @author KhayrusS + * + */ +public class AdminVip implements IAdminCommandHandler +{ + private final static Logger _log = Logger.getLogger(AdminVip.class.getName()); + + private static String[] _adminCommands = + { + "admin_setvip", "admin_removevip" + }; + + private enum CommandEnum + { + admin_setvip, + admin_removevip + } + + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + StringTokenizer st = new StringTokenizer(command); + + CommandEnum comm = CommandEnum.valueOf(st.nextToken()); + + if(comm == null) + return false; + + switch(comm) + { + case admin_setvip: + { + boolean no_token = false; + + if(st.hasMoreTokens()) + { + String char_name = st.nextToken(); + + L2PcInstance player = L2World.getInstance().getPlayer(char_name); + + if(player != null) + { + if (st.hasMoreTokens()) + { + String time = st.nextToken(); + + try{ + int value = Integer.parseInt(time); + + if(value>0) + { + doVip(activeChar, player, char_name, time); + + if(player.isVip()) + return true; + } + else + { + activeChar.sendMessage("Time must be bigger then 0!"); + return false; + } + } + catch(NumberFormatException e) + { + activeChar.sendMessage("Time must be a number!"); + return false; + } + } + else + { + no_token = true; + } + } + else + { + activeChar.sendMessage("Player must be online to set VIP status"); + no_token = true; + } + } + else + { + no_token=true; + } + + if(no_token) + { + activeChar.sendMessage("Usage: //setvip <char_name> [time](in days)"); + return false; + } + } + + case admin_removevip: + { + boolean no_token = false; + + if(st.hasMoreTokens()) + { + String char_name = st.nextToken(); + + L2PcInstance player = L2World.getInstance().getPlayer(char_name); + + if(player!=null) + { + removeVip(activeChar, player, char_name); + + if(!player.isVip()) + return true; + } + else + { + activeChar.sendMessage("Player must be online to remove VIP status"); + no_token = true; + } + } + else + { + no_token = true; + } + + if(no_token) + { + activeChar.sendMessage("Usage: //removevip <char_name>"); + return false; + } + } + } + return true; + } + + public void doVip(L2PcInstance activeChar, L2PcInstance _player, String _playername, String _time) + { + int days = Integer.parseInt(_time); + if (_player == null) + { + activeChar.sendMessage("not found char" + _playername); + return; + } + + if(days > 0) + { + _player.setVip(true); + _player.setEndTime("vip", days); + + Connection connection = null; + try + { + connection = L2DatabaseFactory.getInstance().getConnection(false); + + PreparedStatement statement = connection.prepareStatement("UPDATE characters SET vip=1, vip_end=? WHERE obj_id=?"); + statement.setLong(1, _player.getVipEndTime()); + statement.setInt(2, _player.getObjectId()); + statement.execute(); + statement.close(); + connection.close(); + + if(Config.ALLOW_VIP_NCOLOR && activeChar.isVip()) + _player.getAppearance().setNameColor(Config.VIP_NCOLOR); + + if(Config.ALLOW_VIP_TCOLOR && activeChar.isVip()) + _player.getAppearance().setTitleColor(Config.VIP_TCOLOR); + + _player.broadcastUserInfo(); + _player.sendPacket(new EtcStatusUpdate(_player)); + GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " set vip stat for player " + _playername + " for " + _time + " day(s)"); + _player.sendMessage("You are now an Vip, Congratulations!"); + _player.broadcastUserInfo(); + } + catch (Exception e) + { + if(Config.DEBUG) + e.printStackTrace(); + + _log.log(Level.WARNING,"could not set vip stats of char:", e); + } + finally + { + CloseUtil.close(connection); + } + } + else + { + removeVip(activeChar, _player, _playername); + } + } + + public void removeVip(L2PcInstance activeChar, L2PcInstance _player, String _playername) + { + _player.setVip(false); + _player.setVipEndTime(0); + + Connection connection = null; + try + { + connection = L2DatabaseFactory.getInstance().getConnection(false); + + PreparedStatement statement = connection.prepareStatement("UPDATE characters SET vip=0, vip_end=0 WHERE obj_id=?"); + statement.setInt(1, _player.getObjectId()); + statement.execute(); + statement.close(); + connection.close(); + + _player.getAppearance().setTitleColor(0xFFFF77); + _player.getAppearance().setNameColor(0xFFFFFF); + _player.broadcastUserInfo(); + _player.sendPacket(new EtcStatusUpdate(_player)); + GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " remove vip stat of player " + _playername); + _player.sendMessage("Now You are not an Vip.."); + _player.broadcastUserInfo(); + } + catch (Exception e) + { + if(Config.DEBUG) + e.printStackTrace(); + + _log.log(Level.WARNING,"could not remove vip stats of char:", e); + } + finally + { + CloseUtil.close(connection); + } + } + + public String[] getAdminCommandList() + { + return _adminCommands; + } +} Index: head-src/com/l2jfrozen/Config.java =================================================================== --- head-src/com/l2jfrozen/Config.java (revision 900) +++ head-src/com/l2jfrozen/Config.java (working copy) @@ -548,6 +548,13 @@ public static int AIO_TCOLOR; public static boolean ALLOW_AIO_USE_GK; public static boolean ALLOW_AIO_USE_CM; + public static boolean ALLOW_VIP_NCOLOR; + public static int VIP_NCOLOR; + public static boolean ALLOW_VIP_TCOLOR; + public static int VIP_TCOLOR; + public static boolean ALLOW_VIP_XPSP; + public static int VIP_XP; + public static int VIP_SP; public static boolean ANNOUNCE_CASTLE_LORDS; /** Configuration to allow custom items to be given on character creation */ @@ -644,6 +651,13 @@ AIO_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("AioTitleColor", "88AA88")); ALLOW_AIO_USE_GK = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseGk", "False")); ALLOW_AIO_USE_CM = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseClassMaster", "False")); + ALLOW_VIP_NCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowVipNameColor", "True")); + VIP_NCOLOR = Integer.decode("0x" + otherSettings.getProperty("VipNameColor", "0088FF")); + ALLOW_VIP_TCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowVipTitleColor", "True")); + VIP_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("VipTitleColor", "0088FF")); + ALLOW_VIP_XPSP = Boolean.parseBoolean(otherSettings.getProperty("AllowVipMulXpSp", "True")); + VIP_XP = Integer.parseInt(otherSettings.getProperty("VipMulXp", "2")); + VIP_SP = Integer.parseInt(otherSettings.getProperty("VipMulSp", "2")); ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(otherSettings.getProperty("AnnounceCastleLords", "False")); if(ENABLE_AIO_SYSTEM) //create map if system is enabled {
  3. Does anyone have adapted this code for l2j frozen? can i have a copy? thank you
  4. Could you plz sent me a pm with the ipn updated? or if anyone could help me plz?
  5. Looking for a Graphic Designer i wanna create a logo fror my server plz inform me by pm! I am gonna pay with paypal! Thank you!
  6. ty i will try them for sure keep sharing man!
  7. i have disabled bow in some classes outside oly! in oly players now can equip bow as retail. if i didnt implented end game console code to unequip the bows the players who joined olympiad and equiped the bow inside olympiad they could carry it out of oly even the game is finished! sry for my bad english
  8. Guys that's it! I made it work perfect even in crash in oly the bow uneqquips and the exception on restricted still works outside oly and in oly you can carry bow! Ty "baggos" for your reply! If anyone needs the code to unequip bows or an other equipment when olympiad ends even with crash i can give him for free for l2j frozen [IL] Topic locks!
  9. [Feels Good Mate] I made some changes and made it happen working only with one {IF} in my code! Now it's time to make the code when oly ends to uneqquip them if uqquiped any ideas guys?
  10. Thank you for yor reply, i use l2j frozen pack for interlude the titles.java you typed dont exist in my pack i opened i tried UseItem.java to search about restricted items and i found them. But i dont want to restrict bow in olympiad i want it to be weared as normal cause outside oly is restricted and when olympiad finish to remove his bow if geared so i want to make an easy exception on this upper code. But i dont know much about java coding. Could anyone help me
  11. is there anyone who has the files? i implented code and it's working i only miss the datapack files {html and images}
  12. Hello again i have a config that disables bows in some classes from a config as you can see below I need to make an exception on this code so in olympiad the players of those classes can use bow as retail and when olympiad game unequip the bow if geared! //Weapon if (Config.ALT_DISABLE_BOW_CLASSES) { if(item.getItem() instanceof L2Weapon && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.BOW) { if(Config.DISABLE_BOW_CLASSES.contains(activeChar.getClassId().getId()) && !(activeChar.isInOlympiadMode())){ activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_EQUIP_ITEM_DUE_TO_BAD_CONDITION)); return; } } } If anyone have some time to spare to help me with it would be perfect! Thank you anyway!
  13. nice idea i tried i implented the necessary tables and works fine without changing instances and core doorinastances! Thank you very much all of you! This topic can be locked!
  14. Thank you guys for your replies! As i said there is no such thing in my pack. i use IL chronicle with frozen pack any other solution plz? The only way to configure this out is only from .csv file or by source i tried to copy source like typed above but i think i made a wrong input in tables needed so if anyone have any idea would be helpfull if you need my l2doorinstance code i can add it on pastebin right now!
  15. i tried i add the static void i imported the tables but again i have problem loading the server now (i changed Doors ID btw) wanna see a picture? i work on l2j frozen pack for fun
  16. Hi guys i need to open the main door on pagans temple but after every restart the gate close again i tried .csv file but nothing changed, i tried l2doorinstance.java but i'm new on coding and i cant find the exception or how i should add one for the door! Any reply would be helpfull! Thank you very much!
  17. It's ok guys i found what's wrong... the problem was one item with corrupted client files in my inventory
  18. Guys i have this error when i create new char and log in i get client crash....what's wrong? General protection fault! History: NWndUtil::ItemInfoToNCParam <- NConsoleWnd::AddInventoryItem <- ItemListPacket <- UNetworkHandler::Tick <- Function Name=ItemListPacket <- UGameEngine::Tick <- UpdateWorld <- MainLoop
  19. Guys i edited by myself and using Reborn12 code and now it works Perfect no errors and take the votes right! The change i made was this: protected int getHopZoneVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(PowerPakConfig.VOTES_SITE_HOPZONE_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2HopZone"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("Total Votes") || inputLine.contains("rank tooltip") || inputLine.contains("no steal make love") || inputLine.contains("no votes here") || inputLine.contains("bang, you don't have votes") || inputLine.contains("la vita e bella") || inputLine.contains("rank anonymous tooltip")) { votes = Integer.valueOf(inputLine.split(">")[2].replace("</span", "")); break; } } } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server HOPZONE is offline or something is wrong in link", e); Announcements.getInstance().gameAnnounceToAll("[AutoVoteReward] HOPZONE is offline. We will check reward as it will be online again"); // e.printStackTrace(); } finally { if (in != null) try { in.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (isr != null) try { isr.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (is != null) try { is.close(); } catch (final IOException e1) { e1.printStackTrace(); } } return votes; } Thank you all for your time and the sollutions you told me! Now i'm looking for an Individual VoteReward System-NPC for L2JFrozen if anyone have something i apprecciate it!
  20. if i do this i would have to edit the link from javascript right? This will affect the next lines in javascript about gethopzonevote and the html needed from configs?
  21. i tried it but i think i made wrong lines copy/paste i erased (+) values but on build makes errors As i saied i'm so newbie and i dont know what error is to disguss it further i see the line where is the error but i dont know why and what to do to make it right. Could you plz make the edit for me please if you have some spare time? Or sent me a pick from where to where i make the edit or even better if you have some spare time edit it and sent me the code just to cope paste it... Thanks anyway!
  22. melron i already tried this but the same problem... Reborn12 i checked all the forum posts before post it here as i said i'm still new to javascripting so i cant conver javascript from acis to l2jfrozen that's why i ask your help... As i saw you're a very experienced dev for this matter so the help i need here is a new fixed javascript to replace the existing one without convert it by my self manualy cause i dont know how to do it yet.... If there any other file or java script you need to check plz ask me to sent it here to find the problem Thank you for your time guys i appreciate it!
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..