Monsters teleport back to spawn.
This commit is contained in:
parent
19160dfd8f
commit
30bb3a55b5
@ -140,7 +140,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
guard.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
monster.reduceCurrentHp(1, guard, null);
|
||||
guard.setCanStopAttackByTime(false);
|
||||
|
||||
if ((guard.getId() != COMMANDO) && (guard.getId() != COMMANDO_CAPTAIN))
|
||||
{
|
||||
@ -161,7 +160,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
decoGuard.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
monster.reduceCurrentHp(1, decoGuard, null);
|
||||
decoGuard.setCanStopAttackByTime(false);
|
||||
decoGuard.setIsInvul(true);
|
||||
}
|
||||
}
|
||||
@ -303,7 +301,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
|
||||
commander.reduceCurrentHp(1, sakum, null); // TODO: Find better way for attack
|
||||
sakum.reduceCurrentHp(1, commander, null);
|
||||
commander.setCanStopAttackByTime(false);
|
||||
|
||||
notifyEvent("START_ATTACK", commander, null);
|
||||
}
|
||||
@ -319,7 +316,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
|
||||
commander.reduceCurrentHp(1, sakum, null); // TODO: Find better way for attack
|
||||
sakum.reduceCurrentHp(1, commander, null);
|
||||
commander.setCanStopAttackByTime(false);
|
||||
|
||||
notifyEvent("START_ATTACK", commander, null);
|
||||
}
|
||||
|
@ -521,7 +521,6 @@ public class Lindvior extends AbstractNpcAI
|
||||
}
|
||||
case LYN_DRACO_ATTACKER_GENERATORS:
|
||||
{
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("attack_generator", 10000, npc, null, true);
|
||||
break;
|
||||
|
@ -228,7 +228,6 @@ public final class ChamberOfProphecies extends AbstractInstance
|
||||
{
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
|
||||
{
|
||||
npc.setTarget(player);
|
||||
|
@ -300,7 +300,6 @@ public class NornilsGarden extends AbstractInstance
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
|
||||
{
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("check_agrro", 1000, npc, null, true);
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Chance to forget attackers after some time
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0) && npc.canStopAttackByTime())
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0))
|
||||
{
|
||||
npc.clearAggroList();
|
||||
npc.getAttackByList().clear();
|
||||
@ -661,11 +661,15 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Check if target is dead or if timeout is expired to stop this attack
|
||||
if ((target == null) || target.isAlikeDead() || ((_attackTimeout < GameTimeController.getInstance().getGameTicks()) && npc.canStopAttackByTime()))
|
||||
if ((target == null) || target.isAlikeDead())
|
||||
{
|
||||
// Stop hating this target after the attack timeout or if target is dead
|
||||
npc.stopHating(target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
|
||||
{
|
||||
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
|
||||
@ -673,6 +677,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
npc.setWalking();
|
||||
}
|
||||
|
||||
// Monster teleport to spawn
|
||||
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,6 @@ public class L2Attackable extends L2Npc
|
||||
private boolean _isReturningToSpawnPoint = false;
|
||||
private boolean _canReturnToSpawnPoint = true;
|
||||
private boolean _seeThroughSilentMove = false;
|
||||
private boolean _canStopAttackByTime = true;
|
||||
// Manor
|
||||
private boolean _seeded = false;
|
||||
private L2Seed _seed = null;
|
||||
@ -186,16 +185,6 @@ public class L2Attackable extends L2Npc
|
||||
_seeThroughSilentMove = val;
|
||||
}
|
||||
|
||||
public boolean canStopAttackByTime()
|
||||
{
|
||||
return _canStopAttackByTime;
|
||||
}
|
||||
|
||||
public void setCanStopAttackByTime(boolean val)
|
||||
{
|
||||
_canStopAttackByTime = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the skill if minimum checks are pass.
|
||||
* @param skill the skill
|
||||
|
@ -140,7 +140,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
guard.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
monster.reduceCurrentHp(1, guard, null);
|
||||
guard.setCanStopAttackByTime(false);
|
||||
|
||||
if ((guard.getId() != COMMANDO) && (guard.getId() != COMMANDO_CAPTAIN))
|
||||
{
|
||||
@ -161,7 +160,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
decoGuard.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
monster.reduceCurrentHp(1, decoGuard, null);
|
||||
decoGuard.setCanStopAttackByTime(false);
|
||||
decoGuard.setIsInvul(true);
|
||||
}
|
||||
}
|
||||
@ -303,7 +301,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
|
||||
commander.reduceCurrentHp(1, sakum, null); // TODO: Find better way for attack
|
||||
sakum.reduceCurrentHp(1, commander, null);
|
||||
commander.setCanStopAttackByTime(false);
|
||||
|
||||
notifyEvent("START_ATTACK", commander, null);
|
||||
}
|
||||
@ -319,7 +316,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
|
||||
commander.reduceCurrentHp(1, sakum, null); // TODO: Find better way for attack
|
||||
sakum.reduceCurrentHp(1, commander, null);
|
||||
commander.setCanStopAttackByTime(false);
|
||||
|
||||
notifyEvent("START_ATTACK", commander, null);
|
||||
}
|
||||
|
@ -521,7 +521,6 @@ public class Lindvior extends AbstractNpcAI
|
||||
}
|
||||
case LYN_DRACO_ATTACKER_GENERATORS:
|
||||
{
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("attack_generator", 10000, npc, null, true);
|
||||
break;
|
||||
|
@ -228,7 +228,6 @@ public final class ChamberOfProphecies extends AbstractInstance
|
||||
{
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
|
||||
{
|
||||
npc.setTarget(player);
|
||||
|
@ -300,7 +300,6 @@ public class NornilsGarden extends AbstractInstance
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
|
||||
{
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("check_agrro", 1000, npc, null, true);
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Chance to forget attackers after some time
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0) && npc.canStopAttackByTime())
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0))
|
||||
{
|
||||
npc.clearAggroList();
|
||||
npc.getAttackByList().clear();
|
||||
@ -661,11 +661,15 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Check if target is dead or if timeout is expired to stop this attack
|
||||
if ((target == null) || target.isAlikeDead() || ((_attackTimeout < GameTimeController.getInstance().getGameTicks()) && npc.canStopAttackByTime()))
|
||||
if ((target == null) || target.isAlikeDead())
|
||||
{
|
||||
// Stop hating this target after the attack timeout or if target is dead
|
||||
npc.stopHating(target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
|
||||
{
|
||||
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
|
||||
@ -673,6 +677,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
npc.setWalking();
|
||||
}
|
||||
|
||||
// Monster teleport to spawn
|
||||
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,6 @@ public class L2Attackable extends L2Npc
|
||||
private boolean _isReturningToSpawnPoint = false;
|
||||
private boolean _canReturnToSpawnPoint = true;
|
||||
private boolean _seeThroughSilentMove = false;
|
||||
private boolean _canStopAttackByTime = true;
|
||||
// Manor
|
||||
private boolean _seeded = false;
|
||||
private L2Seed _seed = null;
|
||||
@ -182,16 +181,6 @@ public class L2Attackable extends L2Npc
|
||||
_seeThroughSilentMove = val;
|
||||
}
|
||||
|
||||
public boolean canStopAttackByTime()
|
||||
{
|
||||
return _canStopAttackByTime;
|
||||
}
|
||||
|
||||
public void setCanStopAttackByTime(boolean val)
|
||||
{
|
||||
_canStopAttackByTime = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the skill if minimum checks are pass.
|
||||
* @param skill the skill
|
||||
|
@ -140,7 +140,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
guard.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
monster.reduceCurrentHp(1, guard, null);
|
||||
guard.setCanStopAttackByTime(false);
|
||||
|
||||
if ((guard.getId() != COMMANDO) && (guard.getId() != COMMANDO_CAPTAIN))
|
||||
{
|
||||
@ -161,7 +160,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
decoGuard.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
monster.reduceCurrentHp(1, decoGuard, null);
|
||||
decoGuard.setCanStopAttackByTime(false);
|
||||
decoGuard.setIsInvul(true);
|
||||
}
|
||||
}
|
||||
@ -303,7 +301,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
|
||||
commander.reduceCurrentHp(1, sakum, null); // TODO: Find better way for attack
|
||||
sakum.reduceCurrentHp(1, commander, null);
|
||||
commander.setCanStopAttackByTime(false);
|
||||
|
||||
notifyEvent("START_ATTACK", commander, null);
|
||||
}
|
||||
@ -319,7 +316,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
|
||||
commander.reduceCurrentHp(1, sakum, null); // TODO: Find better way for attack
|
||||
sakum.reduceCurrentHp(1, commander, null);
|
||||
commander.setCanStopAttackByTime(false);
|
||||
|
||||
notifyEvent("START_ATTACK", commander, null);
|
||||
}
|
||||
|
@ -521,7 +521,6 @@ public class Lindvior extends AbstractNpcAI
|
||||
}
|
||||
case LYN_DRACO_ATTACKER_GENERATORS:
|
||||
{
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("attack_generator", 10000, npc, null, true);
|
||||
break;
|
||||
|
@ -228,7 +228,6 @@ public final class ChamberOfProphecies extends AbstractInstance
|
||||
{
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
|
||||
{
|
||||
npc.setTarget(player);
|
||||
|
@ -300,7 +300,6 @@ public class NornilsGarden extends AbstractInstance
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
|
||||
{
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("check_agrro", 1000, npc, null, true);
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Chance to forget attackers after some time
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0) && npc.canStopAttackByTime())
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0))
|
||||
{
|
||||
npc.clearAggroList();
|
||||
npc.getAttackByList().clear();
|
||||
@ -661,11 +661,15 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Check if target is dead or if timeout is expired to stop this attack
|
||||
if ((target == null) || target.isAlikeDead() || ((_attackTimeout < GameTimeController.getInstance().getGameTicks()) && npc.canStopAttackByTime()))
|
||||
if ((target == null) || target.isAlikeDead())
|
||||
{
|
||||
// Stop hating this target after the attack timeout or if target is dead
|
||||
npc.stopHating(target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
|
||||
{
|
||||
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
|
||||
@ -673,6 +677,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
npc.setWalking();
|
||||
}
|
||||
|
||||
// Monster teleport to spawn
|
||||
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,6 @@ public class L2Attackable extends L2Npc
|
||||
private boolean _isReturningToSpawnPoint = false;
|
||||
private boolean _canReturnToSpawnPoint = true;
|
||||
private boolean _seeThroughSilentMove = false;
|
||||
private boolean _canStopAttackByTime = true;
|
||||
// Manor
|
||||
private boolean _seeded = false;
|
||||
private L2Seed _seed = null;
|
||||
@ -182,16 +181,6 @@ public class L2Attackable extends L2Npc
|
||||
_seeThroughSilentMove = val;
|
||||
}
|
||||
|
||||
public boolean canStopAttackByTime()
|
||||
{
|
||||
return _canStopAttackByTime;
|
||||
}
|
||||
|
||||
public void setCanStopAttackByTime(boolean val)
|
||||
{
|
||||
_canStopAttackByTime = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the skill if minimum checks are pass.
|
||||
* @param skill the skill
|
||||
|
@ -140,7 +140,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
guard.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
monster.reduceCurrentHp(1, guard, null);
|
||||
guard.setCanStopAttackByTime(false);
|
||||
|
||||
if ((guard.getId() != COMMANDO) && (guard.getId() != COMMANDO_CAPTAIN))
|
||||
{
|
||||
@ -161,7 +160,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
decoGuard.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
monster.reduceCurrentHp(1, decoGuard, null);
|
||||
decoGuard.setCanStopAttackByTime(false);
|
||||
decoGuard.setIsInvul(true);
|
||||
}
|
||||
}
|
||||
@ -303,7 +301,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
|
||||
commander.reduceCurrentHp(1, sakum, null); // TODO: Find better way for attack
|
||||
sakum.reduceCurrentHp(1, commander, null);
|
||||
commander.setCanStopAttackByTime(false);
|
||||
|
||||
notifyEvent("START_ATTACK", commander, null);
|
||||
}
|
||||
@ -319,7 +316,6 @@ public final class Wastelands extends AbstractNpcAI
|
||||
|
||||
commander.reduceCurrentHp(1, sakum, null); // TODO: Find better way for attack
|
||||
sakum.reduceCurrentHp(1, commander, null);
|
||||
commander.setCanStopAttackByTime(false);
|
||||
|
||||
notifyEvent("START_ATTACK", commander, null);
|
||||
}
|
||||
|
@ -521,7 +521,6 @@ public class Lindvior extends AbstractNpcAI
|
||||
}
|
||||
case LYN_DRACO_ATTACKER_GENERATORS:
|
||||
{
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("attack_generator", 10000, npc, null, true);
|
||||
break;
|
||||
|
@ -228,7 +228,6 @@ public final class ChamberOfProphecies extends AbstractInstance
|
||||
{
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
|
||||
{
|
||||
npc.setTarget(player);
|
||||
|
@ -300,7 +300,6 @@ public class NornilsGarden extends AbstractInstance
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
|
||||
{
|
||||
((L2Attackable) npc).setCanStopAttackByTime(false);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("check_agrro", 1000, npc, null, true);
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Chance to forget attackers after some time
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0) && npc.canStopAttackByTime())
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0))
|
||||
{
|
||||
npc.clearAggroList();
|
||||
npc.getAttackByList().clear();
|
||||
@ -661,11 +661,15 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Check if target is dead or if timeout is expired to stop this attack
|
||||
if ((target == null) || target.isAlikeDead() || ((_attackTimeout < GameTimeController.getInstance().getGameTicks()) && npc.canStopAttackByTime()))
|
||||
if ((target == null) || target.isAlikeDead())
|
||||
{
|
||||
// Stop hating this target after the attack timeout or if target is dead
|
||||
npc.stopHating(target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
|
||||
{
|
||||
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
|
||||
@ -673,6 +677,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
npc.setWalking();
|
||||
}
|
||||
|
||||
// Monster teleport to spawn
|
||||
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,6 @@ public class L2Attackable extends L2Npc
|
||||
private boolean _isReturningToSpawnPoint = false;
|
||||
private boolean _canReturnToSpawnPoint = true;
|
||||
private boolean _seeThroughSilentMove = false;
|
||||
private boolean _canStopAttackByTime = true;
|
||||
// Manor
|
||||
private boolean _seeded = false;
|
||||
private L2Seed _seed = null;
|
||||
@ -182,16 +181,6 @@ public class L2Attackable extends L2Npc
|
||||
_seeThroughSilentMove = val;
|
||||
}
|
||||
|
||||
public boolean canStopAttackByTime()
|
||||
{
|
||||
return _canStopAttackByTime;
|
||||
}
|
||||
|
||||
public void setCanStopAttackByTime(boolean val)
|
||||
{
|
||||
_canStopAttackByTime = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the skill if minimum checks are pass.
|
||||
* @param skill the skill
|
||||
|
@ -827,11 +827,15 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
|
||||
// Check if target is dead or if timeout is expired to stop this attack
|
||||
final L2Character originalAttackTarget = getAttackTarget();
|
||||
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead() || (_attackTimeout < GameTimeController.getInstance().getGameTicks()))
|
||||
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead())
|
||||
{
|
||||
// Stop hating this target after the attack timeout or if target is dead
|
||||
npc.stopHating(originalAttackTarget);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
|
||||
{
|
||||
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
|
||||
@ -839,6 +843,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
npc.setWalking();
|
||||
}
|
||||
|
||||
// Monster teleport to spawn
|
||||
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -505,7 +505,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Chance to forget attackers after some time
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0) && npc.canStopAttackByTime())
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0))
|
||||
{
|
||||
npc.clearAggroList();
|
||||
npc.getAttackByList().clear();
|
||||
@ -661,11 +661,15 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Check if target is dead or if timeout is expired to stop this attack
|
||||
if ((target == null) || target.isAlikeDead() || ((_attackTimeout < GameTimeController.getInstance().getGameTicks()) && npc.canStopAttackByTime()))
|
||||
if ((target == null) || target.isAlikeDead())
|
||||
{
|
||||
// Stop hating this target after the attack timeout or if target is dead
|
||||
npc.stopHating(target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
|
||||
{
|
||||
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
|
||||
@ -673,6 +677,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
npc.setWalking();
|
||||
}
|
||||
|
||||
// Monster teleport to spawn
|
||||
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,6 @@ public class L2Attackable extends L2Npc
|
||||
private boolean _isReturningToSpawnPoint = false;
|
||||
private boolean _canReturnToSpawnPoint = true;
|
||||
private boolean _seeThroughSilentMove = false;
|
||||
private boolean _canStopAttackByTime = true;
|
||||
// Manor
|
||||
private boolean _seeded = false;
|
||||
private L2Seed _seed = null;
|
||||
@ -182,16 +181,6 @@ public class L2Attackable extends L2Npc
|
||||
_seeThroughSilentMove = val;
|
||||
}
|
||||
|
||||
public boolean canStopAttackByTime()
|
||||
{
|
||||
return _canStopAttackByTime;
|
||||
}
|
||||
|
||||
public void setCanStopAttackByTime(boolean val)
|
||||
{
|
||||
_canStopAttackByTime = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the skill if minimum checks are pass.
|
||||
* @param skill the skill
|
||||
|
@ -505,7 +505,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Chance to forget attackers after some time
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0) && npc.canStopAttackByTime())
|
||||
if ((npc.getCurrentHp() == npc.getMaxHp()) && (npc.getCurrentMp() == npc.getMaxMp()) && !npc.getAttackByList().isEmpty() && (Rnd.nextInt(500) == 0))
|
||||
{
|
||||
npc.clearAggroList();
|
||||
npc.getAttackByList().clear();
|
||||
@ -661,11 +661,15 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Check if target is dead or if timeout is expired to stop this attack
|
||||
if ((target == null) || target.isAlikeDead() || ((_attackTimeout < GameTimeController.getInstance().getGameTicks()) && npc.canStopAttackByTime()))
|
||||
if ((target == null) || target.isAlikeDead())
|
||||
{
|
||||
// Stop hating this target after the attack timeout or if target is dead
|
||||
npc.stopHating(target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
|
||||
{
|
||||
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
|
||||
@ -673,6 +677,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
npc.setWalking();
|
||||
}
|
||||
|
||||
// Monster teleport to spawn
|
||||
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,6 @@ public class L2Attackable extends L2Npc
|
||||
private boolean _isReturningToSpawnPoint = false;
|
||||
private boolean _canReturnToSpawnPoint = true;
|
||||
private boolean _seeThroughSilentMove = false;
|
||||
private boolean _canStopAttackByTime = true;
|
||||
// Manor
|
||||
private boolean _seeded = false;
|
||||
private L2Seed _seed = null;
|
||||
@ -182,16 +181,6 @@ public class L2Attackable extends L2Npc
|
||||
_seeThroughSilentMove = val;
|
||||
}
|
||||
|
||||
public boolean canStopAttackByTime()
|
||||
{
|
||||
return _canStopAttackByTime;
|
||||
}
|
||||
|
||||
public void setCanStopAttackByTime(boolean val)
|
||||
{
|
||||
_canStopAttackByTime = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the skill if minimum checks are pass.
|
||||
* @param skill the skill
|
||||
|
Loading…
Reference in New Issue
Block a user