Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision)
- +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -14035,6 +14035,38 @@
- sendSkillList();
- }
- + 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;
- + }
- + }
- +
- /**
- * Sets the donator.
- @@ 18935,6 @@
- // 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().announceToPlayers("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++;
- Index: head-src/com/l2jfrozen/Config.java
- ===================================================================
- --- F:/Workspace/BETA_GS/head-src/com/l2jfrozen/Config.java (revision 936)
- +++ F:/Workspace/BETA_GS/head-src/com/l2jfrozen/Config.java (working copy)
- @@ -2379,6 +2379,9 @@
- public static String PVP1_CUSTOM_MESSAGE;
- public static String PVP2_CUSTOM_MESSAGE;
- + public static int PVP_TO_HERO;
- + public static int DIASHERO;
- + public static boolean ENABLE_HERO_PVPS;
- +
- //============================================================
- public static void loadL2JFrozenConfig()
- {
- @@ -2391,6 +2394,9 @@
- 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: config/functions/l2jfrozen.properties
- ===================================================================
- --- config/functions/l2jfrozen.properties (revision 936)
- +++ config/functions/l2jfrozen.properties (working copy)
- +#Habilitar o systema.
- +Enablehero = False
- +#Dias que o player vai ficar hero.
- +HeroDays = 0
- +# Quantidade que ao atingir vira hero
- +PvPsParaHero = 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement