Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config/functions/l2jfrozen.properties b/config/functions/l2jfrozen.properties
- index b1eaa98..63bc559 100644
- --- a/config/functions/l2jfrozen.properties
- +++ b/config/functions/l2jfrozen.properties
- @@ -281,4 +281,12 @@
- ProtectorSkillLevel = 13
- ProtectorSkillTime = 600
- # Npc Protector Message
- ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
- +
- +#Habilitar o systema.
- +Enablehero = False
- +#Dias que o player vai ficar hero.
- +HeroDays = 0
- +# Quantidade que ao atingir vira hero
- +PvPsParaHero = 2
- +
- diff --git a/head-src/com/l2jfrozen/Config.java b/head-src/com/l2jfrozen/Config.java
- index 6f07f7a..2f65e7c 100644
- --- a/head-src/com/l2jfrozen/Config.java
- +++ b/head-src/com/l2jfrozen/Config.java
- @@ -119,7 +119,9 @@
- public static int TRADE_PVP_AMOUNT;
- public static boolean GLOBAL_CHAT_WITH_PVP;
- public static int GLOBAL_PVP_AMOUNT;
- -
- + public static int PVP_TO_HERO;
- + public static int DIASHERO;
- + public static boolean ENABLE_HERO_PVPS;
- // Anti Brute force attack on login
- public static int BRUT_AVG_TIME;
- public static int BRUT_LOGON_ATTEMPTS;
- @@ -2389,7 +2391,9 @@
- final InputStream is = new FileInputStream(new File(L2JFROZEN));
- L2JFrozenSettings.load(is);
- is.close();
- -
- + PVP_TO_HERO = Integer.parseInt(L2JFrozenSettings.getProperty("PvPsParaHero", "10"));
- + DIASHERO = Integer.parseInt(L2JFrozenSettings.getProperty("Herodays", "1"));
- + ENABLE_HERO_PVPS = Boolean.valueOf(L2JFrozenSettings.getProperty("Enablehero", "True"));
- /** Custom Tables **/
- CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(L2JFrozenSettings.getProperty("CustomSpawnlistTable", "True"));
- SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(L2JFrozenSettings.getProperty("SaveGmSpawnOnCustom", "True"));
- index 108bb8b..0bff1b4 100644
- --- a/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- +++ b/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- @@ -1450,7 +1450,7 @@
- * @see java.lang.Runnable#run()
- */
- @Override
- public void run()
- {
- try
- @@ -8112,7 +8112,16 @@
- // Add karma to attacker and increase its PK counter
- setPvpKills(getPvpKills() + 1);
- + if (Config.ENABLE_HERO_PVPS && getPvpKills() > Config.PVP_TO_HERO && !isHero())
- + {
- + setHero(true);
- + setHeroEndTime(Config.DIASHERO * 24L * 60L * 60L * 1000L);
- + Announcements.getInstance().announceToAll("Hero System " +getName()+ " virou Hero com " +Config.PVP_TO_HERO+ " pvps!");
- + SkillList iu = new SkillList();
- + StatusUpdate uii = new StatusUpdate(getObjectId());
- + sendPacket(uii);
- + sendPacket(iu);
- + }
- // Increase the kill count for a special hero aura
- heroConsecutiveKillCount++;
- @@ -13246,7 +13255,7 @@
- * (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- @Override
- public void run()
- {
- @@ -18928,7 +18937,7 @@
- }
- // open/close gates
- private final GatesRequest _gatesRequest = new GatesRequest();
- private static class GatesRequest
- @@ -19503,7 +19512,38 @@
- {
- _lastAttackPacket = System.currentTimeMillis();
- }
- + public void setHeroEndTime(long heroTime)
- + {
- + Connection con = null;
- + try
- + {
- + con = L2DatabaseFactory.getInstance().getConnection(false);
- + PreparedStatement stmt = con.prepareStatement("REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator, hero_end_date) VALUES (?,?,?,?,?,?)");
- +
- + stmt.setInt(1, getObjectId());
- + stmt.setString(2, getName());
- + stmt.setInt(3, 1);
- + stmt.setInt(4, isNoble() ? 1 : 0);
- + stmt.setInt(5, isDonator() ? 1 : 0);
- + stmt.setLong(6, heroTime == 0 ? 0 : System.currentTimeMillis() + heroTime);
- + stmt.execute();
- + stmt.close();
- + stmt = null;
- + }
- + catch(Exception e)
- + {
- + if (Config.ENABLE_ALL_EXCEPTIONS)
- + e.printStackTrace();
- +
- + LOGGER.info("Error: could not update database: ", e);
- +
- + }
- + finally
- + {
- + CloseUtil.close(con);
- + con = null;
- + }
- + }
- public void checkItemRestriction()
- {
- for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement