Changed L2Character setIsRunning visibility to private.

This commit is contained in:
MobiusDev
2017-11-26 14:31:26 +00:00
parent e016154fef
commit 67c073b42e
203 changed files with 637 additions and 469 deletions

View File

@@ -175,7 +175,7 @@ public final class Apherus extends AbstractNpcAI
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
final L2MonsterInstance protector = (L2MonsterInstance) addSpawn(APHERUS_DOOR_GUARD[getRandom(APHERUS_DOOR_GUARD.length)], player.getX() + getRandom(10, 30), player.getY() + getRandom(10, 30), player.getZ(), 0, false, 600000, false); final L2MonsterInstance protector = (L2MonsterInstance) addSpawn(APHERUS_DOOR_GUARD[getRandom(APHERUS_DOOR_GUARD.length)], player.getX() + getRandom(10, 30), player.getY() + getRandom(10, 30), player.getZ(), 0, false, 600000, false);
protector.setIsRunning(true); protector.setRunning();
protector.setTarget(player); protector.setTarget(player);
addAttackPlayerDesire(protector, player); addAttackPlayerDesire(protector, player);
} }

View File

@@ -147,7 +147,7 @@ public final class PlainsOfLizardman extends AbstractNpcAI
{ {
if ((monster.getId() == TANTA_MAGICIAN) || (monster.getId() == TANTA_SCOUT)) if ((monster.getId() == TANTA_MAGICIAN) || (monster.getId() == TANTA_SCOUT))
{ {
monster.setIsRunning(true); monster.setRunning();
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getX(), npc.getY(), npc.getZ(), 0)); monster.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getX(), npc.getY(), npc.getZ(), 0));
} }
}); });

View File

@@ -143,7 +143,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -157,7 +157,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -168,7 +168,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -298,7 +298,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
npc.setTarget(creature); npc.setTarget(creature);
npc.doCast(CREW_SKILL.getSkill()); npc.doCast(CREW_SKILL.getSkill());
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature);
} }
return super.onSeeCreature(npc, creature, isSummon); return super.onSeeCreature(npc, creature, isSummon);
@@ -424,7 +424,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
npc.getVariables().set("SELFBUFF_USED", 1); npc.getVariables().set("SELFBUFF_USED", 1);
npc.doCast(selfRangeBuff1.getSkill()); npc.doCast(selfRangeBuff1.getSkill());
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
} }

View File

@@ -94,7 +94,7 @@ public final class Maguen extends AbstractNpcAI
final L2Npc maguen = addSpawn(MAGUEN, npc.getLocation(), true, 60000, true); final L2Npc maguen = addSpawn(MAGUEN, npc.getLocation(), true, 60000, true);
maguen.getVariables().set("SUMMON_PLAYER", player); maguen.getVariables().set("SUMMON_PLAYER", player);
maguen.setTitle(player.getName()); maguen.setTitle(player.getName());
maguen.setIsRunning(true); maguen.setRunning();
maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
maguen.broadcastStatusUpdate(); maguen.broadcastStatusUpdate();
showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000); showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000);

View File

@@ -85,7 +85,7 @@ public final class Nemo extends AbstractNpcAI
maguen.getVariables().set("TEST_MAGUEN", 1); maguen.getVariables().set("TEST_MAGUEN", 1);
player.getVariables().set("TEST_MAGUEN", 1); player.getVariables().set("TEST_MAGUEN", 1);
maguen.setTitle(player.getName()); maguen.setTitle(player.getName());
maguen.setIsRunning(true); maguen.setRunning();
maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
maguen.broadcastStatusUpdate(); maguen.broadcastStatusUpdate();
showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000); showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000);

View File

@@ -246,7 +246,7 @@ public final class SelMahumDrill extends AbstractNpcAI
} }
receiver.disableCoreAI(true); receiver.disableCoreAI(true);
receiver.getVariables().set("BUSY_STATE", 1); receiver.getVariables().set("BUSY_STATE", 1);
receiver.setIsRunning(true); receiver.setRunning();
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((receiver.getX() + getRandom(-800, 800)), (receiver.getY() + getRandom(-800, 800)), receiver.getZ(), receiver.getHeading())); receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((receiver.getX() + getRandom(-800, 800)), (receiver.getY() + getRandom(-800, 800)), receiver.getZ(), receiver.getHeading()));
startQuestTimer("reset_busy_state", 5000, receiver, null); startQuestTimer("reset_busy_state", 5000, receiver, null);
} }

View File

@@ -139,7 +139,7 @@ public final class SelMahumSquad extends AbstractNpcAI
case "fire_arrived": case "fire_arrived":
{ {
// myself.i_quest0 = 1; // myself.i_quest0 = 1;
npc.setIsRunning(false); npc.setWalking();
npc.setTarget(npc); npc.setTarget(npc);
if (!npc.isRandomWalkingEnabled()) if (!npc.isRandomWalkingEnabled())
@@ -172,7 +172,7 @@ public final class SelMahumSquad extends AbstractNpcAI
case "remove_effects": case "remove_effects":
{ {
// myself.i_quest0 = 0; // myself.i_quest0 = 0;
npc.setIsRunning(true); npc.setRunning();
npc.setDisplayEffect(MAHUM_EFFECT_NONE); npc.setDisplayEffect(MAHUM_EFFECT_NONE);
break; break;
} }
@@ -244,7 +244,7 @@ public final class SelMahumSquad extends AbstractNpcAI
if (receiver.isRandomWalkingEnabled() && !receiver.isDead() && (receiver.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && CommonUtil.contains(SQUAD_LEADERS, receiver.getId())) if (receiver.isRandomWalkingEnabled() && !receiver.isDead() && (receiver.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && CommonUtil.contains(SQUAD_LEADERS, receiver.getId()))
{ {
receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1 receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1
receiver.setIsRunning(true); receiver.setRunning();
final Location loc = sender.getPointInRange(100, 200); final Location loc = sender.getPointInRange(100, 200);
loc.setHeading(receiver.getHeading()); loc.setHeading(receiver.getHeading());
receiver.stopMove(null); receiver.stopMove(null);
@@ -279,7 +279,7 @@ public final class SelMahumSquad extends AbstractNpcAI
} }
receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1 receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1
receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1 receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1
receiver.setIsRunning(true); receiver.setRunning();
receiver.broadcastSay(ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT); receiver.broadcastSay(ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT);
final Location loc = sender.getPointInRange(100, 200); final Location loc = sender.getPointInRange(100, 200);
loc.setHeading(receiver.getHeading()); loc.setHeading(receiver.getHeading());
@@ -386,7 +386,7 @@ public final class SelMahumSquad extends AbstractNpcAI
cancelQuestTimer("chef_set_invul", npc, null); cancelQuestTimer("chef_set_invul", npc, null);
npc.getVariables().remove("BUSY_STATE"); npc.getVariables().remove("BUSY_STATE");
npc.getVariables().remove("INVUL_REMOVE_TIMER_STARTED"); npc.getVariables().remove("INVUL_REMOVE_TIMER_STARTED");
npc.setIsRunning(false); npc.setWalking();
} }
} }

View File

@@ -74,7 +74,7 @@ public final class BoyAndGirl extends AbstractNpcAI
{ {
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
npc.setIsRunning(true); npc.setRunning();
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600); final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23); addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -58,7 +58,7 @@ public final class Anais extends AbstractNpcAI
{ {
final L2Npc npc = _divineBurners.get(pot); final L2Npc npc = _divineBurners.get(pot);
npc.setDisplayEffect(1); npc.setDisplayEffect(1);
npc.setIsRunning(false); npc.setWalking();
if (pot < 4) if (pot < 4)
{ {
_current = npc; _current = npc;
@@ -92,10 +92,10 @@ public final class Anais extends AbstractNpcAI
final L2Npc b = _divineBurners.get(_pot); final L2Npc b = _divineBurners.get(_pot);
_pot = _pot + 1; _pot = _pot + 1;
b.setDisplayEffect(1); b.setDisplayEffect(1);
b.setIsRunning(false); b.setWalking();
final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0); final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999); ((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999);
ward.setIsRunning(true); ward.setRunning();
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null); ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null);
startQuestTimer("GUARD_ATTACK", 1000, ward, _nextTarget, true); startQuestTimer("GUARD_ATTACK", 1000, ward, _nextTarget, true);
startQuestTimer("SUICIDE", 20000, ward, null); startQuestTimer("SUICIDE", 20000, ward, null);
@@ -127,7 +127,7 @@ public final class Anais extends AbstractNpcAI
if (_current != null) if (_current != null)
{ {
_current.setDisplayEffect(2); _current.setDisplayEffect(2);
_current.setIsRunning(false); _current.setWalking();
_current = null; _current = null;
} }
npc.doDie(null); npc.doDie(null);
@@ -175,7 +175,7 @@ public final class Anais extends AbstractNpcAI
if (_current != null) if (_current != null)
{ {
_current.setDisplayEffect(2); _current.setDisplayEffect(2);
_current.setIsRunning(false); _current.setWalking();
_current = null; _current = null;
} }
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);

View File

@@ -358,7 +358,7 @@ public final class Baium extends AbstractNpcAI
{ {
mob.clearAggroList(); mob.clearAggroList();
} }
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(_baium, 0, 999); mob.addDamageHate(_baium, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _baium); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _baium);
} }

View File

@@ -153,7 +153,7 @@ public final class BalokWarzone extends AbstractInstance
L2Npc minion = minionList.get(Rnd.get(minionList.size())); L2Npc minion = minionList.get(Rnd.get(minionList.size()));
if (minion != null) if (minion != null)
{ {
minion.setIsRunning(true); minion.setRunning();
((L2Attackable) minion).setCanReturnToSpawnPoint(false); ((L2Attackable) minion).setCanReturnToSpawnPoint(false);
currentMinion = minion; currentMinion = minion;
getTimers().addTimer("stage_last_minion_walk", 2000, minion, player); getTimers().addTimer("stage_last_minion_walk", 2000, minion, player);

View File

@@ -75,7 +75,7 @@ public final class IceQueensCastle extends AbstractInstance
{ {
if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed()) if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed())
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob);
((L2Attackable) npc).addDamageHate(mob, 0, 999999); ((L2Attackable) npc).addDamageHate(mob, 0, 999999);
} }
@@ -151,7 +151,7 @@ public final class IceQueensCastle extends AbstractInstance
{ {
if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed()) if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed())
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob);
((L2Attackable) npc).addDamageHate(mob, 0, 999999); ((L2Attackable) npc).addDamageHate(mob, 0, 999999);
} }

View File

@@ -382,7 +382,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (npc.getVariables().getInt("FREYA_MOVE") == 0) if (npc.getVariables().getInt("FREYA_MOVE") == 0)
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
break; break;
@@ -431,14 +431,14 @@ public final class IceQueensCastleBattle extends AbstractInstance
manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4); manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4);
final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId()); final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
jinia.setIsRunning(true); jinia.setRunning();
jinia.setIsInvul(true); jinia.setIsInvul(true);
jinia.setCanReturnToSpawnPoint(false); jinia.setCanReturnToSpawnPoint(false);
jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
freya.reduceCurrentHp(1, jinia, null); freya.reduceCurrentHp(1, jinia, null);
final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId()); final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
kegor.setIsRunning(true); kegor.setRunning();
kegor.setIsInvul(true); kegor.setIsInvul(true);
kegor.setCanReturnToSpawnPoint(false); kegor.setCanReturnToSpawnPoint(false);
kegor.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack kegor.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
@@ -673,7 +673,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getId()); final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getId());
breath.setIsRunning(true); breath.setRunning();
breath.addDamageHate(mob.getMostHated(), 0, 999); breath.addDamageHate(mob.getMostHated(), 0, 999);
breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob.getMostHated()); breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob.getMostHated());
startQuestTimer("BLIZZARD", 20000, breath, null); startQuestTimer("BLIZZARD", 20000, breath, null);
@@ -751,7 +751,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE); manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -825,7 +825,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (controller.getVariables().getInt("FREYA_MOVE") == 0) if (controller.getVariables().getInt("FREYA_MOVE") == 0)
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -1042,7 +1042,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), false, 0, false, world.getId()); final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), false, 0, false, world.getId());
if (player != null) if (player != null)
{ {
breath.setIsRunning(true); breath.setRunning();
breath.addDamageHate(player, 0, 999); breath.addDamageHate(player, 0, 999);
breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
} }
@@ -1116,7 +1116,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE); manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE);
final L2Npc freya = params.getObject("freya", L2Npc.class); final L2Npc freya = params.getObject("freya", L2Npc.class);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -1173,7 +1173,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (target != null) if (target != null)
{ {
((L2Attackable) mob).addDamageHate(target, 0, 999); ((L2Attackable) mob).addDamageHate(target, 0, 999);
mob.setIsRunning(true); mob.setRunning();
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
else else

View File

@@ -103,7 +103,7 @@ public final class KimerianCommon extends AbstractInstance
} }
else if (!npc.isAttackingNow() && (distance > 250)) else if (!npc.isAttackingNow() && (distance > 250))
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, new Location(player.getX() + getRandom(-100, 100), player.getY() + getRandom(-100, 100), player.getZ() + 50), 23); addMoveToDesire(npc, new Location(player.getX() + getRandom(-100, 100), player.getY() + getRandom(-100, 100), player.getZ() + 50), 23);
} }
else if (!npc.isInCombat() || !npc.isAttackingNow() || (npc.getTarget() == null)) else if (!npc.isInCombat() || !npc.isAttackingNow() || (npc.getTarget() == null))
@@ -270,7 +270,7 @@ public final class KimerianCommon extends AbstractInstance
getTimers().addTimer("KIMERIAN_CHAT_1", 5000, t -> kimerian.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_WILL_COME_BACK_ALIVE_WITH_ROTTING_AURA)); getTimers().addTimer("KIMERIAN_CHAT_1", 5000, t -> kimerian.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_WILL_COME_BACK_ALIVE_WITH_ROTTING_AURA));
getTimers().addTimer("KIMERIAN_RUN", 6000, t -> getTimers().addTimer("KIMERIAN_RUN", 6000, t ->
{ {
kimerian.setIsRunning(true); kimerian.setRunning();
addMoveToDesire(kimerian, loc, 23); addMoveToDesire(kimerian, loc, 23);
kimerian.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HA_HA_HA_HA); kimerian.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HA_HA_HA_HA);
}); });
@@ -309,7 +309,7 @@ public final class KimerianCommon extends AbstractInstance
case NEOMI_KASHERON: case NEOMI_KASHERON:
{ {
npc.initSeenCreatures(); npc.initSeenCreatures();
npc.setIsRunning(true); npc.setRunning();
break; break;
} }
case INVISIBLE_NPC: case INVISIBLE_NPC:

View File

@@ -140,14 +140,14 @@ public class Vortex extends AbstractNpcAI
{ {
attackRandomTarget(npc); attackRandomTarget(npc);
npc.setRandomWalking(true); npc.setRandomWalking(true);
npc.setIsRunning(true); npc.setRunning();
break; break;
} }
case BIG_VORTEX: case BIG_VORTEX:
{ {
attackRandomTarget(npc); attackRandomTarget(npc);
npc.setRandomWalking(true); npc.setRandomWalking(true);
npc.setIsRunning(true); npc.setRunning();
break; break;
} }
} }

View File

@@ -187,7 +187,7 @@ public final class OctavisWarzone extends AbstractInstance
((L2Attackable) beasts).setCanReturnToSpawnPoint(false); ((L2Attackable) beasts).setCanReturnToSpawnPoint(false);
final L2Npc octavis = addSpawn((!isExtremeMode(world) ? OCTAVIS_STAGE_1[0] : OCTAVIS_STAGE_1[1]), OCTAVIS_SPAWN_LOC, false, 0, false, world.getId()); final L2Npc octavis = addSpawn((!isExtremeMode(world) ? OCTAVIS_STAGE_1[0] : OCTAVIS_STAGE_1[1]), OCTAVIS_SPAWN_LOC, false, 0, false, world.getId());
octavis.disableCoreAI(true); octavis.disableCoreAI(true);
octavis.setIsRunning(true); octavis.setRunning();
octavis.sendChannelingEffect(beasts, 1); octavis.sendChannelingEffect(beasts, 1);
octavis.setTargetable(false); octavis.setTargetable(false);
((L2Attackable) octavis).setCanReturnToSpawnPoint(false); ((L2Attackable) octavis).setCanReturnToSpawnPoint(false);
@@ -286,7 +286,7 @@ public final class OctavisWarzone extends AbstractInstance
if ((moveX != 0) && (moveY != 0)) if ((moveX != 0) && (moveY != 0))
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, new Location(moveX, moveY, -10008), 23); addMoveToDesire(npc, new Location(moveX, moveY, -10008), 23);
} }
break; break;
@@ -299,7 +299,7 @@ public final class OctavisWarzone extends AbstractInstance
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
final L2Npc beast = addSpawn((!isExtremeMode(world) ? BEASTS_MINIONS[0] : BEASTS_MINIONS[1]), loc, false, 0, false, world.getId()); final L2Npc beast = addSpawn((!isExtremeMode(world) ? BEASTS_MINIONS[0] : BEASTS_MINIONS[1]), loc, false, 0, false, world.getId());
beast.setIsRunning(true); beast.setRunning();
((L2Attackable) beast).setCanReturnToSpawnPoint(false); ((L2Attackable) beast).setCanReturnToSpawnPoint(false);
addMoveToDesire(beast, Util.getRandomPosition(BEASTS_RANDOM_POINT, 500, 500), 23); addMoveToDesire(beast, Util.getRandomPosition(BEASTS_RANDOM_POINT, 500, 500), 23);
} }

View File

@@ -110,14 +110,14 @@ public final class Minigame extends AbstractNpcAI
if (npc.getId() == BURNER) if (npc.getId() == BURNER)
{ {
npc.setDisplayEffect(2); npc.setDisplayEffect(2);
npc.setIsRunning(false); npc.setWalking();
} }
else else
{ {
for (L2Npc burner : room.getBurners()) for (L2Npc burner : room.getBurners())
{ {
burner.setDisplayEffect(2); burner.setDisplayEffect(2);
burner.setIsRunning(false); burner.setWalking();
} }
} }
break; break;
@@ -145,7 +145,7 @@ public final class Minigame extends AbstractNpcAI
{ {
final L2Npc b = room.getBurners()[room.getOrder()[room.getCurrentPot()]]; final L2Npc b = room.getBurners()[room.getOrder()[room.getCurrentPot()]];
b.setDisplayEffect(1); b.setDisplayEffect(1);
b.setIsRunning(false); b.setWalking();
startQuestTimer("off", 2000, b, null); // Stopping burning each pot 2s after startQuestTimer("off", 2000, b, null); // Stopping burning each pot 2s after
startQuestTimer("timer", TIMER_INTERVAL * 1000, npc, null); startQuestTimer("timer", TIMER_INTERVAL * 1000, npc, null);
room.setCurrentPot(room.getCurrentPot() + 1); room.setCurrentPot(room.getCurrentPot() + 1);
@@ -276,7 +276,7 @@ public final class Minigame extends AbstractNpcAI
if (room.getCurrentPot() < 8) if (room.getCurrentPot() < 8)
{ {
npc.setDisplayEffect(1); npc.setDisplayEffect(1);
npc.setIsRunning(false); npc.setWalking();
startQuestTimer("off", 2000, npc, null); startQuestTimer("off", 2000, npc, null);
room.setCurrentPot(room.getCurrentPot() + 1); room.setCurrentPot(room.getCurrentPot() + 1);
} }
@@ -419,7 +419,7 @@ public final class Minigame extends AbstractNpcAI
for (L2Npc burner : _burners) for (L2Npc burner : _burners)
{ {
burner.setDisplayEffect(1); burner.setDisplayEffect(1);
burner.setIsRunning(false); burner.setWalking();
} }
} }

View File

@@ -186,7 +186,7 @@ public final class SummonNpc extends AbstractEffect
{ {
npc.scheduleDespawn(_despawnDelay); npc.scheduleDespawn(_despawnDelay);
} }
npc.setIsRunning(false); // TODO: Fix broadcast info. npc.setWalking(); // TODO: Fix broadcast info.
} }
} }
} }

View File

@@ -22,13 +22,20 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
/** /**
* Run/Walk player action handler. * Run/Walk player action handler.
* @author UnAfraid * @author Mobius
*/ */
public final class RunWalk implements IPlayerActionHandler public final class RunWalk implements IPlayerActionHandler
{ {
@Override @Override
public void useAction(L2PcInstance activeChar, ActionDataHolder data, boolean ctrlPressed, boolean shiftPressed) public void useAction(L2PcInstance activeChar, ActionDataHolder data, boolean ctrlPressed, boolean shiftPressed)
{ {
activeChar.setIsRunning(!activeChar.isRunning()); if (activeChar.isRunning())
{
activeChar.setWalking();
}
else
{
activeChar.setRunning();
}
} }
} }

View File

@@ -226,7 +226,7 @@ public final class ChamberOfProphecies extends AbstractInstance
case "ATTACK1": case "ATTACK1":
case "ATTACK2": case "ATTACK2":
{ {
npc.setIsRunning(true); npc.setRunning();
((L2Attackable) npc).setCanReturnToSpawnPoint(false); ((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false); ((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty()) if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())

View File

@@ -119,7 +119,7 @@ public final class KartiaHelperAdolph extends AbstractNpcAI
if (!npc.isInsideRadius(loc, 50, true, true)) if (!npc.isInsideRadius(loc, 50, true, true))
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, loc, 23); addMoveToDesire(npc, loc, 23);
} }
} }

View File

@@ -88,7 +88,7 @@ public final class KartiaHelperBarton extends AbstractNpcAI
} }
else else
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, loc, 23); addMoveToDesire(npc, loc, 23);
} }
} }

View File

@@ -227,7 +227,7 @@ public final class KartiaHelperElise extends AbstractNpcAI
} }
else else
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, loc, 23); addMoveToDesire(npc, loc, 23);
} }
} }

View File

@@ -284,7 +284,7 @@ public final class KartiasLabyrinth extends AbstractInstance
{ {
final Location loc = instance.getTemplateParameters().getLocation("middlePointRoom1"); final Location loc = instance.getTemplateParameters().getLocation("middlePointRoom1");
final Location moveTo = new Location(loc.getX() + getRandom(-100, 100), loc.getY() + getRandom(-100, 100), loc.getZ()); final Location moveTo = new Location(loc.getX() + getRandom(-100, 100), loc.getY() + getRandom(-100, 100), loc.getZ());
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, moveTo, 6); addMoveToDesire(npc, moveTo, 6);
getTimers().addTimer("START_MOVE", 15000, npc, null); getTimers().addTimer("START_MOVE", 15000, npc, null);
} }
@@ -292,7 +292,7 @@ public final class KartiasLabyrinth extends AbstractInstance
{ {
final Location loc = instance.getTemplateParameters().getLocation("middlePointRoom3"); final Location loc = instance.getTemplateParameters().getLocation("middlePointRoom3");
final Location moveTo = new Location(loc.getX() + getRandom(-200, 200), loc.getY() + getRandom(-200, 200), loc.getZ()); final Location moveTo = new Location(loc.getX() + getRandom(-200, 200), loc.getY() + getRandom(-200, 200), loc.getZ());
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, moveTo, 23); addMoveToDesire(npc, moveTo, 23);
} }
} }

View File

@@ -445,7 +445,7 @@ public final class LabyrinthOfBelis extends AbstractInstance
public String onSpawn(L2Npc npc) public String onSpawn(L2Npc npc)
{ {
final L2Attackable officer = (L2Attackable) npc; final L2Attackable officer = (L2Attackable) npc;
officer.setIsRunning(true); officer.setRunning();
officer.setCanReturnToSpawnPoint(false); officer.setCanReturnToSpawnPoint(false);
getTimers().addRepeatingTimer("MESSAGE", 6000, npc, null); getTimers().addRepeatingTimer("MESSAGE", 6000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
@@ -499,7 +499,7 @@ public final class LabyrinthOfBelis extends AbstractInstance
showOnScreenMsg(player, (getRandomBoolean() ? NpcStringId.IF_TERAIN_DIES_THE_MISSION_WILL_FAIL : NpcStringId.BEHIND_YOU_THE_ENEMY_IS_AMBUSHING_YOU), ExShowScreenMessage.TOP_CENTER, 4500); showOnScreenMsg(player, (getRandomBoolean() ? NpcStringId.IF_TERAIN_DIES_THE_MISSION_WILL_FAIL : NpcStringId.BEHIND_YOU_THE_ENEMY_IS_AMBUSHING_YOU), ExShowScreenMessage.TOP_CENTER, 4500);
final L2Attackable mob = (L2Attackable) addSpawn((getRandomBoolean() ? OPERATIVE : HANDYMAN), SPAWN_ATTACKERS, false, 0, true, world.getId()); final L2Attackable mob = (L2Attackable) addSpawn((getRandomBoolean() ? OPERATIVE : HANDYMAN), SPAWN_ATTACKERS, false, 0, true, world.getId());
mob.setIsRunning(true); mob.setRunning();
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, ATTACKER_SPOT); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, ATTACKER_SPOT);
mob.broadcastSay(ChatType.NPC_GENERAL, (getRandomBoolean() ? NpcStringId.KILL_THE_GUY_MESSING_WITH_THE_ELECTRIC_DEVICE : NpcStringId.FOCUS_ON_ATTACKING_THE_GUY_IN_THE_ROOM)); mob.broadcastSay(ChatType.NPC_GENERAL, (getRandomBoolean() ? NpcStringId.KILL_THE_GUY_MESSING_WITH_THE_ELECTRIC_DEVICE : NpcStringId.FOCUS_ON_ATTACKING_THE_GUY_IN_THE_ROOM));
mob.addDamageHate(npc, 0, 9999); mob.addDamageHate(npc, 0, 9999);

View File

@@ -283,7 +283,7 @@ public final class MemoryOfDisaster extends AbstractInstance
case "AWAKENING_GUIDE": case "AWAKENING_GUIDE":
{ {
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, AWAKENING_GUIDE_MOVE_1); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, AWAKENING_GUIDE_MOVE_1);
npc.setIsRunning(true); npc.setRunning();
break; break;
} }
default: default:
@@ -323,13 +323,13 @@ public final class MemoryOfDisaster extends AbstractInstance
} }
case WIRPHY: case WIRPHY:
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, WIRPHY_MOVE, 23); addMoveToDesire(npc, WIRPHY_MOVE, 23);
break; break;
} }
case SILVERA: case SILVERA:
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, SILVERA_MOVE, 23); addMoveToDesire(npc, SILVERA_MOVE, 23);
break; break;
} }
@@ -470,7 +470,7 @@ public final class MemoryOfDisaster extends AbstractInstance
player.getInstanceWorld().spawnGroup("ROGIN").forEach(n -> player.getInstanceWorld().spawnGroup("ROGIN").forEach(n ->
{ {
addMoveToDesire(n, ROGIN_MOVE, 23); addMoveToDesire(n, ROGIN_MOVE, 23);
n.setIsRunning(true); n.setRunning();
}); });
break; break;
} }
@@ -583,7 +583,7 @@ public final class MemoryOfDisaster extends AbstractInstance
{ {
npc.getInstanceWorld().getNpcs(DWARVES).forEach(n -> npc.getInstanceWorld().getNpcs(DWARVES).forEach(n ->
{ {
n.setIsRunning(true); n.setRunning();
n.broadcastSay(ChatType.NPC_GENERAL, SHOUT_RUN[Rnd.get(SHOUT_RUN.length)]); n.broadcastSay(ChatType.NPC_GENERAL, SHOUT_RUN[Rnd.get(SHOUT_RUN.length)]);
n.getAI().moveTo(DWARVES_MOVE_1); n.getAI().moveTo(DWARVES_MOVE_1);
}); });
@@ -915,7 +915,7 @@ public final class MemoryOfDisaster extends AbstractInstance
{ {
if (skill.getId() == SIEGE_GOLEM_SKILL_1.getSkillId()) if (skill.getId() == SIEGE_GOLEM_SKILL_1.getSkillId())
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().moveTo(GOLEM_MOVE); npc.getAI().moveTo(GOLEM_MOVE);
} }
break; break;

View File

@@ -84,7 +84,7 @@ public final class MithrilMine extends AbstractInstance
for (L2Npc n : npcs) for (L2Npc n : npcs)
{ {
n.setScriptValue(1); n.setScriptValue(1);
n.setIsRunning(true); n.setRunning();
n.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc); n.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
((L2Attackable) n).addDamageHate(npc, 0, 999999); ((L2Attackable) n).addDamageHate(npc, 0, 999999);
} }

View File

@@ -82,7 +82,7 @@ public final class MuseumDungeon extends AbstractInstance
desk.getVariables().set("book", true); desk.getVariables().set("book", true);
// Set Toyron // Set Toyron
toyron.setIsRunning(true); toyron.setRunning();
toyron.setCanReturnToSpawnPoint(false); toyron.setCanReturnToSpawnPoint(false);
} }
@@ -128,7 +128,7 @@ public final class MuseumDungeon extends AbstractInstance
final List<L2Npc> thiefs = world.spawnGroup("thiefs"); final List<L2Npc> thiefs = world.spawnGroup("thiefs");
for (L2Npc thief : thiefs) for (L2Npc thief : thiefs)
{ {
thief.setIsRunning(true); thief.setRunning();
addAttackPlayerDesire(thief, player); addAttackPlayerDesire(thief, player);
thief.broadcastSay(ChatType.NPC_GENERAL, THIEF_SHOUT[getRandom(2)]); thief.broadcastSay(ChatType.NPC_GENERAL, THIEF_SHOUT[getRandom(2)]);
} }
@@ -143,7 +143,7 @@ public final class MuseumDungeon extends AbstractInstance
final List<L2Npc> thiefs = world.spawnGroup("thiefs"); final List<L2Npc> thiefs = world.spawnGroup("thiefs");
for (L2Npc thief : thiefs) for (L2Npc thief : thiefs)
{ {
thief.setIsRunning(true); thief.setRunning();
} }
break; break;
} }

View File

@@ -352,7 +352,7 @@ public final class Nursery extends AbstractInstance
if (getRandom(100) < 4) if (getRandom(100) < 4)
{ {
final L2Npc maguen = addSpawn(MAGUEN, npc, false, 0, false, instance.getId()); final L2Npc maguen = addSpawn(MAGUEN, npc, false, 0, false, instance.getId());
maguen.setIsRunning(true); maguen.setRunning();
maguen.getAI().startFollow(killer); maguen.getAI().startFollow(killer);
showOnScreenMsg(instance, NpcStringId.MAGUEN_APPEARANCE, ExShowScreenMessage.MIDDLE_CENTER, 4000); showOnScreenMsg(instance, NpcStringId.MAGUEN_APPEARANCE, ExShowScreenMessage.MIDDLE_CENTER, 4000);
getTimers().addTimer("MAGUEN_WAIT_TIMER", 4000, maguen, killer); getTimers().addTimer("MAGUEN_WAIT_TIMER", 4000, maguen, killer);

View File

@@ -184,7 +184,7 @@ public final class PailakaDevilsLegacy extends AbstractInstance
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
npc.setScriptValue(1); npc.setScriptValue(1);
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, LEMATAN_PORT_POINT); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, LEMATAN_PORT_POINT);
} }
break; break;

View File

@@ -87,7 +87,7 @@ public final class SSQLibraryOfSages extends AbstractInstance
} }
case "FOLLOW": case "FOLLOW":
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().startFollow(player); npc.getAI().startFollow(player);
npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]); npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
startQuestTimer("FOLLOW", 10000, npc, player); startQuestTimer("FOLLOW", 10000, npc, player);

View File

@@ -194,7 +194,7 @@ public final class SSQMonasteryOfSilence extends AbstractInstance
{ {
return null; return null;
} }
npc.setIsRunning(true); npc.setRunning();
npc.getAI().startFollow(player); npc.getAI().startFollow(player);
if (player.isInCombat()) if (player.isInCombat())
{ {

View File

@@ -87,7 +87,7 @@ public final class TalkingIslandPast extends AbstractInstance
{ {
final L2Npc knight = addSpawn(MYSTERIOUS_DARK_KNIGHT, TI_LOC_3, false, 0, false, instance.getId()); final L2Npc knight = addSpawn(MYSTERIOUS_DARK_KNIGHT, TI_LOC_3, false, 0, false, instance.getId());
knight.getAI().startFollow(player); knight.getAI().startFollow(player);
knight.setIsRunning(true); knight.setRunning();
showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000);
getTimers().addTimer("MSG", null, 5000, null, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000)); getTimers().addTimer("MSG", null, 5000, null, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000));
} }
@@ -129,7 +129,7 @@ public final class TalkingIslandPast extends AbstractInstance
qs.setMemoState(2); qs.setMemoState(2);
final L2Npc knight = addSpawn(MYSTERIOUS_DARK_KNIGHT, loc, false, 0, false, instance.getId()); final L2Npc knight = addSpawn(MYSTERIOUS_DARK_KNIGHT, loc, false, 0, false, instance.getId());
knight.getAI().startFollow(player); knight.getAI().startFollow(player);
knight.setIsRunning(true); knight.setRunning();
showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000);
getTimers().addTimer("MSG", null, 5000, npc, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000)); getTimers().addTimer("MSG", null, 5000, npc, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000));
} }

View File

@@ -153,7 +153,7 @@ public final class Q10326_RespectYourElders extends Quest
{ {
npc.getVariables().set("OWNER", player); npc.getVariables().set("OWNER", player);
npc.setTitle(player.getName()); npc.setTitle(player.getName());
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, HANDERMONKEY_LOC[0], 0); addMoveToDesire(npc, HANDERMONKEY_LOC[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);

View File

@@ -188,7 +188,7 @@ public final class Q10329_BackupSeekers extends Quest
if (qs.isMemoState(1)) if (qs.isMemoState(1))
{ {
npc.setSummoner(player); npc.setSummoner(player);
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, BART_LOC_1[0], 0); addMoveToDesire(npc, BART_LOC_1[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);
@@ -199,7 +199,7 @@ public final class Q10329_BackupSeekers extends Quest
else if (qs.isMemoState(2)) else if (qs.isMemoState(2))
{ {
npc.setSummoner(player); npc.setSummoner(player);
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, BART_LOC_2[0], 0); addMoveToDesire(npc, BART_LOC_2[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);

View File

@@ -203,7 +203,7 @@ public final class Q10365_SeekerEscort extends Quest
{ {
if (qs.isMemoState(1)) if (qs.isMemoState(1))
{ {
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, BLOODHOUND_LOC_1[0], 0); addMoveToDesire(npc, BLOODHOUND_LOC_1[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);
@@ -211,7 +211,7 @@ public final class Q10365_SeekerEscort extends Quest
} }
else if (qs.isMemoState(2)) else if (qs.isMemoState(2))
{ {
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, BLOODHOUND_LOC_2[0], 0); addMoveToDesire(npc, BLOODHOUND_LOC_2[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);

View File

@@ -110,7 +110,7 @@ public final class Q10742_AFurryFriend extends Quest
final L2Npc ricky = addSpawn(RICKY, player, true, 120000); final L2Npc ricky = addSpawn(RICKY, player, true, 120000);
ricky.setSummoner(player); ricky.setSummoner(player);
ricky.setTitle(player.getName()); ricky.setTitle(player.getName());
ricky.setIsRunning(true); ricky.setRunning();
ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player); startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player);
} }

View File

@@ -676,7 +676,10 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
// Set the AI Intention to AI_INTENTION_ACTIVE // Set the AI Intention to AI_INTENTION_ACTIVE
setIntention(AI_INTENTION_ACTIVE); setIntention(AI_INTENTION_ACTIVE);
npc.setWalking(); if (!_actor.isFakePlayer())
{
npc.setWalking();
}
return; return;
} }

View File

@@ -825,7 +825,7 @@ public class L2CharacterAI extends AbstractAI
// Kill the actor client side by sending Server->Client packet AutoAttackStop, StopMove/StopRotation, Die (broadcast) // Kill the actor client side by sending Server->Client packet AutoAttackStop, StopMove/StopRotation, Die (broadcast)
clientNotifyDead(); clientNotifyDead();
if (!_actor.isPlayable()) if (!_actor.isPlayable() && !_actor.isFakePlayer())
{ {
_actor.setWalking(); _actor.setWalking();
} }

View File

@@ -299,7 +299,14 @@ public final class WalkingManager implements IGameXmlReader
} }
npc.sendDebugMessage("Starting to move at route '" + routeName + "'"); npc.sendDebugMessage("Starting to move at route '" + routeName + "'");
npc.setIsRunning(node.runToLocation()); if (node.runToLocation())
{
npc.setRunning();
}
else
{
npc.setWalking();
}
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
walk.setWalkCheckTask(ThreadPoolManager.scheduleAtFixedRate(new StartMovingTask(npc, routeName), 60000, 60000)); // start walk check task, for resuming walk after fight walk.setWalkCheckTask(ThreadPoolManager.scheduleAtFixedRate(new StartMovingTask(npc, routeName), 60000, 60000)); // start walk check task, for resuming walk after fight
@@ -332,7 +339,14 @@ public final class WalkingManager implements IGameXmlReader
walk.setBlocked(true); walk.setBlocked(true);
final L2NpcWalkerNode node = walk.getCurrentNode(); final L2NpcWalkerNode node = walk.getCurrentNode();
npc.sendDebugMessage("Route '" + routeName + "', continuing to node " + walk.getCurrentNodeId()); npc.sendDebugMessage("Route '" + routeName + "', continuing to node " + walk.getCurrentNodeId());
npc.setIsRunning(node.runToLocation()); if (node.runToLocation())
{
npc.setRunning();
}
else
{
npc.setWalking();
}
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
walk.setBlocked(false); walk.setBlocked(false);
walk.setStoppedByAttack(false); walk.setStoppedByAttack(false);

View File

@@ -772,7 +772,10 @@ public class L2Attackable extends L2Npc
((L2AttackableAI) getAI()).setGlobalAggro(-25); ((L2AttackableAI) getAI()).setGlobalAggro(-25);
clearAggroList(); clearAggroList();
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
setWalking(); if (!isFakePlayer())
{
setWalking();
}
} }
return; return;
} }
@@ -790,7 +793,10 @@ public class L2Attackable extends L2Npc
((L2AttackableAI) getAI()).setGlobalAggro(-25); ((L2AttackableAI) getAI()).setGlobalAggro(-25);
clearAggroList(); clearAggroList();
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
setWalking(); if (!isFakePlayer())
{
setWalking();
}
} }
} }
@@ -1461,14 +1467,16 @@ public class L2Attackable extends L2Npc
setScriptValue(0); // remove pvp flag setScriptValue(0); // remove pvp flag
setRunning(); // don't walk setRunning(); // don't walk
} }
else
{
setWalking();
}
// Clear mod Seeded stat // Clear mod Seeded stat
_seeded = false; _seeded = false;
_seed = null; _seed = null;
_seederObjId = 0; _seederObjId = 0;
setWalking();
// check the region where this mob is, do not activate the AI if region is inactive. // check the region where this mob is, do not activate the AI if region is inactive.
// if (!isInActiveRegion()) // if (!isInActiveRegion())
// { // {
@@ -1799,7 +1807,10 @@ public class L2Attackable extends L2Npc
{ {
((L2AttackableAI) getAI()).setGlobalAggro(-25); ((L2AttackableAI) getAI()).setGlobalAggro(-25);
} }
setWalking(); if (!isFakePlayer())
{
setWalking();
}
clearAggroList(); clearAggroList();
} }
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);

View File

@@ -2307,7 +2307,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return _isRunning; return _isRunning;
} }
public final void setIsRunning(boolean value) private final void setIsRunning(boolean value)
{ {
if (_isRunning == value) if (_isRunning == value)
{ {
@@ -2355,10 +2355,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
/** Set the L2Character movement type to run and send Server->Client packet ChangeMoveType to all others L2PcInstance. */ /** Set the L2Character movement type to run and send Server->Client packet ChangeMoveType to all others L2PcInstance. */
public final void setRunning() public final void setRunning()
{ {
if (!isRunning()) setIsRunning(true);
{
setIsRunning(true);
}
} }
public final boolean hasBlockActions() public final boolean hasBlockActions()

View File

@@ -3199,7 +3199,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{ {
((L2Attackable) npc).addDamageHate(target, 0, desire); ((L2Attackable) npc).addDamageHate(target, 0, desire);
} }
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -3210,7 +3210,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
*/ */
protected void addAttackDesire(L2Npc npc, L2Character target) protected void addAttackDesire(L2Npc npc, L2Character target)
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }

View File

@@ -175,7 +175,7 @@ public final class Apherus extends AbstractNpcAI
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
final L2MonsterInstance protector = (L2MonsterInstance) addSpawn(APHERUS_DOOR_GUARD[getRandom(APHERUS_DOOR_GUARD.length)], player.getX() + getRandom(10, 30), player.getY() + getRandom(10, 30), player.getZ(), 0, false, 600000, false); final L2MonsterInstance protector = (L2MonsterInstance) addSpawn(APHERUS_DOOR_GUARD[getRandom(APHERUS_DOOR_GUARD.length)], player.getX() + getRandom(10, 30), player.getY() + getRandom(10, 30), player.getZ(), 0, false, 600000, false);
protector.setIsRunning(true); protector.setRunning();
protector.setTarget(player); protector.setTarget(player);
addAttackPlayerDesire(protector, player); addAttackPlayerDesire(protector, player);
} }

View File

@@ -147,7 +147,7 @@ public final class PlainsOfLizardman extends AbstractNpcAI
{ {
if ((monster.getId() == TANTA_MAGICIAN) || (monster.getId() == TANTA_SCOUT)) if ((monster.getId() == TANTA_MAGICIAN) || (monster.getId() == TANTA_SCOUT))
{ {
monster.setIsRunning(true); monster.setRunning();
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getX(), npc.getY(), npc.getZ(), 0)); monster.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getX(), npc.getY(), npc.getZ(), 0));
} }
}); });

View File

@@ -143,7 +143,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -157,7 +157,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -168,7 +168,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -298,7 +298,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
npc.setTarget(creature); npc.setTarget(creature);
npc.doCast(CREW_SKILL.getSkill()); npc.doCast(CREW_SKILL.getSkill());
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature);
} }
return super.onSeeCreature(npc, creature, isSummon); return super.onSeeCreature(npc, creature, isSummon);
@@ -424,7 +424,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
npc.getVariables().set("SELFBUFF_USED", 1); npc.getVariables().set("SELFBUFF_USED", 1);
npc.doCast(selfRangeBuff1.getSkill()); npc.doCast(selfRangeBuff1.getSkill());
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
} }

View File

@@ -94,7 +94,7 @@ public final class Maguen extends AbstractNpcAI
final L2Npc maguen = addSpawn(MAGUEN, npc.getLocation(), true, 60000, true); final L2Npc maguen = addSpawn(MAGUEN, npc.getLocation(), true, 60000, true);
maguen.getVariables().set("SUMMON_PLAYER", player); maguen.getVariables().set("SUMMON_PLAYER", player);
maguen.setTitle(player.getName()); maguen.setTitle(player.getName());
maguen.setIsRunning(true); maguen.setRunning();
maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
maguen.broadcastStatusUpdate(); maguen.broadcastStatusUpdate();
showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000); showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000);

View File

@@ -85,7 +85,7 @@ public final class Nemo extends AbstractNpcAI
maguen.getVariables().set("TEST_MAGUEN", 1); maguen.getVariables().set("TEST_MAGUEN", 1);
player.getVariables().set("TEST_MAGUEN", 1); player.getVariables().set("TEST_MAGUEN", 1);
maguen.setTitle(player.getName()); maguen.setTitle(player.getName());
maguen.setIsRunning(true); maguen.setRunning();
maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
maguen.broadcastStatusUpdate(); maguen.broadcastStatusUpdate();
showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000); showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000);

View File

@@ -246,7 +246,7 @@ public final class SelMahumDrill extends AbstractNpcAI
} }
receiver.disableCoreAI(true); receiver.disableCoreAI(true);
receiver.getVariables().set("BUSY_STATE", 1); receiver.getVariables().set("BUSY_STATE", 1);
receiver.setIsRunning(true); receiver.setRunning();
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((receiver.getX() + getRandom(-800, 800)), (receiver.getY() + getRandom(-800, 800)), receiver.getZ(), receiver.getHeading())); receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((receiver.getX() + getRandom(-800, 800)), (receiver.getY() + getRandom(-800, 800)), receiver.getZ(), receiver.getHeading()));
startQuestTimer("reset_busy_state", 5000, receiver, null); startQuestTimer("reset_busy_state", 5000, receiver, null);
} }

View File

@@ -139,7 +139,7 @@ public final class SelMahumSquad extends AbstractNpcAI
case "fire_arrived": case "fire_arrived":
{ {
// myself.i_quest0 = 1; // myself.i_quest0 = 1;
npc.setIsRunning(false); npc.setWalking();
npc.setTarget(npc); npc.setTarget(npc);
if (!npc.isRandomWalkingEnabled()) if (!npc.isRandomWalkingEnabled())
@@ -172,7 +172,7 @@ public final class SelMahumSquad extends AbstractNpcAI
case "remove_effects": case "remove_effects":
{ {
// myself.i_quest0 = 0; // myself.i_quest0 = 0;
npc.setIsRunning(true); npc.setRunning();
npc.setDisplayEffect(MAHUM_EFFECT_NONE); npc.setDisplayEffect(MAHUM_EFFECT_NONE);
break; break;
} }
@@ -244,7 +244,7 @@ public final class SelMahumSquad extends AbstractNpcAI
if (receiver.isRandomWalkingEnabled() && !receiver.isDead() && (receiver.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && CommonUtil.contains(SQUAD_LEADERS, receiver.getId())) if (receiver.isRandomWalkingEnabled() && !receiver.isDead() && (receiver.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && CommonUtil.contains(SQUAD_LEADERS, receiver.getId()))
{ {
receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1 receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1
receiver.setIsRunning(true); receiver.setRunning();
final Location loc = sender.getPointInRange(100, 200); final Location loc = sender.getPointInRange(100, 200);
loc.setHeading(receiver.getHeading()); loc.setHeading(receiver.getHeading());
receiver.stopMove(null); receiver.stopMove(null);
@@ -279,7 +279,7 @@ public final class SelMahumSquad extends AbstractNpcAI
} }
receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1 receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1
receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1 receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1
receiver.setIsRunning(true); receiver.setRunning();
receiver.broadcastSay(ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT); receiver.broadcastSay(ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT);
final Location loc = sender.getPointInRange(100, 200); final Location loc = sender.getPointInRange(100, 200);
loc.setHeading(receiver.getHeading()); loc.setHeading(receiver.getHeading());
@@ -386,7 +386,7 @@ public final class SelMahumSquad extends AbstractNpcAI
cancelQuestTimer("chef_set_invul", npc, null); cancelQuestTimer("chef_set_invul", npc, null);
npc.getVariables().remove("BUSY_STATE"); npc.getVariables().remove("BUSY_STATE");
npc.getVariables().remove("INVUL_REMOVE_TIMER_STARTED"); npc.getVariables().remove("INVUL_REMOVE_TIMER_STARTED");
npc.setIsRunning(false); npc.setWalking();
} }
} }

View File

@@ -74,7 +74,7 @@ public final class BoyAndGirl extends AbstractNpcAI
{ {
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
npc.setIsRunning(true); npc.setRunning();
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600); final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23); addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -58,7 +58,7 @@ public final class Anais extends AbstractNpcAI
{ {
final L2Npc npc = _divineBurners.get(pot); final L2Npc npc = _divineBurners.get(pot);
npc.setDisplayEffect(1); npc.setDisplayEffect(1);
npc.setIsRunning(false); npc.setWalking();
if (pot < 4) if (pot < 4)
{ {
_current = npc; _current = npc;
@@ -92,10 +92,10 @@ public final class Anais extends AbstractNpcAI
final L2Npc b = _divineBurners.get(_pot); final L2Npc b = _divineBurners.get(_pot);
_pot = _pot + 1; _pot = _pot + 1;
b.setDisplayEffect(1); b.setDisplayEffect(1);
b.setIsRunning(false); b.setWalking();
final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0); final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999); ((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999);
ward.setIsRunning(true); ward.setRunning();
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null); ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null);
startQuestTimer("GUARD_ATTACK", 1000, ward, _nextTarget, true); startQuestTimer("GUARD_ATTACK", 1000, ward, _nextTarget, true);
startQuestTimer("SUICIDE", 20000, ward, null); startQuestTimer("SUICIDE", 20000, ward, null);
@@ -127,7 +127,7 @@ public final class Anais extends AbstractNpcAI
if (_current != null) if (_current != null)
{ {
_current.setDisplayEffect(2); _current.setDisplayEffect(2);
_current.setIsRunning(false); _current.setWalking();
_current = null; _current = null;
} }
npc.doDie(null); npc.doDie(null);
@@ -175,7 +175,7 @@ public final class Anais extends AbstractNpcAI
if (_current != null) if (_current != null)
{ {
_current.setDisplayEffect(2); _current.setDisplayEffect(2);
_current.setIsRunning(false); _current.setWalking();
_current = null; _current = null;
} }
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);

View File

@@ -358,7 +358,7 @@ public final class Baium extends AbstractNpcAI
{ {
mob.clearAggroList(); mob.clearAggroList();
} }
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(_baium, 0, 999); mob.addDamageHate(_baium, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _baium); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _baium);
} }

View File

@@ -153,7 +153,7 @@ public final class BalokWarzone extends AbstractInstance
L2Npc minion = minionList.get(Rnd.get(minionList.size())); L2Npc minion = minionList.get(Rnd.get(minionList.size()));
if (minion != null) if (minion != null)
{ {
minion.setIsRunning(true); minion.setRunning();
((L2Attackable) minion).setCanReturnToSpawnPoint(false); ((L2Attackable) minion).setCanReturnToSpawnPoint(false);
currentMinion = minion; currentMinion = minion;
getTimers().addTimer("stage_last_minion_walk", 2000, minion, player); getTimers().addTimer("stage_last_minion_walk", 2000, minion, player);

View File

@@ -75,7 +75,7 @@ public final class IceQueensCastle extends AbstractInstance
{ {
if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed()) if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed())
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob);
((L2Attackable) npc).addDamageHate(mob, 0, 999999); ((L2Attackable) npc).addDamageHate(mob, 0, 999999);
} }
@@ -151,7 +151,7 @@ public final class IceQueensCastle extends AbstractInstance
{ {
if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed()) if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed())
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob);
((L2Attackable) npc).addDamageHate(mob, 0, 999999); ((L2Attackable) npc).addDamageHate(mob, 0, 999999);
} }

View File

@@ -382,7 +382,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (npc.getVariables().getInt("FREYA_MOVE") == 0) if (npc.getVariables().getInt("FREYA_MOVE") == 0)
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
break; break;
@@ -431,14 +431,14 @@ public final class IceQueensCastleBattle extends AbstractInstance
manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4); manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4);
final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId()); final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
jinia.setIsRunning(true); jinia.setRunning();
jinia.setIsInvul(true); jinia.setIsInvul(true);
jinia.setCanReturnToSpawnPoint(false); jinia.setCanReturnToSpawnPoint(false);
jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
freya.reduceCurrentHp(1, jinia, null); freya.reduceCurrentHp(1, jinia, null);
final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId()); final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
kegor.setIsRunning(true); kegor.setRunning();
kegor.setIsInvul(true); kegor.setIsInvul(true);
kegor.setCanReturnToSpawnPoint(false); kegor.setCanReturnToSpawnPoint(false);
kegor.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack kegor.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
@@ -673,7 +673,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getId()); final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getId());
breath.setIsRunning(true); breath.setRunning();
breath.addDamageHate(mob.getMostHated(), 0, 999); breath.addDamageHate(mob.getMostHated(), 0, 999);
breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob.getMostHated()); breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob.getMostHated());
startQuestTimer("BLIZZARD", 20000, breath, null); startQuestTimer("BLIZZARD", 20000, breath, null);
@@ -751,7 +751,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE); manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -825,7 +825,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (controller.getVariables().getInt("FREYA_MOVE") == 0) if (controller.getVariables().getInt("FREYA_MOVE") == 0)
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -1042,7 +1042,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), false, 0, false, world.getId()); final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), false, 0, false, world.getId());
if (player != null) if (player != null)
{ {
breath.setIsRunning(true); breath.setRunning();
breath.addDamageHate(player, 0, 999); breath.addDamageHate(player, 0, 999);
breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
} }
@@ -1116,7 +1116,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE); manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE);
final L2Npc freya = params.getObject("freya", L2Npc.class); final L2Npc freya = params.getObject("freya", L2Npc.class);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -1173,7 +1173,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (target != null) if (target != null)
{ {
((L2Attackable) mob).addDamageHate(target, 0, 999); ((L2Attackable) mob).addDamageHate(target, 0, 999);
mob.setIsRunning(true); mob.setRunning();
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
else else

View File

@@ -201,14 +201,14 @@ public class Kelbim extends AbstractNpcAI
for (int i = 0; i < Rnd.get((_bossStage * 5) / 2, _bossStage * 5); i++) for (int i = 0; i < Rnd.get((_bossStage * 5) / 2, _bossStage * 5); i++)
{ {
L2Npc minion = addSpawn(KELBIM_GUARD, _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0); L2Npc minion = addSpawn(KELBIM_GUARD, _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0);
minion.setIsRunning(true); minion.setRunning();
((L2Attackable) minion).setIsRaidMinion(true); ((L2Attackable) minion).setIsRaidMinion(true);
_minions.add(minion); _minions.add(minion);
} }
for (int i = 0; i < Rnd.get((_bossStage * 2) / 2, _bossStage * 2); i++) for (int i = 0; i < Rnd.get((_bossStage * 2) / 2, _bossStage * 2); i++)
{ {
L2Npc minion = addSpawn(KELBIM_GUARDIANS[Rnd.get(KELBIM_GUARDIANS.length)], _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0); L2Npc minion = addSpawn(KELBIM_GUARDIANS[Rnd.get(KELBIM_GUARDIANS.length)], _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0);
minion.setIsRunning(true); minion.setRunning();
((L2Attackable) minion).setIsRaidMinion(true); ((L2Attackable) minion).setIsRaidMinion(true);
_minions.add(minion); _minions.add(minion);
} }

View File

@@ -103,7 +103,7 @@ public final class KimerianCommon extends AbstractInstance
} }
else if (!npc.isAttackingNow() && (distance > 250)) else if (!npc.isAttackingNow() && (distance > 250))
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, new Location(player.getX() + getRandom(-100, 100), player.getY() + getRandom(-100, 100), player.getZ() + 50), 23); addMoveToDesire(npc, new Location(player.getX() + getRandom(-100, 100), player.getY() + getRandom(-100, 100), player.getZ() + 50), 23);
} }
else if (!npc.isInCombat() || !npc.isAttackingNow() || (npc.getTarget() == null)) else if (!npc.isInCombat() || !npc.isAttackingNow() || (npc.getTarget() == null))
@@ -270,7 +270,7 @@ public final class KimerianCommon extends AbstractInstance
getTimers().addTimer("KIMERIAN_CHAT_1", 5000, t -> kimerian.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_WILL_COME_BACK_ALIVE_WITH_ROTTING_AURA)); getTimers().addTimer("KIMERIAN_CHAT_1", 5000, t -> kimerian.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_WILL_COME_BACK_ALIVE_WITH_ROTTING_AURA));
getTimers().addTimer("KIMERIAN_RUN", 6000, t -> getTimers().addTimer("KIMERIAN_RUN", 6000, t ->
{ {
kimerian.setIsRunning(true); kimerian.setRunning();
addMoveToDesire(kimerian, loc, 23); addMoveToDesire(kimerian, loc, 23);
kimerian.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HA_HA_HA_HA); kimerian.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HA_HA_HA_HA);
}); });
@@ -309,7 +309,7 @@ public final class KimerianCommon extends AbstractInstance
case NEOMI_KASHERON: case NEOMI_KASHERON:
{ {
npc.initSeenCreatures(); npc.initSeenCreatures();
npc.setIsRunning(true); npc.setRunning();
break; break;
} }
case INVISIBLE_NPC: case INVISIBLE_NPC:

View File

@@ -140,14 +140,14 @@ public class Vortex extends AbstractNpcAI
{ {
attackRandomTarget(npc); attackRandomTarget(npc);
npc.setRandomWalking(true); npc.setRandomWalking(true);
npc.setIsRunning(true); npc.setRunning();
break; break;
} }
case BIG_VORTEX: case BIG_VORTEX:
{ {
attackRandomTarget(npc); attackRandomTarget(npc);
npc.setRandomWalking(true); npc.setRandomWalking(true);
npc.setIsRunning(true); npc.setRunning();
break; break;
} }
} }

View File

@@ -187,7 +187,7 @@ public final class OctavisWarzone extends AbstractInstance
((L2Attackable) beasts).setCanReturnToSpawnPoint(false); ((L2Attackable) beasts).setCanReturnToSpawnPoint(false);
final L2Npc octavis = addSpawn((!isExtremeMode(world) ? OCTAVIS_STAGE_1[0] : OCTAVIS_STAGE_1[1]), OCTAVIS_SPAWN_LOC, false, 0, false, world.getId()); final L2Npc octavis = addSpawn((!isExtremeMode(world) ? OCTAVIS_STAGE_1[0] : OCTAVIS_STAGE_1[1]), OCTAVIS_SPAWN_LOC, false, 0, false, world.getId());
octavis.disableCoreAI(true); octavis.disableCoreAI(true);
octavis.setIsRunning(true); octavis.setRunning();
octavis.sendChannelingEffect(beasts, 1); octavis.sendChannelingEffect(beasts, 1);
octavis.setTargetable(false); octavis.setTargetable(false);
((L2Attackable) octavis).setCanReturnToSpawnPoint(false); ((L2Attackable) octavis).setCanReturnToSpawnPoint(false);
@@ -286,7 +286,7 @@ public final class OctavisWarzone extends AbstractInstance
if ((moveX != 0) && (moveY != 0)) if ((moveX != 0) && (moveY != 0))
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, new Location(moveX, moveY, -10008), 23); addMoveToDesire(npc, new Location(moveX, moveY, -10008), 23);
} }
break; break;
@@ -299,7 +299,7 @@ public final class OctavisWarzone extends AbstractInstance
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
final L2Npc beast = addSpawn((!isExtremeMode(world) ? BEASTS_MINIONS[0] : BEASTS_MINIONS[1]), loc, false, 0, false, world.getId()); final L2Npc beast = addSpawn((!isExtremeMode(world) ? BEASTS_MINIONS[0] : BEASTS_MINIONS[1]), loc, false, 0, false, world.getId());
beast.setIsRunning(true); beast.setRunning();
((L2Attackable) beast).setCanReturnToSpawnPoint(false); ((L2Attackable) beast).setCanReturnToSpawnPoint(false);
addMoveToDesire(beast, Util.getRandomPosition(BEASTS_RANDOM_POINT, 500, 500), 23); addMoveToDesire(beast, Util.getRandomPosition(BEASTS_RANDOM_POINT, 500, 500), 23);
} }

View File

@@ -110,14 +110,14 @@ public final class Minigame extends AbstractNpcAI
if (npc.getId() == BURNER) if (npc.getId() == BURNER)
{ {
npc.setDisplayEffect(2); npc.setDisplayEffect(2);
npc.setIsRunning(false); npc.setWalking();
} }
else else
{ {
for (L2Npc burner : room.getBurners()) for (L2Npc burner : room.getBurners())
{ {
burner.setDisplayEffect(2); burner.setDisplayEffect(2);
burner.setIsRunning(false); burner.setWalking();
} }
} }
break; break;
@@ -145,7 +145,7 @@ public final class Minigame extends AbstractNpcAI
{ {
final L2Npc b = room.getBurners()[room.getOrder()[room.getCurrentPot()]]; final L2Npc b = room.getBurners()[room.getOrder()[room.getCurrentPot()]];
b.setDisplayEffect(1); b.setDisplayEffect(1);
b.setIsRunning(false); b.setWalking();
startQuestTimer("off", 2000, b, null); // Stopping burning each pot 2s after startQuestTimer("off", 2000, b, null); // Stopping burning each pot 2s after
startQuestTimer("timer", TIMER_INTERVAL * 1000, npc, null); startQuestTimer("timer", TIMER_INTERVAL * 1000, npc, null);
room.setCurrentPot(room.getCurrentPot() + 1); room.setCurrentPot(room.getCurrentPot() + 1);
@@ -276,7 +276,7 @@ public final class Minigame extends AbstractNpcAI
if (room.getCurrentPot() < 8) if (room.getCurrentPot() < 8)
{ {
npc.setDisplayEffect(1); npc.setDisplayEffect(1);
npc.setIsRunning(false); npc.setWalking();
startQuestTimer("off", 2000, npc, null); startQuestTimer("off", 2000, npc, null);
room.setCurrentPot(room.getCurrentPot() + 1); room.setCurrentPot(room.getCurrentPot() + 1);
} }
@@ -419,7 +419,7 @@ public final class Minigame extends AbstractNpcAI
for (L2Npc burner : _burners) for (L2Npc burner : _burners)
{ {
burner.setDisplayEffect(1); burner.setDisplayEffect(1);
burner.setIsRunning(false); burner.setWalking();
} }
} }

View File

@@ -186,7 +186,7 @@ public final class SummonNpc extends AbstractEffect
{ {
npc.scheduleDespawn(_despawnDelay); npc.scheduleDespawn(_despawnDelay);
} }
npc.setIsRunning(false); // TODO: Fix broadcast info. npc.setWalking(); // TODO: Fix broadcast info.
} }
} }
} }

View File

@@ -22,13 +22,20 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
/** /**
* Run/Walk player action handler. * Run/Walk player action handler.
* @author UnAfraid * @author Mobius
*/ */
public final class RunWalk implements IPlayerActionHandler public final class RunWalk implements IPlayerActionHandler
{ {
@Override @Override
public void useAction(L2PcInstance activeChar, ActionDataHolder data, boolean ctrlPressed, boolean shiftPressed) public void useAction(L2PcInstance activeChar, ActionDataHolder data, boolean ctrlPressed, boolean shiftPressed)
{ {
activeChar.setIsRunning(!activeChar.isRunning()); if (activeChar.isRunning())
{
activeChar.setWalking();
}
else
{
activeChar.setRunning();
}
} }
} }

View File

@@ -226,7 +226,7 @@ public final class ChamberOfProphecies extends AbstractInstance
case "ATTACK1": case "ATTACK1":
case "ATTACK2": case "ATTACK2":
{ {
npc.setIsRunning(true); npc.setRunning();
((L2Attackable) npc).setCanReturnToSpawnPoint(false); ((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false); ((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty()) if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())

View File

@@ -119,7 +119,7 @@ public final class KartiaHelperAdolph extends AbstractNpcAI
if (!npc.isInsideRadius(loc, 50, true, true)) if (!npc.isInsideRadius(loc, 50, true, true))
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, loc, 23); addMoveToDesire(npc, loc, 23);
} }
} }

View File

@@ -88,7 +88,7 @@ public final class KartiaHelperBarton extends AbstractNpcAI
} }
else else
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, loc, 23); addMoveToDesire(npc, loc, 23);
} }
} }

View File

@@ -227,7 +227,7 @@ public final class KartiaHelperElise extends AbstractNpcAI
} }
else else
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, loc, 23); addMoveToDesire(npc, loc, 23);
} }
} }

View File

@@ -284,7 +284,7 @@ public final class KartiasLabyrinth extends AbstractInstance
{ {
final Location loc = instance.getTemplateParameters().getLocation("middlePointRoom1"); final Location loc = instance.getTemplateParameters().getLocation("middlePointRoom1");
final Location moveTo = new Location(loc.getX() + getRandom(-100, 100), loc.getY() + getRandom(-100, 100), loc.getZ()); final Location moveTo = new Location(loc.getX() + getRandom(-100, 100), loc.getY() + getRandom(-100, 100), loc.getZ());
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, moveTo, 6); addMoveToDesire(npc, moveTo, 6);
getTimers().addTimer("START_MOVE", 15000, npc, null); getTimers().addTimer("START_MOVE", 15000, npc, null);
} }
@@ -292,7 +292,7 @@ public final class KartiasLabyrinth extends AbstractInstance
{ {
final Location loc = instance.getTemplateParameters().getLocation("middlePointRoom3"); final Location loc = instance.getTemplateParameters().getLocation("middlePointRoom3");
final Location moveTo = new Location(loc.getX() + getRandom(-200, 200), loc.getY() + getRandom(-200, 200), loc.getZ()); final Location moveTo = new Location(loc.getX() + getRandom(-200, 200), loc.getY() + getRandom(-200, 200), loc.getZ());
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, moveTo, 23); addMoveToDesire(npc, moveTo, 23);
} }
} }

View File

@@ -445,7 +445,7 @@ public final class LabyrinthOfBelis extends AbstractInstance
public String onSpawn(L2Npc npc) public String onSpawn(L2Npc npc)
{ {
final L2Attackable officer = (L2Attackable) npc; final L2Attackable officer = (L2Attackable) npc;
officer.setIsRunning(true); officer.setRunning();
officer.setCanReturnToSpawnPoint(false); officer.setCanReturnToSpawnPoint(false);
getTimers().addRepeatingTimer("MESSAGE", 6000, npc, null); getTimers().addRepeatingTimer("MESSAGE", 6000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
@@ -499,7 +499,7 @@ public final class LabyrinthOfBelis extends AbstractInstance
showOnScreenMsg(player, (getRandomBoolean() ? NpcStringId.IF_TERAIN_DIES_THE_MISSION_WILL_FAIL : NpcStringId.BEHIND_YOU_THE_ENEMY_IS_AMBUSHING_YOU), ExShowScreenMessage.TOP_CENTER, 4500); showOnScreenMsg(player, (getRandomBoolean() ? NpcStringId.IF_TERAIN_DIES_THE_MISSION_WILL_FAIL : NpcStringId.BEHIND_YOU_THE_ENEMY_IS_AMBUSHING_YOU), ExShowScreenMessage.TOP_CENTER, 4500);
final L2Attackable mob = (L2Attackable) addSpawn((getRandomBoolean() ? OPERATIVE : HANDYMAN), SPAWN_ATTACKERS, false, 0, true, world.getId()); final L2Attackable mob = (L2Attackable) addSpawn((getRandomBoolean() ? OPERATIVE : HANDYMAN), SPAWN_ATTACKERS, false, 0, true, world.getId());
mob.setIsRunning(true); mob.setRunning();
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, ATTACKER_SPOT); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, ATTACKER_SPOT);
mob.broadcastSay(ChatType.NPC_GENERAL, (getRandomBoolean() ? NpcStringId.KILL_THE_GUY_MESSING_WITH_THE_ELECTRIC_DEVICE : NpcStringId.FOCUS_ON_ATTACKING_THE_GUY_IN_THE_ROOM)); mob.broadcastSay(ChatType.NPC_GENERAL, (getRandomBoolean() ? NpcStringId.KILL_THE_GUY_MESSING_WITH_THE_ELECTRIC_DEVICE : NpcStringId.FOCUS_ON_ATTACKING_THE_GUY_IN_THE_ROOM));
mob.addDamageHate(npc, 0, 9999); mob.addDamageHate(npc, 0, 9999);

View File

@@ -283,7 +283,7 @@ public final class MemoryOfDisaster extends AbstractInstance
case "AWAKENING_GUIDE": case "AWAKENING_GUIDE":
{ {
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, AWAKENING_GUIDE_MOVE_1); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, AWAKENING_GUIDE_MOVE_1);
npc.setIsRunning(true); npc.setRunning();
break; break;
} }
default: default:
@@ -323,13 +323,13 @@ public final class MemoryOfDisaster extends AbstractInstance
} }
case WIRPHY: case WIRPHY:
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, WIRPHY_MOVE, 23); addMoveToDesire(npc, WIRPHY_MOVE, 23);
break; break;
} }
case SILVERA: case SILVERA:
{ {
npc.setIsRunning(true); npc.setRunning();
addMoveToDesire(npc, SILVERA_MOVE, 23); addMoveToDesire(npc, SILVERA_MOVE, 23);
break; break;
} }
@@ -470,7 +470,7 @@ public final class MemoryOfDisaster extends AbstractInstance
player.getInstanceWorld().spawnGroup("ROGIN").forEach(n -> player.getInstanceWorld().spawnGroup("ROGIN").forEach(n ->
{ {
addMoveToDesire(n, ROGIN_MOVE, 23); addMoveToDesire(n, ROGIN_MOVE, 23);
n.setIsRunning(true); n.setRunning();
}); });
break; break;
} }
@@ -583,7 +583,7 @@ public final class MemoryOfDisaster extends AbstractInstance
{ {
npc.getInstanceWorld().getNpcs(DWARVES).forEach(n -> npc.getInstanceWorld().getNpcs(DWARVES).forEach(n ->
{ {
n.setIsRunning(true); n.setRunning();
n.broadcastSay(ChatType.NPC_GENERAL, SHOUT_RUN[Rnd.get(SHOUT_RUN.length)]); n.broadcastSay(ChatType.NPC_GENERAL, SHOUT_RUN[Rnd.get(SHOUT_RUN.length)]);
n.getAI().moveTo(DWARVES_MOVE_1); n.getAI().moveTo(DWARVES_MOVE_1);
}); });
@@ -915,7 +915,7 @@ public final class MemoryOfDisaster extends AbstractInstance
{ {
if (skill.getId() == SIEGE_GOLEM_SKILL_1.getSkillId()) if (skill.getId() == SIEGE_GOLEM_SKILL_1.getSkillId())
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().moveTo(GOLEM_MOVE); npc.getAI().moveTo(GOLEM_MOVE);
} }
break; break;

View File

@@ -84,7 +84,7 @@ public final class MithrilMine extends AbstractInstance
for (L2Npc n : npcs) for (L2Npc n : npcs)
{ {
n.setScriptValue(1); n.setScriptValue(1);
n.setIsRunning(true); n.setRunning();
n.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc); n.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
((L2Attackable) n).addDamageHate(npc, 0, 999999); ((L2Attackable) n).addDamageHate(npc, 0, 999999);
} }

View File

@@ -82,7 +82,7 @@ public final class MuseumDungeon extends AbstractInstance
desk.getVariables().set("book", true); desk.getVariables().set("book", true);
// Set Toyron // Set Toyron
toyron.setIsRunning(true); toyron.setRunning();
toyron.setCanReturnToSpawnPoint(false); toyron.setCanReturnToSpawnPoint(false);
} }
@@ -128,7 +128,7 @@ public final class MuseumDungeon extends AbstractInstance
final List<L2Npc> thiefs = world.spawnGroup("thiefs"); final List<L2Npc> thiefs = world.spawnGroup("thiefs");
for (L2Npc thief : thiefs) for (L2Npc thief : thiefs)
{ {
thief.setIsRunning(true); thief.setRunning();
addAttackPlayerDesire(thief, player); addAttackPlayerDesire(thief, player);
thief.broadcastSay(ChatType.NPC_GENERAL, THIEF_SHOUT[getRandom(2)]); thief.broadcastSay(ChatType.NPC_GENERAL, THIEF_SHOUT[getRandom(2)]);
} }
@@ -143,7 +143,7 @@ public final class MuseumDungeon extends AbstractInstance
final List<L2Npc> thiefs = world.spawnGroup("thiefs"); final List<L2Npc> thiefs = world.spawnGroup("thiefs");
for (L2Npc thief : thiefs) for (L2Npc thief : thiefs)
{ {
thief.setIsRunning(true); thief.setRunning();
} }
break; break;
} }

View File

@@ -352,7 +352,7 @@ public final class Nursery extends AbstractInstance
if (getRandom(100) < 4) if (getRandom(100) < 4)
{ {
final L2Npc maguen = addSpawn(MAGUEN, npc, false, 0, false, instance.getId()); final L2Npc maguen = addSpawn(MAGUEN, npc, false, 0, false, instance.getId());
maguen.setIsRunning(true); maguen.setRunning();
maguen.getAI().startFollow(killer); maguen.getAI().startFollow(killer);
showOnScreenMsg(instance, NpcStringId.MAGUEN_APPEARANCE, ExShowScreenMessage.MIDDLE_CENTER, 4000); showOnScreenMsg(instance, NpcStringId.MAGUEN_APPEARANCE, ExShowScreenMessage.MIDDLE_CENTER, 4000);
getTimers().addTimer("MAGUEN_WAIT_TIMER", 4000, maguen, killer); getTimers().addTimer("MAGUEN_WAIT_TIMER", 4000, maguen, killer);

View File

@@ -184,7 +184,7 @@ public final class PailakaDevilsLegacy extends AbstractInstance
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
npc.setScriptValue(1); npc.setScriptValue(1);
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, LEMATAN_PORT_POINT); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, LEMATAN_PORT_POINT);
} }
break; break;

View File

@@ -87,7 +87,7 @@ public final class SSQLibraryOfSages extends AbstractInstance
} }
case "FOLLOW": case "FOLLOW":
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().startFollow(player); npc.getAI().startFollow(player);
npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]); npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
startQuestTimer("FOLLOW", 10000, npc, player); startQuestTimer("FOLLOW", 10000, npc, player);

View File

@@ -194,7 +194,7 @@ public final class SSQMonasteryOfSilence extends AbstractInstance
{ {
return null; return null;
} }
npc.setIsRunning(true); npc.setRunning();
npc.getAI().startFollow(player); npc.getAI().startFollow(player);
if (player.isInCombat()) if (player.isInCombat())
{ {

View File

@@ -87,7 +87,7 @@ public final class TalkingIslandPast extends AbstractInstance
{ {
final L2Npc knight = addSpawn(MYSTERIOUS_DARK_KNIGHT, TI_LOC_3, false, 0, false, instance.getId()); final L2Npc knight = addSpawn(MYSTERIOUS_DARK_KNIGHT, TI_LOC_3, false, 0, false, instance.getId());
knight.getAI().startFollow(player); knight.getAI().startFollow(player);
knight.setIsRunning(true); knight.setRunning();
showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000);
getTimers().addTimer("MSG", null, 5000, null, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000)); getTimers().addTimer("MSG", null, 5000, null, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000));
} }
@@ -129,7 +129,7 @@ public final class TalkingIslandPast extends AbstractInstance
qs.setMemoState(2); qs.setMemoState(2);
final L2Npc knight = addSpawn(MYSTERIOUS_DARK_KNIGHT, loc, false, 0, false, instance.getId()); final L2Npc knight = addSpawn(MYSTERIOUS_DARK_KNIGHT, loc, false, 0, false, instance.getId());
knight.getAI().startFollow(player); knight.getAI().startFollow(player);
knight.setIsRunning(true); knight.setRunning();
showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000);
getTimers().addTimer("MSG", null, 5000, npc, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000)); getTimers().addTimer("MSG", null, 5000, npc, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000));
} }

View File

@@ -153,7 +153,7 @@ public final class Q10326_RespectYourElders extends Quest
{ {
npc.getVariables().set("OWNER", player); npc.getVariables().set("OWNER", player);
npc.setTitle(player.getName()); npc.setTitle(player.getName());
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, HANDERMONKEY_LOC[0], 0); addMoveToDesire(npc, HANDERMONKEY_LOC[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);

View File

@@ -188,7 +188,7 @@ public final class Q10329_BackupSeekers extends Quest
if (qs.isMemoState(1)) if (qs.isMemoState(1))
{ {
npc.setSummoner(player); npc.setSummoner(player);
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, BART_LOC_1[0], 0); addMoveToDesire(npc, BART_LOC_1[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);
@@ -199,7 +199,7 @@ public final class Q10329_BackupSeekers extends Quest
else if (qs.isMemoState(2)) else if (qs.isMemoState(2))
{ {
npc.setSummoner(player); npc.setSummoner(player);
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, BART_LOC_2[0], 0); addMoveToDesire(npc, BART_LOC_2[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);

View File

@@ -203,7 +203,7 @@ public final class Q10365_SeekerEscort extends Quest
{ {
if (qs.isMemoState(1)) if (qs.isMemoState(1))
{ {
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, BLOODHOUND_LOC_1[0], 0); addMoveToDesire(npc, BLOODHOUND_LOC_1[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);
@@ -211,7 +211,7 @@ public final class Q10365_SeekerEscort extends Quest
} }
else if (qs.isMemoState(2)) else if (qs.isMemoState(2))
{ {
npc.setIsRunning(true); npc.setRunning();
npc.broadcastInfo(); npc.broadcastInfo();
addMoveToDesire(npc, BLOODHOUND_LOC_2[0], 0); addMoveToDesire(npc, BLOODHOUND_LOC_2[0], 0);
npc.getVariables().set("MOVE_INDEX", 0); npc.getVariables().set("MOVE_INDEX", 0);

View File

@@ -110,7 +110,7 @@ public final class Q10742_AFurryFriend extends Quest
final L2Npc ricky = addSpawn(RICKY, player, true, 120000); final L2Npc ricky = addSpawn(RICKY, player, true, 120000);
ricky.setSummoner(player); ricky.setSummoner(player);
ricky.setTitle(player.getName()); ricky.setTitle(player.getName());
ricky.setIsRunning(true); ricky.setRunning();
ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player); startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player);
} }

View File

@@ -676,7 +676,10 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
// Set the AI Intention to AI_INTENTION_ACTIVE // Set the AI Intention to AI_INTENTION_ACTIVE
setIntention(AI_INTENTION_ACTIVE); setIntention(AI_INTENTION_ACTIVE);
npc.setWalking(); if (!_actor.isFakePlayer())
{
npc.setWalking();
}
return; return;
} }

View File

@@ -825,7 +825,7 @@ public class L2CharacterAI extends AbstractAI
// Kill the actor client side by sending Server->Client packet AutoAttackStop, StopMove/StopRotation, Die (broadcast) // Kill the actor client side by sending Server->Client packet AutoAttackStop, StopMove/StopRotation, Die (broadcast)
clientNotifyDead(); clientNotifyDead();
if (!_actor.isPlayable()) if (!_actor.isPlayable() && !_actor.isFakePlayer())
{ {
_actor.setWalking(); _actor.setWalking();
} }

View File

@@ -299,7 +299,14 @@ public final class WalkingManager implements IGameXmlReader
} }
npc.sendDebugMessage("Starting to move at route '" + routeName + "'"); npc.sendDebugMessage("Starting to move at route '" + routeName + "'");
npc.setIsRunning(node.runToLocation()); if (node.runToLocation())
{
npc.setRunning();
}
else
{
npc.setWalking();
}
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
walk.setWalkCheckTask(ThreadPoolManager.scheduleAtFixedRate(new StartMovingTask(npc, routeName), 60000, 60000)); // start walk check task, for resuming walk after fight walk.setWalkCheckTask(ThreadPoolManager.scheduleAtFixedRate(new StartMovingTask(npc, routeName), 60000, 60000)); // start walk check task, for resuming walk after fight
@@ -332,7 +339,14 @@ public final class WalkingManager implements IGameXmlReader
walk.setBlocked(true); walk.setBlocked(true);
final L2NpcWalkerNode node = walk.getCurrentNode(); final L2NpcWalkerNode node = walk.getCurrentNode();
npc.sendDebugMessage("Route '" + routeName + "', continuing to node " + walk.getCurrentNodeId()); npc.sendDebugMessage("Route '" + routeName + "', continuing to node " + walk.getCurrentNodeId());
npc.setIsRunning(node.runToLocation()); if (node.runToLocation())
{
npc.setRunning();
}
else
{
npc.setWalking();
}
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
walk.setBlocked(false); walk.setBlocked(false);
walk.setStoppedByAttack(false); walk.setStoppedByAttack(false);

View File

@@ -768,7 +768,10 @@ public class L2Attackable extends L2Npc
((L2AttackableAI) getAI()).setGlobalAggro(-25); ((L2AttackableAI) getAI()).setGlobalAggro(-25);
clearAggroList(); clearAggroList();
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
setWalking(); if (!isFakePlayer())
{
setWalking();
}
} }
return; return;
} }
@@ -786,7 +789,10 @@ public class L2Attackable extends L2Npc
((L2AttackableAI) getAI()).setGlobalAggro(-25); ((L2AttackableAI) getAI()).setGlobalAggro(-25);
clearAggroList(); clearAggroList();
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
setWalking(); if (!isFakePlayer())
{
setWalking();
}
} }
} }
@@ -1407,14 +1413,16 @@ public class L2Attackable extends L2Npc
setScriptValue(0); // remove pvp flag setScriptValue(0); // remove pvp flag
setRunning(); // don't walk setRunning(); // don't walk
} }
else
{
setWalking();
}
// Clear mod Seeded stat // Clear mod Seeded stat
_seeded = false; _seeded = false;
_seed = null; _seed = null;
_seederObjId = 0; _seederObjId = 0;
setWalking();
// check the region where this mob is, do not activate the AI if region is inactive. // check the region where this mob is, do not activate the AI if region is inactive.
// if (!isInActiveRegion()) // if (!isInActiveRegion())
// { // {
@@ -1745,7 +1753,10 @@ public class L2Attackable extends L2Npc
{ {
((L2AttackableAI) getAI()).setGlobalAggro(-25); ((L2AttackableAI) getAI()).setGlobalAggro(-25);
} }
setWalking(); if (!isFakePlayer())
{
setWalking();
}
clearAggroList(); clearAggroList();
} }
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);

View File

@@ -2311,7 +2311,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return _isRunning; return _isRunning;
} }
public final void setIsRunning(boolean value) private final void setIsRunning(boolean value)
{ {
if (_isRunning == value) if (_isRunning == value)
{ {
@@ -2359,10 +2359,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
/** Set the L2Character movement type to run and send Server->Client packet ChangeMoveType to all others L2PcInstance. */ /** Set the L2Character movement type to run and send Server->Client packet ChangeMoveType to all others L2PcInstance. */
public final void setRunning() public final void setRunning()
{ {
if (!isRunning()) setIsRunning(true);
{
setIsRunning(true);
}
} }
public final boolean hasBlockActions() public final boolean hasBlockActions()

View File

@@ -3199,7 +3199,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
{ {
((L2Attackable) npc).addDamageHate(target, 0, desire); ((L2Attackable) npc).addDamageHate(target, 0, desire);
} }
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -3210,7 +3210,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
*/ */
protected void addAttackDesire(L2Npc npc, L2Character target) protected void addAttackDesire(L2Npc npc, L2Character target)
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }

View File

@@ -175,7 +175,7 @@ public final class Apherus extends AbstractNpcAI
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
final L2MonsterInstance protector = (L2MonsterInstance) addSpawn(APHERUS_DOOR_GUARD[getRandom(APHERUS_DOOR_GUARD.length)], player.getX() + getRandom(10, 30), player.getY() + getRandom(10, 30), player.getZ(), 0, false, 600000, false); final L2MonsterInstance protector = (L2MonsterInstance) addSpawn(APHERUS_DOOR_GUARD[getRandom(APHERUS_DOOR_GUARD.length)], player.getX() + getRandom(10, 30), player.getY() + getRandom(10, 30), player.getZ(), 0, false, 600000, false);
protector.setIsRunning(true); protector.setRunning();
protector.setTarget(player); protector.setTarget(player);
addAttackPlayerDesire(protector, player); addAttackPlayerDesire(protector, player);
} }

View File

@@ -147,7 +147,7 @@ public final class PlainsOfLizardman extends AbstractNpcAI
{ {
if ((monster.getId() == TANTA_MAGICIAN) || (monster.getId() == TANTA_SCOUT)) if ((monster.getId() == TANTA_MAGICIAN) || (monster.getId() == TANTA_SCOUT))
{ {
monster.setIsRunning(true); monster.setRunning();
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getX(), npc.getY(), npc.getZ(), 0)); monster.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getX(), npc.getY(), npc.getZ(), 0));
} }
}); });

View File

@@ -143,7 +143,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -157,7 +157,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -168,7 +168,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if ((target != null)) if ((target != null))
{ {
npc.setTarget(target); npc.setTarget(target);
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(target, 0, 555); mob.addDamageHate(target, 0, 555);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
@@ -298,7 +298,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
npc.setTarget(creature); npc.setTarget(creature);
npc.doCast(CREW_SKILL.getSkill()); npc.doCast(CREW_SKILL.getSkill());
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature);
} }
return super.onSeeCreature(npc, creature, isSummon); return super.onSeeCreature(npc, creature, isSummon);
@@ -424,7 +424,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
npc.getVariables().set("SELFBUFF_USED", 1); npc.getVariables().set("SELFBUFF_USED", 1);
npc.doCast(selfRangeBuff1.getSkill()); npc.doCast(selfRangeBuff1.getSkill());
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
} }

View File

@@ -94,7 +94,7 @@ public final class Maguen extends AbstractNpcAI
final L2Npc maguen = addSpawn(MAGUEN, npc.getLocation(), true, 60000, true); final L2Npc maguen = addSpawn(MAGUEN, npc.getLocation(), true, 60000, true);
maguen.getVariables().set("SUMMON_PLAYER", player); maguen.getVariables().set("SUMMON_PLAYER", player);
maguen.setTitle(player.getName()); maguen.setTitle(player.getName());
maguen.setIsRunning(true); maguen.setRunning();
maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
maguen.broadcastStatusUpdate(); maguen.broadcastStatusUpdate();
showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000); showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000);

View File

@@ -85,7 +85,7 @@ public final class Nemo extends AbstractNpcAI
maguen.getVariables().set("TEST_MAGUEN", 1); maguen.getVariables().set("TEST_MAGUEN", 1);
player.getVariables().set("TEST_MAGUEN", 1); player.getVariables().set("TEST_MAGUEN", 1);
maguen.setTitle(player.getName()); maguen.setTitle(player.getName());
maguen.setIsRunning(true); maguen.setRunning();
maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); maguen.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
maguen.broadcastStatusUpdate(); maguen.broadcastStatusUpdate();
showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000); showOnScreenMsg(player, NpcStringId.MAGUEN_APPEARANCE, 2, 4000);

View File

@@ -246,7 +246,7 @@ public final class SelMahumDrill extends AbstractNpcAI
} }
receiver.disableCoreAI(true); receiver.disableCoreAI(true);
receiver.getVariables().set("BUSY_STATE", 1); receiver.getVariables().set("BUSY_STATE", 1);
receiver.setIsRunning(true); receiver.setRunning();
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((receiver.getX() + getRandom(-800, 800)), (receiver.getY() + getRandom(-800, 800)), receiver.getZ(), receiver.getHeading())); receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((receiver.getX() + getRandom(-800, 800)), (receiver.getY() + getRandom(-800, 800)), receiver.getZ(), receiver.getHeading()));
startQuestTimer("reset_busy_state", 5000, receiver, null); startQuestTimer("reset_busy_state", 5000, receiver, null);
} }

View File

@@ -139,7 +139,7 @@ public final class SelMahumSquad extends AbstractNpcAI
case "fire_arrived": case "fire_arrived":
{ {
// myself.i_quest0 = 1; // myself.i_quest0 = 1;
npc.setIsRunning(false); npc.setWalking();
npc.setTarget(npc); npc.setTarget(npc);
if (!npc.isRandomWalkingEnabled()) if (!npc.isRandomWalkingEnabled())
@@ -172,7 +172,7 @@ public final class SelMahumSquad extends AbstractNpcAI
case "remove_effects": case "remove_effects":
{ {
// myself.i_quest0 = 0; // myself.i_quest0 = 0;
npc.setIsRunning(true); npc.setRunning();
npc.setDisplayEffect(MAHUM_EFFECT_NONE); npc.setDisplayEffect(MAHUM_EFFECT_NONE);
break; break;
} }
@@ -244,7 +244,7 @@ public final class SelMahumSquad extends AbstractNpcAI
if (receiver.isRandomWalkingEnabled() && !receiver.isDead() && (receiver.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && CommonUtil.contains(SQUAD_LEADERS, receiver.getId())) if (receiver.isRandomWalkingEnabled() && !receiver.isDead() && (receiver.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && CommonUtil.contains(SQUAD_LEADERS, receiver.getId()))
{ {
receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1 receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1
receiver.setIsRunning(true); receiver.setRunning();
final Location loc = sender.getPointInRange(100, 200); final Location loc = sender.getPointInRange(100, 200);
loc.setHeading(receiver.getHeading()); loc.setHeading(receiver.getHeading());
receiver.stopMove(null); receiver.stopMove(null);
@@ -279,7 +279,7 @@ public final class SelMahumSquad extends AbstractNpcAI
} }
receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1 receiver.setRandomWalking(false); // Moving to fire - i_ai0 = 1
receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1 receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1
receiver.setIsRunning(true); receiver.setRunning();
receiver.broadcastSay(ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT); receiver.broadcastSay(ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT);
final Location loc = sender.getPointInRange(100, 200); final Location loc = sender.getPointInRange(100, 200);
loc.setHeading(receiver.getHeading()); loc.setHeading(receiver.getHeading());
@@ -386,7 +386,7 @@ public final class SelMahumSquad extends AbstractNpcAI
cancelQuestTimer("chef_set_invul", npc, null); cancelQuestTimer("chef_set_invul", npc, null);
npc.getVariables().remove("BUSY_STATE"); npc.getVariables().remove("BUSY_STATE");
npc.getVariables().remove("INVUL_REMOVE_TIMER_STARTED"); npc.getVariables().remove("INVUL_REMOVE_TIMER_STARTED");
npc.setIsRunning(false); npc.setWalking();
} }
} }

View File

@@ -74,7 +74,7 @@ public final class BoyAndGirl extends AbstractNpcAI
{ {
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
npc.setIsRunning(true); npc.setRunning();
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600); final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23); addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -58,7 +58,7 @@ public final class Anais extends AbstractNpcAI
{ {
final L2Npc npc = _divineBurners.get(pot); final L2Npc npc = _divineBurners.get(pot);
npc.setDisplayEffect(1); npc.setDisplayEffect(1);
npc.setIsRunning(false); npc.setWalking();
if (pot < 4) if (pot < 4)
{ {
_current = npc; _current = npc;
@@ -92,10 +92,10 @@ public final class Anais extends AbstractNpcAI
final L2Npc b = _divineBurners.get(_pot); final L2Npc b = _divineBurners.get(_pot);
_pot = _pot + 1; _pot = _pot + 1;
b.setDisplayEffect(1); b.setDisplayEffect(1);
b.setIsRunning(false); b.setWalking();
final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0); final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999); ((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999);
ward.setIsRunning(true); ward.setRunning();
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null); ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null);
startQuestTimer("GUARD_ATTACK", 1000, ward, _nextTarget, true); startQuestTimer("GUARD_ATTACK", 1000, ward, _nextTarget, true);
startQuestTimer("SUICIDE", 20000, ward, null); startQuestTimer("SUICIDE", 20000, ward, null);
@@ -127,7 +127,7 @@ public final class Anais extends AbstractNpcAI
if (_current != null) if (_current != null)
{ {
_current.setDisplayEffect(2); _current.setDisplayEffect(2);
_current.setIsRunning(false); _current.setWalking();
_current = null; _current = null;
} }
npc.doDie(null); npc.doDie(null);
@@ -175,7 +175,7 @@ public final class Anais extends AbstractNpcAI
if (_current != null) if (_current != null)
{ {
_current.setDisplayEffect(2); _current.setDisplayEffect(2);
_current.setIsRunning(false); _current.setWalking();
_current = null; _current = null;
} }
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);

View File

@@ -358,7 +358,7 @@ public final class Baium extends AbstractNpcAI
{ {
mob.clearAggroList(); mob.clearAggroList();
} }
mob.setIsRunning(true); mob.setRunning();
mob.addDamageHate(_baium, 0, 999); mob.addDamageHate(_baium, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _baium); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _baium);
} }

View File

@@ -153,7 +153,7 @@ public final class BalokWarzone extends AbstractInstance
L2Npc minion = minionList.get(Rnd.get(minionList.size())); L2Npc minion = minionList.get(Rnd.get(minionList.size()));
if (minion != null) if (minion != null)
{ {
minion.setIsRunning(true); minion.setRunning();
((L2Attackable) minion).setCanReturnToSpawnPoint(false); ((L2Attackable) minion).setCanReturnToSpawnPoint(false);
currentMinion = minion; currentMinion = minion;
getTimers().addTimer("stage_last_minion_walk", 2000, minion, player); getTimers().addTimer("stage_last_minion_walk", 2000, minion, player);

View File

@@ -75,7 +75,7 @@ public final class IceQueensCastle extends AbstractInstance
{ {
if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed()) if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed())
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob);
((L2Attackable) npc).addDamageHate(mob, 0, 999999); ((L2Attackable) npc).addDamageHate(mob, 0, 999999);
} }
@@ -151,7 +151,7 @@ public final class IceQueensCastle extends AbstractInstance
{ {
if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed()) if ((mob.getId() == ARCHERY_KNIGHT) && !mob.isDead() && !mob.isDecayed())
{ {
npc.setIsRunning(true); npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob);
((L2Attackable) npc).addDamageHate(mob, 0, 999999); ((L2Attackable) npc).addDamageHate(mob, 0, 999999);
} }

View File

@@ -382,7 +382,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (npc.getVariables().getInt("FREYA_MOVE") == 0) if (npc.getVariables().getInt("FREYA_MOVE") == 0)
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
break; break;
@@ -431,14 +431,14 @@ public final class IceQueensCastleBattle extends AbstractInstance
manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4); manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4);
final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId()); final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
jinia.setIsRunning(true); jinia.setRunning();
jinia.setIsInvul(true); jinia.setIsInvul(true);
jinia.setCanReturnToSpawnPoint(false); jinia.setCanReturnToSpawnPoint(false);
jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
freya.reduceCurrentHp(1, jinia, null); freya.reduceCurrentHp(1, jinia, null);
final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId()); final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
kegor.setIsRunning(true); kegor.setRunning();
kegor.setIsInvul(true); kegor.setIsInvul(true);
kegor.setCanReturnToSpawnPoint(false); kegor.setCanReturnToSpawnPoint(false);
kegor.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack kegor.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
@@ -673,7 +673,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getId()); final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getId());
breath.setIsRunning(true); breath.setRunning();
breath.addDamageHate(mob.getMostHated(), 0, 999); breath.addDamageHate(mob.getMostHated(), 0, 999);
breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob.getMostHated()); breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob.getMostHated());
startQuestTimer("BLIZZARD", 20000, breath, null); startQuestTimer("BLIZZARD", 20000, breath, null);
@@ -751,7 +751,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE); manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -825,7 +825,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (controller.getVariables().getInt("FREYA_MOVE") == 0) if (controller.getVariables().getInt("FREYA_MOVE") == 0)
{ {
controller.getVariables().set("FREYA_MOVE", 1); controller.getVariables().set("FREYA_MOVE", 1);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -1042,7 +1042,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), false, 0, false, world.getId()); final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), false, 0, false, world.getId());
if (player != null) if (player != null)
{ {
breath.setIsRunning(true); breath.setRunning();
breath.addDamageHate(player, 0, 999); breath.addDamageHate(player, 0, 999);
breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
} }
@@ -1116,7 +1116,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE); manageScreenMsg(world, NpcStringId.FREYA_HAS_STARTED_TO_MOVE);
final L2Npc freya = params.getObject("freya", L2Npc.class); final L2Npc freya = params.getObject("freya", L2Npc.class);
freya.setIsRunning(true); freya.setRunning();
freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT); freya.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MIDDLE_POINT);
} }
@@ -1173,7 +1173,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
if (target != null) if (target != null)
{ {
((L2Attackable) mob).addDamageHate(target, 0, 999); ((L2Attackable) mob).addDamageHate(target, 0, 999);
mob.setIsRunning(true); mob.setRunning();
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
} }
else else

Some files were not shown because too many files have changed in this diff Show More