Orgyilkos Posted November 15, 2009 Posted November 15, 2009 Hero Status for X kills. :) I created for L2J. This my first topic in maxcheaters :) Patch: ### Eclipse Workspace Patch 1.0 #P L2_GameServer Index: java/config/l2jmods.properties =================================================================== --- java/config/l2jmods.properties (revision 3695) +++ java/config/l2jmods.properties (working copy) @@ -256,4 +256,14 @@ # This option will enable core support for: # Mana Drug (item ID 726), using skill ID 9007. # Mana Potion (item ID 728), using skill ID 9008. -EnableManaPotionSupport = False \ No newline at end of file +EnableManaPotionSupport = False + +# ---------------------------------------------- # +# Hero Status (until restart) for kills System [Author: Mentor] www.teamsrv.net +# ---------------------------------------------- # +# Enabled Hero status for kills? (Default: False) +HeroStatusForKills = False +# Kills (PvP+PK) for Hero Status (Default: 20) +HeroStatusForKillsCount = 20 +# Death for removed Hero Status (Default: 2) +DeleteHeroStatusDeathCount = 2 \ No newline at end of file Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3695) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -35,6 +35,7 @@ import javolution.util.FastMap; import net.sf.l2j.Config; import net.sf.l2j.L2DatabaseFactory; +import net.sf.l2j.gameserver.Announcements; import net.sf.l2j.gameserver.GameTimeController; import net.sf.l2j.gameserver.GeoData; import net.sf.l2j.gameserver.GmListTable; @@ -288,6 +289,9 @@ private static final String SELECT_CHAR_TRANSFORM = "SELECT transform_id FROM characters WHERE charId=?"; private static final String UPDATE_CHAR_TRANSFORM = "UPDATE characters SET transform_id=? WHERE charId=?"; + private static int KillsForAddHero = 0; + private static int KillsForRemoveHero = 0; + public static final int REQUEST_TIMEOUT = 15; public static final int STORE_PRIVATE_NONE = 0; public static final int STORE_PRIVATE_SELL = 1; @@ -5663,6 +5667,9 @@ { // Add karma to attacker and increase its PK counter setPvpKills(getPvpKills() + 1); + + if (Config.TEAMSRV_HERO_ENABLED) + KillsForHero(); // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter sendPacket(new UserInfo(this)); @@ -5717,12 +5724,48 @@ setKarma(getKarma() + newKarma); if (increasePk) setPkKills(getPkKills() + 1); + + if (Config.TEAMSRV_HERO_ENABLED) + KillsForHero(); // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter sendPacket(new UserInfo(this)); sendPacket(new ExBrExtraUserInfo(this)); } +public void KillsForHero() +{ +/** + * author: Mentor + * web: www.teamsrv.net + * + */ + if(isHero()) + { + ++KillsForRemoveHero; + } + else + { + ++KillsForAddHero; + } + + if (KillsForAddHero >= Config.TEAMSRV_HERO_KILLS) + { + setHero(true); + broadcastUserInfo(); + KillsForAddHero = 0; + Announcements.getInstance().announceToAll("Congratulations "+ getName()+"! Gived Hero Status."); + } + + if(KillsForRemoveHero >= Config.TEAMSRV_HERO_REMOVE) + { + setHero(false); + broadcastUserInfo(); + KillsForRemoveHero = 0; + Announcements.getInstance().announceToAll("Sorry "+ getName()+"! Removed Hero Status."); + } + } + public int calculateKarmaLost(long exp) { // KARMA LOSS Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 3695) +++ java/net/sf/l2j/Config.java (working copy) @@ -616,8 +616,11 @@ public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT; + public static boolean TEAMSRV_HERO_ENABLED; + public static int TEAMSRV_HERO_KILLS; + public static int TEAMSRV_HERO_REMOVE; + - //-------------------------------------------------- // NPC Settings //-------------------------------------------------- @@ -2014,6 +2017,9 @@ OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080")); L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false")); + TEAMSRV_HERO_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("HeroStatusForKills", "False")); + TEAMSRV_HERO_KILLS = Integer.parseInt(L2JModSettings.getProperty("HeroStatusForKillsCount", "10")); + TEAMSRV_HERO_REMOVE = Integer.parseInt(L2JModSettings.getProperty("DeleteHeroStatusDeathCount", "10")); } catch (Exception e) {
Levi4than Posted November 15, 2009 Posted November 15, 2009 Great share bro!!And welcome to our comunity!
Vago Posted November 15, 2009 Posted November 15, 2009 probably shared already with other name. As I know I shared this myself long ago...
Recommended Posts