Citar# Enable or not the system.
FHEnabled = True
# How to kill to get the fakehero.
FHNeedKills = 5
# How many deaths lose fakehero.
FHNeedDeads = 2
Si matas 5 veces, te conviertes en heroe temporal. Pero si mueres dos veces, el heroe temporal lo pierdes.
### Eclipse Workspace Patch 1.0
#P trunk
Index: unstable/java/com/l2jfanatic/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- unstable/java/com/l2jfanatic/gameserver/model/actor/instance/L2PcInstance.java (revision 8)
+++ unstable/java/com/l2jfanatic/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -36,6 +36,7 @@
import com.l2jfanatic.Config;
import com.l2jfanatic.L2DatabaseFactory;
+import com.l2jfanatic.gameserver.Announcements;
import com.l2jfanatic.gameserver.GameTimeController;
import com.l2jfanatic.gameserver.GeoData;
import com.l2jfanatic.gameserver.ItemsAutoDestroy;
@@ -407,6 +408,9 @@
private boolean _isInWater;
private boolean _isIn7sDungeon = false;
+ // by leonardo alves.
+ private int heroaddkills = 0, deadkillsremovehero = 0;
+
private PunishLevel _punishLevel = PunishLevel.NONE;
private long _punishTimer = 0;
private ScheduledFuture<?> _punishTask;
@@ -502,7 +506,7 @@
private TradeList _buyList;
private boolean _noble = false;
- private boolean _hero = false;
+ private boolean _hero = false, _fakehero = false;
/** The L2Npc corresponding to the current folk the player is talking with. */
private L2Npc _currentFolkNpc = null;
@@ -1942,6 +1946,12 @@
*/
public void setPvpKills(int pvpKills)
{
+ ++heroaddkills;
+ if(Config.FH_ENABLED && !isFakeHero() && !isHero() && heroaddkills == Config.FH_NEED_KILLS){
+ setFakeHero(true);
+ setHero(true);
+ Announcements.getInstance().announceToAll(getName()+": Set hero for "+heroaddkills+" kills.");
+ }
_pvpKills = pvpKills;
}
@@ -4187,6 +4197,16 @@
@Override
public boolean doDie(L2Character killer)
{
+ ++deadkillsremovehero;
+ if(Config.FH_ENABLED && isFakeHero() && deadkillsremovehero == Config.FH_NEED_DEADS)
+ {
+ setFakeHero(false);
+ setHero(false);
+ Announcements.getInstance().announceToAll(getName()+": dead hero status lost.. total kills: "+heroaddkills+".");
+ Announcements.getInstance().announceToAll(getName()+": Dead: "+deadkillsremovehero+".");
+ deadkillsremovehero = 0;
+ heroaddkills = 0;
+ }
// Kill the L2PcInstance
if (!super.doDie(killer))
return false;
@@ -8252,10 +8272,13 @@
{
return _blockList;
}
-
+ public void setFakeHero(boolean fakehero)
+ {
+ _fakehero = fakehero;
+ }
public void setHero(boolean hero)
{
- if (hero && _baseClass == _activeClass)
+ if (!_fakehero && hero && _baseClass == _activeClass)
{
for (L2Skill s : SkillTable.getHeroSkills())
addSkill(s, false); // Dont Save Hero skills to database
@@ -8284,7 +8307,10 @@
{
return _OlympiadStart;
}
-
+ public boolean isFakeHero()
+ {
+ return _fakehero;
+ }
public boolean isHero()
{
return _hero;
Index: unstable/java/com/l2jfanatic/Config.java
===================================================================
--- unstable/java/com/l2jfanatic/Config.java (revision 8)
+++ unstable/java/com/l2jfanatic/Config.java (working copy)
@@ -372,6 +372,15 @@
public static boolean WYVERN_PROTECTION;
public static String ID_RESTRICT;
public static List<Integer> LISTID_RESTRICT;
public static List<String> ITEM_PROTECTION_EXCLUDE_ON = new ArrayList<String>();
+ // By Leonardo Alves
+ public static boolean FH_ENABLED;
+ public static int FH_NEED_KILLS;
+ public static int FH_NEED_DEADS;
+ // L2JBrasil - L2JFanatic Team.
public static int STARTING_ADENA;
public static boolean EFFECT_CANCELING;
public static double HP_REGEN_MULTIPLIER;
@@ -996,6 +1005,21 @@
{
ITEM_PROTECTION_EXCLUDE_ON.add(items.nextToken());
}
+ FH_ENABLED = Boolean.parseBoolean(players.getProperty("FHEnabled","True"));
+ FH_NEED_KILLS = Integer.parseInt(players.getProperty("FHNeedKills", "5"));
+ FH_NEED_DEADS = Integer.parseInt(players.getProperty("FHNeedDeads", "100"));
STARTING_ADENA = players.getProperty("StartingAdena", 100);
EFFECT_CANCELING = players.getProperty("CancelLesserEffect", true);
HP_REGEN_MULTIPLIER = players.getProperty("HpRegenMultiplier", 1.);
Index: unstable/dist/config/players.properties
===================================================================
--- unstable/dist/config/players.properties (revision 8)
+++ unstable/dist/config/players.properties (working copy)
@@ -2,6 +2,16 @@
ProtectionItemID = 0,0,0,0,0
ItemsProtectionExcludeOn = PVP PEACE SIEGE OLYMPIAD SEVEN RB
+
+# By Leonardo Alves
+FHEnabled = True
+FHNeedKills = 5
+FHNeedDeads = 2
+
#Amount of adenas that a new character is given, default is 100
StartingAdena = 100