Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2JDream
- Index: Dream_GameServer/src/com/dream/game/handler/voiced/VipComand.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/handler/voiced/VipComand.java (revision 0)
- +++ Dream_GameServer/src/com/dream/game/handler/voiced/VipComand.java (working copy)
- @@ -0,0 +1,62 @@
- +/*
- + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
- + */
- +package com.dream.game.handler.voiced;
- +
- +import com.dream.Config;
- +import com.dream.game.handler.IVoicedCommandHandler;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +
- +public class VipComand implements IVoicedCommandHandler
- +{
- + private static final String[] VOICED_COMMANDS =
- + {
- + "viptele",
- + };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
- + {
- + if (command.equals("viptele"))
- + {
- + if (checkConditions(activeChar))
- + {
- + activeChar.teleToLocation(Config.VIP_TELE_X, Config.VIP_TELE_Y, Config.VIP_TELE_Z);
- + }
- + }
- +
- + return true;
- + }
- +
- + private static boolean checkConditions(L2PcInstance p)
- + {
- + if (!p.isVip() && Config.ALLOW_VIP_TELE)
- + {
- + return false;
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +
- + @Override
- + public String getDescription(String command)
- + {
- + return "Teleport you to an Vip area.";
- + }
- +}
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/handler/item/VipItem.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/handler/item/VipItem.java (revision 0)
- +++ Dream_GameServer/src/com/dream/game/handler/item/VipItem.java (working copy)
- @@ -0,0 +1,109 @@
- +package com.dream.game.handler.item;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +
- +import com.dream.Config;
- +import com.dream.L2DatabaseFactory;
- +import com.dream.game.handler.IItemHandler;
- +import com.dream.game.model.actor.L2Playable;
- +import com.dream.game.model.actor.instance.L2ItemInstance;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +import com.dream.game.network.SystemChatChannelId;
- +import com.dream.game.network.serverpackets.CreatureSay;
- +
- +public class VipItem implements IItemHandler
- +{
- + private static final int[] ITEM_IDS =
- + {
- + Config.VIP_ITEM1,
- + Config.VIP_ITEM2,
- + Config.VIP_ITEM3
- + };
- +
- + @Override
- + public void useItem(L2Playable playable, L2ItemInstance item, boolean par)
- + {
- +
- + }
- +
- + @Override
- + public void useItem(L2Playable playable, L2ItemInstance item)
- + {
- + if (!(playable instanceof L2PcInstance))
- + {
- + return;
- + }
- +
- + L2PcInstance activeChar = (L2PcInstance) playable;
- +
- + if (item.getItemId() == Config.VIP_ITEM1)
- + {
- + activeChar.setVip(true);
- + activeChar.setEndTime("vip", Config.VIP_ITEM_DAY1);
- + activeChar.doVIP(activeChar);
- + activeChar.sendPacket(new CreatureSay(0, SystemChatChannelId.Chat_None, "System", "Dear player, you are now an VIP, congratulations."));
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET vip = 1, vip_end = ? WHERE charId=?");
- + statement.setLong(1, activeChar.getVipEndTime());
- + statement.setInt(2, activeChar.getObjectId());
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warn("Something went wrong, check log folder for details", e);
- + }
- + }
- +
- + if (item.getItemId() == Config.VIP_ITEM2)
- + {
- + activeChar.setVip(true);
- + activeChar.setEndTime("vip", Config.VIP_ITEM_DAY2);
- + activeChar.doVIP(activeChar);
- + activeChar.sendPacket(new CreatureSay(0, SystemChatChannelId.Chat_None, "System", "Dear player, you are now an VIP, congratulations."));
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET vip = 1, vip_end = ? WHERE charId=?");
- + statement.setLong(1, activeChar.getVipEndTime());
- + statement.setInt(2, activeChar.getObjectId());
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warn("Something went wrong, check log folder for details", e);
- + }
- + }
- +
- + if (item.getItemId() == Config.VIP_ITEM3)
- + {
- + activeChar.setVip(true);
- + activeChar.setEndTime("vip", Config.VIP_ITEM_DAY3);
- + activeChar.doVIP(activeChar);
- + activeChar.sendPacket(new CreatureSay(0, SystemChatChannelId.Chat_None, "System", "Dear player, you are now an VIP, congratulations."));
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET vip = 1, vip_end = ? WHERE charId=?");
- + statement.setLong(1, activeChar.getVipEndTime());
- + statement.setInt(2, activeChar.getObjectId());
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warn("Something went wrong, check log folder for details", e);
- + }
- + }
- + }
- +
- + @Override
- + public int[] getItemIds()
- + {
- + return ITEM_IDS;
- + }
- +}
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/Config.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/Config.java (revision 2099)
- +++ Dream_GameServer/src/com/dream/Config.java (working copy)
- @@ -11,6 +11,7 @@
- import java.io.OutputStream;
- import java.math.BigInteger;
- import java.util.ArrayList;
- +import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.Properties;
- @@ -35,6 +36,105 @@
- {
- protected static Logger _log = Logger.getLogger(Config.class.getName());
- + // Vip Properties
- + public static boolean ENABLE_VIP_SYSTEM;
- + public static Map<Integer, Integer> VIP_SKILLS;
- + public static boolean ALLOW_VIP_NCOLOR;
- + public static int VIP_NCOLOR;
- + public static boolean ALLOW_VIP_TCOLOR;
- + public static int VIP_TCOLOR;
- + public static float VIP_XP_SP_RATE;
- + public static float VIP_ADENA_RATE;
- + public static float VIP_DROP_RATE;
- + public static float VIP_SPOIL_RATE;
- + public static boolean ALLOW_VIP_ITEM;
- + public static int VIP_ITEMID;
- + public static boolean ALLOW_CUSTOM_CHAR_VIP;
- + public static int CUSTOM_DAY_VIP;
- + public static boolean ALLOW_VIP_LEVEL;
- + public static int VIP_DAY_LEVEL;
- + public static int VIP_LEVEL_GIVE;
- + public static int VIP_ITEM1;
- + public static int VIP_ITEM_DAY1;
- + public static int VIP_ITEM2;
- + public static int VIP_ITEM_DAY2;
- + public static int VIP_ITEM3;
- + public static int VIP_ITEM_DAY3;
- + public static boolean ALLOW_VIP_TELE;
- + public static int VIP_TELE_X;
- + public static int VIP_TELE_Y;
- + public static int VIP_TELE_Z;
- +
- + public static void loadVipConfig()
- + {
- + try
- + {
- + Properties p = new L2Properties(ConfigFiles.VIP_FILE);
- +
- + /** VIP System */
- + ENABLE_VIP_SYSTEM = Boolean.parseBoolean(p.getProperty("EnableVipSystem", "True"));
- + ALLOW_VIP_NCOLOR = Boolean.parseBoolean(p.getProperty("AllowVipNameColor", "True"));
- + VIP_NCOLOR = Integer.decode("0x" + p.getProperty("VipNameColor", "88AA88"));
- + ALLOW_VIP_TCOLOR = Boolean.parseBoolean(p.getProperty("AllowVipTitleColor", "True"));
- + VIP_TCOLOR = Integer.decode("0x" + p.getProperty("VipTitleColor", "88AA88"));
- + VIP_XP_SP_RATE = Float.parseFloat(p.getProperty("VIPXpSpRate", "1.5"));
- + VIP_ADENA_RATE = Float.parseFloat(p.getProperty("VIPAdenaRate", "1.5"));
- + VIP_DROP_RATE = Float.parseFloat(p.getProperty("VIPDropRate", "1.5"));
- + VIP_SPOIL_RATE = Float.parseFloat(p.getProperty("VIPSpoilRate", "1.5"));
- + VIP_ITEMID = Integer.parseInt(p.getProperty("ItemIdVip", "9945"));
- + ALLOW_VIP_ITEM = Boolean.parseBoolean(p.getProperty("AllowVIPItem", "False"));
- + ALLOW_CUSTOM_CHAR_VIP = Boolean.parseBoolean(p.getProperty("AllowCustomStartVip", "false"));
- + CUSTOM_DAY_VIP = Integer.parseInt(p.getProperty("CustomStartDays", "1"));
- + ALLOW_VIP_LEVEL = Boolean.parseBoolean(p.getProperty("AllowVipLevel", "false"));
- + VIP_DAY_LEVEL = Integer.parseInt(p.getProperty("VipDayLevel", "10"));
- + VIP_LEVEL_GIVE = Integer.parseInt(p.getProperty("VipLevelGive", "15"));
- + VIP_ITEM1 = Integer.parseInt(p.getProperty("VipItem1", "5567"));
- + VIP_ITEM_DAY1 = Integer.parseInt(p.getProperty("VipItemDay1", "7"));
- + VIP_ITEM2 = Integer.parseInt(p.getProperty("VipItem2", "5568"));
- + VIP_ITEM_DAY2 = Integer.parseInt(p.getProperty("VipItemDay2", "15"));
- + VIP_ITEM3 = Integer.parseInt(p.getProperty("VipItem3", "5569"));
- + VIP_ITEM_DAY3 = Integer.parseInt(p.getProperty("VipItemDay3", "30"));
- + ALLOW_VIP_TELE = Boolean.parseBoolean(p.getProperty("AllowVipTele", "True"));
- + VIP_TELE_X = Integer.parseInt(p.getProperty("VipTeleX", "36554"));
- + VIP_TELE_Y = Integer.parseInt(p.getProperty("VipTeley", "-6654"));
- + VIP_TELE_Z = Integer.parseInt(p.getProperty("VipTelez", "1644"));
- +
- + if (ENABLE_VIP_SYSTEM)
- + {
- + String[] VipSkillsSplit = p.getProperty("VipSkills", "").split(";");
- + VIP_SKILLS = new HashMap<>(VipSkillsSplit.length);
- + for (String skill : VipSkillsSplit)
- + {
- + String[] skillSplit = skill.split(",");
- + if (skillSplit.length != 2)
- + {
- + _log.info("[VIP System]: invalid config property in vip.properties -> VipSkills \"" + skill + "\"");
- + }
- + else
- + {
- + try
- + {
- + VIP_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
- + }
- + catch (NumberFormatException nfe)
- + {
- + if (!skill.equals(""))
- + {
- + _log.info("[VIP System]: invalid config property in vip.properties -> VipSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
- + }
- + }
- + }
- + }
- + }
- +
- + }
- + catch (Exception e)
- + {
- + _log.error(e.getMessage(), e);
- + throw new Error("Failed to Load " + ConfigFiles.VIP_FILE + " File.");
- + }
- + }
- +
- // Npc Properties
- public static boolean SHOW_NPC_LVL;
- public static int MAX_DRIFT_RANGE;
- @@ -2554,6 +2654,7 @@
- loadCustomConfig();
- loadOptionsConfig();
- loadRatesConfig();
- + loadVipConfig();
- if (!ReloadHandler.getInstance().isRegistred("config"))
- {
- ReloadHandler.getInstance().registerHandler("config", _reloadAll);
- Index: Dream_GameServer/src/com/dream/game/model/actor/stat/PcStat.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/model/actor/stat/PcStat.java (revision 2099)
- +++ Dream_GameServer/src/com/dream/game/model/actor/stat/PcStat.java (working copy)
- @@ -129,6 +129,13 @@
- L2PcInstance activeChar = getActiveChar();
- + if (Config.ALLOW_VIP_LEVEL && (getLevel() == Config.VIP_DAY_LEVEL))
- + {
- + activeChar.setVip(true);
- + activeChar.setVipEndTime(Config.VIP_LEVEL_GIVE);
- + activeChar.doVIP(activeChar);
- + }
- +
- if (levelIncreased)
- {
- QuestState qs = activeChar.getQuestState("255_Tutorial");
- Index: Dream_Commons/src/main/java/com/dream/ConfigFiles.java
- ===================================================================
- --- Dream_Commons/src/main/java/com/dream/ConfigFiles.java (revision 2099)
- +++ Dream_Commons/src/main/java/com/dream/ConfigFiles.java (working copy)
- @@ -34,4 +34,5 @@
- public static final String SAY_FILTER = "./config/admin/sayfilter.txt";
- + public static final String VIP_FILE = "./config/main/vip.properties";
- }
- Index: Dream_GameServer/src/com/dream/game/model/actor/L2Attackable.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/model/actor/L2Attackable.java (revision 2099)
- +++ Dream_GameServer/src/com/dream/game/model/actor/L2Attackable.java (working copy)
- @@ -657,6 +657,17 @@
- }
- }
- + if (attacker instanceof L2PcInstance)
- + {
- + L2PcInstance a = (L2PcInstance) attacker;
- +
- + if (a.isVip())
- + {
- + exp *= Config.VIP_XP_SP_RATE;
- + sp *= Config.VIP_XP_SP_RATE;
- + }
- + }
- +
- // Distribute the Exp and SP between the
- // L2PcInstance and its L2Summon
- if (isChampion())
- @@ -829,6 +840,17 @@
- }
- }
- + if (attacker instanceof L2PcInstance)
- + {
- + L2PcInstance a = (L2PcInstance) attacker;
- +
- + if (a.isVip())
- + {
- + exp *= Config.VIP_XP_SP_RATE;
- + sp *= Config.VIP_XP_SP_RATE;
- + }
- + }
- +
- // champion xp/sp :)
- if (isChampion())
- {
- @@ -1227,14 +1249,26 @@
- if (drop.getItemId() == 57)
- {
- dropChance *= Config.RATE_DROP_ADENA;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_ADENA_RATE;
- + }
- }
- else if (isSweep)
- {
- dropChance *= Config.RATE_DROP_SPOIL;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_SPOIL_RATE;
- + }
- }
- else
- {
- dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_DROP_RATE;
- + }
- }
- dropChance = Math.round(dropChance) * champRate;
- @@ -1364,14 +1398,21 @@
- }
- int dropChance = drop.getChance();
- -
- if (drop.getItemId() == 57)
- {
- dropChance *= Config.RATE_DROP_ADENA;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_ADENA_RATE;
- + }
- }
- else
- {
- dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
- + if (lastAttacker.isVip())
- + {
- + dropChance *= Config.VIP_DROP_RATE;
- + }
- }
- dropChance = Math.round(dropChance) * champRate;
- Index: Dream_GameServer/src/com/dream/game/network/clientpackets/EnterWorld.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/network/clientpackets/EnterWorld.java (revision 2099)
- +++ Dream_GameServer/src/com/dream/game/network/clientpackets/EnterWorld.java (working copy)
- @@ -1,5 +1,8 @@
- package com.dream.game.network.clientpackets;
- +import java.util.Calendar;
- +import java.util.Date;
- +
- import org.apache.log4j.Logger;
- import com.dream.Config;
- @@ -46,7 +49,9 @@
- import com.dream.game.model.restriction.ObjectRestrictions;
- import com.dream.game.model.world.L2World;
- import com.dream.game.model.zone.L2Zone;
- +import com.dream.game.network.SystemChatChannelId;
- import com.dream.game.network.SystemMessageId;
- +import com.dream.game.network.serverpackets.CreatureSay;
- import com.dream.game.network.serverpackets.Die;
- import com.dream.game.network.serverpackets.EtcStatusUpdate;
- import com.dream.game.network.serverpackets.ExStorageMaxCount;
- @@ -335,6 +340,21 @@
- ObjectRestrictions.getInstance().resumeTasks(activeChar.getObjectId());
- + if (activeChar.isVip())
- + {
- + onEnterVip(activeChar);
- + }
- +
- + 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 (Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)
- {
- activeChar.checkAllowedSkills();
- @@ -564,4 +584,30 @@
- }
- }
- + private static void onEnterVip(L2PcInstance activeChar)
- + {
- + long now = Calendar.getInstance().getTimeInMillis();
- + long endDay = activeChar.getVipEndTime();
- + if (now > endDay)
- + {
- + activeChar.setVip(false);
- + activeChar.setVipEndTime(0);
- + activeChar.lostVipSkills();
- + if (Config.ALLOW_VIP_ITEM)
- + {
- + activeChar.getInventory().destroyItemByItemId("", Config.VIP_ITEMID, 1, activeChar, null);
- + activeChar.getWarehouse().destroyItemByItemId("", Config.VIP_ITEMID, 1, activeChar, null);
- + activeChar.sendPacket(new ItemList(activeChar.getInventory().getItems(), true));
- + }
- + activeChar.sendPacket(new CreatureSay(0, SystemChatChannelId.Chat_None, "System", "Your VIP period ends."));
- + }
- + else
- + {
- + Date dt = new Date(endDay);
- + if (activeChar.isVip())
- + {
- + activeChar.sendMessage("Your VIP period ends at: " + dt);
- + }
- + }
- + }
- }
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/handler/admin/AdminVip.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/handler/admin/AdminVip.java (revision 0)
- +++ Dream_GameServer/src/com/dream/game/handler/admin/AdminVip.java (working copy)
- @@ -0,0 +1,114 @@
- +/*
- + * 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.dream.game.handler.admin;
- +
- +import org.apache.log4j.Logger;
- +
- +import com.dream.Config;
- +import com.dream.game.access.gmHandler;
- +import com.dream.game.model.L2Object;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +import com.dream.game.model.world.L2World;
- +
- +public class AdminVip extends gmHandler
- +{
- + private static String[] _adminCommands =
- + {
- + "setvip",
- + "removevip"
- + };
- +
- + protected static Logger _log = Logger.getLogger(Config.class.getName());
- +
- + @Override
- + public void runCommand(L2PcInstance admin, String... params)
- + {
- + final String command = params[0];
- +
- + if (command.startsWith("setvip"))
- + {
- + L2Object target = admin.getTarget();
- + L2PcInstance player = L2World.getInstance().getPlayer(params[1]);
- +
- + if ((target != null) && (target instanceof L2PcInstance))
- + {
- + player = (L2PcInstance) target;
- + }
- + else
- + {
- + player = admin;
- + }
- +
- + try
- + {
- + String playername = player.getName();
- + admin.doVip(player, playername, params[2]);
- + }
- + catch (Exception e)
- + {
- + admin.sendMessage("Usage: //setvip <name> [time](in days)");
- + }
- +
- + player.broadcastUserInfo();
- +
- + if (player.isVip())
- + {
- + return;
- + }
- + }
- + else if (command.startsWith("removevip"))
- + {
- + L2Object target = admin.getTarget();
- + L2PcInstance player = null;
- +
- + if (target instanceof L2PcInstance)
- + {
- + player = (L2PcInstance) target;
- + }
- + else
- + {
- + player = admin;
- + }
- +
- + try
- + {
- + String playername = player.getName();
- + admin.removeVip(player, playername);
- + }
- + catch (Exception e)
- + {
- + admin.sendMessage("Usage: //removevip <char_name>");
- + }
- +
- + player.broadcastUserInfo();
- +
- + if (!player.isVip())
- + {
- + return;
- + }
- + }
- + return;
- + }
- +
- + @Override
- + public String[] getCommandList()
- + {
- + return _adminCommands;
- + }
- +}
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/network/clientpackets/CharacterCreate.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/network/clientpackets/CharacterCreate.java (revision 2099)
- +++ Dream_GameServer/src/com/dream/game/network/clientpackets/CharacterCreate.java (working copy)
- @@ -191,6 +191,13 @@
- }
- }
- + if (Config.ALLOW_CUSTOM_CHAR_VIP)
- + {
- + newChar.setVip(true);
- + newChar.setVipEndTime(Config.CUSTOM_DAY_VIP);
- + newChar.doVIP(newChar);
- + }
- +
- startTutorialQuest(newChar);
- newChar.store();
- newChar.deleteMe();
- Index: Dream_GameServer/dist/config/main/vip.properties
- ===================================================================
- --- Dream_GameServer/dist/config/main/vip.properties (revision 0)
- +++ Dream_GameServer/dist/config/main/vip.properties (working copy)
- @@ -0,0 +1,84 @@
- +#=============================================================
- +# VIP System
- +#=============================================================
- +EnableVipSystem = True
- +
- +# Enable / Disable Name Color
- +AllowVipNameColor = True
- +VipNameColor = 88AA88
- +
- +# Enable / Disable Title Color
- +AllowVipTitleColor = True
- +VipTitleColor = 88AA88
- +
- +# VIP Xp/Sp Rate
- +VIPXpSpRate = 1.5
- +# VIP Adena rate
- +VIPAdenaRate = 1.5
- +# VIP drop rate
- +VIPDropRate = 1.5
- +# VIP spoil rate
- +VIPSpoilRate = 1.5
- +
- +# List of Vip Skills
- +# Format : skillid,skilllvl;skillid2,skilllvl2;
- +VipSkills = 1085,3;1304,3;1087,3;1354,1;1062,2;1243,6;1045,6;1048,6;1429,1;163,1;\
- +1311,6;213,8;1007,3;1309,3;1552,3;1006,3;1308,3;1253,3;1284,3;1392,3;1393,3;214,1;\
- +1009,3;1310,4;1363,1;1362,1;1397,3;1292,6;1078,6;307,1;276,1;309,1;274,1;275,1;164,3;\
- +272,1;277,1;273,1;311,1;366,1;365,1;310,1;271,1;1242,3;1391,3;1002,3;7029,1;\
- +1352,1;229,7;228,3;1077,3;1218,33;1059,3;1219,33;1388,3;1389,3;1240,3;1413,1;\
- +1086,2;1036,2;1035,4;1068,3;1356,1;1355,1;1357,1;1307,3;1410,1;1409,1;1353,1;\
- +1044,3;1182,3;1191,3;1189,3;1259,4;1306,6;234,23;1040,3;364,1;264,1;306,1;\
- +269,1;270,1;265,1;363,1;349,1;308,1;305,1;304,1;267,1;266,1;268,1;1390,3;1303,2;\
- +1204,2;1268,4
- +
- +# Custom item for VIP
- +AllowVIPItem = True
- +
- +# ID of the item that will be given to VIP
- +# Default: Keshanberk*Keshanberk
- +ItemIdVip = 5233
- +
- +# Allow custom Day's Vip on CharacterCreate
- +# Default: False
- +AllowCustomStartVip = False
- +# Custom Start Days for Vip
- +# Default: 1
- +CustomStartDays = 1
- +
- +# Allow VipLevel when Char reach LEVEL
- +# Default: False
- +AllowVipLevel = False
- +
- +# Level need to rech to doVIP
- +VipDayLevel = 10
- +
- +# Time in Day's GIVE reach LEVEL
- +VipLevelGive = 15
- +
- +# Vip Item Use's
- +# ID of the item that you will put the player to become VIP!
- +VipItem1 = 5567
- +
- +# Number of days that the player get VIP!
- +VipItemDay1 = 7
- +
- +# ID of the item that you will put the player to become VIP!
- +VipItem2 = 5568
- +
- +# Number of days that the player get VIP!
- +VipItemDay2 = 15
- +
- +# ID of the item that you will put the player to become VIP!
- +VipItem3 = 5569
- +
- +# Number of days that the player get VIP!
- +VipItemDay3 = 30
- +
- +# System Vip Teleport Command
- +# Arena Teleport
- +# Vip Teleport Command .viptele
- +AllowVipTele = True
- +VipTeleX = 36554
- +VipTeley = -6654
- +VipTelez = 1644
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/model/actor/instance/L2PcInstance.java (revision 2099)
- +++ Dream_GameServer/src/com/dream/game/model/actor/instance/L2PcInstance.java (working copy)
- @@ -245,6 +245,10 @@
- private boolean _showTraders = true;
- private boolean _showBuffAnimation = true;
- + /** VIP System */
- + private boolean _isVip = false;
- + private long _vip_endTime = 0;
- +
- private boolean _GmStatus = false;
- private boolean _AllowFixRes = false;
- private boolean _AllowAltG = false;
- @@ -270,9 +274,9 @@
- private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE charId = ? AND class_index = ?";
- - private static final String UPDATE_CHARACTER = "UPDATE characters SET level = ?, maxHp = ?, curHp = ?, maxCp = ?, curCp = ?, maxMp = ?, curMp = ?, face = ?, hairStyle = ?, hairColor = ?, heading = ?, x = ?, y = ?, z = ?, exp = ?, expBeforeDeath = ?, sp = ?, karma = ?, pvpkills = ?, pkkills = ?, rec_have = ?, rec_left = ?, clanid = ?, race = ?, classid = ?, deletetime = ?, title = ?, online = ?, isin7sdungeon = ?, clan_privs = ?, wantspeace = ?, base_class = ?, onlinetime = ?, in_jail = ?, jail_timer = ?, newbie = ?, nobless = ?, pledge_rank = ?, 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 = ?, pccaffe_points = ?, isBanned = ?, hwid = ? WHERE charId = ?";
- + private static final String UPDATE_CHARACTER = "UPDATE characters SET level = ?, maxHp = ?, curHp = ?, maxCp = ?, curCp = ?, maxMp = ?, curMp = ?, face = ?, hairStyle = ?, hairColor = ?, heading = ?, x = ?, y = ?, z = ?, exp = ?, expBeforeDeath = ?, sp = ?, karma = ?, pvpkills = ?, pkkills = ?, rec_have = ?, rec_left = ?, clanid = ?, race = ?, classid = ?, deletetime = ?, title = ?, online = ?, isin7sdungeon = ?, clan_privs = ?, wantspeace = ?, base_class = ?, onlinetime = ?, in_jail = ?, jail_timer = ?, newbie = ?, nobless = ?, pledge_rank = ?, 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 = ?, pccaffe_points = ?, isBanned = ?, hwid = ?, vip = ?, vip_end = ? 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, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, pledge_rank, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally, clan_join_expiry_time, clan_create_expiry_time, death_penalty_level, pccaffe_points, isBanned, hwid FROM characters 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, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, pledge_rank, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally, clan_join_expiry_time, clan_create_expiry_time, death_penalty_level, pccaffe_points, isBanned, hwid, vip, vip_end FROM characters WHERE charId = ?";
- private static final String CREATE_CHARACTER = "INSERT INTO characters (account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, exp, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, online, isin7sdungeon, clan_privs, wantspeace, base_class, newbie, nobless, pledge_rank, last_recom_date) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
- @@ -5891,6 +5895,10 @@
- player.setLvlJoinedAcademy(rset.getInt("lvl_joined_academy"));
- player.setAllianceWithVarkaKetra(rset.getInt("varka_ketra_ally"));
- player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));
- +
- + player.setVip(rset.getInt("vip") == 1 ? true : false);
- + player.setVipEndTime(rset.getLong("vip_end"));
- +
- player.getPosition().setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
- PreparedStatement stmt = con.prepareStatement("SELECT charId, char_name FROM characters WHERE account_name=? AND charId<>?");
- @@ -6441,7 +6449,9 @@
- statement.setLong(49, _pccaffe);
- statement.setInt(50, isBanned() ? 1 : 0);
- statement.setString(51, getHWid());
- - statement.setInt(52, getObjectId());
- + statement.setInt(52, isVip() ? 1 : 0);
- + statement.setLong(53, getVipEndTime());
- + statement.setInt(54, getObjectId());
- statement.execute();
- statement.close();
- }
- @@ -13378,4 +13388,172 @@
- {
- sendPacket(new CreatureSay(objectId, SystemChatChannelId.Chat_None, charName, text));
- }
- +
- + public boolean isVip()
- + {
- + return _isVip;
- + }
- +
- + public void setVip(boolean val)
- + {
- + _isVip = val;
- + }
- +
- + public long getVipEndTime()
- + {
- + return _vip_endTime;
- + }
- +
- + public void setVipEndTime(long val)
- + {
- + _vip_endTime = val;
- + }
- +
- + public void rewardVipSkills()
- + {
- + L2Skill skill;
- + for (Integer skillid : Config.VIP_SKILLS.keySet())
- + {
- + int skilllvl = Config.VIP_SKILLS.get(skillid);
- + skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
- + if (skill != null)
- + {
- + addSkill(skill, true);
- + }
- + }
- + }
- +
- + public void lostVipSkills()
- + {
- + for (L2Skill skill : this.getAllSkills())
- + {
- + this.removeSkill(skill);
- + }
- + }
- +
- + public void setEndTime(String process, int val)
- + {
- + Calendar calendar = Calendar.getInstance();
- + calendar.add(Calendar.DAY_OF_MONTH, val);
- + long end_day = calendar.getTimeInMillis();
- +
- + if (process.equals("vip"))
- + {
- + _vip_endTime = end_day;
- + }
- + }
- +
- + public void doVip(L2PcInstance _player, String _playername, String _time)
- + {
- + int days = Integer.parseInt(_time);
- +
- + if ((_player == null) || _player.isVip())
- + {
- + return;
- + }
- +
- + if (days > 0)
- + {
- + _player.lostVipSkills();
- + _player.setVip(true);
- + _player.setEndTime("vip", days);
- + _player.sendPacket(new CreatureSay(0, SystemChatChannelId.Chat_None, "System", "Dear player, you are now an VIP, congratulations."));
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET vip = 1, vip_end = ? WHERE charId=?");
- + statement.setLong(1, _player.getVipEndTime());
- + statement.setInt(2, _player.getObjectId());
- + statement.execute();
- + statement.close();
- +
- + if (Config.ALLOW_VIP_NCOLOR)
- + {
- + _player.getAppearance().setNameColor(Config.VIP_NCOLOR);
- + }
- +
- + if (Config.ALLOW_VIP_TCOLOR)
- + {
- + _player.getAppearance().setTitleColor(Config.VIP_TCOLOR);
- + }
- +
- + _player.rewardVipSkills();
- +
- + if (Config.ALLOW_VIP_ITEM)
- + {
- + _player.getInventory().addItem("", Config.VIP_ITEMID, 1, _player, null);
- + _player.getInventory().equipItem(_player.getInventory().getItemByItemId(Config.VIP_ITEMID));
- + _player.sendPacket(new ItemList(_player.getInventory().getItems(), true));
- +
- + }
- + _player.broadcastUserInfo();
- + _player.sendSkillList();
- + }
- + catch (Exception e)
- + {
- + _log.warn("Something went wrong, check log folder for details", e);
- + }
- + }
- + }
- +
- + public void removeVip(L2PcInstance _player, String _playername)
- + {
- + if (!_player.isVip())
- + {
- + return;
- + }
- +
- + _player.setVip(false);
- + _player.setVipEndTime(0);
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET vip = 0, vip_end = 0 WHERE charId = ?");
- + statement.setInt(1, _player.getObjectId());
- + statement.execute();
- + statement.close();
- +
- + _player.lostVipSkills();
- +
- + if (Config.ALLOW_VIP_ITEM)
- + {
- + _player.getInventory().destroyItemByItemId("", Config.VIP_ITEMID, 1, _player, null);
- + _player.getWarehouse().destroyItemByItemId("", Config.VIP_ITEMID, 1, _player, null);
- + _player.sendPacket(new ItemList(_player.getInventory().getItems(), true));
- + }
- + _player.getAppearance().setNameColor(0xFFFFFF);
- + _player.getAppearance().setTitleColor(0xFFFF77);
- + _player.broadcastUserInfo();
- + _player.sendSkillList();
- + }
- + catch (Exception e)
- + {
- + _log.warn("Something went wrong, check log folder for details", e);
- + }
- + }
- +
- + public void doVIP(L2PcInstance _player)
- + {
- + if (Config.ALLOW_VIP_NCOLOR)
- + {
- + _player.getAppearance().setNameColor(Config.VIP_NCOLOR);
- + }
- +
- + if (Config.ALLOW_VIP_TCOLOR)
- + {
- + _player.getAppearance().setTitleColor(Config.VIP_TCOLOR);
- + }
- +
- + _player.rewardVipSkills();
- +
- + if (Config.ALLOW_VIP_ITEM)
- + {
- + _player.getInventory().addItem("", Config.VIP_ITEMID, 1, _player, null);
- + _player.getInventory().equipItem(_player.getInventory().getItemByItemId(Config.VIP_ITEMID));
- + _player.sendPacket(new ItemList(_player.getInventory().getItems(), true));
- +
- + }
- + _player.broadcastUserInfo();
- + _player.sendSkillList();
- + }
- }
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement