Browse Source

BETA: Dropped skill "lambdas" since they are not used.

Reviewed by: Zoey76, !UnAfraid
Nos 10 years ago
parent
commit
b05d54048c
40 changed files with 80 additions and 414 deletions
  1. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/EnchantItemHPBonusData.java
  2. 1 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/OptionsData.java
  3. 12 83
      L2J_Server_BETA/java/com/l2jserver/gameserver/engines/DocumentBase.java
  4. 6 7
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/Elementals.java
  5. 6 6
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/items/L2Item.java
  6. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/options/Options.java
  7. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/Func.java
  8. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncAdd.java
  9. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncBaseMul.java
  10. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncDiv.java
  11. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncEnchant.java
  12. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncEnchantHp.java
  13. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncMul.java
  14. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncSet.java
  15. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncShare.java
  16. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncSub.java
  17. 5 5
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncTemplate.java
  18. 0 29
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/Lambda.java
  19. 0 62
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/LambdaCalc.java
  20. 0 40
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/LambdaConst.java
  21. 0 47
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/LambdaRnd.java
  22. 0 82
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/LambdaStats.java
  23. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncArmorSet.java
  24. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkAccuracy.java
  25. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkCritical.java
  26. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncAtkEvasion.java
  27. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncGatesMDefMod.java
  28. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncGatesPDefMod.java
  29. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncHenna.java
  30. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkCritical.java
  31. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkMod.java
  32. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMAtkSpeed.java
  33. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMDefMod.java
  34. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxCpMul.java
  35. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxHpMul.java
  36. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMaxMpMul.java
  37. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncMoveSpeed.java
  38. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPAtkMod.java
  39. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPAtkSpeed.java
  40. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/formulas/FuncPDefMod.java

+ 2 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/EnchantItemHPBonusData.java

@@ -31,7 +31,6 @@ import com.l2jserver.gameserver.model.items.L2Item;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.items.type.CrystalType;
 import com.l2jserver.gameserver.model.skills.funcs.FuncTemplate;
-import com.l2jserver.gameserver.model.skills.funcs.LambdaConst;
 import com.l2jserver.gameserver.model.stats.Stats;
 
 /**
@@ -100,7 +99,7 @@ public class EnchantItemHPBonusData extends DocumentParser
 						case L2Item.SLOT_UNDERWEAR:
 						case L2Item.SLOT_L_HAND:
 						case L2Item.SLOT_BELT:
-							item.attach(new FuncTemplate(null, null, "EnchantHp", Stats.MAX_HP, 0x60, new LambdaConst(0)));
+							item.attach(new FuncTemplate(null, null, "EnchantHp", Stats.MAX_HP, 0x60, 0));
 							break;
 						default:
 							break;
@@ -118,7 +117,7 @@ public class EnchantItemHPBonusData extends DocumentParser
 					switch (item.getBodyPart())
 					{
 						case L2Item.SLOT_L_HAND:
-							item.attach(new FuncTemplate(null, null, "EnchantHp", Stats.MAX_HP, 0x60, new LambdaConst(0)));
+							item.attach(new FuncTemplate(null, null, "EnchantHp", Stats.MAX_HP, 0x60, 0));
 							break;
 						default:
 							break;

+ 1 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/OptionsData.java

@@ -31,7 +31,6 @@ import com.l2jserver.gameserver.model.options.Options;
 import com.l2jserver.gameserver.model.options.OptionsSkillHolder;
 import com.l2jserver.gameserver.model.options.OptionsSkillType;
 import com.l2jserver.gameserver.model.skills.funcs.FuncTemplate;
-import com.l2jserver.gameserver.model.skills.funcs.LambdaConst;
 import com.l2jserver.gameserver.model.stats.Stats;
 
 /**
@@ -153,7 +152,7 @@ public class OptionsData extends DocumentParser
 		Stats stat = Stats.valueOfXml(parseString(attrs, "stat"));
 		int ord = Integer.decode(parseString(attrs, "order"));
 		double val = parseDouble(attrs, "val");
-		op.addFunc(new FuncTemplate(null, null, func, stat, ord, new LambdaConst(val)));
+		op.addFunc(new FuncTemplate(null, null, func, stat, ord, val));
 	}
 	
 	public Options getOptions(int id)

+ 12 - 83
L2J_Server_BETA/java/com/l2jserver/gameserver/engines/DocumentBase.java

@@ -133,11 +133,6 @@ import com.l2jserver.gameserver.model.skills.AbnormalType;
 import com.l2jserver.gameserver.model.skills.EffectScope;
 import com.l2jserver.gameserver.model.skills.Skill;
 import com.l2jserver.gameserver.model.skills.funcs.FuncTemplate;
-import com.l2jserver.gameserver.model.skills.funcs.Lambda;
-import com.l2jserver.gameserver.model.skills.funcs.LambdaCalc;
-import com.l2jserver.gameserver.model.skills.funcs.LambdaConst;
-import com.l2jserver.gameserver.model.skills.funcs.LambdaStats;
-import com.l2jserver.gameserver.model.stats.Env;
 import com.l2jserver.gameserver.model.stats.Stats;
 
 /**
@@ -291,10 +286,20 @@ public abstract class DocumentBase
 	{
 		Stats stat = Stats.valueOfXml(n.getAttributes().getNamedItem("stat").getNodeValue());
 		String order = n.getAttributes().getNamedItem("order").getNodeValue();
-		Lambda lambda = getLambda(n, template);
+		String valueString = n.getAttributes().getNamedItem("val").getNodeValue();
+		double value;
+		if (valueString.charAt(0) == '#')
+		{
+			value = Double.parseDouble(getTableValue(valueString));
+		}
+		else
+		{
+			value = Double.parseDouble(valueString);
+		}
+		
 		int ord = Integer.decode(getValue(order, template));
 		Condition applayCond = parseCondition(n.getFirstChild(), template);
-		FuncTemplate ft = new FuncTemplate(attachCond, applayCond, name, stat, ord, lambda);
+		FuncTemplate ft = new FuncTemplate(attachCond, applayCond, name, stat, ord, value);
 		if (template instanceof L2Item)
 		{
 			((L2Item) template).attach(ft);
@@ -309,17 +314,6 @@ public abstract class DocumentBase
 		}
 	}
 	
-	protected void attachLambdaFunc(Node n, Object template, LambdaCalc calc)
-	{
-		String name = n.getNodeName();
-		final StringBuilder sb = new StringBuilder(name);
-		sb.setCharAt(0, Character.toUpperCase(name.charAt(0)));
-		name = sb.toString();
-		Lambda lambda = getLambda(n, template);
-		FuncTemplate ft = new FuncTemplate(null, null, name, null, calc.funcs.length, lambda);
-		calc.addFunc(ft.getFunc(new Env(), calc));
-	}
-	
 	protected void attachEffect(Node n, Object template, Condition attachCond)
 	{
 		attachEffect(n, template, attachCond, null);
@@ -1307,71 +1301,6 @@ public abstract class DocumentBase
 		set.set("capsuled_items_skill", value);
 	}
 	
-	protected Lambda getLambda(Node n, Object template)
-	{
-		Node nval = n.getAttributes().getNamedItem("val");
-		if (nval != null)
-		{
-			String val = nval.getNodeValue();
-			if (val.charAt(0) == '#')
-			{ // table by level
-				return new LambdaConst(Double.parseDouble(getTableValue(val)));
-			}
-			else if (val.charAt(0) == '$')
-			{
-				if (val.equalsIgnoreCase("$player_level"))
-				{
-					return new LambdaStats(LambdaStats.StatsType.PLAYER_LEVEL);
-				}
-				if (val.equalsIgnoreCase("$target_level"))
-				{
-					return new LambdaStats(LambdaStats.StatsType.TARGET_LEVEL);
-				}
-				if (val.equalsIgnoreCase("$player_max_hp"))
-				{
-					return new LambdaStats(LambdaStats.StatsType.PLAYER_MAX_HP);
-				}
-				if (val.equalsIgnoreCase("$player_max_mp"))
-				{
-					return new LambdaStats(LambdaStats.StatsType.PLAYER_MAX_MP);
-				}
-				// try to find value out of item fields
-				StatsSet set = getStatsSet();
-				String field = set.getString(val.substring(1));
-				if (field != null)
-				{
-					return new LambdaConst(Double.parseDouble(getValue(field, template)));
-				}
-				// failed
-				throw new IllegalArgumentException("Unknown value " + val);
-			}
-			else
-			{
-				return new LambdaConst(Double.parseDouble(val));
-			}
-		}
-		LambdaCalc calc = new LambdaCalc();
-		n = n.getFirstChild();
-		while ((n != null) && (n.getNodeType() != Node.ELEMENT_NODE))
-		{
-			n = n.getNextSibling();
-		}
-		if ((n == null) || !"val".equals(n.getNodeName()))
-		{
-			throw new IllegalArgumentException("Value not specified");
-		}
-		
-		for (n = n.getFirstChild(); n != null; n = n.getNextSibling())
-		{
-			if (n.getNodeType() != Node.ELEMENT_NODE)
-			{
-				continue;
-			}
-			attachLambdaFunc(n, template, calc);
-		}
-		return calc;
-	}
-	
 	protected String getValue(String value, Object template)
 	{
 		// is it a table?

+ 6 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/model/Elementals.java

@@ -23,7 +23,6 @@ import java.util.Map;
 
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.skills.funcs.FuncAdd;
-import com.l2jserver.gameserver.model.skills.funcs.LambdaConst;
 import com.l2jserver.gameserver.model.stats.Stats;
 
 public final class Elementals
@@ -258,22 +257,22 @@ public final class Elementals
 			switch (_elementalType)
 			{
 				case FIRE:
-					player.addStatFunc(new FuncAdd(isArmor ? Stats.FIRE_RES : Stats.FIRE_POWER, 0x40, this, new LambdaConst(_elementalValue)));
+					player.addStatFunc(new FuncAdd(isArmor ? Stats.FIRE_RES : Stats.FIRE_POWER, 0x40, this, _elementalValue));
 					break;
 				case WATER:
-					player.addStatFunc(new FuncAdd(isArmor ? Stats.WATER_RES : Stats.WATER_POWER, 0x40, this, new LambdaConst(_elementalValue)));
+					player.addStatFunc(new FuncAdd(isArmor ? Stats.WATER_RES : Stats.WATER_POWER, 0x40, this, _elementalValue));
 					break;
 				case WIND:
-					player.addStatFunc(new FuncAdd(isArmor ? Stats.WIND_RES : Stats.WIND_POWER, 0x40, this, new LambdaConst(_elementalValue)));
+					player.addStatFunc(new FuncAdd(isArmor ? Stats.WIND_RES : Stats.WIND_POWER, 0x40, this, _elementalValue));
 					break;
 				case EARTH:
-					player.addStatFunc(new FuncAdd(isArmor ? Stats.EARTH_RES : Stats.EARTH_POWER, 0x40, this, new LambdaConst(_elementalValue)));
+					player.addStatFunc(new FuncAdd(isArmor ? Stats.EARTH_RES : Stats.EARTH_POWER, 0x40, this, _elementalValue));
 					break;
 				case DARK:
-					player.addStatFunc(new FuncAdd(isArmor ? Stats.DARK_RES : Stats.DARK_POWER, 0x40, this, new LambdaConst(_elementalValue)));
+					player.addStatFunc(new FuncAdd(isArmor ? Stats.DARK_RES : Stats.DARK_POWER, 0x40, this, _elementalValue));
 					break;
 				case HOLY:
-					player.addStatFunc(new FuncAdd(isArmor ? Stats.HOLY_RES : Stats.HOLY_POWER, 0x40, this, new LambdaConst(_elementalValue)));
+					player.addStatFunc(new FuncAdd(isArmor ? Stats.HOLY_RES : Stats.HOLY_POWER, 0x40, this, _elementalValue));
 					break;
 			}
 			

+ 6 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/model/items/L2Item.java

@@ -747,27 +747,27 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
 		{
 			case FIRE_RES:
 			case FIRE_POWER:
-				setElementals(new Elementals(Elementals.FIRE, (int) f.lambda.calc(null)));
+				setElementals(new Elementals(Elementals.FIRE, (int) f.value));
 				break;
 			case WATER_RES:
 			case WATER_POWER:
-				setElementals(new Elementals(Elementals.WATER, (int) f.lambda.calc(null)));
+				setElementals(new Elementals(Elementals.WATER, (int) f.value));
 				break;
 			case WIND_RES:
 			case WIND_POWER:
-				setElementals(new Elementals(Elementals.WIND, (int) f.lambda.calc(null)));
+				setElementals(new Elementals(Elementals.WIND, (int) f.value));
 				break;
 			case EARTH_RES:
 			case EARTH_POWER:
-				setElementals(new Elementals(Elementals.EARTH, (int) f.lambda.calc(null)));
+				setElementals(new Elementals(Elementals.EARTH, (int) f.value));
 				break;
 			case HOLY_RES:
 			case HOLY_POWER:
-				setElementals(new Elementals(Elementals.HOLY, (int) f.lambda.calc(null)));
+				setElementals(new Elementals(Elementals.HOLY, (int) f.value));
 				break;
 			case DARK_RES:
 			case DARK_POWER:
-				setElementals(new Elementals(Elementals.DARK, (int) f.lambda.calc(null)));
+				setElementals(new Elementals(Elementals.DARK, (int) f.value));
 				break;
 		}
 		

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/options/Options.java

@@ -82,7 +82,7 @@ public class Options
 			{
 				funcs.add(f);
 			}
-			player.sendDebugMessage("Adding stats: " + t.stat + " val: " + t.lambda.calc(env));
+			player.sendDebugMessage("Adding stats: " + t.stat + " val: " + t.value);
 		}
 		return funcs;
 	}

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/Func.java

@@ -58,21 +58,21 @@ public abstract class Func
 	 */
 	public Condition cond;
 	
-	public Lambda _lambda;
+	public double _value;
 	
 	/**
 	 * Constructor of Func.
 	 * @param pStat
 	 * @param pOrder
 	 * @param owner
-	 * @param lambda
+	 * @param value
 	 */
-	public Func(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public Func(Stats pStat, int pOrder, Object owner, double value)
 	{
 		stat = pStat;
 		order = pOrder;
 		funcOwner = owner;
-		_lambda = lambda;
+		_value = value;
 	}
 	
 	/**

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncAdd.java

@@ -23,9 +23,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
 
 public class FuncAdd extends Func
 {
-	public FuncAdd(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncAdd(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override
@@ -33,7 +33,7 @@ public class FuncAdd extends Func
 	{
 		if ((cond == null) || cond.test(env))
 		{
-			env.addValue(_lambda.calc(env));
+			env.addValue(_value);
 		}
 	}
 }

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncBaseMul.java

@@ -23,9 +23,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
 
 public class FuncBaseMul extends Func
 {
-	public FuncBaseMul(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncBaseMul(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override
@@ -33,7 +33,7 @@ public class FuncBaseMul extends Func
 	{
 		if ((cond == null) || cond.test(env))
 		{
-			env.addValue(env.getBaseValue() * _lambda.calc(env));
+			env.addValue(env.getBaseValue() * _value);
 		}
 	}
 }

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncDiv.java

@@ -23,9 +23,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
 
 public class FuncDiv extends Func
 {
-	public FuncDiv(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncDiv(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override
@@ -33,7 +33,7 @@ public class FuncDiv extends Func
 	{
 		if ((cond == null) || cond.test(env))
 		{
-			env.divValue(_lambda.calc(env));
+			env.divValue(_value);
 		}
 	}
 }

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncEnchant.java

@@ -28,9 +28,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
 
 public class FuncEnchant extends Func
 {
-	public FuncEnchant(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncEnchant(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncEnchantHp.java

@@ -28,9 +28,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
  */
 public class FuncEnchantHp extends Func
 {
-	public FuncEnchantHp(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncEnchantHp(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncMul.java

@@ -23,9 +23,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
 
 public class FuncMul extends Func
 {
-	public FuncMul(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncMul(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override
@@ -33,7 +33,7 @@ public class FuncMul extends Func
 	{
 		if ((cond == null) || cond.test(env))
 		{
-			env.mulValue(_lambda.calc(env));
+			env.mulValue(_value);
 		}
 	}
 }

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncSet.java

@@ -23,9 +23,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
 
 public class FuncSet extends Func
 {
-	public FuncSet(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncSet(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override
@@ -33,7 +33,7 @@ public class FuncSet extends Func
 	{
 		if ((cond == null) || cond.test(env))
 		{
-			env.setValue(_lambda.calc(env));
+			env.setValue(_value);
 		}
 	}
 }

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncShare.java

@@ -29,9 +29,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
  */
 public class FuncShare extends Func
 {
-	public FuncShare(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncShare(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override
@@ -46,7 +46,7 @@ public class FuncShare extends Func
 				final L2PcInstance player = summon.getOwner();
 				if (player != null)
 				{
-					env.addValue(getBaseValue(stat, player) * _lambda.calc(env));
+					env.addValue(getBaseValue(stat, player) * _value);
 				}
 			}
 		}

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncSub.java

@@ -23,9 +23,9 @@ import com.l2jserver.gameserver.model.stats.Stats;
 
 public class FuncSub extends Func
 {
-	public FuncSub(Stats pStat, int pOrder, Object owner, Lambda lambda)
+	public FuncSub(Stats pStat, int pOrder, Object owner, double value)
 	{
-		super(pStat, pOrder, owner, lambda);
+		super(pStat, pOrder, owner, value);
 	}
 	
 	@Override
@@ -33,7 +33,7 @@ public class FuncSub extends Func
 	{
 		if ((cond == null) || cond.test(env))
 		{
-			env.subValue(_lambda.calc(env));
+			env.subValue(_value);
 		}
 	}
 }

+ 5 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/FuncTemplate.java

@@ -39,15 +39,15 @@ public final class FuncTemplate
 	public final Constructor<?> constructor;
 	public final Stats stat;
 	public final int order;
-	public final Lambda lambda;
+	public final double value;
 	
-	public FuncTemplate(Condition pAttachCond, Condition pApplayCond, String pFunc, Stats pStat, int pOrder, Lambda pLambda)
+	public FuncTemplate(Condition pAttachCond, Condition pApplayCond, String pFunc, Stats pStat, int pOrder, double pValue)
 	{
 		attachCond = pAttachCond;
 		applayCond = pApplayCond;
 		stat = pStat;
 		order = pOrder;
-		lambda = pLambda;
+		value = pValue;
 		try
 		{
 			func = Class.forName("com.l2jserver.gameserver.model.skills.funcs.Func" + pFunc);
@@ -67,7 +67,7 @@ public final class FuncTemplate
 				// Owner
 				Object.class,
 				// Value for function
-				Lambda.class
+				Double.TYPE
 			});
 		}
 		catch (NoSuchMethodException e)
@@ -84,7 +84,7 @@ public final class FuncTemplate
 		}
 		try
 		{
-			Func f = (Func) constructor.newInstance(stat, order, owner, lambda);
+			Func f = (Func) constructor.newInstance(stat, order, owner, value);
 			if (applayCond != null)
 			{
 				f.setCondition(applayCond);

+ 0 - 29
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/Lambda.java

@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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;
-
-import com.l2jserver.gameserver.model.stats.Env;
-
-/**
- * @author mkizub
- */
-public abstract class Lambda
-{
-	public abstract double calc(Env env);
-}

+ 0 - 62
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/LambdaCalc.java

@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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;
-
-import com.l2jserver.gameserver.model.stats.Env;
-
-/**
- * @author mkizub
- */
-public final class LambdaCalc extends Lambda
-{
-	public Func[] funcs;
-	
-	public LambdaCalc()
-	{
-		funcs = new Func[0];
-	}
-	
-	@Override
-	public double calc(Env env)
-	{
-		double saveValue = env.getValue();
-		try
-		{
-			env.setValue(0);
-			for (Func f : funcs)
-			{
-				f.calc(env);
-			}
-			return env.getValue();
-		}
-		finally
-		{
-			env.setValue(saveValue);
-		}
-	}
-	
-	public void addFunc(Func f)
-	{
-		int len = funcs.length;
-		Func[] dest = new Func[len + 1];
-		System.arraycopy(funcs, 0, dest, 0, len);
-		dest[len] = f;
-		funcs = dest;
-	}
-}

+ 0 - 40
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/LambdaConst.java

@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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;
-
-import com.l2jserver.gameserver.model.stats.Env;
-
-/**
- * @author mkizub
- */
-public final class LambdaConst extends Lambda
-{
-	private final double _value;
-	
-	public LambdaConst(double value)
-	{
-		_value = value;
-	}
-	
-	@Override
-	public double calc(Env env)
-	{
-		return _value;
-	}
-}

+ 0 - 47
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/LambdaRnd.java

@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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;
-
-import com.l2jserver.gameserver.model.stats.Env;
-import com.l2jserver.util.Rnd;
-
-/**
- * @author mkizub
- */
-public final class LambdaRnd extends Lambda
-{
-	private final Lambda _max;
-	private final boolean _linear;
-	
-	public LambdaRnd(Lambda max, boolean linear)
-	{
-		_max = max;
-		_linear = linear;
-	}
-	
-	@Override
-	public double calc(Env env)
-	{
-		if (_linear)
-		{
-			return _max.calc(env) * Rnd.nextDouble();
-		}
-		return _max.calc(env) * Rnd.nextGaussian();
-	}
-}

+ 0 - 82
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/funcs/LambdaStats.java

@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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;
-
-import com.l2jserver.gameserver.model.stats.Env;
-
-/**
- * @author mkizub
- */
-public final class LambdaStats extends Lambda
-{
-	public enum StatsType
-	{
-		PLAYER_LEVEL,
-		CUBIC_LEVEL,
-		TARGET_LEVEL,
-		PLAYER_MAX_HP,
-		PLAYER_MAX_MP
-	}
-	
-	private final StatsType _stat;
-	
-	public LambdaStats(StatsType stat)
-	{
-		_stat = stat;
-	}
-	
-	@Override
-	public double calc(Env env)
-	{
-		switch (_stat)
-		{
-			case PLAYER_LEVEL:
-				if (env.getCharacter() == null)
-				{
-					return 1;
-				}
-				return env.getCharacter().getLevel();
-			case CUBIC_LEVEL:
-				if (env.getCubic() == null)
-				{
-					return 1;
-				}
-				return env.getCubic().getOwner().getLevel();
-			case TARGET_LEVEL:
-				if (env.getTarget() == null)
-				{
-					return 1;
-				}
-				return env.getTarget().getLevel();
-			case PLAYER_MAX_HP:
-				if (env.getCharacter() == null)
-				{
-					return 1;
-				}
-				return env.getCharacter().getMaxHp();
-			case PLAYER_MAX_MP:
-				if (env.getCharacter() == null)
-				{
-					return 1;
-				}
-				return env.getCharacter().getMaxMp();
-		}
-		return 0;
-	}
-}

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

@@ -47,7 +47,7 @@ public class FuncArmorSet extends Func
 	
 	private FuncArmorSet(Stats stat)
 	{
-		super(stat, 0x10, null, null);
+		super(stat, 0x10, null, 0);
 	}
 	
 	@Override

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

@@ -36,7 +36,7 @@ public class FuncAtkAccuracy extends Func
 	
 	private FuncAtkAccuracy()
 	{
-		super(Stats.ACCURACY_COMBAT, 0x10, null, null);
+		super(Stats.ACCURACY_COMBAT, 0x10, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncAtkCritical extends Func
 	
 	private FuncAtkCritical()
 	{
-		super(Stats.CRITICAL_RATE, 0x09, null, null);
+		super(Stats.CRITICAL_RATE, 0x09, null, 0);
 	}
 	
 	@Override

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

@@ -36,7 +36,7 @@ public class FuncAtkEvasion extends Func
 	
 	private FuncAtkEvasion()
 	{
-		super(Stats.EVASION_RATE, 0x10, null, null);
+		super(Stats.EVASION_RATE, 0x10, null, 0);
 	}
 	
 	@Override

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

@@ -38,7 +38,7 @@ public class FuncGatesMDefMod extends Func
 	
 	private FuncGatesMDefMod()
 	{
-		super(Stats.MAGIC_DEFENCE, 0x20, null, null);
+		super(Stats.MAGIC_DEFENCE, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -38,7 +38,7 @@ public class FuncGatesPDefMod extends Func
 	
 	private FuncGatesPDefMod()
 	{
-		super(Stats.POWER_DEFENCE, 0x20, null, null);
+		super(Stats.POWER_DEFENCE, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -44,7 +44,7 @@ public class FuncHenna extends Func
 	
 	private FuncHenna(Stats stat)
 	{
-		super(stat, 0x10, null, null);
+		super(stat, 0x10, null, 0);
 	}
 	
 	@Override

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

@@ -38,7 +38,7 @@ public class FuncMAtkCritical extends Func
 	
 	private FuncMAtkCritical()
 	{
-		super(Stats.MCRITICAL_RATE, 0x09, null, null);
+		super(Stats.MCRITICAL_RATE, 0x09, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncMAtkMod extends Func
 	
 	private FuncMAtkMod()
 	{
-		super(Stats.MAGIC_ATTACK, 0x20, null, null);
+		super(Stats.MAGIC_ATTACK, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncMAtkSpeed extends Func
 	
 	private FuncMAtkSpeed()
 	{
-		super(Stats.MAGIC_ATTACK_SPEED, 0x20, null, null);
+		super(Stats.MAGIC_ATTACK_SPEED, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -39,7 +39,7 @@ public class FuncMDefMod extends Func
 	
 	private FuncMDefMod()
 	{
-		super(Stats.MAGIC_DEFENCE, 0x20, null, null);
+		super(Stats.MAGIC_DEFENCE, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncMaxCpMul extends Func
 	
 	private FuncMaxCpMul()
 	{
-		super(Stats.MAX_CP, 0x20, null, null);
+		super(Stats.MAX_CP, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncMaxHpMul extends Func
 	
 	private FuncMaxHpMul()
 	{
-		super(Stats.MAX_HP, 0x20, null, null);
+		super(Stats.MAX_HP, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncMaxMpMul extends Func
 	
 	private FuncMaxMpMul()
 	{
-		super(Stats.MAX_MP, 0x20, null, null);
+		super(Stats.MAX_MP, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncMoveSpeed extends Func
 	
 	private FuncMoveSpeed()
 	{
-		super(Stats.MOVE_SPEED, 0x30, null, null);
+		super(Stats.MOVE_SPEED, 0x30, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncPAtkMod extends Func
 	
 	private FuncPAtkMod()
 	{
-		super(Stats.POWER_ATTACK, 0x30, null, null);
+		super(Stats.POWER_ATTACK, 0x30, null, 0);
 	}
 	
 	@Override

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

@@ -37,7 +37,7 @@ public class FuncPAtkSpeed extends Func
 	
 	private FuncPAtkSpeed()
 	{
-		super(Stats.POWER_ATTACK_SPEED, 0x20, null, null);
+		super(Stats.POWER_ATTACK_SPEED, 0x20, null, 0);
 	}
 	
 	@Override

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

@@ -39,7 +39,7 @@ public class FuncPDefMod extends Func
 	
 	private FuncPDefMod()
 	{
-		super(Stats.POWER_DEFENCE, 0x20, null, null);
+		super(Stats.POWER_DEFENCE, 0x20, null, 0);
 	}
 	
 	@Override