Explorar o código

Rename time -> abnormalTime, thanks UnAfraid.

MELERIX %!s(int64=14) %!d(string=hai) anos
pai
achega
ff280f77b6

+ 20 - 20
L2J_Server/java/com/l2jserver/gameserver/model/L2Effect.java

@@ -85,7 +85,7 @@ public abstract class L2Effect
 	private EffectState _state;
 	
 	// period, seconds
-	private final int _period;
+	private final int _abnormalTime;
 	private int _periodStartTicks;
 	private int _periodFirstTime;
 	
@@ -164,7 +164,7 @@ public abstract class L2Effect
 		_totalCount = _count;
 		
 		// Support for retail herbs duration when _effected has a Summon
-		int temp = template.period;
+		int temp = template.abnormalTime;
 		
 		if ((_skill.getId() > 2277 && _skill.getId() < 2286) || (_skill.getId() >= 2512 && _skill.getId() <= 2514))
 		{
@@ -178,7 +178,7 @@ public abstract class L2Effect
 		if (env.skillMastery)
 			temp *= 2;
 		
-		_period = temp;
+		_abnormalTime = temp;
 		_abnormalEffect = template.abnormalEffect;
 		_specialEffect = template.specialEffect;
 		_eventEffect = template.eventEffect;
@@ -220,7 +220,7 @@ public abstract class L2Effect
 		_funcTemplates = _template.funcTemplates;
 		_count = effect.getCount();
 		_totalCount = _template.counter;
-		_period = _template.period;
+		_abnormalTime = _template.abnormalTime;
 		_abnormalEffect = _template.abnormalEffect;
 		_specialEffect = _template.specialEffect;
 		_eventEffect = _template.eventEffect;
@@ -257,7 +257,7 @@ public abstract class L2Effect
 
 	public void setFirstTime(int newFirstTime)
 	{
-		_periodFirstTime = Math.min(newFirstTime, _period);
+		_periodFirstTime = Math.min(newFirstTime, _abnormalTime);
 		_periodStartTicks -= _periodFirstTime * GameTimeController.TICKS_PER_SECOND;
 	}
 
@@ -266,9 +266,9 @@ public abstract class L2Effect
 		return _icon;
 	}
 	
-	public int getPeriod()
+	public int getAbnormalTime()
 	{
-		return _period;
+		return _abnormalTime;
 	}
 	
 	public int getTime()
@@ -284,7 +284,7 @@ public abstract class L2Effect
 	{
 		if (_count == _totalCount)
 			return 0;
-		return (Math.abs(_count - _totalCount + 1) * _period) + getTime() + 1;
+		return (Math.abs(_count - _totalCount + 1) * _abnormalTime) + getTime() + 1;
 	}
 	
 	public boolean getInUse()
@@ -354,12 +354,12 @@ public abstract class L2Effect
 	
 	private final synchronized void startEffectTask()
 	{
-		if (_period > 0)
+		if (_abnormalTime > 0)
 		{
 			stopEffectTask();
-			final int initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			final int initialDelay = Math.max((_abnormalTime - _periodFirstTime) * 1000, 5);
 			if (_count > 1)
-				_currentFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new EffectTask(), initialDelay, _period * 1000);
+				_currentFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new EffectTask(), initialDelay, _abnormalTime * 1000);
 			else
 				_currentFuture = ThreadPoolManager.getInstance().scheduleEffect(new EffectTask(), initialDelay);
 		}
@@ -463,7 +463,7 @@ public abstract class L2Effect
 					getEffected().sendPacket(smsg);
 				}
 
-				if (_period != 0)
+				if (_abnormalTime != 0)
 				{
 					startEffectTask();
 					return;
@@ -506,7 +506,7 @@ public abstract class L2Effect
 				stopEffectTask();
 				
 				// Cancel the effect in the the abnormal effect map of the L2Character
-				if (getInUse() || !(_count > 1 || _period > 0))
+				if (getInUse() || !(_count > 1 || _abnormalTime > 0))
 					if (_startConditionsCorrect)
 						onExit();
 				
@@ -564,8 +564,8 @@ public abstract class L2Effect
 		}
 		else if (future != null)
 			mi.addEffect(sk.getId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
-		else if (_period == -1)
-			mi.addEffect(sk.getId(), getLevel(), _period);
+		else if (_abnormalTime == -1)
+			mi.addEffect(sk.getId(), getLevel(), _abnormalTime);
 	}
 	
 	public final void addPartySpelledIcon(PartySpelled ps)
@@ -577,8 +577,8 @@ public abstract class L2Effect
 		final L2Skill sk = getSkill();
 		if (future != null)
 			ps.addPartySpelledEffect(sk.getId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
-		else if (_period == -1)
-			ps.addPartySpelledEffect(sk.getId(), getLevel(), _period);
+		else if (_abnormalTime == -1)
+			ps.addPartySpelledEffect(sk.getId(), getLevel(), _abnormalTime);
 	}
 	
 	public final void addOlympiadSpelledIcon(ExOlympiadSpelledInfo os)
@@ -590,8 +590,8 @@ public abstract class L2Effect
 		final L2Skill sk = getSkill();
 		if (future != null)
 			os.addEffect(sk.getId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
-		else if (_period == -1)
-			os.addEffect(sk.getId(), getLevel(), _period);
+		else if (_abnormalTime == -1)
+			os.addEffect(sk.getId(), getLevel(), _abnormalTime);
 	}
 	
 	public int getLevel()
@@ -656,7 +656,7 @@ public abstract class L2Effect
 	@Override
 	public String toString()
 	{
-		return "L2Effect [_skill=" + _skill + ", _state=" + _state + ", _period=" + _period + "]";
+		return "L2Effect [_skill=" + _skill + ", _state=" + _state + ", _period=" + _abnormalTime + "]";
 	}
 	
 	public boolean isSeflEffectType()

+ 9 - 9
L2J_Server/java/com/l2jserver/gameserver/skills/DocumentBase.java

@@ -244,33 +244,33 @@ abstract class DocumentBase
 		/**
 		 * Keep this values as default ones, DP needs it
 		 */
-		int time = 1;
+		int abnormalTime = 1;
 		int count = 1;
 		
 		if (attrs.getNamedItem("count") != null)
 		{
 			count = Integer.decode(getValue(attrs.getNamedItem("count").getNodeValue(), template));
 		}
-		if (attrs.getNamedItem("time") != null)
+		if (attrs.getNamedItem("abnormalTime") != null)
 		{
-			time = Integer.decode(getValue(attrs.getNamedItem("time").getNodeValue(),template));
+			abnormalTime = Integer.decode(getValue(attrs.getNamedItem("abnormalTime").getNodeValue(),template));
 			if (Config.ENABLE_MODIFY_SKILL_DURATION)
 			{
 				if (Config.SKILL_DURATION_LIST.containsKey(((L2Skill) template).getId()))
 				{
 					if (((L2Skill) template).getLevel() < 100)
-						time = Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
+						abnormalTime = Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
 					else if ((((L2Skill) template).getLevel() >= 100) && (((L2Skill) template).getLevel() < 140))
-						time += Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
+						abnormalTime += Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
 					else if (((L2Skill) template).getLevel() > 140)
-						time = Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
+						abnormalTime = Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
 					if (Config.DEBUG)
-						_log.info("*** Skill " + ((L2Skill) template).getName() + " (" + ((L2Skill) template).getLevel() + ") changed duration to " + time + " seconds.");
+						_log.info("*** Skill " + ((L2Skill) template).getName() + " (" + ((L2Skill) template).getLevel() + ") changed duration to " + abnormalTime + " seconds.");
 				}
 			}
 		}
 		else if (((L2Skill) template).getBuffDuration() > 0)
-			time = ((L2Skill) template).getBuffDuration() / 1000 / count;
+			abnormalTime = ((L2Skill) template).getBuffDuration() / 1000 / count;
 		
 		boolean self = false;
 		if (attrs.getNamedItem("self") != null)
@@ -372,7 +372,7 @@ abstract class DocumentBase
 			throw new NoSuchElementException("Invalid chance condition: " + chanceCond + " "
 					+ activationChance);
 		
-		lt = new EffectTemplate(attachCond, applayCond, name, lambda, count, time, abnormal, special, event, abnormalType, abnormalLvl, icon, effectPower, type, trigId, trigLvl, chance);
+		lt = new EffectTemplate(attachCond, applayCond, name, lambda, count, abnormalTime, abnormal, special, event, abnormalType, abnormalLvl, icon, effectPower, type, trigId, trigLvl, chance);
 		parseTemplate(n, lt);
 		if (template instanceof L2Item)
 			((L2Item) template).attach(lt);

+ 1 - 1
L2J_Server/java/com/l2jserver/gameserver/skills/effects/EffectCancel.java

@@ -188,7 +188,7 @@ public class EffectCancel extends L2Effect
 	private static boolean calcCancelSuccess(L2Effect effect, int cancelLvl, int baseRate)
 	{
 		int rate = 2 * (cancelLvl - effect.getSkill().getMagicLevel());
-		rate += effect.getPeriod()/120;
+		rate += effect.getAbnormalTime()/120;
 		rate += baseRate;
 		
 		if (rate < 25)

+ 1 - 1
L2J_Server/java/com/l2jserver/gameserver/skills/effects/EffectCancelDebuff.java

@@ -147,7 +147,7 @@ public class EffectCancelDebuff extends L2Effect
     private static boolean calcCancelSuccess(L2Effect effect, int cancelLvl, int baseRate)
     {
         int rate = 2 * (cancelLvl - effect.getSkill().getMagicLevel());
-        rate += (effect.getPeriod() - effect.getTime()) / 1200;
+        rate += (effect.getAbnormalTime() - effect.getTime()) / 1200;
         rate += baseRate;
        
         if (rate < 25)

+ 1 - 1
L2J_Server/java/com/l2jserver/gameserver/skills/effects/EffectHealOverTime.java

@@ -62,7 +62,7 @@ public class EffectHealOverTime extends L2Effect
 	@Override
 	public boolean onStart()
 	{
-		getEffected().sendPacket(new ExRegMax(calc(), getTotalCount() * getPeriod(), getPeriod()));
+		getEffected().sendPacket(new ExRegMax(calc(), getTotalCount() * getAbnormalTime(), getAbnormalTime()));
 		return true;
 	}
 	

+ 1 - 1
L2J_Server/java/com/l2jserver/gameserver/skills/effects/EffectMpConsumePerLevel.java

@@ -50,7 +50,7 @@ public class EffectMpConsumePerLevel extends L2Effect
 		
 		double base = calc();
 		double consume = (getEffected().getLevel() - 1) / 7.5 * base
-		* getPeriod();
+		* getAbnormalTime();
 		
 		if (consume > getEffected().getCurrentMp())
 		{

+ 3 - 3
L2J_Server/java/com/l2jserver/gameserver/templates/effects/EffectTemplate.java

@@ -44,7 +44,7 @@ public class EffectTemplate
 	public final Condition applayCond;
 	public final Lambda lambda;
 	public final int counter;
-	public final int period; // in seconds
+	public final int abnormalTime; // in seconds
 	public final AbnormalEffect abnormalEffect;
 	public final AbnormalEffect specialEffect;
 	public final AbnormalEffect eventEffect;
@@ -61,7 +61,7 @@ public class EffectTemplate
 	public final ChanceCondition chanceCondition;
 	
 	public EffectTemplate(Condition pAttachCond, Condition pApplayCond, String func, Lambda pLambda,
-			int pCounter, int pPeriod, AbnormalEffect pAbnormalEffect, AbnormalEffect pSpecialEffect,
+			int pCounter, int pAbnormalTime, AbnormalEffect pAbnormalEffect, AbnormalEffect pSpecialEffect,
 			AbnormalEffect pEventEffect, String pAbnormalType, byte pAbnormalLvl, boolean showicon,
 			double ePower, L2SkillType eType, int trigId, int trigLvl, ChanceCondition chanceCond)
 	{
@@ -69,7 +69,7 @@ public class EffectTemplate
 		applayCond = pApplayCond;
 		lambda = pLambda;
 		counter = pCounter;
-		period = pPeriod;
+		abnormalTime = pAbnormalTime;
 		abnormalEffect = pAbnormalEffect;
 		specialEffect = pSpecialEffect;
 		eventEffect = pEventEffect;