DrHouse hace 16 años
padre
commit
0eb2a79817
Se han modificado 24 ficheros con 172 adiciones y 188 borrados
  1. 10 11
      L2_GameServer/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminFightCalculator.java
  2. 7 7
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Blow.java
  3. 5 5
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  4. 3 3
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/CpDam.java
  5. 19 19
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Disablers.java
  6. 2 4
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/InstantJump.java
  7. 2 2
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Manadam.java
  8. 11 11
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Mdam.java
  9. 7 8
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Pdam.java
  10. 3 3
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Resurrect.java
  11. 1 1
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Spoil.java
  12. 3 3
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/StrSiegeAssault.java
  13. 1 1
      L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Unlock.java
  14. 28 28
      L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java
  15. 1 1
      L2_GameServer/java/net/sf/l2j/gameserver/model/L2Skill.java
  16. 1 1
      L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  17. 4 4
      L2_GameServer/java/net/sf/l2j/gameserver/model/actor/status/CharStatus.java
  18. 37 48
      L2_GameServer/java/net/sf/l2j/gameserver/skills/Formulas.java
  19. 4 4
      L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java
  20. 1 1
      L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectSpoil.java
  21. 5 6
      L2_GameServer/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillChargeDmg.java
  22. 9 9
      L2_GameServer/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillDrain.java
  23. 4 4
      L2_GameServer/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillElemental.java
  24. 4 4
      L2_GameServer/java/net/sf/l2j/gameserver/templates/item/L2Weapon.java

+ 10 - 11
L2_GameServer/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminFightCalculator.java

@@ -214,7 +214,6 @@ public class AdminFightCalculator implements IAdminCommandHandler
 	
 	private void handleShow(String params, L2PcInstance activeChar)
 	{
-		Formulas f = Formulas.getInstance();
 		params = params.trim();
 		
 		L2Character npc1 = null;
@@ -263,13 +262,13 @@ public class AdminFightCalculator implements IAdminCommandHandler
 		
 		for (int i = 0; i < 10000; i++)
 		{
-			boolean _miss1 = f.calcHitMiss(npc1, npc2);
+			boolean _miss1 = Formulas.calcHitMiss(npc1, npc2);
 			if (_miss1)
 				miss1++;
-			byte _shld1 = f.calcShldUse(npc1, npc2, false);
+			byte _shld1 = Formulas.calcShldUse(npc1, npc2, false);
 			if (_shld1 > 0)
 				shld1++;
-			boolean _crit1 = f.calcCrit(npc1.getCriticalHit(npc2, null));
+			boolean _crit1 = Formulas.calcCrit(npc1.getCriticalHit(npc2, null));
 			if (_crit1)
 				crit1++;
 			
@@ -283,7 +282,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
 			if (!_miss1)
 			{
 				npc1.setAttackingBodypart();
-				double _dmg1 = f.calcPhysDam(npc1, npc2, null, _shld1, _crit1, false, false);
+				double _dmg1 = Formulas.calcPhysDam(npc1, npc2, null, _shld1, _crit1, false, false);
 				dmg1 += _dmg1;
 				npc1.abortAttack();
 			}
@@ -291,13 +290,13 @@ public class AdminFightCalculator implements IAdminCommandHandler
 		
 		for (int i = 0; i < 10000; i++)
 		{
-			boolean _miss2 = f.calcHitMiss(npc2, npc1);
+			boolean _miss2 = Formulas.calcHitMiss(npc2, npc1);
 			if (_miss2)
 				miss2++;
-			byte _shld2 = f.calcShldUse(npc2, npc1, false);
+			byte _shld2 = Formulas.calcShldUse(npc2, npc1, false);
 			if (_shld2 > 0)
 				shld2++;
-			boolean _crit2 = f.calcCrit(npc2.getCriticalHit(npc1, null));
+			boolean _crit2 = Formulas.calcCrit(npc2.getCriticalHit(npc1, null));
 			if (_crit2)
 				crit2++;
 			
@@ -311,7 +310,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
 			if (!_miss2)
 			{
 				npc2.setAttackingBodypart();
-				double _dmg2 = f.calcPhysDam(npc2, npc1, null, _shld2, _crit2, false, false);
+				double _dmg2 = Formulas.calcPhysDam(npc2, npc1, null, _shld2, _crit2, false, false);
 				dmg2 += _dmg2;
 				npc2.abortAttack();
 			}
@@ -335,10 +334,10 @@ public class AdminFightCalculator implements IAdminCommandHandler
 		int tdmg2 = (int) (sAtk2 * dmg2);
 		// HP restored per 100 seconds
 		double maxHp1 = npc1.getMaxHp();
-		int hp1 = (int) (f.calcHpRegen(npc1) * 100000 / f.getRegeneratePeriod(npc1));
+		int hp1 = (int) (Formulas.calcHpRegen(npc1) * 100000 / Formulas.getRegeneratePeriod(npc1));
 		
 		double maxHp2 = npc2.getMaxHp();
-		int hp2 = (int) (f.calcHpRegen(npc2) * 100000 / f.getRegeneratePeriod(npc2));
+		int hp2 = (int) (Formulas.calcHpRegen(npc2) * 100000 / Formulas.getRegeneratePeriod(npc2));
 		
 		NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
 

+ 7 - 7
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Blow.java

@@ -60,7 +60,7 @@ public class Blow implements ISkillHandler
 				continue;
 			
 			// Check firstly if target dodges skill
-			boolean skillIsEvaded = Formulas.getInstance().calcPhysicalSkillEvasion(target, skill);
+			boolean skillIsEvaded = Formulas.calcPhysicalSkillEvasion(target, skill);
 			
 			byte _successChance = SIDE;
 			
@@ -76,7 +76,7 @@ public class Blow implements ISkillHandler
 			if ((skill.getCondition() & L2Skill.COND_BEHIND) != 0)
 				success = (_successChance == BEHIND);
 			if ((skill.getCondition() & L2Skill.COND_CRIT) != 0)
-				success = (success && Formulas.getInstance().calcBlow(activeChar, target, _successChance));
+				success = (success && Formulas.calcBlow(activeChar, target, _successChance));
 			if (!skillIsEvaded && success)
 			{
 				if (skill.hasEffects())
@@ -92,13 +92,13 @@ public class Blow implements ISkillHandler
 				}
 				L2ItemInstance weapon = activeChar.getActiveWeaponInstance();
 				boolean soul = (weapon != null && weapon.getChargedSoulshot() == L2ItemInstance.CHARGED_SOULSHOT && weapon.getItemType() == L2WeaponType.DAGGER);
-				byte shld = Formulas.getInstance().calcShldUse(activeChar, target);
+				byte shld = Formulas.calcShldUse(activeChar, target);
 				
 				// Crit rate base crit rate for skill, modified with STR bonus
 				boolean crit = false;
-				if (Formulas.getInstance().calcCrit(skill.getBaseCritRate() * 10 * Formulas.getInstance().getSTRBonus(activeChar)))
+				if (Formulas.calcCrit(skill.getBaseCritRate() * 10 * Formulas.getSTRBonus(activeChar)))
 					crit = true;
-				double damage = (int) Formulas.getInstance().calcBlowDamage(activeChar, target, skill, shld, soul);
+				double damage = (int) Formulas.calcBlowDamage(activeChar, target, skill, shld, soul);
 				if (crit)
 				{
 					damage *= 2;
@@ -174,7 +174,7 @@ public class Blow implements ISkillHandler
 	        	else
 	        		target.reduceCurrentHp(damage, activeChar, skill);
 				// Manage attack or cast break of the target (calculating rate, sending message...)
-                if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage))
+                if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
                 {
                 	target.breakAttack();
                 	target.breakCast();
@@ -214,7 +214,7 @@ public class Blow implements ISkillHandler
 			}
 			
 			//Possibility of a lethal strike
-			Formulas.getInstance().calcLethalHit(activeChar, target, skill);
+			Formulas.calcLethalHit(activeChar, target, skill);
 			
 			L2Effect effect = activeChar.getFirstEffect(skill.getId());
 			//Self Effect

+ 5 - 5
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java

@@ -190,8 +190,8 @@ public class Continuous implements ISkillHandler
 					ss = ((L2NpcInstance) activeChar).isUsingShot(true);
 				}
 				
-				byte shld = Formulas.getInstance().calcShldUse(activeChar, target);
-				acted = Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss);
+				byte shld = Formulas.calcShldUse(activeChar, target);
+				acted = Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss);
 			}
 			
 			if (acted)
@@ -248,7 +248,7 @@ public class Continuous implements ISkillHandler
 			}
 			
 			// Possibility of a lethal strike
-			Formulas.getInstance().calcLethalHit(activeChar, target, skill);
+			Formulas.calcLethalHit(activeChar, target, skill);
 		}
 		// self Effect :]
 		L2Effect effect = activeChar.getFirstEffect(skill.getId());
@@ -266,8 +266,8 @@ public class Continuous implements ISkillHandler
 		{
 			if (skill.isOffensive())
 			{
-				byte shld = Formulas.getInstance().calcShldUse(activeCubic.getOwner(), target);
-				boolean acted = Formulas.getInstance().calcCubicSkillSuccess(activeCubic, target, skill, shld);
+				byte shld = Formulas.calcShldUse(activeCubic.getOwner(), target);
+				boolean acted = Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld);
 				if (!acted)
 				{
 					activeCubic.getOwner().sendPacket(new SystemMessage(SystemMessageId.ATTACK_FAILED));

+ 3 - 3
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/CpDam.java

@@ -102,13 +102,13 @@ public class CpDam implements ISkillHandler
 				continue;
 			}
 			
-			byte shld = Formulas.getInstance().calcShldUse(activeChar, target);
-			if (!Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+			byte shld = Formulas.calcShldUse(activeChar, target);
+			if (!Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 				return;
 			int damage = (int) (target.getCurrentCp() * (1 - skill.getPower()));
 			
 			// Manage attack or cast break of the target (calculating rate, sending message...)
-			if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage))
+			if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
 			{
 				target.breakAttack();
 				target.breakCast();

+ 19 - 19
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Disablers.java

@@ -175,13 +175,13 @@ public class Disablers implements ISkillHandler
 			if (target == null || target.isDead() || target.isInvul()) //bypass if target is null, invul or dead
 				continue;
 			
-			shld = Formulas.getInstance().calcShldUse(activeChar, target);
+			shld = Formulas.calcShldUse(activeChar, target);
 			
 			switch (type)
 			{
 				case BETRAY:
 				{
-					if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 						skill.getEffects(activeChar, target);
 					else
 					{
@@ -205,7 +205,7 @@ public class Disablers implements ISkillHandler
 					if (target.reflectSkill(skill))
 						target = activeChar;
 					
-					if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 						skill.getEffects(activeChar, target);
 					else
 					{
@@ -225,7 +225,7 @@ public class Disablers implements ISkillHandler
 					if (target.reflectSkill(skill))
 						target = activeChar;
 					
-					if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 						skill.getEffects(activeChar, target);
 					else
 					{
@@ -245,7 +245,7 @@ public class Disablers implements ISkillHandler
 					if (target.reflectSkill(skill))
 						target = activeChar;
 					
-					if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 					{
 						// stop same type effect if available
 						L2Effect[] effects = target.getAllEffects();
@@ -273,7 +273,7 @@ public class Disablers implements ISkillHandler
 					// do nothing if not on mob
 					if (target instanceof L2Attackable)
 					{
-						if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+						if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 						{
 							L2Effect[] effects = target.getAllEffects();
 							for (L2Effect e : effects)
@@ -326,7 +326,7 @@ public class Disablers implements ISkillHandler
 				case AGGREDUCE_CHAR:
 				{
 					// these skills needs to be rechecked
-					if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 					{
 						if (target instanceof L2Attackable)
 						{
@@ -360,7 +360,7 @@ public class Disablers implements ISkillHandler
 					// these skills needs to be rechecked
 					if (target instanceof L2Attackable && !target.isRaid())
 					{
-						if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+						if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 						{
 							if (skill.getTargetType() == L2Skill.SkillTargetType.TARGET_UNDEAD)
 							{
@@ -388,7 +388,7 @@ public class Disablers implements ISkillHandler
 				}
 				case ERASE:
 				{
-					if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss)
+					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss)
 					// doesn't affect siege golem or wild hog cannon
 							&& !(target instanceof L2SiegeSummonInstance))
 					{
@@ -420,7 +420,7 @@ public class Disablers implements ISkillHandler
 					if (target.reflectSkill(skill))
 						target = activeChar;
 					
-					if (!Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (!Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 					{
 						if (activeChar instanceof L2PcInstance)
 						{
@@ -448,7 +448,7 @@ public class Disablers implements ISkillHandler
 					if (target.reflectSkill(skill))
 						target = activeChar;
 					
-					if (!Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (!Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 					{
 						if (activeChar instanceof L2PcInstance)
 						{
@@ -559,7 +559,7 @@ public class Disablers implements ISkillHandler
 					if (target.reflectSkill(skill))
 						target = activeChar;
 					
-					if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 					{
 						L2Effect[] effects = target.getAllEffects();
 						
@@ -711,7 +711,7 @@ public class Disablers implements ISkillHandler
 						}//end for
 					}//end else
 					
-					if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
+					if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, ss, sps, bss))
 					{
 						skill.getEffects(activeChar, target);
 					}
@@ -719,7 +719,7 @@ public class Disablers implements ISkillHandler
 			}//end switch
 			
 			//Possibility of a lethal strike
-			Formulas.getInstance().calcLethalHit(activeChar, target, skill);
+			Formulas.calcLethalHit(activeChar, target, skill);
 			
 		}//end for
 		
@@ -746,13 +746,13 @@ public class Disablers implements ISkillHandler
 			if (target == null || target.isDead()) //bypass if target is null or dead
 				continue;
 			
-			byte shld = Formulas.getInstance().calcShldUse(activeCubic.getOwner(), target);
+			byte shld = Formulas.calcShldUse(activeCubic.getOwner(), target);
 			
 			switch (type)
 			{
 				case STUN:
 				{
-					if (Formulas.getInstance().calcCubicSkillSuccess(activeCubic, target, skill, shld))
+					if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld))
 					{
 						// if this is a debuff let the duel manager know about it
 						// so the debuff can be removed after the duel
@@ -778,7 +778,7 @@ public class Disablers implements ISkillHandler
 				}
 				case PARALYZE: //use same as root for now
 				{
-					if (Formulas.getInstance().calcCubicSkillSuccess(activeCubic, target, skill, shld))
+					if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld))
 					{
 						// if this is a debuff let the duel manager know about it
 						// so the debuff can be removed after the duel
@@ -829,7 +829,7 @@ public class Disablers implements ISkillHandler
 				}
 				case ROOT:
 				{
-					if (Formulas.getInstance().calcCubicSkillSuccess(activeCubic, target, skill, shld))
+					if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld))
 					{
 						// if this is a debuff let the duel manager know about it
 						// so the debuff can be removed after the duel
@@ -856,7 +856,7 @@ public class Disablers implements ISkillHandler
 				}
 				case AGGDAMAGE:
 				{
-					if (Formulas.getInstance().calcCubicSkillSuccess(activeCubic, target, skill, shld))
+					if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld))
 					{
 						if (target instanceof L2Attackable)
 							target.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, activeCubic.getOwner(), (int) ((150 * skill.getPower()) / (target.getLevel() + 7)));

+ 2 - 4
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/InstantJump.java

@@ -56,8 +56,6 @@ public class InstantJump implements ISkillHandler
 		//if(targets.length > 1 || targets.length == 0) // this is about bad target type in DP... just dont use anything else than TARGET_ONE...
 		//	return;
 		
-		Formulas f = Formulas.getInstance();
-		
 		int x=0,y=0,z=0;
 		
 		// Gracia Final support = it ports u behind ur target, uncomment these lines when Gracia Final! is out.
@@ -108,8 +106,8 @@ public class InstantJump implements ISkillHandler
 				// activate attacked effects, if any
 				target.stopSkillEffects(skill.getId());
 				
-				byte shld = Formulas.getInstance().calcShldUse(activeChar, target);
-				if (f.calcSkillSuccess(activeChar, target, skill, shld, false, false, false))
+				byte shld = Formulas.calcShldUse(activeChar, target);
+				if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, false, false, false))
 				{
 					skill.getEffects(activeChar, target);
 				

+ 2 - 2
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Manadam.java

@@ -93,14 +93,14 @@ public class Manadam implements ISkillHandler
 			if (target.reflectSkill(skill))
 				target = activeChar;
 			
-			boolean acted = Formulas.getInstance().calcMagicAffected(activeChar, target, skill);
+			boolean acted = Formulas.calcMagicAffected(activeChar, target, skill);
 			if (target.isInvul() || !acted)
 			{
 				activeChar.sendPacket(new SystemMessage(SystemMessageId.MISSED_TARGET));
 			}
 			else
 			{
-				double damage = Formulas.getInstance().calcManaDam(activeChar, target, skill, ss, bss);
+				double damage = Formulas.calcManaDam(activeChar, target, skill, ss, bss);
 				
 				double mp = (damage > target.getCurrentMp() ? target.getCurrentMp() : damage);
 				target.reduceCurrentMp(mp);

+ 11 - 11
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Mdam.java

@@ -109,10 +109,10 @@ public class Mdam implements ISkillHandler
 				continue;
 			}
 			
-			boolean mcrit = Formulas.getInstance().calcMCrit(activeChar.getMCriticalHit(target, skill));
-			byte shld = Formulas.getInstance().calcShldUse(activeChar, target);
+			boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, skill));
+			byte shld = Formulas.calcShldUse(activeChar, target);
 			
-			int damage = (int) Formulas.getInstance().calcMagicDam(activeChar, target, skill, shld, ss, bss, mcrit);
+			int damage = (int) Formulas.calcMagicDam(activeChar, target, skill, shld, ss, bss, mcrit);
 			if (skill.getMaxSoulConsumeCount() > 0 && activeChar instanceof L2PcInstance && ((L2PcInstance) activeChar).getSouls() > 0)
 			{
 				switch (((L2PcInstance) activeChar).getSouls())
@@ -138,7 +138,7 @@ public class Mdam implements ISkillHandler
 			if (damage > 0)
 			{
 				// Manage attack or cast break of the target (calculating rate, sending message...)
-				if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage))
+				if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
 				{
 					target.breakAttack();
 					target.breakCast();
@@ -160,7 +160,7 @@ public class Mdam implements ISkillHandler
 					{
 						// activate attacked effects, if any
 						target.stopSkillEffects(skill.getId());
-						if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, shld, false, ss, bss))
+						if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, false, ss, bss))
 							skill.getEffects(activeChar, target);
 						else
 						{
@@ -189,7 +189,7 @@ public class Mdam implements ISkillHandler
 				}
 			}
 			// Possibility of a lethal strike
-			Formulas.getInstance().calcLethalHit(activeChar, target, skill);
+			Formulas.calcLethalHit(activeChar, target, skill);
 		}
 		// self Effect :]
 		L2Effect effect = activeChar.getFirstEffect(skill.getId());
@@ -224,9 +224,9 @@ public class Mdam implements ISkillHandler
 				continue;
 			}
 			
-			boolean mcrit = Formulas.getInstance().calcMCrit(activeCubic.getMCriticalHit(target, skill));
-			byte shld = Formulas.getInstance().calcShldUse(activeCubic.getOwner(), target);
-			int damage = (int) Formulas.getInstance().calcMagicDam(activeCubic, target, skill, mcrit, shld);
+			boolean mcrit = Formulas.calcMCrit(activeCubic.getMCriticalHit(target, skill));
+			byte shld = Formulas.calcShldUse(activeCubic.getOwner(), target);
+			int damage = (int) Formulas.calcMagicDam(activeCubic, target, skill, mcrit, shld);
 			
 			// if target is reflecting the skill then no damage is done
 			if (target.reflectSkill(skill))
@@ -238,7 +238,7 @@ public class Mdam implements ISkillHandler
 			if (damage > 0)
 			{
 				// Manage attack or cast break of the target (calculating rate, sending message...)
-				if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage))
+				if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
 				{
 					target.breakAttack();
 					target.breakCast();
@@ -252,7 +252,7 @@ public class Mdam implements ISkillHandler
 					target.stopSkillEffects(skill.getId());
 					if (target.getFirstEffect(skill) != null)
 						target.removeEffect(target.getFirstEffect(skill));
-					if (Formulas.getInstance().calcCubicSkillSuccess(activeCubic, target, skill, shld))
+					if (Formulas.calcCubicSkillSuccess(activeCubic, target, skill, shld))
 						skill.getEffects(activeCubic, target);
 				}
 				

+ 7 - 8
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Pdam.java

@@ -70,7 +70,6 @@ public class Pdam implements ISkillHandler
 		
 		for (L2Character target: (L2Character[]) targets)
 		{
-			Formulas f = Formulas.getInstance();
 			L2ItemInstance weapon = activeChar.getActiveWeaponInstance();
 			if (activeChar instanceof L2PcInstance && target instanceof L2PcInstance && ((L2PcInstance)target).isFakeDeath())
 			{
@@ -80,18 +79,18 @@ public class Pdam implements ISkillHandler
 				continue;
 			
 			boolean dual = activeChar.isUsingDualWeapon();
-			byte shld = f.calcShldUse(activeChar, target);
+			byte shld = Formulas.calcShldUse(activeChar, target);
 			// PDAM critical chance not affected by buffs, only by STR. Only some skills are meant to crit.
 			boolean crit = false;
 			if (skill.getBaseCritRate() > 0)
-				crit = f.calcCrit(skill.getBaseCritRate() * 10 * f.getSTRBonus(activeChar));
+				crit = Formulas.calcCrit(skill.getBaseCritRate() * 10 * Formulas.getSTRBonus(activeChar));
 			
 			boolean soul = (weapon != null && weapon.getChargedSoulshot() == L2ItemInstance.CHARGED_SOULSHOT && weapon.getItemType() != L2WeaponType.DAGGER);
 			
 			if (!crit && (skill.getCondition() & L2Skill.COND_CRIT) != 0)
 				damage = 0;
 			else
-				damage = (int) f.calcPhysDam(activeChar, target, skill, shld, false, dual, soul);
+				damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, dual, soul);
 			if (skill.getMaxSoulConsumeCount() > 0 && activeChar instanceof L2PcInstance && ((L2PcInstance) activeChar).getSouls() > 0)
 			{
 				switch (((L2PcInstance) activeChar).getSouls())
@@ -119,7 +118,7 @@ public class Pdam implements ISkillHandler
 			if (soul && weapon != null)
 				weapon.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);
 			
-			boolean skillIsEvaded = f.calcPhysicalSkillEvasion(target, skill);
+			boolean skillIsEvaded = Formulas.calcPhysicalSkillEvasion(target, skill);
 			
 			if (!skillIsEvaded)
 			{
@@ -141,7 +140,7 @@ public class Pdam implements ISkillHandler
 						{
 							// activate attacked effects, if any
 							target.stopSkillEffects(skill.getId());
-							if (f.calcSkillSuccess(activeChar, target, skill, shld, false, false, false))
+							if (Formulas.calcSkillSuccess(activeChar, target, skill, shld, false, false, false))
 							{
 								skill.getEffects(activeChar, target);
 							
@@ -173,7 +172,7 @@ public class Pdam implements ISkillHandler
 					}
 				
 					// Possibility of a lethal strike
-					boolean lethal = Formulas.getInstance().calcLethalHit(activeChar, target, skill);
+					boolean lethal = Formulas.calcLethalHit(activeChar, target, skill);
 				
 					// Make damage directly to HP
 					if (!lethal && skill.getDmgDirectlyToHP())
@@ -246,7 +245,7 @@ public class Pdam implements ISkillHandler
 				}
 				
 				// Possibility of a lethal strike despite skill is evaded
-				Formulas.getInstance().calcLethalHit(activeChar, target, skill);
+				Formulas.calcLethalHit(activeChar, target, skill);
 			}
 			
 			if (skill.getId() == 345 || skill.getId() == 346) // Sonic Rage or Raging Force

+ 3 - 3
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Resurrect.java

@@ -85,17 +85,17 @@ public class Resurrect implements ISkillHandler
 				else if (cha instanceof L2PetInstance)
 				{
 					if (((L2PetInstance) cha).getOwner() == activeChar)
-						cha.doRevive(Formulas.getInstance().calculateSkillResurrectRestorePercent(skill.getPower(), activeChar.getWIT()));
+						cha.doRevive(Formulas.calculateSkillResurrectRestorePercent(skill.getPower(), activeChar.getWIT()));
 					else
 						((L2PetInstance) cha).getOwner().reviveRequest((L2PcInstance) activeChar, skill, true);
 				}
 				else
-					cha.doRevive(Formulas.getInstance().calculateSkillResurrectRestorePercent(skill.getPower(), activeChar.getWIT()));
+					cha.doRevive(Formulas.calculateSkillResurrectRestorePercent(skill.getPower(), activeChar.getWIT()));
 			}
 			else
 			{
 				DecayTaskManager.getInstance().cancelDecayTask(cha);
-				cha.doRevive(Formulas.getInstance().calculateSkillResurrectRestorePercent(skill.getPower(), activeChar.getWIT()));
+				cha.doRevive(Formulas.calculateSkillResurrectRestorePercent(skill.getPower(), activeChar.getWIT()));
 			}
 	}
 	

+ 1 - 1
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Spoil.java

@@ -66,7 +66,7 @@ public class Spoil implements ISkillHandler
 			boolean spoil = false;
 			if (target.isDead() == false)
 			{
-				spoil = Formulas.getInstance().calcMagicSuccess(activeChar, (L2Character) tgt, skill);
+				spoil = Formulas.calcMagicSuccess(activeChar, (L2Character) tgt, skill);
 				
 				if (spoil)
 				{

+ 3 - 3
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/StrSiegeAssault.java

@@ -90,14 +90,14 @@ public class StrSiegeAssault implements ISkillHandler
 					continue;
 				
 				boolean dual = activeChar.isUsingDualWeapon();
-				byte shld = Formulas.getInstance().calcShldUse(activeChar, target);
-				boolean crit = Formulas.getInstance().calcCrit(activeChar.getCriticalHit(target, skill));
+				byte shld = Formulas.calcShldUse(activeChar, target);
+				boolean crit = Formulas.calcCrit(activeChar.getCriticalHit(target, skill));
 				boolean soul = (weapon != null && weapon.getChargedSoulshot() == L2ItemInstance.CHARGED_SOULSHOT && weapon.getItemType() != L2WeaponType.DAGGER);
 				
 				if (!crit && (skill.getCondition() & L2Skill.COND_CRIT) != 0)
 					damage = 0;
 				else
-					damage = (int) Formulas.getInstance().calcPhysDam(activeChar, target, skill, shld, crit, dual, soul);
+					damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, crit, dual, soul);
 				
 				if (damage > 0)
 				{

+ 1 - 1
L2_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Unlock.java

@@ -49,7 +49,7 @@ public class Unlock implements ISkillHandler
 		
 		for (L2Object target: targets)
 		{
-			boolean success = Formulas.getInstance().calculateUnlockChance(skill);
+			boolean success = Formulas.calculateUnlockChance(skill);
 			if (target instanceof L2DoorInstance)
 			{
 				L2DoorInstance door = (L2DoorInstance) target;

+ 28 - 28
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java

@@ -324,7 +324,7 @@ public abstract class L2Character extends L2Object
 		{
 			// Copy the Standard Calcultors of the L2NPCInstance in _calculators
 			if (this instanceof L2DoorInstance)
-				_calculators = Formulas.getInstance().getStdDoorCalculators();
+				_calculators = Formulas.getStdDoorCalculators();
 			else
 				_calculators = NPC_STD_CALCULATOR;
 			
@@ -345,7 +345,7 @@ public abstract class L2Character extends L2Object
 
 			// If L2Character is a L2PcInstance or a L2Summon, create the basic calculator set
 			_calculators = new Calculator[Stats.NUM_STATS];
-			Formulas.getInstance().addFuncsToNewCharacter(this);
+			Formulas.addFuncsToNewCharacter(this);
 		}
 
 		if (!(this instanceof L2PcInstance) && !(this instanceof L2MonsterInstance) &&
@@ -992,7 +992,7 @@ public abstract class L2Character extends L2Object
 		boolean crit1 = false;
 
 		// Calculate if hit is missed or not
-		boolean miss1 = Formulas.getInstance().calcHitMiss(this, target);
+		boolean miss1 = Formulas.calcHitMiss(this, target);
 
 		// Consume arrows
 		reduceArrowCount(false);
@@ -1003,13 +1003,13 @@ public abstract class L2Character extends L2Object
 		if (!miss1)
 		{
 			// Calculate if shield defense is efficient
-			shld1 = Formulas.getInstance().calcShldUse(this, target);
+			shld1 = Formulas.calcShldUse(this, target);
 
 			// Calculate if hit is critical
-			crit1 = Formulas.getInstance().calcCrit(getStat().getCriticalHit(target, null));
+			crit1 = Formulas.calcCrit(getStat().getCriticalHit(target, null));
 
 			// Calculate physical damages
-			damage1 = (int)Formulas.getInstance().calcPhysDam(this, target, null, shld1, crit1, false, attack.soulshot);
+			damage1 = (int)Formulas.calcPhysDam(this, target, null, shld1, crit1, false, attack.soulshot);
 		}
 
 		// Check if the L2Character is a L2PcInstance
@@ -1064,7 +1064,7 @@ public abstract class L2Character extends L2Object
         boolean crit1 = false;
 
         // Calculate if hit is missed or not
-        boolean miss1 = Formulas.getInstance().calcHitMiss(this, target);
+        boolean miss1 = Formulas.calcHitMiss(this, target);
 
         // Consume bolts
         reduceArrowCount(true);
@@ -1075,13 +1075,13 @@ public abstract class L2Character extends L2Object
         if (!miss1)
         {
             // Calculate if shield defense is efficient
-            shld1 = Formulas.getInstance().calcShldUse(this, target);
+            shld1 = Formulas.calcShldUse(this, target);
 
             // Calculate if hit is critical
-            crit1 = Formulas.getInstance().calcCrit(getStat().getCriticalHit(target, null));
+            crit1 = Formulas.calcCrit(getStat().getCriticalHit(target, null));
 
             // Calculate physical damages
-            damage1 = (int)Formulas.getInstance().calcPhysDam(this, target, null, shld1, crit1, false, attack.soulshot);
+            damage1 = (int)Formulas.calcPhysDam(this, target, null, shld1, crit1, false, attack.soulshot);
         }
 
         // Check if the L2Character is a L2PcInstance
@@ -1135,20 +1135,20 @@ public abstract class L2Character extends L2Object
 		boolean crit2 = false;
 
 		// Calculate if hits are missed or not
-		boolean miss1 = Formulas.getInstance().calcHitMiss(this, target);
-		boolean miss2 = Formulas.getInstance().calcHitMiss(this, target);
+		boolean miss1 = Formulas.calcHitMiss(this, target);
+		boolean miss2 = Formulas.calcHitMiss(this, target);
 
 		// Check if hit 1 isn't missed
 		if (!miss1)
 		{
 			// Calculate if shield defense is efficient against hit 1
-			shld1 = Formulas.getInstance().calcShldUse(this, target);
+			shld1 = Formulas.calcShldUse(this, target);
 
 			// Calculate if hit 1 is critical
-			crit1 = Formulas.getInstance().calcCrit(getStat().getCriticalHit(target, null));
+			crit1 = Formulas.calcCrit(getStat().getCriticalHit(target, null));
 
 			// Calculate physical damages of hit 1
-			damage1 = (int)Formulas.getInstance().calcPhysDam(this, target, null, shld1, crit1, true, attack.soulshot);
+			damage1 = (int)Formulas.calcPhysDam(this, target, null, shld1, crit1, true, attack.soulshot);
 			damage1 /= 2;
 		}
 
@@ -1156,13 +1156,13 @@ public abstract class L2Character extends L2Object
 		if (!miss2)
 		{
 			// Calculate if shield defense is efficient against hit 2
-			shld2 = Formulas.getInstance().calcShldUse(this, target);
+			shld2 = Formulas.calcShldUse(this, target);
 
 			// Calculate if hit 2 is critical
-			crit2 = Formulas.getInstance().calcCrit(getStat().getCriticalHit(target, null));
+			crit2 = Formulas.calcCrit(getStat().getCriticalHit(target, null));
 
 			// Calculate physical damages of hit 2
-			damage2 = (int)Formulas.getInstance().calcPhysDam(this, target, null, shld2, crit2, true, attack.soulshot);
+			damage2 = (int)Formulas.calcPhysDam(this, target, null, shld2, crit2, true, attack.soulshot);
 			damage2 /= 2;
 		}
 
@@ -1317,19 +1317,19 @@ public abstract class L2Character extends L2Object
 		boolean crit1 = false;
 
 		// Calculate if hit is missed or not
-		boolean miss1 = Formulas.getInstance().calcHitMiss(this, target);
+		boolean miss1 = Formulas.calcHitMiss(this, target);
 
 		// Check if hit isn't missed
 		if (!miss1)
 		{
 			// Calculate if shield defense is efficient
-			shld1 = Formulas.getInstance().calcShldUse(this, target);
+			shld1 = Formulas.calcShldUse(this, target);
 
 			// Calculate if hit is critical
-			crit1 = Formulas.getInstance().calcCrit(getStat().getCriticalHit(target, null));
+			crit1 = Formulas.calcCrit(getStat().getCriticalHit(target, null));
 
 			// Calculate physical damages
-			damage1 = (int)Formulas.getInstance().calcPhysDam(this, target, null, shld1, crit1, false, attack.soulshot);
+			damage1 = (int)Formulas.calcPhysDam(this, target, null, shld1, crit1, false, attack.soulshot);
 
 			if (attackpercent != 100)
 				damage1 = (int)(damage1*attackpercent/100);
@@ -1502,9 +1502,9 @@ public abstract class L2Character extends L2Object
 		// Don't modify the skill time for FORCE_BUFF skills. The skill time for those skills represent the buff time.
 		if(!effectWhileCasting)
 		{
-			hitTime = Formulas.getInstance().calcAtkSpd(this, skill, hitTime);
+			hitTime = Formulas.calcAtkSpd(this, skill, hitTime);
 			if (coolTime > 0) 
-				coolTime = Formulas.getInstance().calcAtkSpd(this, skill, coolTime);
+				coolTime = Formulas.calcAtkSpd(this, skill, coolTime);
 		}
 			
 		// Calculate altered Cast Speed due to BSpS/SpS
@@ -1590,7 +1590,7 @@ public abstract class L2Character extends L2Object
 			reuseDelay *= 333.0 / (skill.isMagic() ? getMAtkSpd() : getPAtkSpd());
 		}
 		
-		boolean skillMastery = Formulas.getInstance().calcSkillMastery(this, skill);
+		boolean skillMastery = Formulas.calcSkillMastery(this, skill);
 
 		// Skill reuse check
 		if (reuseDelay > 30000 && !skillMastery) addTimeStamp(skill.getId(),reuseDelay);
@@ -3358,7 +3358,7 @@ public abstract class L2Character extends L2Object
 	private static final Calculator[] NPC_STD_CALCULATOR;
 
 
-	static {NPC_STD_CALCULATOR = Formulas.getInstance().getStdNPCCalculators();}
+	static {NPC_STD_CALCULATOR = Formulas.getStdNPCCalculators();}
 
 	protected L2CharacterAI _ai;
 
@@ -5159,7 +5159,7 @@ public abstract class L2Character extends L2Object
                 }
 
 				// Manage attack or cast break of the target (calculating rate, sending message...)
-				if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage))
+				if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
 				{
 					target.breakAttack();
 					target.breakCast();
@@ -5438,7 +5438,7 @@ public abstract class L2Character extends L2Object
         else
             atkSpd = getPAtkSpd();
 
-        return Formulas.getInstance().calcPAtkSpd(this, target, atkSpd);
+        return Formulas.calcPAtkSpd(this, target, atkSpd);
     }
 
     public int calculateReuseTime(L2Character target, L2Weapon weapon)

+ 1 - 1
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Skill.java

@@ -2987,7 +2987,7 @@ public abstract class L2Skill
 
         boolean skillMastery = false;
         
-        if (!isToggle() && Formulas.getInstance().calcSkillMastery(effector, this))
+        if (!isToggle() && Formulas.calcSkillMastery(effector, this))
         	skillMastery = true;
         
         for (EffectTemplate et : _effectTemplates)

+ 1 - 1
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

@@ -10220,7 +10220,7 @@ public final class L2PcInstance extends L2PlayableInstance
 			else if (getCharmOfCourage())
 				_revivePower=0;
 			else
-				_revivePower = Formulas.getInstance().calculateSkillResurrectRestorePercent(skill.getPower(), Reviver.getWIT());
+				_revivePower = Formulas.calculateSkillResurrectRestorePercent(skill.getPower(), Reviver.getWIT());
 			
 			restoreExp = (int)Math.round((getExpBeforeDeath() - getExp()) * _revivePower / 100);
 			    

+ 4 - 4
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/status/CharStatus.java

@@ -303,7 +303,7 @@ public class CharStatus
                 _log.fine("HP/MP/CP regen started");
             
             // Get the Regeneration periode
-            int period = Formulas.getInstance().getRegeneratePeriod(getActiveChar());
+            int period = Formulas.getRegeneratePeriod(getActiveChar());
             
             // Create the HP/MP/CP Regeneration task
             _regTask = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new RegenTask(), period, period);
@@ -529,17 +529,17 @@ public class CharStatus
                 // Modify the current CP of the L2Character and broadcast Server->Client packet StatusUpdate
                 if (getCurrentCp() < charstat.getMaxCp())
                     setCurrentCp(getCurrentCp()
-                            + Formulas.getInstance().calcCpRegen(getActiveChar()), false);
+                            + Formulas.calcCpRegen(getActiveChar()), false);
                 
                 // Modify the current HP of the L2Character and broadcast Server->Client packet StatusUpdate
                 if (getCurrentHp() < charstat.getMaxHp())
                     setCurrentHp(getCurrentHp()
-                            + Formulas.getInstance().calcHpRegen(getActiveChar()), false);
+                            + Formulas.calcHpRegen(getActiveChar()), false);
                 
                 // Modify the current MP of the L2Character and broadcast Server->Client packet StatusUpdate
                 if (getCurrentMp() < charstat.getMaxMp())
                     setCurrentMp(getCurrentMp()
-                            + Formulas.getInstance().calcMpRegen(getActiveChar()), false);
+                            + Formulas.calcMpRegen(getActiveChar()), false);
                 
                 if (!getActiveChar().isInActiveRegion())
                 {

+ 37 - 48
L2_GameServer/java/net/sf/l2j/gameserver/skills/Formulas.java

@@ -839,21 +839,10 @@ public final class Formulas
 		}
 	}
 
-	private static final Formulas _instance = new Formulas();
-
-	public static Formulas getInstance()
-	{
-		return _instance;
-	}
-
-	private Formulas()
-	{
-	}
-
 	/**
 	 * Return the period between 2 regenerations task (3s for L2Character, 5 min for L2DoorInstance).<BR><BR>
 	 */
-	public int getRegeneratePeriod(L2Character cha)
+	public static int getRegeneratePeriod(L2Character cha)
 	{
 		if (cha instanceof L2DoorInstance) return HP_REGENERATE_PERIOD * 100; // 5 mins
 
@@ -872,7 +861,7 @@ public final class Formulas
 	 * To reduce cache memory use, L2NPCInstances who don't have skills share the same Calculator set called <B>NPC_STD_CALCULATOR</B>.<BR><BR>
 	 *
 	 */
-	public Calculator[] getStdNPCCalculators()
+	public static Calculator[] getStdNPCCalculators()
 	{
 		Calculator[] std = new Calculator[Stats.NUM_STATS];
 
@@ -887,7 +876,7 @@ public final class Formulas
 		return std;
 	}
 
-	public Calculator[] getStdDoorCalculators()
+	public static Calculator[] getStdDoorCalculators()
 	{
 		Calculator[] std = new Calculator[Stats.NUM_STATS];
 
@@ -919,7 +908,7 @@ public final class Formulas
 	 *
 	 * @param cha L2PcInstance or L2Summon that must obtain basic Func objects
 	 */
-	public void addFuncsToNewCharacter(L2Character cha)
+	public static void addFuncsToNewCharacter(L2Character cha)
 	{
 		if (cha instanceof L2PcInstance)
 		{
@@ -977,7 +966,7 @@ public final class Formulas
 	/**
 	 * Calculate the HP regen rate (base + modifiers).<BR><BR>
 	 */
-	public final double calcHpRegen(L2Character cha)
+	public static final double calcHpRegen(L2Character cha)
 	{
         double init = cha.getTemplate().baseHpReg;
 		double hpRegenMultiplier = cha.isRaid() ? Config.RAID_HP_REGEN_MULTIPLIER : Config.HP_REGEN_MULTIPLIER;
@@ -1058,7 +1047,7 @@ public final class Formulas
 	/**
 	 * Calculate the MP regen rate (base + modifiers).<BR><BR>
 	 */
-	public final double calcMpRegen(L2Character cha)
+	public static final double calcMpRegen(L2Character cha)
 	{
         double init = cha.getTemplate().baseMpReg;
         double mpRegenMultiplier = cha.isRaid() ? Config.RAID_MP_REGEN_MULTIPLIER : Config.MP_REGEN_MULTIPLIER;
@@ -1131,7 +1120,7 @@ public final class Formulas
 	/**
 	 * Calculate the CP regen rate (base + modifiers).<BR><BR>
 	 */
-	public final double calcCpRegen(L2Character cha)
+	public static final double calcCpRegen(L2Character cha)
 	{
         double init = cha.getTemplate().baseHpReg;
         double cpRegenMultiplier = Config.CP_REGEN_MULTIPLIER;
@@ -1163,7 +1152,7 @@ public final class Formulas
 	}
 
 	@SuppressWarnings("deprecation")
-	public final double calcFestivalRegenModifier(L2PcInstance activeChar)
+	public static final double calcFestivalRegenModifier(L2PcInstance activeChar)
 	{
 		final int[] festivalInfo = SevenSignsFestival.getInstance().getFestivalForPlayer(activeChar);
 		final int oracle = festivalInfo[0];
@@ -1186,7 +1175,7 @@ public final class Formulas
 		return 1.0 - (distToCenter * 0.0005); // Maximum Decreased Regen of ~ -65%;
 	}
 
-	public final double calcSiegeRegenModifer(L2PcInstance activeChar)
+	public static final double calcSiegeRegenModifer(L2PcInstance activeChar)
 	{
 		if (activeChar == null || activeChar.getClan() == null) return 0;
 
@@ -1202,7 +1191,7 @@ public final class Formulas
 		return 1.5; // If all is true, then modifer will be 50% more
 	}
 	/** Calculate blow damage based on cAtk */
-	public double calcBlowDamage(L2Character attacker, L2Character target, L2Skill skill, byte shld, boolean ss)
+	public static double calcBlowDamage(L2Character attacker, L2Character target, L2Skill skill, byte shld, boolean ss)
 	{
 		double power = skill.getPower();
 		double damage = attacker.getPAtk(target);
@@ -1274,7 +1263,7 @@ public final class Formulas
 	 * @param ss if weapon item was charged by soulshot
 	 * @return damage points
 	 */
-	public final double calcPhysDam(L2Character attacker, L2Character target, L2Skill skill,
+	public static final double calcPhysDam(L2Character attacker, L2Character target, L2Skill skill,
 									byte shld, boolean crit, boolean dual, boolean ss)
 	{
 		double damage = attacker.getPAtk(target);
@@ -1463,7 +1452,7 @@ public final class Formulas
 		return damage;
 	}
 
-	public final double calcMagicDam(L2Character attacker, L2Character target, L2Skill skill,
+	public static final double calcMagicDam(L2Character attacker, L2Character target, L2Skill skill,
 										byte shld, boolean ss, boolean bss, boolean mcrit)
 	{	
 		double mAtk = attacker.getMAtk(target, skill);
@@ -1544,7 +1533,7 @@ public final class Formulas
 		return damage;
 	}
 	
-	public final double calcMagicDam(L2CubicInstance attacker, L2Character target, L2Skill skill, boolean mcrit, byte shld)
+	public static final double calcMagicDam(L2CubicInstance attacker, L2Character target, L2Skill skill, boolean mcrit, byte shld)
 	{
 		double mAtk = attacker.getMAtk();
 		double mDef = target.getMDef(attacker.getOwner(), skill);
@@ -1604,17 +1593,17 @@ public final class Formulas
 	}
 
 	/** Returns true in case of critical hit */
-	public final boolean calcCrit(double rate)
+	public static final boolean calcCrit(double rate)
 	{
 		return rate > Rnd.get(1000);
 	}
 	/** Calculate value of blow success */
-	public final boolean calcBlow(L2Character activeChar, L2Character target, int chance)
+	public static final boolean calcBlow(L2Character activeChar, L2Character target, int chance)
 	{
 		return activeChar.calcStat(Stats.BLOW_RATE, chance*(1.0+(activeChar.getDEX()-20)/100), target, null)>Rnd.get(100);
 	}
 	/** Calculate value of lethal chance */
-	public final double calcLethal(L2Character activeChar, L2Character target, int baseLethal, int magiclvl)
+	public static final double calcLethal(L2Character activeChar, L2Character target, int baseLethal, int magiclvl)
 	{
 		double chance = 0;
 		if (magiclvl > 0)
@@ -1647,7 +1636,7 @@ public final class Formulas
 		return 10 * activeChar.calcStat(Stats.LETHAL_RATE, chance, target, null);
 	}
     
-    public final boolean calcLethalHit(L2Character activeChar, L2Character target, L2Skill skill)
+    public static final boolean calcLethalHit(L2Character activeChar, L2Character target, L2Skill skill)
     {
         if (!target.isRaid()
                 && !(target instanceof L2DoorInstance)
@@ -1709,13 +1698,13 @@ public final class Formulas
         return true;
     }
     
-	public final boolean calcMCrit(double mRate)
+	public static final boolean calcMCrit(double mRate)
 	{
 		return mRate > Rnd.get(1000);
 	}
 
 	/** Returns true in case when ATTACK is canceled due to hit */
-	public final boolean calcAtkBreak(L2Character target, double dmg)
+	public static final boolean calcAtkBreak(L2Character target, double dmg)
 	{
 	    if (target instanceof L2PcInstance)
         {
@@ -1751,7 +1740,7 @@ public final class Formulas
 	}
 
 	/** Calculate delay (in milliseconds) before next ATTACK */
-	public final int calcPAtkSpd(L2Character attacker, L2Character target, double rate)
+	public static final int calcPAtkSpd(L2Character attacker, L2Character target, double rate)
 	{
 		// measured Oct 2006 by Tank6585, formula by Sami
 		// attack speed 312 equals 1500 ms delay... (or 300 + 40 ms delay?)
@@ -1760,7 +1749,7 @@ public final class Formulas
 	}
 
 	/** Calculate delay (in milliseconds) for skills cast */
-	public final int calcAtkSpd(L2Character attacker, L2Skill skill, double skillTime)
+	public static final int calcAtkSpd(L2Character attacker, L2Skill skill, double skillTime)
 	{
 		if (skill.isMagic()) return (int) (skillTime * 333 / attacker.getMAtkSpd());
 		return (int) (skillTime * 333 / attacker.getPAtkSpd());
@@ -1769,7 +1758,7 @@ public final class Formulas
 	/** Returns true if hit missed (target evaded) 
 	 *  Formula based on http://l2p.l2wh.com/nonskillattacks.html
 	 **/
-	public boolean calcHitMiss(L2Character attacker, L2Character target)
+	public static boolean calcHitMiss(L2Character attacker, L2Character target)
 	{
 		int delta = attacker.getAccuracy() - target.getEvasionRate(attacker);
 		int chance;
@@ -1838,7 +1827,7 @@ public final class Formulas
 	 * @param sendSysMsg
 	 * @return
 	 */
-	public byte calcShldUse(L2Character attacker, L2Character target, boolean sendSysMsg)
+	public static byte calcShldUse(L2Character attacker, L2Character target, boolean sendSysMsg)
 	{
 		double shldRate = target.calcStat(Stats.SHIELD_RATE, 0, attacker, null)
 			* DEXbonus[target.getDEX()];
@@ -1883,12 +1872,12 @@ public final class Formulas
 		return shldSuccess;
 	}
 	
-	public byte calcShldUse(L2Character attacker, L2Character target)
+	public static byte calcShldUse(L2Character attacker, L2Character target)
 	{
 		return calcShldUse(attacker, target, true);
 	}
 
-	public boolean calcMagicAffected(L2Character actor, L2Character target, L2Skill skill)
+	public static boolean calcMagicAffected(L2Character actor, L2Character target, L2Skill skill)
 	{
 		// TODO: CHECK/FIX THIS FORMULA UP!!
 		L2SkillType type = skill.getSkillType();
@@ -1913,7 +1902,7 @@ public final class Formulas
 		return d > 0;
 	}
 
-	public double calcSkillVulnerability(L2Character target, L2Skill skill)
+	public static double calcSkillVulnerability(L2Character target, L2Skill skill)
 	{
 		double multiplier = 1;	// initialize...
 
@@ -2048,7 +2037,7 @@ public final class Formulas
 	}
 
  
-    public double calcSkillProficiency(L2Skill skill, L2Character attacker, L2Character target)
+    public static double calcSkillProficiency(L2Skill skill, L2Character attacker, L2Character target)
 	{
 		double multiplier = 1; // initialize...
 		
@@ -2106,7 +2095,7 @@ public final class Formulas
 	}
 	
 	
-	public double calcSkillStatModifier(L2SkillType type, L2Character target)
+	public static double calcSkillStatModifier(L2SkillType type, L2Character target)
 	{
 		double multiplier = 1;
 		if (type == null) return multiplier;
@@ -2145,7 +2134,7 @@ public final class Formulas
 		return multiplier;
 	}
 
-	public boolean calcSkillSuccess(L2Character attacker, L2Character target, L2Skill skill, byte shld, boolean ss, boolean sps, boolean bss)
+	public static boolean calcSkillSuccess(L2Character attacker, L2Character target, L2Skill skill, byte shld, boolean ss, boolean sps, boolean bss)
 	{
 		if (shld == 2) // perfect block
 		{
@@ -2268,7 +2257,7 @@ public final class Formulas
 		return (Rnd.get(100) < rate);
 	}
 	
-	public boolean calcCubicSkillSuccess(L2CubicInstance attacker, L2Character target, L2Skill skill, byte shld)
+	public static boolean calcCubicSkillSuccess(L2CubicInstance attacker, L2Character target, L2Skill skill, byte shld)
 	{
 		if (shld == 2) // perfect block
 		{
@@ -2372,7 +2361,7 @@ public final class Formulas
 		return (Rnd.get(100) < rate);
 	}
 
-	public boolean calcMagicSuccess(L2Character attacker, L2Character target, L2Skill skill)
+	public static boolean calcMagicSuccess(L2Character attacker, L2Character target, L2Skill skill)
 	{
 		double lvlDifference = (target.getLevel() - (skill.getMagicLevel() > 0 ? skill.getMagicLevel() : attacker.getLevel()));
 		int rate = Math.round((float)(Math.pow(1.3, lvlDifference) * 100));
@@ -2380,7 +2369,7 @@ public final class Formulas
 		return (Rnd.get(10000) > rate);
 	}
 
-	public boolean calculateUnlockChance(L2Skill skill)
+	public static boolean calculateUnlockChance(L2Skill skill)
 	{
 		int level = skill.getLevel();
 		int chance = 0;
@@ -2417,7 +2406,7 @@ public final class Formulas
 		return true;
 	}
 	
-    public double calcManaDam(L2Character attacker, L2Character target, L2Skill skill,
+    public static double calcManaDam(L2Character attacker, L2Character target, L2Skill skill,
 			boolean ss, boolean bss)
     {
     	//Mana Burnt = (SQR(M.Atk)*Power*(Target Max MP/97))/M.Def
@@ -2432,7 +2421,7 @@ public final class Formulas
     	return damage;
     }
     
-    public double calculateSkillResurrectRestorePercent(double baseRestorePercent, int casterWIT)
+    public static double calculateSkillResurrectRestorePercent(double baseRestorePercent, int casterWIT)
 	{
 		double restorePercent = baseRestorePercent;
 		double modifier = WITbonus[casterWIT];
@@ -2453,11 +2442,11 @@ public final class Formulas
 		return restorePercent;
 	}
     
-    public double getSTRBonus(L2Character activeChar)
+    public static double getSTRBonus(L2Character activeChar)
     {
     	return STRbonus[activeChar.getSTR()];
     }
-   public boolean calcPhysicalSkillEvasion(L2Character target, L2Skill skill)
+    public static boolean calcPhysicalSkillEvasion(L2Character target, L2Skill skill)
     {
     	if (skill.isMagic() && skill.getSkillType() != L2SkillType.BLOW)
     		return false;
@@ -2465,7 +2454,7 @@ public final class Formulas
     	return Rnd.get(100) < target.calcStat(Stats.P_SKILL_EVASION, 0, null, skill);
     }
     
-    public boolean calcSkillMastery(L2Character actor, L2Skill sk)
+    public static boolean calcSkillMastery(L2Character actor, L2Skill sk)
     {
     	if (sk.getSkillType() == L2SkillType.FISHING)
     		return false;

+ 4 - 4
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java

@@ -173,9 +173,9 @@ final class EffectSignetMDam extends L2Effect
 			caster.broadcastPacket(new MagicSkillLaunched(caster, getSkill().getId(), getSkill().getLevel(), targets.toArray(new L2Character[targets.size()])));
 			for (L2Character target : targets)
 			{
-				boolean mcrit = Formulas.getInstance().calcMCrit(caster.getMCriticalHit(target, getSkill()));
-				byte shld = Formulas.getInstance().calcShldUse(caster, target);
-				int mdam = (int) Formulas.getInstance().calcMagicDam(caster, target, getSkill(), shld, ss, bss, mcrit);
+				boolean mcrit = Formulas.calcMCrit(caster.getMCriticalHit(target, getSkill()));
+				byte shld = Formulas.calcShldUse(caster, target);
+				int mdam = (int) Formulas.calcMagicDam(caster, target, getSkill(), shld, ss, bss, mcrit);
 				
 				if (target instanceof L2Summon)
 					target.broadcastStatusUpdate();
@@ -183,7 +183,7 @@ final class EffectSignetMDam extends L2Effect
 				if (mdam > 0)
 				{
 					if (!target.isRaid()
-					        && Formulas.getInstance().calcAtkBreak(target, mdam))
+					        && Formulas.calcAtkBreak(target, mdam))
 					{
 						target.breakAttack();
 						target.breakCast();

+ 1 - 1
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectSpoil.java

@@ -78,7 +78,7 @@ public class EffectSpoil extends L2Effect
 		boolean spoil = false;
 		if (target.isDead() == false)
 		{
-			spoil = Formulas.getInstance().calcMagicSuccess(getEffector(), target, getSkill());
+			spoil = Formulas.calcMagicSuccess(getEffector(), target, getSkill());
 			
 			if (spoil)
 			{

+ 5 - 6
L2_GameServer/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillChargeDmg.java

@@ -90,7 +90,7 @@ public class L2SkillChargeDmg extends L2Skill
         		continue;
         	
         	//Calculate skill evasion
-        	boolean skillIsEvaded = Formulas.getInstance().calcPhysicalSkillEvasion(target, this);
+        	boolean skillIsEvaded = Formulas.calcPhysicalSkillEvasion(target, this);
         	if(skillIsEvaded)
         	{
 				if (caster instanceof L2PcInstance)
@@ -112,20 +112,19 @@ public class L2SkillChargeDmg extends L2Skill
         	
         	
 			// TODO: should we use dual or not?
-			// because if so, damage are lowered but we dont do anything special with dual then
+			// because if so, damage are lowered but we don't do anything special with dual then
 			// like in doAttackHitByDual which in fact does the calcPhysDam call twice
-        	Formulas f = Formulas.getInstance();
 			//boolean dual  = caster.isUsingDualWeapon();
-			byte shld = Formulas.getInstance().calcShldUse(caster, target);
+			byte shld = Formulas.calcShldUse(caster, target);
 			boolean crit = false;
 			if (this.getBaseCritRate() > 0)
-				crit = f.calcCrit(this.getBaseCritRate() * 10 * f.getSTRBonus(caster));
+				crit = Formulas.calcCrit(this.getBaseCritRate() * 10 * Formulas.getSTRBonus(caster));
 			boolean soul = (weapon != null
 							&& weapon.getChargedSoulshot() == L2ItemInstance.CHARGED_SOULSHOT
 							&& weapon.getItemType() != L2WeaponType.DAGGER );
 
 			// damage calculation, crit is static 2x
-			int damage = (int)Formulas.getInstance().calcPhysDam(caster, target, this, shld, false, false, soul);
+			int damage = (int)Formulas.calcPhysDam(caster, target, this, shld, false, false, soul);
 			if (crit) damage *= 2;
 
 			if (damage > 0)

+ 9 - 9
L2_GameServer/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillDrain.java

@@ -98,9 +98,9 @@ public class L2SkillDrain extends L2Skill {
             }
             	
 
-			boolean mcrit = Formulas.getInstance().calcMCrit(activeChar.getMCriticalHit(target, this));
-			byte shld = Formulas.getInstance().calcShldUse(activeChar, target);
-			int damage = (int)Formulas.getInstance().calcMagicDam(
+			boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, this));
+			byte shld = Formulas.calcShldUse(activeChar, target);
+			int damage = (int)Formulas.calcMagicDam(
 					activeChar, target, this, shld, ss, bss, mcrit);
 			
 			int _drain = 0;
@@ -132,7 +132,7 @@ public class L2SkillDrain extends L2Skill {
             if (damage > 0 && (!target.isDead() || getTargetType() != SkillTargetType.TARGET_CORPSE_MOB))
             {
                 // Manage attack or cast break of the target (calculating rate, sending message...)
-                if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage))
+                if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
                 {
                     target.breakAttack();
                     target.breakCast();
@@ -154,7 +154,7 @@ public class L2SkillDrain extends L2Skill {
                 	{
                 		// activate attacked effects, if any
                         target.stopSkillEffects(getId());
-                        if (Formulas.getInstance().calcSkillSuccess(activeChar, target, this, shld, false, ss, bss))
+                        if (Formulas.calcSkillSuccess(activeChar, target, this, shld, false, ss, bss))
                             getEffects(activeChar, target);
                         else
                         {
@@ -194,10 +194,10 @@ public class L2SkillDrain extends L2Skill {
 			if (target.isAlikeDead() && getTargetType() != SkillTargetType.TARGET_CORPSE_MOB)
 				continue;
 
-			boolean mcrit = Formulas.getInstance().calcMCrit(activeCubic.getMCriticalHit(target, this));
-			byte shld = Formulas.getInstance().calcShldUse(activeCubic.getOwner(), target);
+			boolean mcrit = Formulas.calcMCrit(activeCubic.getMCriticalHit(target, this));
+			byte shld = Formulas.calcShldUse(activeCubic.getOwner(), target);
 			
-			int damage = (int)Formulas.getInstance().calcMagicDam(activeCubic, target, this, mcrit, shld);
+			int damage = (int)Formulas.calcMagicDam(activeCubic, target, this, mcrit, shld);
 			if (Config.DEBUG)
     			_log.info("L2SkillDrain: useCubicSkill() -> damage = " + damage);
 			
@@ -217,7 +217,7 @@ public class L2SkillDrain extends L2Skill {
     			target.reduceCurrentHp(damage, activeCubic.getOwner(), this);
                 
                 // Manage attack or cast break of the target (calculating rate, sending message...)
-                if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage)){
+                if (!target.isRaid() && Formulas.calcAtkBreak(target, damage)){
                     target.breakAttack();
                     target.breakCast();
                 }

+ 4 - 4
L2_GameServer/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillElemental.java

@@ -133,10 +133,10 @@ public class L2SkillElemental extends L2Skill {
 				continue;
 			}
 
-			boolean mcrit = Formulas.getInstance().calcMCrit(activeChar.getMCriticalHit(target, this));
-			byte shld = Formulas.getInstance().calcShldUse(activeChar, target);
+			boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, this));
+			byte shld = Formulas.calcShldUse(activeChar, target);
 			
-			int damage = (int)Formulas.getInstance().calcMagicDam(
+			int damage = (int)Formulas.calcMagicDam(
 					activeChar, target, this, shld, ss, bss, mcrit);
 
 			if (damage > 0)
@@ -144,7 +144,7 @@ public class L2SkillElemental extends L2Skill {
 				target.reduceCurrentHp(damage, activeChar, this);
 
 	            // Manage attack or cast break of the target (calculating rate, sending message...)
-	            if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage))
+	            if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
 	            {
 	                target.breakAttack();
 	                target.breakCast();

+ 4 - 4
L2_GameServer/java/net/sf/l2j/gameserver/templates/item/L2Weapon.java

@@ -338,8 +338,8 @@ public final class L2Weapon extends L2Item
 		if (!_skillsOnCritCondition.test(env))
 			return _emptyEffectSet; // Skill condition not met
 			
-		byte shld = Formulas.getInstance().calcShldUse(caster, target);
-		if (!Formulas.getInstance().calcSkillSuccess(caster, target, _skillsOnCrit, shld, false, false, false))
+		byte shld = Formulas.calcShldUse(caster, target);
+		if (!Formulas.calcSkillSuccess(caster, target, _skillsOnCrit, shld, false, false, false))
 			return _emptyEffectSet; // These skills should not work on RaidBoss
 		if (target.getFirstEffect(_skillsOnCrit.getId()) != null)
 			target.getFirstEffect(_skillsOnCrit.getId()).exit();
@@ -374,8 +374,8 @@ public final class L2Weapon extends L2Item
 		if (!_skillsOnCastCondition.test(env))
 			return _emptyEffectSet;
 		
-		byte shld = Formulas.getInstance().calcShldUse(caster, target);
-		if (_skillsOnCast.isOffensive() && !Formulas.getInstance().calcSkillSuccess(caster, target, _skillsOnCast, shld, false, false, false))
+		byte shld = Formulas.calcShldUse(caster, target);
+		if (_skillsOnCast.isOffensive() && !Formulas.calcSkillSuccess(caster, target, _skillsOnCast, shld, false, false, false))
 			return _emptyEffectSet;
 		
 		try