Răsfoiți Sursa

BETA: Armorset base stats implementation
- Separated all static func classes from Formulas into own files
- Merged all Henna related func classes in one.
- Removed all uselss func classes.

Rumen Nikiforov 13 ani în urmă
părinte
comite
f550a2d306
29 a modificat fișierele cu 1433 adăugiri și 906 ștergeri
  1. 6 6
      L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/ArmorSetsData.java
  2. 67 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2ArmorSet.java
  3. 6 5
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java
  4. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java
  5. 86 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncArmorSet.java
  6. 72 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkAccuracy.java
  7. 46 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkCritical.java
  8. 67 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkEvasion.java
  9. 52 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncBowAtkRange.java
  10. 52 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncCrossBowAtkRange.java
  11. 53 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncGatesMDefMod.java
  12. 53 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncGatesPDefMod.java
  13. 75 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncHenna.java
  14. 56 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkCritical.java
  15. 58 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkMod.java
  16. 45 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkSpeed.java
  17. 90 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMDefMod.java
  18. 50 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxCpAdd.java
  19. 45 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxCpMul.java
  20. 50 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxHpAdd.java
  21. 45 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxHpMul.java
  22. 50 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxMpAdd.java
  23. 45 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxMpMul.java
  24. 45 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMoveSpeed.java
  25. 54 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPAtkMod.java
  26. 45 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPAtkSpeed.java
  27. 79 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPDefMod.java
  28. 4 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Calculator.java
  29. 36 891
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Formulas.java

+ 6 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/ArmorSetsData.java

@@ -113,32 +113,32 @@ public final class ArmorSetsData extends DocumentParser
 								}
 								case "con":
 								{
-									// TODO: Implement me
+									set.addCon(parseInt(attrs, "val"));
 									break;
 								}
 								case "dex":
 								{
-									// TODO: Implement me
+									set.addDex(parseInt(attrs, "val"));
 									break;
 								}
 								case "str":
 								{
-									// TODO: Implement me
+									set.addStr(parseInt(attrs, "val"));
 									break;
 								}
 								case "men":
 								{
-									// TODO: Implement me
+									set.addMen(parseInt(attrs, "val"));
 									break;
 								}
 								case "wit":
 								{
-									// TODO: Implement me
+									set.addWit(parseInt(attrs, "val"));
 									break;
 								}
 								case "int":
 								{
-									// TODO: Implement me
+									set.addInt(parseInt(attrs, "val"));
 									break;
 								}
 							}

+ 67 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2ArmorSet.java

@@ -38,6 +38,13 @@ public final class L2ArmorSet
 	private final List<SkillHolder> _shieldSkills;
 	private final List<SkillHolder> _enchant6Skill;
 	
+	private int _con;
+	private int _dex;
+	private int _str;
+	private int _men;
+	private int _wit;
+	private int _int;
+	
 	public L2ArmorSet()
 	{
 		_legs = new ArrayList<>();
@@ -96,6 +103,36 @@ public final class L2ArmorSet
 		_enchant6Skill.add(holder);
 	}
 	
+	public void addCon(int val)
+	{
+		_con = val;
+	}
+	
+	public void addDex(int val)
+	{
+		_dex = val;
+	}
+	
+	public void addStr(int val)
+	{
+		_str = val;
+	}
+	
+	public void addMen(int val)
+	{
+		_men = val;
+	}
+	
+	public void addWit(int val)
+	{
+		_wit = val;
+	}
+	
+	public void addInt(int val)
+	{
+		_int = val;
+	}
+	
 	/**
 	 * Checks if player have equipped all items from set (not checking shield)
 	 * 
@@ -231,4 +268,34 @@ public final class L2ArmorSet
 		
 		return true;
 	}
+	
+	public int getCON()
+	{
+		return _con;
+	}
+	
+	public int getDEX()
+	{
+		return _dex;
+	}
+	
+	public int getSTR()
+	{
+		return _str;
+	}
+	
+	public int getMEN()
+	{
+		return _men;
+	}
+	
+	public int getWIT()
+	{
+		return _wit;
+	}
+	
+	public int getINT()
+	{
+		return _int;
+	}
 }

+ 6 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -17,6 +17,7 @@ package com.l2jserver.gameserver.model.actor;
 import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_ACTIVE;
 import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_FOLLOW;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Set;
@@ -4015,7 +4016,7 @@ public abstract class L2Character extends L2Object
 	public final void addStatFuncs(Func[] funcs)
 	{
 		
-		FastList<Stats> modifiedStats = new FastList<Stats>();
+		List<Stats> modifiedStats = new ArrayList<Stats>();
 		
 		for (Func f : funcs)
 		{
@@ -4098,7 +4099,7 @@ public abstract class L2Character extends L2Object
 	public final void removeStatFuncs(Func[] funcs)
 	{
 		
-		FastList<Stats> modifiedStats = new FastList<Stats>();
+		List<Stats> modifiedStats = new ArrayList<Stats>();
 		
 		for (Func f : funcs)
 		{
@@ -4136,7 +4137,7 @@ public abstract class L2Character extends L2Object
 	public final void removeStatsOwner(Object owner)
 	{
 		
-		FastList<Stats> modifiedStats = null;
+		List<Stats> modifiedStats = null;
 		
 		int i = 0;
 		// Go through the Calculator set
@@ -4159,7 +4160,7 @@ public abstract class L2Character extends L2Object
 			}
 			
 			// If possible, free the memory and just create a link on NPC_STD_CALCULATOR
-			if (this instanceof L2Npc)
+			if (isNpc())
 			{
 				i = 0;
 				for (; i < Stats.NUM_STATS; i++)
@@ -4182,7 +4183,7 @@ public abstract class L2Character extends L2Object
 		}
 	}
 	
-	protected void broadcastModifiedStats(FastList<Stats> stats)
+	protected void broadcastModifiedStats(List<Stats> stats)
 	{
 		if (stats == null || stats.isEmpty())
 			return;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java

@@ -1355,7 +1355,7 @@ public class L2PetInstance extends L2Summon
 	}
 
 	@Override
-	protected void broadcastModifiedStats(FastList<Stats> stats)
+	protected void broadcastModifiedStats(List<Stats> stats)
 	{
 		// check for initialization
 		if (getInstanceType() == InstanceType.L2PetInstance)

+ 86 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncArmorSet.java

@@ -0,0 +1,86 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.l2jserver.gameserver.datatables.ArmorSetsData;
+import com.l2jserver.gameserver.model.L2ArmorSet;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ */
+public class FuncArmorSet extends Func
+{
+	private static final Map<Stats, FuncArmorSet> _fh_instance = new HashMap<>();
+	
+	public static Func getInstance(Stats st)
+	{
+		if (!_fh_instance.containsKey(st))
+		{
+			return _fh_instance.put(st, new FuncArmorSet(st));
+		}
+		return _fh_instance.get(st);
+	}
+	
+	private FuncArmorSet(Stats stat)
+	{
+		super(stat, 0x10, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		L2PcInstance player = env.getPlayer();
+		if (player != null)
+		{
+			L2ItemInstance chest = player.getChestArmorInstance();
+			if (chest != null)
+			{
+				L2ArmorSet set = ArmorSetsData.getInstance().getSet(chest.getItemId());
+				if (set != null && set.containAll(player))
+				{
+					switch (stat)
+					{
+						case STAT_STR:
+							env.addValue(set.getSTR());
+							break;
+						case STAT_DEX:
+							env.addValue(set.getDEX());
+							break;
+						case STAT_INT:
+							env.addValue(set.getINT());
+							break;
+						case STAT_MEN:
+							env.addValue(set.getMEN());
+							break;
+						case STAT_CON:
+							env.addValue(set.getCON());
+							break;
+						case STAT_WIT:
+							env.addValue(set.getWIT());
+							break;
+					}
+				}
+			}
+		}
+	}
+}

+ 72 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkAccuracy.java

@@ -0,0 +1,72 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncAtkAccuracy extends Func
+{
+	private static final FuncAtkAccuracy _faa_instance = new FuncAtkAccuracy();
+	
+	public static Func getInstance()
+	{
+		return _faa_instance;
+	}
+	
+	private FuncAtkAccuracy()
+	{
+		super(Stats.ACCURACY_COMBAT, 0x10, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		final int level = env.getCharacter().getLevel();
+		if (env.getCharacter() instanceof L2PcInstance)
+		{
+			// [Square(DEX)]*6 + lvl + weapon hitbonus;
+			env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
+			if (level > 77)
+			{
+				env.addValue((level - 77) + 1);
+			}
+			if (level > 69)
+			{
+				env.addValue(level - 69);
+				// if (env.player instanceof L2Summon)
+				// env.value += (level < 60) ? 4 : 5;
+			}
+		}
+		else
+		{
+			env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
+			if (level > 77)
+			{
+				env.addValue(level - 76);
+			}
+			if (level > 69)
+			{
+				env.addValue(level - 69);
+			}
+		}
+	}
+}

+ 46 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkCritical.java

@@ -0,0 +1,46 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncAtkCritical extends Func
+{
+	private static final FuncAtkCritical _fac_instance = new FuncAtkCritical();
+	
+	public static Func getInstance()
+	{
+		return _fac_instance;
+	}
+	
+	private FuncAtkCritical()
+	{
+		super(Stats.CRITICAL_RATE, 0x09, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()) * 10);
+		env.setBaseValue(env.getValue());
+	}
+}

+ 67 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkEvasion.java

@@ -0,0 +1,67 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncAtkEvasion extends Func
+{
+	private static final FuncAtkEvasion _fae_instance = new FuncAtkEvasion();
+	
+	public static Func getInstance()
+	{
+		return _fae_instance;
+	}
+	
+	private FuncAtkEvasion()
+	{
+		super(Stats.EVASION_RATE, 0x10, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		final int level = env.getCharacter().getLevel();
+		if (env.getCharacter() instanceof L2PcInstance)
+		{
+			// [Square(DEX)]*6 + lvl;
+			env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
+			if (level > 77)
+			{
+				env.addValue(level - 77);
+			}
+			if (level > 69)
+			{
+				env.addValue(level - 69);
+			}
+		}
+		else
+		{
+			// [Square(DEX)]*6 + lvl;
+			env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
+			if (level > 69)
+			{
+				env.addValue((level - 69) + 2);
+			}
+		}
+	}
+}

+ 52 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncBowAtkRange.java

@@ -0,0 +1,52 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.conditions.ConditionUsingItemType;
+import com.l2jserver.gameserver.model.items.type.L2WeaponType;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncBowAtkRange extends Func
+{
+	private static final FuncBowAtkRange _fbar_instance = new FuncBowAtkRange();
+	
+	public static Func getInstance()
+	{
+		return _fbar_instance;
+	}
+	
+	private FuncBowAtkRange()
+	{
+		super(Stats.POWER_ATTACK_RANGE, 0x10, null);
+		setCondition(new ConditionUsingItemType(L2WeaponType.BOW.mask()));
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		if (!cond.test(env))
+		{
+			return;
+		}
+		// default is 40 and with bow should be 500
+		env.addValue(460);
+	}
+}

+ 52 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncCrossBowAtkRange.java

@@ -0,0 +1,52 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.conditions.ConditionUsingItemType;
+import com.l2jserver.gameserver.model.items.type.L2WeaponType;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncCrossBowAtkRange extends Func
+{
+	private static final FuncCrossBowAtkRange _fcb_instance = new FuncCrossBowAtkRange();
+	
+	public static Func getInstance()
+	{
+		return _fcb_instance;
+	}
+	
+	private FuncCrossBowAtkRange()
+	{
+		super(Stats.POWER_ATTACK_RANGE, 0x10, null);
+		setCondition(new ConditionUsingItemType(L2WeaponType.CROSSBOW.mask()));
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		if (!cond.test(env))
+		{
+			return;
+		}
+		// default is 40 and with crossbow should be 400
+		env.addValue(360);
+	}
+}

+ 53 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncGatesMDefMod.java

@@ -0,0 +1,53 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.SevenSigns;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncGatesMDefMod extends Func
+{
+	private static final FuncGatesMDefMod _fmm_instance = new FuncGatesMDefMod();
+	
+	public static Func getInstance()
+	{
+		return _fmm_instance;
+	}
+	
+	private FuncGatesMDefMod()
+	{
+		super(Stats.MAGIC_DEFENCE, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
+		{
+			env.mulValue(Config.ALT_SIEGE_DAWN_GATES_MDEF_MULT);
+		}
+		else if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK)
+		{
+			env.mulValue(Config.ALT_SIEGE_DUSK_GATES_MDEF_MULT);
+		}
+	}
+}

+ 53 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncGatesPDefMod.java

@@ -0,0 +1,53 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.SevenSigns;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncGatesPDefMod extends Func
+{
+	private static final FuncGatesPDefMod _fmm_instance = new FuncGatesPDefMod();
+	
+	public static Func getInstance()
+	{
+		return _fmm_instance;
+	}
+	
+	private FuncGatesPDefMod()
+	{
+		super(Stats.POWER_DEFENCE, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
+		{
+			env.mulValue(Config.ALT_SIEGE_DAWN_GATES_PDEF_MULT);
+		}
+		else if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK)
+		{
+			env.mulValue(Config.ALT_SIEGE_DUSK_GATES_PDEF_MULT);
+		}
+	}
+}

+ 75 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncHenna.java

@@ -0,0 +1,75 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ */
+public class FuncHenna extends Func
+{
+	private static final Map<Stats, FuncHenna> _fh_instance = new HashMap<>();
+	
+	public static Func getInstance(Stats st)
+	{
+		if (!_fh_instance.containsKey(st))
+		{
+			return _fh_instance.put(st, new FuncHenna(st));
+		}
+		return _fh_instance.get(st);
+	}
+	
+	private FuncHenna(Stats stat)
+	{
+		super(stat, 0x10, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		L2PcInstance pc = env.getPlayer();
+		if (pc != null)
+		{
+			switch (stat)
+			{
+				case STAT_STR:
+					env.addValue(pc.getHennaStatSTR());
+					break;
+				case STAT_CON:
+					env.addValue(pc.getHennaStatCON());
+					break;
+				case STAT_DEX:
+					env.addValue(pc.getHennaStatDEX());
+					break;
+				case STAT_INT:
+					env.addValue(pc.getHennaStatINT());
+					break;
+				case STAT_WIT:
+					env.addValue(pc.getHennaStatWIT());
+					break;
+				case STAT_MEN:
+					env.addValue(pc.getHennaStatMEN());
+					break;
+			}
+		}
+	}
+}

+ 56 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkCritical.java

@@ -0,0 +1,56 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.L2Summon;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMAtkCritical extends Func
+{
+	private static final FuncMAtkCritical _fac_instance = new FuncMAtkCritical();
+	
+	public static Func getInstance()
+	{
+		return _fac_instance;
+	}
+	
+	private FuncMAtkCritical()
+	{
+		super(Stats.MCRITICAL_RATE, 0x30, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		L2Character p = env.getCharacter();
+		if (p instanceof L2Summon)
+		{
+			env.setValue(8); // TODO: needs retail value
+		}
+		else if ((p instanceof L2PcInstance) && (p.getActiveWeaponInstance() != null))
+		{
+			env.mulValue(BaseStats.WIT.calcBonus(p));
+		}
+	}
+}

+ 58 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkMod.java

@@ -0,0 +1,58 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMAtkMod extends Func
+{
+	private static final FuncMAtkMod _fma_instance = new FuncMAtkMod();
+	
+	public static Func getInstance()
+	{
+		return _fma_instance;
+	}
+	
+	private FuncMAtkMod()
+	{
+		super(Stats.MAGIC_ATTACK, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		if (env.getCharacter() instanceof L2PcInstance)
+		{
+			double intb = BaseStats.INT.calcBonus(env.getPlayer());
+			double lvlb = env.getPlayer().getLevelMod();
+			env.mulValue((lvlb * lvlb) * (intb * intb));
+		}
+		else
+		{
+			float level = env.getCharacter().getLevel();
+			double intb = BaseStats.INT.calcBonus(env.getCharacter());
+			float lvlb = ((level + 89) / 100);
+			env.mulValue((lvlb * lvlb) * (intb * intb));
+		}
+	}
+}

+ 45 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkSpeed.java

@@ -0,0 +1,45 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMAtkSpeed extends Func
+{
+	private static final FuncMAtkSpeed _fas_instance = new FuncMAtkSpeed();
+	
+	public static Func getInstance()
+	{
+		return _fas_instance;
+	}
+	
+	private FuncMAtkSpeed()
+	{
+		super(Stats.MAGIC_ATTACK_SPEED, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		env.mulValue(BaseStats.WIT.calcBonus(env.getCharacter()));
+	}
+}

+ 90 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMDefMod.java

@@ -0,0 +1,90 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.instance.L2BabyPetInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
+import com.l2jserver.gameserver.model.itemcontainer.Inventory;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMDefMod extends Func
+{
+	private static final FuncMDefMod _fmm_instance = new FuncMDefMod();
+	
+	public static Func getInstance()
+	{
+		return _fmm_instance;
+	}
+	
+	private FuncMDefMod()
+	{
+		super(Stats.MAGIC_DEFENCE, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		float level = env.getCharacter().getLevel();
+		if (env.getCharacter() instanceof L2PcInstance)
+		{
+			L2PcInstance p = env.getPlayer();
+			if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER) != null)
+			{
+				env.subValue(5);
+			}
+			if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER) != null)
+			{
+				env.subValue(5);
+			}
+			if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR) != null)
+			{
+				env.subValue(9);
+			}
+			if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR) != null)
+			{
+				env.subValue(9);
+			}
+			if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK) != null)
+			{
+				env.subValue(13);
+			}
+			env.mulValue(BaseStats.MEN.calcBonus(env.getPlayer()) * env.getPlayer().getLevelMod());
+		}
+		else if ((env.getCharacter() instanceof L2PetInstance) || (env.getCharacter() instanceof L2BabyPetInstance))
+		{
+			if (env.getCharacter().getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK) != 0)
+			{
+				env.subValue(13);
+				env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
+			}
+			else
+			{
+				env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
+			}
+		}
+		else
+		{
+			env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
+		}
+	}
+}

+ 50 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxCpAdd.java

@@ -0,0 +1,50 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.templates.L2PcTemplate;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMaxCpAdd extends Func
+{
+	private static final FuncMaxCpAdd _fmca_instance = new FuncMaxCpAdd();
+	
+	public static Func getInstance()
+	{
+		return _fmca_instance;
+	}
+	
+	private FuncMaxCpAdd()
+	{
+		super(Stats.MAX_CP, 0x10, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
+		int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
+		double cpmod = t.getLvlCpMod() * lvl;
+		double cpmax = (t.getLvlCpAdd() + cpmod) * lvl;
+		double cpmin = (t.getLvlCpAdd() * lvl) + cpmod;
+		env.addValue((cpmax + cpmin) / 2);
+	}
+}

+ 45 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxCpMul.java

@@ -0,0 +1,45 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMaxCpMul extends Func
+{
+	private static final FuncMaxCpMul _fmcm_instance = new FuncMaxCpMul();
+	
+	public static Func getInstance()
+	{
+		return _fmcm_instance;
+	}
+	
+	private FuncMaxCpMul()
+	{
+		super(Stats.MAX_CP, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		env.mulValue(BaseStats.CON.calcBonus(env.getCharacter()));
+	}
+}

+ 50 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxHpAdd.java

@@ -0,0 +1,50 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.templates.L2PcTemplate;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMaxHpAdd extends Func
+{
+	private static final FuncMaxHpAdd _fmha_instance = new FuncMaxHpAdd();
+	
+	public static Func getInstance()
+	{
+		return _fmha_instance;
+	}
+	
+	private FuncMaxHpAdd()
+	{
+		super(Stats.MAX_HP, 0x10, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
+		int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
+		double hpmod = t.getLvlHpMod() * lvl;
+		double hpmax = (t.getLvlHpAdd() + hpmod) * lvl;
+		double hpmin = (t.getLvlHpAdd() * lvl) + hpmod;
+		env.addValue((hpmax + hpmin) / 2);
+	}
+}

+ 45 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxHpMul.java

@@ -0,0 +1,45 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMaxHpMul extends Func
+{
+	private static final FuncMaxHpMul _fmhm_instance = new FuncMaxHpMul();
+	
+	public static Func getInstance()
+	{
+		return _fmhm_instance;
+	}
+	
+	private FuncMaxHpMul()
+	{
+		super(Stats.MAX_HP, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		env.mulValue(BaseStats.CON.calcBonus(env.getCharacter()));
+	}
+}

+ 50 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxMpAdd.java

@@ -0,0 +1,50 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.templates.L2PcTemplate;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMaxMpAdd extends Func
+{
+	private static final FuncMaxMpAdd _fmma_instance = new FuncMaxMpAdd();
+	
+	public static Func getInstance()
+	{
+		return _fmma_instance;
+	}
+	
+	private FuncMaxMpAdd()
+	{
+		super(Stats.MAX_MP, 0x10, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
+		int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
+		double mpmod = t.getLvlMpMod() * lvl;
+		double mpmax = (t.getLvlMpAdd() + mpmod) * lvl;
+		double mpmin = (t.getLvlMpAdd() * lvl) + mpmod;
+		env.addValue((mpmax + mpmin) / 2);
+	}
+}

+ 45 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxMpMul.java

@@ -0,0 +1,45 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMaxMpMul extends Func
+{
+	private static final FuncMaxMpMul _fmmm_instance = new FuncMaxMpMul();
+	
+	public static Func getInstance()
+	{
+		return _fmmm_instance;
+	}
+	
+	private FuncMaxMpMul()
+	{
+		super(Stats.MAX_MP, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()));
+	}
+}

+ 45 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMoveSpeed.java

@@ -0,0 +1,45 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncMoveSpeed extends Func
+{
+	private static final FuncMoveSpeed _fms_instance = new FuncMoveSpeed();
+	
+	public static Func getInstance()
+	{
+		return _fms_instance;
+	}
+	
+	private FuncMoveSpeed()
+	{
+		super(Stats.RUN_SPEED, 0x30, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()));
+	}
+}

+ 54 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPAtkMod.java

@@ -0,0 +1,54 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncPAtkMod extends Func
+{
+	private static final FuncPAtkMod _fpa_instance = new FuncPAtkMod();
+	
+	public static Func getInstance()
+	{
+		return _fpa_instance;
+	}
+	
+	private FuncPAtkMod()
+	{
+		super(Stats.POWER_ATTACK, 0x30, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		if (env.getCharacter() instanceof L2PcInstance)
+		{
+			env.mulValue(BaseStats.STR.calcBonus(env.getPlayer()) * env.getPlayer().getLevelMod());
+		}
+		else
+		{
+			float level = env.getCharacter().getLevel();
+			env.mulValue(BaseStats.STR.calcBonus(env.getCharacter()) * ((level + 89) / 100));
+		}
+	}
+}

+ 45 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPAtkSpeed.java

@@ -0,0 +1,45 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.BaseStats;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncPAtkSpeed extends Func
+{
+	private static final FuncPAtkSpeed _fas_instance = new FuncPAtkSpeed();
+	
+	public static Func getInstance()
+	{
+		return _fas_instance;
+	}
+	
+	private FuncPAtkSpeed()
+	{
+		super(Stats.POWER_ATTACK_SPEED, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()));
+	}
+}

+ 79 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPDefMod.java

@@ -0,0 +1,79 @@
+/*
+ * 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.l2jserver.gameserver.model.skills.funcs.formulas;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.itemcontainer.Inventory;
+import com.l2jserver.gameserver.model.items.L2Item;
+import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.stats.Env;
+import com.l2jserver.gameserver.model.stats.Stats;
+
+/**
+ * @author UnAfraid
+ *
+ */
+public class FuncPDefMod extends Func
+{
+	private static final FuncPDefMod _fmm_instance = new FuncPDefMod();
+	
+	public static Func getInstance()
+	{
+		return _fmm_instance;
+	}
+	
+	private FuncPDefMod()
+	{
+		super(Stats.POWER_DEFENCE, 0x20, null);
+	}
+	
+	@Override
+	public void calc(Env env)
+	{
+		if (env.getCharacter() instanceof L2PcInstance)
+		{
+			L2PcInstance p = env.getPlayer();
+			boolean hasMagePDef = (p.getClassId().isMage() || (p.getClassId().getId() == 0x31)); // orc mystics are a special case
+			if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD) != null)
+			{
+				env.subValue(12);
+			}
+			L2ItemInstance chest = p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
+			if (chest != null)
+			{
+				env.subValue(hasMagePDef ? 15 : 31);
+			}
+			if ((p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) != null) || ((chest != null) && (chest.getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR)))
+			{
+				env.subValue(hasMagePDef ? 8 : 18);
+			}
+			if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) != null)
+			{
+				env.subValue(8);
+			}
+			if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) != null)
+			{
+				env.subValue(7);
+			}
+			env.mulValue(env.getPlayer().getLevelMod());
+		}
+		else
+		{
+			float level = env.getCharacter().getLevel();
+			env.mulValue((level + 89) / 100);
+		}
+	}
+}

+ 4 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Calculator.java

@@ -14,7 +14,8 @@
  */
 package com.l2jserver.gameserver.model.stats;
 
-import javolution.util.FastList;
+import java.util.ArrayList;
+import java.util.List;
 
 import com.l2jserver.gameserver.model.skills.funcs.Func;
 
@@ -160,9 +161,9 @@ public final class Calculator
 	 * @param owner 
 	 * @return 
 	 */
-	public synchronized FastList<Stats> removeOwner(Object owner)
+	public synchronized List<Stats> removeOwner(Object owner)
 	{
-		FastList<Stats> modifiedStats = new FastList<Stats>();
+		List<Stats> modifiedStats = new ArrayList<Stats>();
 		
 		for (Func func: _functions)
 		{

+ 36 - 891
L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Formulas.java

@@ -39,26 +39,42 @@ import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
-import com.l2jserver.gameserver.model.actor.templates.L2PcTemplate;
-import com.l2jserver.gameserver.model.base.PlayerState;
-import com.l2jserver.gameserver.model.conditions.ConditionPlayerState;
-import com.l2jserver.gameserver.model.conditions.ConditionUsingItemType;
 import com.l2jserver.gameserver.model.effects.EffectTemplate;
 import com.l2jserver.gameserver.model.entity.Castle;
 import com.l2jserver.gameserver.model.entity.ClanHall;
 import com.l2jserver.gameserver.model.entity.Fort;
 import com.l2jserver.gameserver.model.entity.Siege;
-import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 import com.l2jserver.gameserver.model.items.L2Armor;
 import com.l2jserver.gameserver.model.items.L2Item;
 import com.l2jserver.gameserver.model.items.L2Weapon;
-import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.items.type.L2ArmorType;
 import com.l2jserver.gameserver.model.items.type.L2WeaponType;
 import com.l2jserver.gameserver.model.skills.L2Skill;
 import com.l2jserver.gameserver.model.skills.L2SkillType;
 import com.l2jserver.gameserver.model.skills.L2TraitType;
-import com.l2jserver.gameserver.model.skills.funcs.Func;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncArmorSet;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncAtkAccuracy;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncAtkCritical;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncAtkEvasion;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncBowAtkRange;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncCrossBowAtkRange;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncGatesMDefMod;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncGatesPDefMod;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncHenna;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMAtkCritical;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMAtkMod;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMAtkSpeed;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMDefMod;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxCpAdd;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxCpMul;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxHpAdd;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxHpMul;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxMpAdd;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxMpMul;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMoveSpeed;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncPAtkMod;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncPAtkSpeed;
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncPDefMod;
 import com.l2jserver.gameserver.model.zone.type.L2CastleZone;
 import com.l2jserver.gameserver.model.zone.type.L2ClanHallZone;
 import com.l2jserver.gameserver.model.zone.type.L2FortZone;
@@ -91,884 +107,6 @@ public final class Formulas
 	
 	private static final byte MELEE_ATTACK_RANGE = 40;
 	
-	static class FuncAddLevel3 extends Func
-	{
-		static final FuncAddLevel3[] _instancies = new FuncAddLevel3[Stats.NUM_STATS];
-		
-		static Func getInstance(Stats stat)
-		{
-			int pos = stat.ordinal();
-			if (_instancies[pos] == null)
-			{
-				_instancies[pos] = new FuncAddLevel3(stat);
-			}
-			return _instancies[pos];
-		}
-		
-		private FuncAddLevel3(Stats pStat)
-		{
-			super(pStat, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.addValue(env.getCharacter().getLevel() / 3.0);
-		}
-	}
-	
-	static class FuncMultLevelMod extends Func
-	{
-		static final FuncMultLevelMod[] _instancies = new FuncMultLevelMod[Stats.NUM_STATS];
-		
-		static Func getInstance(Stats stat)
-		{
-			int pos = stat.ordinal();
-			if (_instancies[pos] == null)
-			{
-				_instancies[pos] = new FuncMultLevelMod(stat);
-			}
-			return _instancies[pos];
-		}
-		
-		private FuncMultLevelMod(Stats pStat)
-		{
-			super(pStat, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.mulValue(env.getCharacter().getLevelMod());
-		}
-	}
-	
-	static class FuncMultRegenResting extends Func
-	{
-		static final FuncMultRegenResting[] _instancies = new FuncMultRegenResting[Stats.NUM_STATS];
-		
-		/**
-		 * @param stat
-		 * @return the Func object corresponding to the state concerned.
-		 */
-		static Func getInstance(Stats stat)
-		{
-			int pos = stat.ordinal();
-			
-			if (_instancies[pos] == null)
-			{
-				_instancies[pos] = new FuncMultRegenResting(stat);
-			}
-			
-			return _instancies[pos];
-		}
-		
-		/**
-		 * Constructor of the FuncMultRegenResting.
-		 * @param pStat
-		 */
-		private FuncMultRegenResting(Stats pStat)
-		{
-			super(pStat, 0x20, null);
-			setCondition(new ConditionPlayerState(PlayerState.RESTING, true));
-		}
-		
-		/**
-		 * Calculate the modifier of the state concerned.
-		 */
-		@Override
-		public void calc(Env env)
-		{
-			if (!cond.test(env))
-			{
-				return;
-			}
-			env.mulValue(1.45);
-		}
-	}
-	
-	static class FuncPAtkMod extends Func
-	{
-		static final FuncPAtkMod _fpa_instance = new FuncPAtkMod();
-		
-		static Func getInstance()
-		{
-			return _fpa_instance;
-		}
-		
-		private FuncPAtkMod()
-		{
-			super(Stats.POWER_ATTACK, 0x30, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			if (env.getCharacter() instanceof L2PcInstance)
-			{
-				env.mulValue(BaseStats.STR.calcBonus(env.getPlayer()) * env.getPlayer().getLevelMod());
-			}
-			else
-			{
-				float level = env.getCharacter().getLevel();
-				env.mulValue(BaseStats.STR.calcBonus(env.getCharacter()) * ((level + 89) / 100));
-			}
-		}
-	}
-	
-	static class FuncMAtkMod extends Func
-	{
-		static final FuncMAtkMod _fma_instance = new FuncMAtkMod();
-		
-		static Func getInstance()
-		{
-			return _fma_instance;
-		}
-		
-		private FuncMAtkMod()
-		{
-			super(Stats.MAGIC_ATTACK, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			if (env.getCharacter() instanceof L2PcInstance)
-			{
-				double intb = BaseStats.INT.calcBonus(env.getPlayer());
-				double lvlb = env.getPlayer().getLevelMod();
-				env.mulValue((lvlb * lvlb) * (intb * intb));
-			}
-			else
-			{
-				float level = env.getCharacter().getLevel();
-				double intb = BaseStats.INT.calcBonus(env.getCharacter());
-				float lvlb = ((level + 89) / 100);
-				env.mulValue((lvlb * lvlb) * (intb * intb));
-			}
-		}
-	}
-	
-	static class FuncMDefMod extends Func
-	{
-		static final FuncMDefMod _fmm_instance = new FuncMDefMod();
-		
-		static Func getInstance()
-		{
-			return _fmm_instance;
-		}
-		
-		private FuncMDefMod()
-		{
-			super(Stats.MAGIC_DEFENCE, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			float level = env.getCharacter().getLevel();
-			if (env.getCharacter() instanceof L2PcInstance)
-			{
-				L2PcInstance p = env.getPlayer();
-				if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER) != null)
-				{
-					env.subValue(5);
-				}
-				if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER) != null)
-				{
-					env.subValue(5);
-				}
-				if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR) != null)
-				{
-					env.subValue(9);
-				}
-				if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR) != null)
-				{
-					env.subValue(9);
-				}
-				if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK) != null)
-				{
-					env.subValue(13);
-				}
-				env.mulValue(BaseStats.MEN.calcBonus(env.getPlayer()) * env.getPlayer().getLevelMod());
-			}
-			else if ((env.getCharacter() instanceof L2PetInstance) || (env.getCharacter() instanceof L2BabyPetInstance))
-			{
-				if (env.getCharacter().getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK) != 0)
-				{
-					env.subValue(13);
-					env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
-				}
-				else
-				{
-					env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
-				}
-			}
-			else
-			{
-				env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
-			}
-		}
-	}
-	
-	static class FuncPDefMod extends Func
-	{
-		static final FuncPDefMod _fmm_instance = new FuncPDefMod();
-		
-		static Func getInstance()
-		{
-			return _fmm_instance;
-		}
-		
-		private FuncPDefMod()
-		{
-			super(Stats.POWER_DEFENCE, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			if (env.getCharacter() instanceof L2PcInstance)
-			{
-				L2PcInstance p = env.getPlayer();
-				boolean hasMagePDef = (p.getClassId().isMage() || (p.getClassId().getId() == 0x31)); // orc mystics are a special case
-				if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD) != null)
-				{
-					env.subValue(12);
-				}
-				L2ItemInstance chest = p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
-				if (chest != null)
-				{
-					env.subValue(hasMagePDef ? 15 : 31);
-				}
-				if ((p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) != null) || ((chest != null) && (chest.getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR)))
-				{
-					env.subValue(hasMagePDef ? 8 : 18);
-				}
-				if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) != null)
-				{
-					env.subValue(8);
-				}
-				if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) != null)
-				{
-					env.subValue(7);
-				}
-				env.mulValue(env.getPlayer().getLevelMod());
-			}
-			else
-			{
-				float level = env.getCharacter().getLevel();
-				env.mulValue((level + 89) / 100);
-			}
-		}
-	}
-	
-	static class FuncGatesPDefMod extends Func
-	{
-		static final FuncGatesPDefMod _fmm_instance = new FuncGatesPDefMod();
-		
-		static Func getInstance()
-		{
-			return _fmm_instance;
-		}
-		
-		private FuncGatesPDefMod()
-		{
-			super(Stats.POWER_DEFENCE, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
-			{
-				env.mulValue(Config.ALT_SIEGE_DAWN_GATES_PDEF_MULT);
-			}
-			else if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK)
-			{
-				env.mulValue(Config.ALT_SIEGE_DUSK_GATES_PDEF_MULT);
-			}
-		}
-	}
-	
-	static class FuncGatesMDefMod extends Func
-	{
-		static final FuncGatesMDefMod _fmm_instance = new FuncGatesMDefMod();
-		
-		static Func getInstance()
-		{
-			return _fmm_instance;
-		}
-		
-		private FuncGatesMDefMod()
-		{
-			super(Stats.MAGIC_DEFENCE, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
-			{
-				env.mulValue(Config.ALT_SIEGE_DAWN_GATES_MDEF_MULT);
-			}
-			else if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK)
-			{
-				env.mulValue(Config.ALT_SIEGE_DUSK_GATES_MDEF_MULT);
-			}
-		}
-	}
-	
-	static class FuncBowAtkRange extends Func
-	{
-		private static final FuncBowAtkRange _fbar_instance = new FuncBowAtkRange();
-		
-		static Func getInstance()
-		{
-			return _fbar_instance;
-		}
-		
-		private FuncBowAtkRange()
-		{
-			super(Stats.POWER_ATTACK_RANGE, 0x10, null);
-			setCondition(new ConditionUsingItemType(L2WeaponType.BOW.mask()));
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			if (!cond.test(env))
-			{
-				return;
-			}
-			// default is 40 and with bow should be 500
-			env.addValue(460);
-		}
-	}
-	
-	static class FuncCrossBowAtkRange extends Func
-	{
-		private static final FuncCrossBowAtkRange _fcb_instance = new FuncCrossBowAtkRange();
-		
-		static Func getInstance()
-		{
-			return _fcb_instance;
-		}
-		
-		private FuncCrossBowAtkRange()
-		{
-			super(Stats.POWER_ATTACK_RANGE, 0x10, null);
-			setCondition(new ConditionUsingItemType(L2WeaponType.CROSSBOW.mask()));
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			if (!cond.test(env))
-			{
-				return;
-			}
-			// default is 40 and with crossbow should be 400
-			env.addValue(360);
-		}
-	}
-	
-	static class FuncAtkAccuracy extends Func
-	{
-		static final FuncAtkAccuracy _faa_instance = new FuncAtkAccuracy();
-		
-		static Func getInstance()
-		{
-			return _faa_instance;
-		}
-		
-		private FuncAtkAccuracy()
-		{
-			super(Stats.ACCURACY_COMBAT, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			final int level = env.getCharacter().getLevel();
-			if (env.getCharacter() instanceof L2PcInstance)
-			{
-				// [Square(DEX)]*6 + lvl + weapon hitbonus;
-				env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
-				if (level > 77)
-				{
-					env.addValue((level - 77) + 1);
-				}
-				if (level > 69)
-				{
-					env.addValue(level - 69);
-					// if (env.player instanceof L2Summon)
-					// env.value += (level < 60) ? 4 : 5;
-				}
-			}
-			else
-			{
-				env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
-				if (level > 77)
-				{
-					env.addValue(level - 76);
-				}
-				if (level > 69)
-				{
-					env.addValue(level - 69);
-				}
-			}
-		}
-	}
-	
-	static class FuncAtkEvasion extends Func
-	{
-		static final FuncAtkEvasion _fae_instance = new FuncAtkEvasion();
-		
-		static Func getInstance()
-		{
-			return _fae_instance;
-		}
-		
-		private FuncAtkEvasion()
-		{
-			super(Stats.EVASION_RATE, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			final int level = env.getCharacter().getLevel();
-			if (env.getCharacter() instanceof L2PcInstance)
-			{
-				// [Square(DEX)]*6 + lvl;
-				env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
-				if (level > 77)
-				{
-					env.addValue(level - 77);
-				}
-				if (level > 69)
-				{
-					env.addValue(level - 69);
-				}
-			}
-			else
-			{
-				// [Square(DEX)]*6 + lvl;
-				env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
-				if (level > 69)
-				{
-					env.addValue((level - 69) + 2);
-				}
-			}
-		}
-	}
-	
-	static class FuncAtkCritical extends Func
-	{
-		static final FuncAtkCritical _fac_instance = new FuncAtkCritical();
-		
-		static Func getInstance()
-		{
-			return _fac_instance;
-		}
-		
-		private FuncAtkCritical()
-		{
-			super(Stats.CRITICAL_RATE, 0x09, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()) * 10);
-			env.setBaseValue(env.getValue());
-		}
-	}
-	
-	static class FuncMAtkCritical extends Func
-	{
-		static final FuncMAtkCritical _fac_instance = new FuncMAtkCritical();
-		
-		static Func getInstance()
-		{
-			return _fac_instance;
-		}
-		
-		private FuncMAtkCritical()
-		{
-			super(Stats.MCRITICAL_RATE, 0x30, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2Character p = env.getCharacter();
-			if (p instanceof L2Summon)
-			{
-				env.setValue(8); // TODO: needs retail value
-			}
-			else if ((p instanceof L2PcInstance) && (p.getActiveWeaponInstance() != null))
-			{
-				env.mulValue(BaseStats.WIT.calcBonus(p));
-			}
-		}
-	}
-	
-	static class FuncMoveSpeed extends Func
-	{
-		static final FuncMoveSpeed _fms_instance = new FuncMoveSpeed();
-		
-		static Func getInstance()
-		{
-			return _fms_instance;
-		}
-		
-		private FuncMoveSpeed()
-		{
-			super(Stats.RUN_SPEED, 0x30, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()));
-		}
-	}
-	
-	static class FuncPAtkSpeed extends Func
-	{
-		static final FuncPAtkSpeed _fas_instance = new FuncPAtkSpeed();
-		
-		static Func getInstance()
-		{
-			return _fas_instance;
-		}
-		
-		private FuncPAtkSpeed()
-		{
-			super(Stats.POWER_ATTACK_SPEED, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()));
-		}
-	}
-	
-	static class FuncMAtkSpeed extends Func
-	{
-		static final FuncMAtkSpeed _fas_instance = new FuncMAtkSpeed();
-		
-		static Func getInstance()
-		{
-			return _fas_instance;
-		}
-		
-		private FuncMAtkSpeed()
-		{
-			super(Stats.MAGIC_ATTACK_SPEED, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.mulValue(BaseStats.WIT.calcBonus(env.getCharacter()));
-		}
-	}
-	
-	static class FuncHennaSTR extends Func
-	{
-		static final FuncHennaSTR _fh_instance = new FuncHennaSTR();
-		
-		static Func getInstance()
-		{
-			return _fh_instance;
-		}
-		
-		private FuncHennaSTR()
-		{
-			super(Stats.STAT_STR, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcInstance pc = env.getPlayer();
-			if (pc != null)
-			{
-				env.addValue(pc.getHennaStatSTR());
-			}
-		}
-	}
-	
-	static class FuncHennaDEX extends Func
-	{
-		static final FuncHennaDEX _fh_instance = new FuncHennaDEX();
-		
-		static Func getInstance()
-		{
-			return _fh_instance;
-		}
-		
-		private FuncHennaDEX()
-		{
-			super(Stats.STAT_DEX, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcInstance pc = env.getPlayer();
-			if (pc != null)
-			{
-				env.addValue(pc.getHennaStatDEX());
-			}
-		}
-	}
-	
-	static class FuncHennaINT extends Func
-	{
-		static final FuncHennaINT _fh_instance = new FuncHennaINT();
-		
-		static Func getInstance()
-		{
-			return _fh_instance;
-		}
-		
-		private FuncHennaINT()
-		{
-			super(Stats.STAT_INT, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcInstance pc = env.getPlayer();
-			if (pc != null)
-			{
-				env.addValue(pc.getHennaStatINT());
-			}
-		}
-	}
-	
-	static class FuncHennaMEN extends Func
-	{
-		static final FuncHennaMEN _fh_instance = new FuncHennaMEN();
-		
-		static Func getInstance()
-		{
-			return _fh_instance;
-		}
-		
-		private FuncHennaMEN()
-		{
-			super(Stats.STAT_MEN, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcInstance pc = env.getPlayer();
-			if (pc != null)
-			{
-				env.addValue(pc.getHennaStatMEN());
-			}
-		}
-	}
-	
-	static class FuncHennaCON extends Func
-	{
-		static final FuncHennaCON _fh_instance = new FuncHennaCON();
-		
-		static Func getInstance()
-		{
-			return _fh_instance;
-		}
-		
-		private FuncHennaCON()
-		{
-			super(Stats.STAT_CON, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcInstance pc = env.getPlayer();
-			if (pc != null)
-			{
-				env.addValue(pc.getHennaStatCON());
-			}
-		}
-	}
-	
-	static class FuncHennaWIT extends Func
-	{
-		static final FuncHennaWIT _fh_instance = new FuncHennaWIT();
-		
-		static Func getInstance()
-		{
-			return _fh_instance;
-		}
-		
-		private FuncHennaWIT()
-		{
-			super(Stats.STAT_WIT, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcInstance pc = env.getPlayer();
-			if (pc != null)
-			{
-				env.addValue(pc.getHennaStatWIT());
-			}
-		}
-	}
-	
-	static class FuncMaxHpAdd extends Func
-	{
-		static final FuncMaxHpAdd _fmha_instance = new FuncMaxHpAdd();
-		
-		static Func getInstance()
-		{
-			return _fmha_instance;
-		}
-		
-		private FuncMaxHpAdd()
-		{
-			super(Stats.MAX_HP, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
-			int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
-			double hpmod = t.getLvlHpMod() * lvl;
-			double hpmax = (t.getLvlHpAdd() + hpmod) * lvl;
-			double hpmin = (t.getLvlHpAdd() * lvl) + hpmod;
-			env.addValue((hpmax + hpmin) / 2);
-		}
-	}
-	
-	static class FuncMaxHpMul extends Func
-	{
-		static final FuncMaxHpMul _fmhm_instance = new FuncMaxHpMul();
-		
-		static Func getInstance()
-		{
-			return _fmhm_instance;
-		}
-		
-		private FuncMaxHpMul()
-		{
-			super(Stats.MAX_HP, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.mulValue(BaseStats.CON.calcBonus(env.getCharacter()));
-		}
-	}
-	
-	static class FuncMaxCpAdd extends Func
-	{
-		static final FuncMaxCpAdd _fmca_instance = new FuncMaxCpAdd();
-		
-		static Func getInstance()
-		{
-			return _fmca_instance;
-		}
-		
-		private FuncMaxCpAdd()
-		{
-			super(Stats.MAX_CP, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
-			int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
-			double cpmod = t.getLvlCpMod() * lvl;
-			double cpmax = (t.getLvlCpAdd() + cpmod) * lvl;
-			double cpmin = (t.getLvlCpAdd() * lvl) + cpmod;
-			env.addValue((cpmax + cpmin) / 2);
-		}
-	}
-	
-	static class FuncMaxCpMul extends Func
-	{
-		static final FuncMaxCpMul _fmcm_instance = new FuncMaxCpMul();
-		
-		static Func getInstance()
-		{
-			return _fmcm_instance;
-		}
-		
-		private FuncMaxCpMul()
-		{
-			super(Stats.MAX_CP, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.mulValue(BaseStats.CON.calcBonus(env.getCharacter()));
-		}
-	}
-	
-	static class FuncMaxMpAdd extends Func
-	{
-		static final FuncMaxMpAdd _fmma_instance = new FuncMaxMpAdd();
-		
-		static Func getInstance()
-		{
-			return _fmma_instance;
-		}
-		
-		private FuncMaxMpAdd()
-		{
-			super(Stats.MAX_MP, 0x10, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
-			int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
-			double mpmod = t.getLvlMpMod() * lvl;
-			double mpmax = (t.getLvlMpAdd() + mpmod) * lvl;
-			double mpmin = (t.getLvlMpAdd() * lvl) + mpmod;
-			env.addValue((mpmax + mpmin) / 2);
-		}
-	}
-	
-	static class FuncMaxMpMul extends Func
-	{
-		static final FuncMaxMpMul _fmmm_instance = new FuncMaxMpMul();
-		
-		static Func getInstance()
-		{
-			return _fmmm_instance;
-		}
-		
-		private FuncMaxMpMul()
-		{
-			super(Stats.MAX_MP, 0x20, null);
-		}
-		
-		@Override
-		public void calc(Env env)
-		{
-			env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()));
-		}
-	}
-	
 	/**
 	 * Return the period between 2 regeneration task (3s for L2Character, 5 min for L2DoorInstance).
 	 * @param cha
@@ -1098,12 +236,19 @@ public final class Formulas
 			cha.addStatFunc(FuncMAtkSpeed.getInstance());
 			cha.addStatFunc(FuncMoveSpeed.getInstance());
 			
-			cha.addStatFunc(FuncHennaSTR.getInstance());
-			cha.addStatFunc(FuncHennaDEX.getInstance());
-			cha.addStatFunc(FuncHennaINT.getInstance());
-			cha.addStatFunc(FuncHennaMEN.getInstance());
-			cha.addStatFunc(FuncHennaCON.getInstance());
-			cha.addStatFunc(FuncHennaWIT.getInstance());
+			cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_STR));
+			cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_DEX));
+			cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_INT));
+			cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_MEN));
+			cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_CON));
+			cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_WIT));
+			
+			cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_STR));
+			cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_DEX));
+			cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_INT));
+			cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_MEN));
+			cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_CON));
+			cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_WIT));
 		}
 		else if (cha instanceof L2PetInstance)
 		{