浏览代码

Changes in attribute system:
1. Now using one element numbering system everywhere, beginning from 0 (fire), not 1.
2. New xml parameter "elementPower" (default 0) for determining skill element power.
3. Elemental bonus not applied to skills without elements.
4. Formula corrections.

_DS_ 16 年之前
父节点
当前提交
9da9fe8dfc

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

@@ -110,15 +110,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
         TARGET_OWNER_PET,
         TARGET_OWNER_PET,
         TARGET_GROUND
         TARGET_GROUND
     }
     }
-
-    //elements
-    public final static int ELEMENT_FIRE = 1;
-    public final static int ELEMENT_WATER = 2;
-    public final static int ELEMENT_WIND = 3;
-    public final static int ELEMENT_EARTH = 4;
-    public final static int ELEMENT_HOLY = 5;
-    public final static int ELEMENT_DARK = 6;
-
     
     
     //conditional values
     //conditional values
     public final static int COND_RUNNING = 0x0001;
     public final static int COND_RUNNING = 0x0001;
@@ -228,6 +219,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
     
     
     private final boolean _ispotion;
     private final boolean _ispotion;
     private final int _element;
     private final int _element;
+    private final int _elementPower;
 
 
     private final Stats _stat;
     private final Stats _stat;
 
 
@@ -438,7 +430,8 @@ public abstract class L2Skill implements IChanceSkillTrigger
         _effectId = set.getInteger("effectId", 0);
         _effectId = set.getInteger("effectId", 0);
         _effectLvl = set.getInteger("effectLevel", 0);
         _effectLvl = set.getInteger("effectLevel", 0);
 
 
-        _element = set.getInteger("element", 0);
+        _element = set.getInteger("element", -1);
+        _elementPower = set.getInteger("elementPower", 0);
 
 
         _condition = set.getInteger("condition", 0);
         _condition = set.getInteger("condition", 0);
         _conditionValue = set.getInteger("conditionValue", 0);
         _conditionValue = set.getInteger("conditionValue", 0);
@@ -512,6 +505,11 @@ public abstract class L2Skill implements IChanceSkillTrigger
         return _element;
         return _element;
     }
     }
 
 
+    public final int getElementPower()
+    {
+    	return _elementPower;
+    }
+
     /**
     /**
      * Return the target type of the skill : SELF, PARTY, CLAN, PET...<BR><BR>
      * Return the target type of the skill : SELF, PARTY, CLAN, PET...<BR><BR>
      *
      *

+ 6 - 31
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/L2Character.java

@@ -6856,36 +6856,6 @@ public abstract class L2Character extends L2Object
 		_fusionSkill = fb;
 		_fusionSkill = fb;
 	}
 	}
 
 
-	public int getDefAttrFire()
-	{
-		return (int) (getStat().getElementAttributeFire());
-	}
-
-	public int getDefAttrWater()
-	{
-		return (int) (getStat().getElementAttributeWater());
-	}
-
-	public int getDefAttrEarth()
-	{
-		return (int) (getStat().getElementAttributeEarth());
-	}
-
-	public int getDefAttrWind()
-	{
-		return (int) (getStat().getElementAttributeWind());
-	}
-
-	public int getDefAttrHoly()
-	{
-		return (int) (getStat().getElementAttributeHoly());
-	}
-
-	public int getDefAttrUnholy()
-	{
-		return (int) (getStat().getElementAttributeUnholy());
-	}
-
 	public int getAttackElement()
 	public int getAttackElement()
 	{
 	{
 		return getStat().getAttackElement();
 		return getStat().getAttackElement();
@@ -6895,7 +6865,12 @@ public abstract class L2Character extends L2Object
 	{
 	{
 		return getStat().getAttackElementValue(attackAttribute);
 		return getStat().getAttackElementValue(attackAttribute);
 	}
 	}
-	
+
+	public int getDefenseElementValue(int defenseAttribute)
+	{
+		return getStat().getDefenseElementValue(defenseAttribute);
+	}
+
     public final void startPhysicalAttackMuted()
     public final void startPhysicalAttackMuted()
     {
     {
         setIsPhysicalAttackMuted(true);
         setIsPhysicalAttackMuted(true);

+ 29 - 37
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java

@@ -15,6 +15,7 @@
 package net.sf.l2j.gameserver.model.actor.stat;
 package net.sf.l2j.gameserver.model.actor.stat;
 
 
 import net.sf.l2j.Config;
 import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.model.Elementals;
 import net.sf.l2j.gameserver.model.L2ItemInstance;
 import net.sf.l2j.gameserver.model.L2ItemInstance;
 import net.sf.l2j.gameserver.model.L2PetDataTable;
 import net.sf.l2j.gameserver.model.L2PetDataTable;
 import net.sf.l2j.gameserver.model.L2Skill;
 import net.sf.l2j.gameserver.model.L2Skill;
@@ -692,36 +693,6 @@ public class CharStat
 		return (int) calcStat(Stats.MP_CONSUME, skill.getMpInitialConsume(), null, skill);
 		return (int) calcStat(Stats.MP_CONSUME, skill.getMpInitialConsume(), null, skill);
 	}
 	}
 
 
-	public double getElementAttributeFire()
-	{
-		return (int) calcStat(Stats.FIRE_RES, _activeChar.getTemplate().baseFireRes, null, null);
-	}
-
-	public double getElementAttributeWater()
-	{
-		return (int) calcStat(Stats.WATER_RES, _activeChar.getTemplate().baseWaterRes, null, null);
-	}
-
-	public double getElementAttributeEarth()
-	{
-		return (int) calcStat(Stats.EARTH_RES, _activeChar.getTemplate().baseEarthRes, null, null);
-	}
-
-	public double getElementAttributeWind()
-	{
-		return (int) calcStat(Stats.WIND_RES, _activeChar.getTemplate().baseWindRes, null, null);
-	}
-
-	public double getElementAttributeHoly()
-	{
-		return (int) calcStat(Stats.HOLY_RES, _activeChar.getTemplate().baseHolyRes, null, null);
-	}
-
-	public double getElementAttributeUnholy()
-	{
-		return (int) calcStat(Stats.DARK_RES, _activeChar.getTemplate().baseDarkRes, null, null);
-	}
-
 	public int getAttackElement()
 	public int getAttackElement()
 	{
 	{
 		L2ItemInstance weaponInstance = _activeChar.getActiveWeaponInstance();
 		L2ItemInstance weaponInstance = _activeChar.getActiveWeaponInstance();
@@ -730,7 +701,7 @@ public class CharStat
 			return weaponInstance.getAttackElementType();
 			return weaponInstance.getAttackElementType();
 		
 		
 		// temp fix starts
 		// temp fix starts
-		double tempVal =0,stats[] = { 0, 0, 0, 0, 0, 0 };
+		int tempVal =0, stats[] = { 0, 0, 0, 0, 0, 0 };
 
 
 		int returnVal = -2;
 		int returnVal = -2;
 		stats[0] = (int) calcStat(Stats.FIRE_POWER, _activeChar.getTemplate().baseFire, null, null);
 		stats[0] = (int) calcStat(Stats.FIRE_POWER, _activeChar.getTemplate().baseFire, null, null);
@@ -762,20 +733,41 @@ public class CharStat
 	{
 	{
 		switch (attackAttribute)
 		switch (attackAttribute)
 		{
 		{
-		case 0:
+		case Elementals.FIRE:
 			return (int) calcStat(Stats.FIRE_POWER, _activeChar.getTemplate().baseFire, null, null);
 			return (int) calcStat(Stats.FIRE_POWER, _activeChar.getTemplate().baseFire, null, null);
-		case 1:
+		case Elementals.WATER:
 			return (int) calcStat(Stats.WATER_POWER, _activeChar.getTemplate().baseWater, null, null);
 			return (int) calcStat(Stats.WATER_POWER, _activeChar.getTemplate().baseWater, null, null);
-		case 2:
+		case Elementals.WIND:
 			return (int) calcStat(Stats.WIND_POWER, _activeChar.getTemplate().baseWind, null, null);
 			return (int) calcStat(Stats.WIND_POWER, _activeChar.getTemplate().baseWind, null, null);
-		case 3:
+		case Elementals.EARTH:
 			return (int) calcStat(Stats.EARTH_POWER, _activeChar.getTemplate().baseEarth, null, null);
 			return (int) calcStat(Stats.EARTH_POWER, _activeChar.getTemplate().baseEarth, null, null);
-		case 4:
+		case Elementals.HOLY:
 			return (int) calcStat(Stats.HOLY_POWER, _activeChar.getTemplate().baseHoly, null, null);
 			return (int) calcStat(Stats.HOLY_POWER, _activeChar.getTemplate().baseHoly, null, null);
-		case 5:
+		case Elementals.DARK:
 			return (int) calcStat(Stats.DARK_POWER, _activeChar.getTemplate().baseDark, null, null);
 			return (int) calcStat(Stats.DARK_POWER, _activeChar.getTemplate().baseDark, null, null);
 		default:
 		default:
 			return 0;
 			return 0;
 		}
 		}
 	}
 	}
+	
+	public int getDefenseElementValue(int defenseAttribute)
+	{
+		switch (defenseAttribute)
+		{
+		case Elementals.FIRE:
+			return (int) calcStat(Stats.FIRE_RES, _activeChar.getTemplate().baseFireRes, null, null);
+		case Elementals.WATER:
+			return (int) calcStat(Stats.WATER_RES, _activeChar.getTemplate().baseWaterRes, null, null);
+		case Elementals.WIND:
+			return (int) calcStat(Stats.WIND_RES, _activeChar.getTemplate().baseWindRes, null, null);
+		case Elementals.EARTH:
+			return (int) calcStat(Stats.EARTH_RES, _activeChar.getTemplate().baseEarthRes, null, null);
+		case Elementals.HOLY:
+			return (int) calcStat(Stats.HOLY_RES, _activeChar.getTemplate().baseHolyRes, null, null);
+		case Elementals.DARK:
+			return (int) calcStat(Stats.DARK_RES, _activeChar.getTemplate().baseDarkRes, null, null);
+		default:
+			return 0;
+		}
+	}
 }
 }

+ 7 - 6
L2_GameServer/java/net/sf/l2j/gameserver/network/serverpackets/GMViewCharacterInfo.java

@@ -14,6 +14,7 @@
  */
  */
 package net.sf.l2j.gameserver.network.serverpackets;
 package net.sf.l2j.gameserver.network.serverpackets;
 
 
+import net.sf.l2j.gameserver.model.Elementals;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
 import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
 /**
 /**
@@ -255,12 +256,12 @@ public class GMViewCharacterInfo extends L2GameServerPacket
         int attackAttribute = _activeChar.getAttackElement();
         int attackAttribute = _activeChar.getAttackElement();
 		writeH(attackAttribute);
 		writeH(attackAttribute);
 		writeH(_activeChar.getAttackElementValue(attackAttribute));
 		writeH(_activeChar.getAttackElementValue(attackAttribute));
-        writeH(_activeChar.getDefAttrFire());
-        writeH(_activeChar.getDefAttrWater());
-        writeH(_activeChar.getDefAttrWind());
-        writeH(_activeChar.getDefAttrEarth());
-        writeH(_activeChar.getDefAttrHoly());
-        writeH(_activeChar.getDefAttrUnholy());
+        writeH(_activeChar.getDefenseElementValue(Elementals.FIRE));
+        writeH(_activeChar.getDefenseElementValue(Elementals.WATER));
+        writeH(_activeChar.getDefenseElementValue(Elementals.WIND));
+        writeH(_activeChar.getDefenseElementValue(Elementals.EARTH));
+        writeH(_activeChar.getDefenseElementValue(Elementals.HOLY));
+        writeH(_activeChar.getDefenseElementValue(Elementals.DARK));
         writeD(_activeChar.getFame());
         writeD(_activeChar.getFame());
 	}
 	}
 
 

+ 7 - 6
L2_GameServer/java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java

@@ -17,6 +17,7 @@ package net.sf.l2j.gameserver.network.serverpackets;
 import net.sf.l2j.Config;
 import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.datatables.NpcTable;
 import net.sf.l2j.gameserver.datatables.NpcTable;
 import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
 import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
+import net.sf.l2j.gameserver.model.Elementals;
 import net.sf.l2j.gameserver.model.L2Transformation;
 import net.sf.l2j.gameserver.model.L2Transformation;
 import net.sf.l2j.gameserver.model.actor.L2Summon;
 import net.sf.l2j.gameserver.model.actor.L2Summon;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
@@ -332,12 +333,12 @@ public final class UserInfo extends L2GameServerPacket
         int attackAttribute = _activeChar.getAttackElement();
         int attackAttribute = _activeChar.getAttackElement();
 		writeH(attackAttribute);
 		writeH(attackAttribute);
 		writeH(_activeChar.getAttackElementValue(attackAttribute));
 		writeH(_activeChar.getAttackElementValue(attackAttribute));
-        writeH(_activeChar.getDefAttrFire());
-        writeH(_activeChar.getDefAttrWater());
-        writeH(_activeChar.getDefAttrWind());
-        writeH(_activeChar.getDefAttrEarth());
-        writeH(_activeChar.getDefAttrHoly());
-        writeH(_activeChar.getDefAttrUnholy());
+        writeH(_activeChar.getDefenseElementValue(Elementals.FIRE));
+        writeH(_activeChar.getDefenseElementValue(Elementals.WATER));
+        writeH(_activeChar.getDefenseElementValue(Elementals.WIND));
+        writeH(_activeChar.getDefenseElementValue(Elementals.EARTH));
+        writeH(_activeChar.getDefenseElementValue(Elementals.HOLY));
+        writeH(_activeChar.getDefenseElementValue(Elementals.DARK));
         
         
         writeD(_activeChar.getAgathionId());
         writeD(_activeChar.getAgathionId());
         
         

+ 52 - 102
L2_GameServer/java/net/sf/l2j/gameserver/skills/Formulas.java

@@ -23,8 +23,6 @@ import net.sf.l2j.gameserver.instancemanager.CastleManager;
 import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
 import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
 import net.sf.l2j.gameserver.instancemanager.FortManager;
 import net.sf.l2j.gameserver.instancemanager.FortManager;
 import net.sf.l2j.gameserver.instancemanager.SiegeManager;
 import net.sf.l2j.gameserver.instancemanager.SiegeManager;
-import net.sf.l2j.gameserver.model.Elementals;
-import net.sf.l2j.gameserver.model.L2ItemInstance;
 import net.sf.l2j.gameserver.model.L2SiegeClan;
 import net.sf.l2j.gameserver.model.L2SiegeClan;
 import net.sf.l2j.gameserver.model.L2Skill;
 import net.sf.l2j.gameserver.model.L2Skill;
 import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.L2Character;
@@ -33,7 +31,6 @@ import net.sf.l2j.gameserver.model.actor.L2Playable;
 import net.sf.l2j.gameserver.model.actor.L2Summon;
 import net.sf.l2j.gameserver.model.actor.L2Summon;
 import net.sf.l2j.gameserver.model.actor.instance.L2CubicInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2CubicInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
-import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
 import net.sf.l2j.gameserver.model.base.PlayerState;
 import net.sf.l2j.gameserver.model.base.PlayerState;
@@ -2600,110 +2597,63 @@ public final class Formulas
     }
     }
     public static double calcElemental(L2Character attacker, L2Character target, L2Skill skill)  
     public static double calcElemental(L2Character attacker, L2Character target, L2Skill skill)  
     {  
     {  
-    	double calcPower = 0;  
-    	double calcDefen = 0;  
-    	double calcTotal = 0;  
+    	int calcPower = 0;  
+    	int calcDefen = 0;  
+    	int calcTotal = 0;  
     	double result = 1;  
     	double result = 1;  
+		int element;  
     	
     	
-    	if (target instanceof L2NpcInstance)  
-    		calcDefen = 20;
-    	L2ItemInstance weaponInstance = attacker.getActiveWeaponInstance();  
-		int elementType = -1;  
-		// first check skill element
-		if (skill != null && skill.getElement() > 0)  
-    	{
-    		calcPower = 20;  
-    		// Calculate the elemental power  
-    		switch (skill.getElement())  
-    		{  
-    			case L2Skill.ELEMENT_FIRE:
-    				if (attacker.getAttackElement() == Elementals.FIRE)
-    					calcPower = attacker.calcStat(Stats.FIRE_POWER, calcPower, target, skill);  
-    				calcDefen = target.calcStat(Stats.FIRE_RES, calcDefen, target, skill);  
-    				break;  
-    			case L2Skill.ELEMENT_WATER:
-    				if (attacker.getAttackElement() == Elementals.WATER)
-    					calcPower = attacker.calcStat(Stats.WATER_POWER, calcPower, target, skill);  
-    				calcDefen = target.calcStat(Stats.WATER_RES, calcDefen, target, skill);  
-    				break;  
-    			case L2Skill.ELEMENT_EARTH:
-    				if (attacker.getAttackElement() == Elementals.EARTH)
-    					calcPower = attacker.calcStat(Stats.EARTH_POWER, calcPower, target, skill);  
-    				calcDefen = target.calcStat(Stats.EARTH_RES, calcDefen, target, skill);  
-    				break;  
-    			case L2Skill.ELEMENT_WIND:
-    				if (attacker.getAttackElement() == Elementals.WIND)
-    					calcPower = attacker.calcStat(Stats.WIND_POWER, calcPower, target, skill);  
-    				calcDefen = target.calcStat(Stats.WIND_RES, calcDefen, target, skill);  
-    				break;  
-    			case L2Skill.ELEMENT_HOLY:
-    				if (attacker.getAttackElement() == Elementals.HOLY)
-    					calcPower = attacker.calcStat(Stats.HOLY_POWER, calcPower, target, skill);  
-    				calcDefen = target.calcStat(Stats.HOLY_RES, calcDefen, target, skill);  
-    				break;  
-    			case L2Skill.ELEMENT_DARK:
-    				if (attacker.getAttackElement() == Elementals.DARK)
-    					calcPower = attacker.calcStat(Stats.DARK_POWER, calcPower, target, skill);  
-    				calcDefen = target.calcStat(Stats.DARK_RES, calcDefen, target, skill);  
-    				break;  
-    		}  
-    		calcTotal = calcPower - calcDefen;  
-    		if (calcTotal <= -80)  
-    			result = 0.20;  
-    		else if (calcTotal > -80 && calcTotal <= -1)  
-    			result = 1 - (Math.abs(calcTotal) / 100);  
-    		else if (calcTotal >= 1 && calcTotal <= 74)  
-    			result = 1 + (calcTotal * 0.0052);  
-    		else if (calcTotal >= 75 && calcTotal <= 149)  
-    			result = 1.4;  
-    		else if (calcTotal >= 150)  
-    			result = 1.7;  
-    	}
-		// if skill not used or non-elemental skill, check for item/character elemental power
+		if (skill != null)
+		{
+			element = skill.getElement();
+			if (element >= 0)
+			{
+				calcPower = skill.getElementPower();
+				calcDefen = target.getDefenseElementValue(element);
+
+				if (attacker.getAttackElement() == element)
+					calcPower += attacker.getAttackElementValue(element);
+
+				calcTotal = Math.max(calcPower - calcDefen, -20);
+				if (calcTotal < 0)
+					result += calcTotal * 0.01;
+				else if (calcTotal < 75)
+					result += calcTotal * 0.0052;
+				else if (calcTotal < 150)
+					result = 1.4;
+				else
+					result = 1.7;
+
+				if (Config.DEVELOPER)
+					_log.info(skill.getName()
+						+ ": "
+						+ calcPower
+						+ ", "
+						+ calcDefen
+						+ ", "
+						+ result);
+			}
+		}
 		else
 		else
 		{
 		{
-			if (weaponInstance != null && weaponInstance.getAttackElementType() >= 0 && weaponInstance.getAttackElementType() == attacker.getAttackElement())
-				elementType = weaponInstance.getAttackElementType();
-			else if (attacker.getAttackElement() > 0)
-				elementType = attacker.getAttackElement();
-			if (elementType >= 0)
+			element = attacker.getAttackElement();
+			if (element >= 0)
 			{
 			{
-				switch (elementType)  
-	    		{  
-	    			case Elementals.FIRE:  
-	    				calcPower = attacker.calcStat(Stats.FIRE_POWER, calcPower, target, skill);  
-	    				calcDefen = target.calcStat(Stats.FIRE_RES, calcDefen, target, skill);  
-	    				break;  
-	    			case Elementals.WATER:  
-	    				calcPower = attacker.calcStat(Stats.WATER_POWER, calcPower, target, skill);  
-	    				calcDefen = target.calcStat(Stats.WATER_RES, calcDefen, target, skill);  
-	    				break;  
-	    			case Elementals.EARTH:  
-	    				calcPower = attacker.calcStat(Stats.EARTH_POWER, calcPower, target, skill);  
-	    				calcDefen = target.calcStat(Stats.EARTH_RES, calcDefen, target, skill);  
-	    				break;  
-	    			case Elementals.WIND:  
-	    				calcPower = attacker.calcStat(Stats.WIND_POWER, calcPower, target, skill);  
-	    				calcDefen = target.calcStat(Stats.WIND_RES, calcDefen, target, skill);  
-	    				break;  
-	    			case Elementals.HOLY:  
-	    				calcPower = attacker.calcStat(Stats.HOLY_POWER, calcPower, target, skill);  
-	    				calcDefen = target.calcStat(Stats.HOLY_RES, calcDefen, target, skill);  
-	    				break;  
-	    			case Elementals.DARK:  
-	    				calcPower = attacker.calcStat(Stats.DARK_POWER, calcPower, target, skill);  
-	    				calcDefen = target.calcStat(Stats.DARK_RES, calcDefen, target, skill);  
-	    				break;
-	    		}
-				calcTotal = calcPower - calcDefen;  
-	    		if (calcTotal <= -80)  
-	    			result = 0.20;  
-	    		else if (calcTotal > -80 && calcTotal <= -1)  
-	    			result = 1 - (Math.abs(calcTotal) * 0.007);  
-	    		else if (calcTotal >= 1 && calcTotal < 100)  
-	    			result = 1 + (calcTotal * 0.007);  
-	    		else if (calcTotal > 100)  
-	    			result = 1.7; 
+				calcPower = attacker.getAttackElementValue(element);
+				calcDefen = target.getDefenseElementValue(element);
+
+				calcTotal = Math.max(calcPower - calcDefen, -20);
+				calcTotal = Math.min(calcTotal, 100);
+				
+				result += calcTotal * 0.007;
+
+				if (Config.DEVELOPER)
+					_log.info("Hit: "
+						+ calcPower
+						+ ", "
+						+ calcDefen
+						+ ", "
+						+ result);
 			}
 			}
 		}
 		}
     	return result;
     	return result;

+ 6 - 6
L2_GameServer/java/net/sf/l2j/gameserver/templates/chars/L2CharTemplate.java

@@ -79,12 +79,12 @@ public class L2CharTemplate
 	public final double baseMovementVuln;
 	public final double baseMovementVuln;
 	public final double baseConfusionVuln;
 	public final double baseConfusionVuln;
 	public final double baseSleepVuln;
 	public final double baseSleepVuln;
-	public final double baseFireRes;
-	public final double baseWindRes;
-	public final double baseWaterRes;
-	public final double baseEarthRes;
-	public final double baseHolyRes;
-	public final double baseDarkRes;
+	public double baseFireRes;
+	public double baseWindRes;
+	public double baseWaterRes;
+	public double baseEarthRes;
+	public double baseHolyRes;
+	public double baseDarkRes;
 	public final double baseCritVuln;
 	public final double baseCritVuln;
 	
 	
 	public final boolean isUndead;
 	public final boolean isUndead;

+ 8 - 0
L2_GameServer/java/net/sf/l2j/gameserver/templates/chars/L2NpcTemplate.java

@@ -195,6 +195,14 @@ public final class L2NpcTemplate extends L2CharTemplate
 			AI = AIType.HEALER;
 			AI = AIType.HEALER;
 		else
 		else
 			AI = AIType.FIGHTER;
 			AI = AIType.FIGHTER;
+
+		// all NPCs has 20 resistance to all attributes
+		baseFireRes += 20;
+		baseWindRes += 20;
+		baseWaterRes += 20;
+		baseEarthRes += 20;
+		baseHolyRes += 20;
+		baseDarkRes += 20;
 	}
 	}
 	
 	
 	public void addTeachInfo(ClassId classId)
 	public void addTeachInfo(ClassId classId)