|
@@ -28,7 +28,6 @@ import com.l2jserver.gameserver.model.actor.L2Decoy;
|
|
import com.l2jserver.gameserver.model.actor.knownlist.DecoyKnownList;
|
|
import com.l2jserver.gameserver.model.actor.knownlist.DecoyKnownList;
|
|
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
|
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
|
import com.l2jserver.gameserver.model.skills.L2Skill;
|
|
import com.l2jserver.gameserver.model.skills.L2Skill;
|
|
-import com.l2jserver.gameserver.model.skills.l2skills.L2SkillDecoy;
|
|
|
|
import com.l2jserver.gameserver.taskmanager.DecayTaskManager;
|
|
import com.l2jserver.gameserver.taskmanager.DecayTaskManager;
|
|
|
|
|
|
public class L2DecoyInstance extends L2Decoy
|
|
public class L2DecoyInstance extends L2Decoy
|
|
@@ -38,22 +37,14 @@ public class L2DecoyInstance extends L2Decoy
|
|
private Future<?> _DecoyLifeTask;
|
|
private Future<?> _DecoyLifeTask;
|
|
private Future<?> _HateSpam;
|
|
private Future<?> _HateSpam;
|
|
|
|
|
|
- public L2DecoyInstance(int objectId, L2NpcTemplate template, L2PcInstance owner, L2Skill skill)
|
|
|
|
|
|
+ public L2DecoyInstance(int objectId, L2NpcTemplate template, L2PcInstance owner, int totalLifeTime)
|
|
{
|
|
{
|
|
super(objectId, template, owner);
|
|
super(objectId, template, owner);
|
|
setInstanceType(InstanceType.L2DecoyInstance);
|
|
setInstanceType(InstanceType.L2DecoyInstance);
|
|
- if (skill != null)
|
|
|
|
- {
|
|
|
|
- _totalLifeTime = ((L2SkillDecoy) skill).getTotalLifeTime();
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- _totalLifeTime = 20000;
|
|
|
|
- }
|
|
|
|
|
|
+ _totalLifeTime = totalLifeTime;
|
|
_timeRemaining = _totalLifeTime;
|
|
_timeRemaining = _totalLifeTime;
|
|
- int delay = 1000;
|
|
|
|
int skilllevel = getTemplate().getIdTemplate() - 13070;
|
|
int skilllevel = getTemplate().getIdTemplate() - 13070;
|
|
- _DecoyLifeTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new DecoyLifetime(getOwner(), this), delay, delay);
|
|
|
|
|
|
+ _DecoyLifeTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new DecoyLifetime(getOwner(), this), 1000, 1000);
|
|
_HateSpam = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new HateSpam(this, SkillTable.getInstance().getInfo(5272, skilllevel)), 2000, 5000);
|
|
_HateSpam = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new HateSpam(this, SkillTable.getInstance().getInfo(5272, skilllevel)), 2000, 5000);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -103,9 +94,8 @@ public class L2DecoyInstance extends L2Decoy
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- double newTimeRemaining;
|
|
|
|
_Decoy.decTimeRemaining(1000);
|
|
_Decoy.decTimeRemaining(1000);
|
|
- newTimeRemaining = _Decoy.getTimeRemaining();
|
|
|
|
|
|
+ double newTimeRemaining = _Decoy.getTimeRemaining();
|
|
if (newTimeRemaining < 0)
|
|
if (newTimeRemaining < 0)
|
|
{
|
|
{
|
|
_Decoy.unSummon(_activeChar);
|
|
_Decoy.unSummon(_activeChar);
|
|
@@ -118,10 +108,9 @@ public class L2DecoyInstance extends L2Decoy
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- static class HateSpam implements Runnable
|
|
|
|
|
|
+ private static class HateSpam implements Runnable
|
|
{
|
|
{
|
|
private final L2DecoyInstance _activeChar;
|
|
private final L2DecoyInstance _activeChar;
|
|
-
|
|
|
|
private final L2Skill _skill;
|
|
private final L2Skill _skill;
|
|
|
|
|
|
HateSpam(L2DecoyInstance activeChar, L2Skill Hate)
|
|
HateSpam(L2DecoyInstance activeChar, L2Skill Hate)
|