Переглянути джерело

BETA: Retail-Like isMagic Support
* Using Retail-Like enums for isMagic.
* Now all Magic Skills will consume SPS/BSPS by default.
* Fixed Cast Time bonus for SPS/BSPS.
* Updated isMagic values for all skills (thx '''UnAfraid''').
* Removed isPotion & staticHitTime boolean from skills (skills with isMagic = 2 will have staticReuse & staticHitTime by default).
* Removed isDance boolean from skills (now using isMagic = 3).
* Removed nextDanceCost from Dance/Song skills (now is calculated internally).

Thanks '''MELERIX''' for help.

Adry_85 13 роки тому
батько
коміт
010ead9979

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2AttackableAI.java

@@ -1909,8 +1909,8 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 		{
 			return false;
 		}
-		// Is a magic skill and character is magically muted or is a physical skill and character is physically muted.
-		if (!skill.ignoreSkillMute() && ((skill.isMagic() && getActiveChar().isMuted()) || getActiveChar().isPhysicalMuted()))
+		// If is a static skill and magic skill and character is muted or is a physical skill muted and character is physically muted.
+		if (!skill.isStatic() && ((skill.isMagic() && getActiveChar().isMuted()) || getActiveChar().isPhysicalMuted()))
 		{
 			return false;
 		}

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

@@ -409,7 +409,7 @@ public class L2Attackable extends L2Npc
 		if (getCurrentHp() <= skill.getHpConsume())
 			return;
 		
-		if (!skill.ignoreSkillMute())
+		if (!skill.isStatic())
 		{
 			if (skill.isMagic())
 			{

+ 14 - 26
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -1860,27 +1860,15 @@ public abstract class L2Character extends L2Object
 		L2ItemInstance weaponInst = getActiveWeaponInstance();
 		if (weaponInst != null)
 		{
-			if (skill.isMagic() && !effectWhileCasting && !skill.isPotion())
+			if (skill.isMagic() && !effectWhileCasting)
 			{
 				if ((weaponInst.getChargedSpiritshot() == L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT) || (weaponInst.getChargedSpiritshot() == L2ItemInstance.CHARGED_SPIRITSHOT))
 				{
-					//Only takes 70% of the time to cast a BSpS/SpS cast
-					hitTime = (int) (0.70 * hitTime);
-					coolTime = (int) (0.70 * coolTime);
+					// Using SPS/BSPS Casting Time of Magic Skills is reduced in 40%
+					hitTime = (int) (0.60 * hitTime);
+					coolTime = (int) (0.60 * coolTime);
 					
-					//Because the following are magic skills that do not actively 'eat' BSpS/SpS,
-					//I must 'eat' them here so players don't take advantage of infinite speed increase
-					switch (skill.getSkillType())
-					{
-						case BUFF:
-						case MANAHEAL:
-						case MANARECHARGE:
-						case MANA_BY_LEVEL:
-						case RESURRECT:
-						case RECALL:
-							weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_NONE);
-							break;
-					}
+					weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_NONE);
 				}
 			}
 			
@@ -1900,8 +1888,8 @@ public abstract class L2Character extends L2Object
 			}
 		}
 		
-		// Don't modify skills HitTime if staticHitTime is specified for skill in datapack.
-		if (skill.isStaticHitTime())
+		// if skill is static
+		if (skill.isStatic())
 		{
 			hitTime = skill.getHitTime();
 			coolTime = skill.getCoolTime();
@@ -1934,7 +1922,7 @@ public abstract class L2Character extends L2Object
 		// Init the reuse time of the skill
 		int reuseDelay;
 		
-		if (skill.isStaticReuse())
+		if (skill.isStaticReuse() || skill.isStatic())
 		{
 			reuseDelay = (skill.getReuseDelay());
 		}
@@ -2160,7 +2148,7 @@ public abstract class L2Character extends L2Object
 			return false;
 		}
 		
-		if (!skill.isPotion() && !skill.ignoreSkillMute()) // Skill mute checks.
+		if (!skill.isStatic()) // Skill mute checks.
 		{
 			// Check if the skill is a magic spell and if the L2Character is not muted
 			if (skill.isMagic())
@@ -5706,8 +5694,8 @@ public abstract class L2Character extends L2Object
 	 */
 	public void breakCast()
 	{
-		// damage can only cancel magical skills
-		if (isCastingNow() && canAbortCast() && getLastSkillCast() != null && getLastSkillCast().isMagic())
+		// damage can only cancel magical & static skills
+		if (isCastingNow() && canAbortCast() && getLastSkillCast() != null && (getLastSkillCast().isMagic() || getLastSkillCast().isStatic()))
 		{
 			// Abort the cast of the L2Character and send Server->Client MagicSkillCanceld/ActionFailed packet.
 			abortCast();
@@ -6372,8 +6360,8 @@ public abstract class L2Character extends L2Object
 		
 		// Ensure that a cast is in progress
 		// Check if player is using fake death.
-		// Potions can be used while faking death.
-		if ((mut.simultaneously && !isCastingSimultaneouslyNow()) || (!mut.simultaneously && !isCastingNow()) || (isAlikeDead() && !skill.isPotion()))
+		// Static skills can be used while faking death.
+		if ((mut.simultaneously && !isCastingSimultaneouslyNow()) || (!mut.simultaneously && !isCastingNow()) || (isAlikeDead() && !skill.isStatic()))
 		{
 			// now cancels both, simultaneous and normal
 			getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
@@ -6390,7 +6378,7 @@ public abstract class L2Character extends L2Object
 			level = 1;
 		
 		// Send a Server->Client packet MagicSkillLaunched to the L2Character AND to all L2PcInstance in the _KnownPlayers of the L2Character
-		if (!skill.isPotion())
+		if (!skill.isStatic())
 			broadcastPacket(new MagicSkillLaunched(this, magicId, level, targets));
 		
 		mut.phase = 2;

+ 2 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/stat/CharStat.java

@@ -777,12 +777,13 @@ public class CharStat
 		if (skill == null)
 			return 1;
 		double mpConsume = skill.getMpConsume();
+		double nextDanceMpCost = Math.ceil(skill.getMpConsume() / 2);
 		if (skill.isDance())
 		{
 			if (Config.DANCE_CONSUME_ADDITIONAL_MP
 					&& _activeChar != null
 					&& _activeChar.getDanceCount() > 0)
-				mpConsume += _activeChar.getDanceCount() * skill.getNextDanceMpCost();
+				mpConsume += _activeChar.getDanceCount() * nextDanceMpCost;
 		}
 		
 		mpConsume = calcStat(Stats.MP_CONSUME, mpConsume, null, skill);

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/effects/L2Effect.java

@@ -575,7 +575,7 @@ public abstract class L2Effect implements IChanceSkillTrigger
 		final L2Skill sk = getSkill();
 		if (_totalCount > 1)
 		{
-			if (sk.isPotion())
+			if (sk.isStatic())
 				mi.addEffect(sk.getDisplayId(), getLevel(), sk.getBuffDuration() - (getTaskTime() * 1000));
 			else
 				mi.addEffect(sk.getDisplayId(), getLevel(), -1);
@@ -646,7 +646,7 @@ public abstract class L2Effect implements IChanceSkillTrigger
 				|| getSkill().isDebuff()
 				|| getSkill().isHeroSkill()
 				|| getSkill().isGMSkill()
-				|| (getSkill().isPotion() && (getSkill().getId() != 2274 && getSkill().getId() != 2341)) // Hardcode for now :<
+				|| getSkill().isStatic()
 				|| isHerbEffect()
 				|| !getSkill().canBeDispeled())
 			return false;

+ 14 - 39
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2Skill.java

@@ -107,10 +107,9 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	// not needed, just for easier debug
 	private final String _name;
 	private final L2SkillOpType _operateType;
-	private final boolean _magic;
+	private final int _magic;
 	private final L2TraitType _traitType;
 	private final boolean _staticReuse;
-	private final boolean _staticHitTime;
 	private final boolean _staticDamage; // Damage dealing skills do static damage based on the power value.
 	private final int _mpConsume;
 	private final int _mpInitialConsume;
@@ -183,7 +182,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	private final boolean _removedOnAnyActionExceptMove;
 	private final boolean _removedOnDamage;
 	
-	private final boolean _isPotion;
 	private final byte _element;
 	private final int _elementPower;
 	
@@ -223,8 +221,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	private final int _lethalEffect2;     // percent of success for lethal 2nd effect (hit cp,hp to 1 or if mob hp to 1) (only for PDAM skills)
 	private final boolean _directHpDmg;  // If true then dmg is being make directly
 	private final boolean _isTriggeredSkill;      // If true the skill will take activation buff slot instead of a normal buff slot
-	private final boolean _isDance;      // If true then casting more dances will cost more MP
-	private final int _nextDanceCost;
 	private final float _sSBoost;	//If true skill will have SoulShot boost (power*2)
 	private final int _aggroPoints;
 	
@@ -247,7 +243,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	private final String _attribute;
 	
 	private final boolean _ignoreShield;
-	private final boolean _ignoreSkillMute;
 	
 	private final boolean _isSuicideAttack;
 	private final boolean _canBeReflected;
@@ -270,12 +265,10 @@ public abstract class L2Skill implements IChanceSkillTrigger
 		_displayId = set.getInteger("displayId", _id);
 		_name = set.getString("name");
 		_operateType = set.getEnum("operateType", L2SkillOpType.class);
-		_magic = set.getBool("isMagic", false);
+		_magic = set.getInteger("isMagic", 0);
 		_traitType = set.getEnum("trait", L2TraitType.class, L2TraitType.NONE);
 		_staticReuse = set.getBool("staticReuse", false);
-		_staticHitTime = set.getBool("staticHitTime", false);
 		_staticDamage = set.getBool("staticDamage", false);
-		_isPotion = set.getBool("isPotion", false);
 		_mpConsume = set.getInteger("mpConsume", 0);
 		_mpInitialConsume = set.getInteger("mpInitialConsume", 0);
 		_hpConsume = set.getInteger("hpConsume", 0);
@@ -419,7 +412,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 		_maxChance = set.getInteger("maxChance", Config.MAX_DEBUFF_CHANCE);
 		_stat = set.getEnum("stat", Stats.class, null);
 		_ignoreShield = set.getBool("ignoreShld", false);
-		_ignoreSkillMute = set.getBool("ignoreSkillMute", false);
 		_skillType = set.getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY);
 		_effectType = set.getEnum("effectType", L2SkillType.class, null);
 		_effectId = set.getInteger("effectId", 0);
@@ -494,8 +486,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 		
 		_directHpDmg  = set.getBool("dmgDirectlyToHp",false);
 		_isTriggeredSkill = set.getBool("isTriggeredSkill",false);
-		_isDance = set.getBool("isDance",false);
-		_nextDanceCost = set.getInteger("nextDanceCost", 0);
 		_sSBoost = set.getFloat("SSBoost", 0.f);
 		_aggroPoints = set.getInteger("aggroPoints", 0);
 		
@@ -525,11 +515,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	
 	public abstract void useSkill(L2Character caster, L2Object[] targets);
 	
-	public final boolean isPotion()
-	{
-		return _isPotion;
-	}
-	
 	public final int getArmorsAllowed()
 	{
 		return _armorsAllowed;
@@ -914,27 +899,27 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	}
 	
 	/**
-	 * @return Returns the magic.
+	 * @return Returns true to set magic skills.
 	 */
 	public final boolean isMagic()
 	{
-		return _magic;
+		return _magic == 1;
 	}
 	
 	/**
-	 * @return Returns true to set static reuse.
-	 */
-	public final boolean isStaticReuse()
+	 * @return Returns true to set static skills.
+	*/
+	public final boolean isStatic()
 	{
-		return _staticReuse;
+		return _magic == 2;
 	}
 	
 	/**
-	 * @return Returns true to set static hittime.
-	 */
-	public final boolean isStaticHitTime()
+	 * @return Returns true to set static reuse.
+	*/
+	public final boolean isStaticReuse()
 	{
-		return _staticHitTime;
+		return _staticReuse;
 	}
 	
 	public final boolean isStaticDamage()
@@ -1039,12 +1024,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	
 	public final boolean isDance()
 	{
-		return _isDance;
-	}
-	
-	public final int getNextDanceMpCost()
-	{
-		return _nextDanceCost;
+		return _magic == 3;
 	}
 	
 	public final float getSSBoost()
@@ -1072,7 +1052,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	
 	public final boolean useSpiritShot()
 	{
-		return isMagic();
+		return _magic == 1;
 	}
 	public final boolean useFishShot()
 	{
@@ -1964,11 +1944,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 		return _ignoreShield;
 	}
 	
-	public boolean ignoreSkillMute()
-	{
-		return _ignoreSkillMute;
-	}
-	
 	public boolean canBeReflected()
 	{
 		return _canBeReflected;