浏览代码

Removing need of resource hungry for loops on L2Character is transformed check. Instead of checking all effects, to see if the transformation effect is "null", it will check if the characters status is transformed or not.

Ahmed 17 年之前
父节点
当前提交
a62402041f

+ 17 - 0
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/L2Character.java

@@ -202,6 +202,23 @@ public abstract class L2Character extends L2Object
 		else if (isInsideZone(zone)) // zone overlap possible
 			_currentZones ^= zone;
 	}
+	
+	/**
+	 * This will return true if the player is transformed,<br>
+	 * but if the player is not transformed it will return false.
+	 * @return
+	 */
+	public boolean charIsTransformed()
+	{
+		if (this instanceof L2PcInstance)
+		{
+			if (((L2PcInstance)this).isTransformed())
+			{
+				return true;
+			}
+		}
+		return false;
+	}
 
 	// =========================================================
 	// Constructor

+ 3 - 2
L2_GameServer_T1/java/net/sf/l2j/gameserver/skills/Formulas.java

@@ -1172,12 +1172,13 @@ public final class Formulas
 			}
 		}
 		// In C5 summons make 10 % less dmg in PvP.
-		if(attacker instanceof L2Summon && target instanceof L2PcInstance) damage *= 0.9;
+		if(attacker instanceof L2Summon && target instanceof L2PcInstance) 
+			damage *= 0.9;
 
 		// defence modifier depending of the attacker weapon
 		L2Weapon weapon = attacker.getActiveWeaponItem();
 		Stats stat = null;
-		if (weapon != null && attacker.getFirstEffect(L2Effect.EffectType.TRANSFORMATION) == null)
+		if (weapon != null && !attacker.charIsTransformed())
 		{
 			switch (weapon.getItemType())
 			{