Pārlūkot izejas kodu

BETA: Core-Part for [DP10033].

Nos 11 gadi atpakaļ
vecāks
revīzija
f62e9a5c52

+ 5 - 0
L2J_Server_BETA/dist/game/config/Character.properties

@@ -144,6 +144,11 @@ AltShieldBlocks = False
 # Default: 10
 AltPerfectShieldBlockRate = 10
 
+# This is the value ticks are multiplied with to result in interval per tick in milliseconds.
+# Note: Editing this will not affect how much the over-time effects heals since heal scales with that value too.
+# Default: 666
+EffectTickRatio = 666
+
 # ---------------------------------------------------------------------------
 # Class, Sub-class and skill learning options
 # ---------------------------------------------------------------------------

+ 2 - 0
L2J_Server_BETA/java/com/l2jserver/Config.java

@@ -140,6 +140,7 @@ public final class Config
 	public static boolean SUMMON_STORE_SKILL_COOLTIME;
 	public static boolean ALT_GAME_SHIELD_BLOCKS;
 	public static int ALT_PERFECT_SHLD_BLOCK;
+	public static long EFFECT_TICK_RATIO;
 	public static boolean ALLOW_CLASS_MASTERS;
 	public static ClassMasterSettings CLASS_MASTER_SETTINGS;
 	public static boolean ALLOW_ENTIRE_TREE;
@@ -1486,6 +1487,7 @@ public final class Config
 			SUMMON_STORE_SKILL_COOLTIME = Character.getBoolean("SummonStoreSkillCooltime", true);
 			ALT_GAME_SHIELD_BLOCKS = Character.getBoolean("AltShieldBlocks", false);
 			ALT_PERFECT_SHLD_BLOCK = Character.getInt("AltPerfectShieldBlockRate", 10);
+			EFFECT_TICK_RATIO = Character.getLong("EffectTickRatio", 666);
 			ALLOW_CLASS_MASTERS = Character.getBoolean("AllowClassMasters", false);
 			ALLOW_ENTIRE_TREE = Character.getBoolean("AllowEntireTree", false);
 			ALTERNATE_CLASS_MASTER = Character.getBoolean("AlternateClassMaster", false);

+ 1 - 14
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2PlayerAI.java

@@ -278,20 +278,7 @@ public class L2PlayerAI extends L2PlayableAI
 			clientStopMoving(null);
 		}
 		
-		L2Object oldTarget = _actor.getTarget();
-		if ((oldTarget != null) && (target != null) && (oldTarget != target))
-		{
-			// Replace the current target by the cast target
-			_actor.setTarget(getCastTarget());
-			// Launch the Cast of the skill
-			_accessor.doCast(_skill);
-			// Restore the initial target
-			_actor.setTarget(oldTarget);
-		}
-		else
-		{
-			_accessor.doCast(_skill);
-		}
+		_accessor.doCast(_skill);
 	}
 	
 	private void thinkPickUp()

+ 6 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/effects/AbstractEffect.java

@@ -25,6 +25,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.logging.Logger;
 
+import com.l2jserver.Config;
 import com.l2jserver.gameserver.handler.EffectHandler;
 import com.l2jserver.gameserver.model.ChanceCondition;
 import com.l2jserver.gameserver.model.StatsSet;
@@ -173,6 +174,11 @@ public abstract class AbstractEffect implements IChanceSkillTrigger
 		return _ticks;
 	}
 	
+	public double getTicksMultiplier()
+	{
+		return (getTicks() * Config.EFFECT_TICK_RATIO) / 1000f;
+	}
+	
 	public List<FuncTemplate> getFuncTemplates()
 	{
 		return _funcTemplates;

+ 3 - 17
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/BuffInfo.java

@@ -25,6 +25,7 @@ import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ScheduledFuture;
 
+import com.l2jserver.Config;
 import com.l2jserver.gameserver.GameTimeController;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.model.CharEffectList;
@@ -287,7 +288,7 @@ public final class BuffInfo
 			{
 				// The task for the effect ticks
 				final EffectTickTask effectTask = new EffectTickTask(this, effect);
-				final ScheduledFuture<?> scheduledFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(effectTask, effect.getTicks() * 1000L, effect.getTicks() * 1000L);
+				final ScheduledFuture<?> scheduledFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(effectTask, effect.getTicks() * Config.EFFECT_TICK_RATIO, effect.getTicks() * Config.EFFECT_TICK_RATIO);
 				// Adds the task for ticking
 				addTask(effect, new EffectTaskInfo(effectTask, scheduledFuture));
 			}
@@ -313,22 +314,7 @@ public final class BuffInfo
 			continueForever = effect.onActionTime(this);
 		}
 		
-		// Skills without abnormal time should tick indefinitely, unless they fail on action time.
-		if (_env.getSkill().getAbnormalTime() > 0)
-		{
-			// Checks made in seconds, although tasks run in milliseconds, it'll increase margin for effects that run indefinitely.
-			final long elapsedTime = effect.getTicks() * tickCount;
-			if (elapsedTime >= _env.getSkill().getAbnormalTime())
-			{
-				final EffectTaskInfo task = getEffectTask(effect);
-				if (task != null)
-				{
-					task.getScheduledFuture().cancel(true); // Allow to finish current run.
-					_env.getTarget().getEffectList().remove(this); // Remove the buff from the effect list.
-				}
-			}
-		}
-		else if (!continueForever)
+		if (!continueForever && _env.getSkill().isToggle())
 		{
 			final EffectTaskInfo task = getEffectTask(effect);
 			if (task != null)

+ 8 - 8
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExRegMax.java → L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExRegenMax.java

@@ -18,17 +18,17 @@
  */
 package com.l2jserver.gameserver.network.serverpackets;
 
-public class ExRegMax extends L2GameServerPacket
+public class ExRegenMax extends L2GameServerPacket
 {
-	private final double _max;
-	private final int _count;
 	private final int _time;
+	private final int _tickInterval;
+	private final double _amountPerTick;
 	
-	public ExRegMax(double max, int count, int time)
+	public ExRegenMax(int time, int tickInterval, double amountPerTick)
 	{
-		_max = max;
-		_count = count;
 		_time = time;
+		_tickInterval = tickInterval;
+		_amountPerTick = amountPerTick;
 	}
 	
 	@Override
@@ -37,8 +37,8 @@ public class ExRegMax extends L2GameServerPacket
 		writeC(0xfe);
 		writeH(0x01);
 		writeD(1);
-		writeD(_count);
 		writeD(_time);
-		writeF(_max);
+		writeD(_tickInterval);
+		writeF(_amountPerTick);
 	}
 }