Script adjustments.

This commit is contained in:
MobiusDevelopment
2019-06-09 03:53:07 +00:00
parent ea06ddbade
commit 14e229033b
246 changed files with 3230 additions and 3112 deletions

View File

@@ -230,6 +230,7 @@ public final class Alarm extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SELF_DESTRUCT_IN_60", npc, null);
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null); startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES); npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class); final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class);

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.commons.util.CommonUtil;
@@ -28,6 +28,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.zone.type.EffectZone; import org.l2jmobius.gameserver.model.zone.type.EffectZone;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import org.l2jmobius.gameserver.scripting.annotations.Disabled;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
@@ -35,6 +36,7 @@ import ai.AbstractNpcAI;
* Dummy AI for spawns/respawns only for testing. * Dummy AI for spawns/respawns only for testing.
* @author Gnacik * @author Gnacik
*/ */
@Disabled // Mobius: this needs to be rewritten.
public final class DenOfEvil extends AbstractNpcAI public final class DenOfEvil extends AbstractNpcAI
{ {
// private static final int _buffer_id = 32656; // private static final int _buffer_id = 32656;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.ChatType;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -84,6 +84,7 @@ public class GardenWatchman extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SPAWN_TRAP", npc, null);
startQuestTimer("SPAWN_TRAP", 50000, npc, null); startQuestTimer("SPAWN_TRAP", 50000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -66,6 +66,8 @@ public final class GenesisVines extends AbstractNpcAI
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
npc.setScriptValue(1); npc.setScriptValue(1);
cancelQuestTimer("CAST_SKILL", npc, null);
cancelQuestTimer("DELETE", npc, null);
startQuestTimer("CAST_SKILL", 3000, npc, null); startQuestTimer("CAST_SKILL", 3000, npc, null);
startQuestTimer("DELETE", 150000, npc, null); startQuestTimer("DELETE", 150000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -112,16 +112,19 @@ public final class Spirit extends AbstractNpcAI
{ {
case EXECUTED_MAIDEN_VENGEFUL_SPIRIT: case EXECUTED_MAIDEN_VENGEFUL_SPIRIT:
{ {
cancelQuestTimer("SPAM_TEXT1", npc, null);
startQuestTimer("SPAM_TEXT1", 50000, npc, null, true); startQuestTimer("SPAM_TEXT1", 50000, npc, null, true);
break; break;
} }
case SPIRIT_OF_THE_TORTURED_DWARF: case SPIRIT_OF_THE_TORTURED_DWARF:
{ {
cancelQuestTimer("SPAM_TEXT2", npc, null);
startQuestTimer("SPAM_TEXT2", 50000, npc, null, true); startQuestTimer("SPAM_TEXT2", 50000, npc, null, true);
break; break;
} }
case SPIRIT_OF_ONE_BURNED_ALIVE: case SPIRIT_OF_ONE_BURNED_ALIVE:
{ {
cancelQuestTimer("SPAM_TEXT3", npc, null);
startQuestTimer("SPAM_TEXT3", 50000, npc, null, true); startQuestTimer("SPAM_TEXT3", 50000, npc, null, true);
break; break;
} }

View File

@@ -403,6 +403,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IXmlReader
((Attackable) npc).setCanReturnToSpawnPoint(false); ((Attackable) npc).setCanReturnToSpawnPoint(false);
npc.setTargetable(false); npc.setTargetable(false);
npc.setIsInvul(true); npc.setIsInvul(true);
cancelQuestTimer("REMOVE_PETRIFY", npc, null);
startQuestTimer("REMOVE_PETRIFY", 5 * 60 * 1000, npc, null, false); // 5 minutes startQuestTimer("REMOVE_PETRIFY", 5 * 60 * 1000, npc, null, false); // 5 minutes
} }
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -215,6 +215,12 @@ public final class DarkWaterDragon extends AbstractNpcAI
addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR1, x - 100, y - 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR1, x - 100, y - 100, npc.getZ(), 0, false, 40000);
cancelQuestTimer("first_spawn", npc, null);
cancelQuestTimer("second_spawn", npc, null);
cancelQuestTimer("third_spawn", npc, null);
cancelQuestTimer("fourth_spawn", npc, null);
cancelQuestTimer("fafurion_poison", npc, null);
cancelQuestTimer("fafurion_despawn", npc, null);
startQuestTimer("first_spawn", 2000, npc, null); // timer to delay timer "1" startQuestTimer("first_spawn", 2000, npc, null); // timer to delay timer "1"
startQuestTimer("second_spawn", 4000, npc, null); // timer to delay timer "2" startQuestTimer("second_spawn", 4000, npc, null); // timer to delay timer "2"
startQuestTimer("third_spawn", 8000, npc, null); // timer to delay timer "3" startQuestTimer("third_spawn", 8000, npc, null); // timer to delay timer "3"

View File

@@ -73,7 +73,7 @@ public final class HillsOfGold extends AbstractNpcAI
return; return;
} }
}); });
startQuestTimer("SPICULA_AGGRO" + npc.getObjectId(), 10000, npc, null); startQuestTimer("SPICULA_AGGRO", 10000, npc, null);
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -98,7 +98,7 @@ public final class HillsOfGold extends AbstractNpcAI
{ {
if ((npc.getId() == SPICULA_1) || (npc.getId() == SPICULA_2)) if ((npc.getId() == SPICULA_1) || (npc.getId() == SPICULA_2))
{ {
startQuestTimer("SPICULA_AGGRO" + npc.getObjectId(), 5000, npc, null); startQuestTimer("SPICULA_AGGRO", 5000, npc, null);
} }
else else
{ {

View File

@@ -282,6 +282,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
{ {
npc.setIsInvul(true); npc.setIsInvul(true);
npc.disableCoreAI(true); npc.disableCoreAI(true);
cancelQuestTimer("TRAINING", npc, null);
startQuestTimer("TRAINING", 30000, npc, null, true); startQuestTimer("TRAINING", 30000, npc, null, true);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override @Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{ {
if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100))) if ((killer.getRace() == Race.ERTHEIA) && (SPAWN_RATE > getRandom(100)))
{ {
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE; final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@@ -486,6 +486,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
if (CommonUtil.contains(SPRIGNANT, npc.getId())) if (CommonUtil.contains(SPRIGNANT, npc.getId()))
{ {
cancelQuestTimer("USE_SKILL", npc, null);
startQuestTimer("USE_SKILL", 15000, npc, null); startQuestTimer("USE_SKILL", 15000, npc, null);
} }
else if (CommonUtil.contains(TREX, npc.getId())) else if (CommonUtil.contains(TREX, npc.getId()))
@@ -495,6 +496,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if (collectGhost == 1) if (collectGhost == 1)
{ {
cancelQuestTimer("GHOST_DESPAWN", npc, null);
startQuestTimer("GHOST_DESPAWN", collectDespawn * 60000, npc, null); startQuestTimer("GHOST_DESPAWN", collectDespawn * 60000, npc, null);
} }
} }

View File

@@ -263,6 +263,7 @@ public final class SelMahumDrill extends AbstractNpcAI
{ {
if (CommonUtil.contains(MAHUM_CHIEFS, npc.getId())) if (CommonUtil.contains(MAHUM_CHIEFS, npc.getId()))
{ {
cancelQuestTimer("do_social_action", npc, null);
startQuestTimer("do_social_action", 15000, npc, null); startQuestTimer("do_social_action", 15000, npc, null);
} }

View File

@@ -68,7 +68,6 @@ public final class SelMahumSquad extends AbstractNpcAI
private SelMahumSquad() private SelMahumSquad()
{ {
addAttackId(CHEF); addAttackId(CHEF);
addAttackId(SQUAD_LEADERS); addAttackId(SQUAD_LEADERS);
addEventReceivedId(CHEF, FIRE, STOVE); addEventReceivedId(CHEF, FIRE, STOVE);
@@ -320,7 +319,7 @@ public final class SelMahumSquad extends AbstractNpcAI
@Override @Override
public void onMoveFinished(Npc npc) public void onMoveFinished(Npc npc)
{ {
// Npc moves to fire // NPC moves to fire.
if (!npc.isRandomWalkingEnabled() && (npc.getX() == npc.getVariables().getInt("DESTINATION_X")) && (npc.getY() == npc.getVariables().getInt("DESTINATION_Y"))) if (!npc.isRandomWalkingEnabled() && (npc.getX() == npc.getVariables().getInt("DESTINATION_X")) && (npc.getY() == npc.getVariables().getInt("DESTINATION_Y")))
{ {
npc.setRHandId(OHS_Weapon); npc.setRHandId(OHS_Weapon);
@@ -354,6 +353,7 @@ public final class SelMahumSquad extends AbstractNpcAI
} }
else if (npc.getId() == FIRE) else if (npc.getId() == FIRE)
{ {
cancelQuestTimer("fire", npc, null);
startQuestTimer("fire", 1000, npc, null); startQuestTimer("fire", 1000, npc, null);
} }
else if (CommonUtil.contains(SQUAD_LEADERS, npc.getId())) else if (CommonUtil.contains(SQUAD_LEADERS, npc.getId()))

View File

@@ -72,7 +72,9 @@ public final class BoyAndGirl extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("NPC_CHANGEWEAP", npc, null);
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
cancelQuestTimer("NPC_SHOUT", npc, null);
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
npc.setRunning(); npc.setRunning();
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600); final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);

View File

@@ -61,6 +61,7 @@ public final class Handermonkey extends AbstractNpcAI
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
npc.setRunning(); npc.setRunning();
cancelQuestTimer("NPC_MOVE", npc, null);
startQuestTimer("NPC_MOVE", 5000, npc, null, true); startQuestTimer("NPC_MOVE", 5000, npc, null, true);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -123,11 +123,11 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
private static final class changeZoneStage implements Runnable private static final class changeZoneStage implements Runnable
{ {
private final ZoneType zone; private final ZoneType _zone;
public changeZoneStage(ZoneType a) public changeZoneStage(ZoneType zone)
{ {
zone = a; _zone = zone;
} }
@Override @Override
@@ -135,50 +135,50 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
{ {
try try
{ {
zoneInfo currentInfo = _roomInfo.get(zone); zoneInfo currentInfo = _roomInfo.get(_zone);
switch (currentInfo.getZoneStage()) switch (currentInfo.getZoneStage())
{ {
case 0: case 0:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.MONITOR_THE_DAMAGE_FOR_30_SEC, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.MONITOR_THE_DAMAGE_FOR_30_SEC, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 1: case 1:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 2: case 2:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 3: case 3:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIFTEEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIFTEEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 4: case 4:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 5: case 5:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 6: case 6:
{ {
if (currentInfo.getCurrentMonitorizedDamage() >= 10) if (currentInfo.getCurrentMonitorizedDamage() >= 10)
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000));
String zoneName = zone.getName().toLowerCase().replace(" ", "_"); String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName))); _templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName)));
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null)); _templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null));
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED))); _zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
currentInfo.setZoneStage(7); currentInfo.setZoneStage(7);
ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min ThreadPool.schedule(new changeZoneStage(_zone), 600000); // 10min
} }
else else
{ {
@@ -190,14 +190,14 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
case 7: case 7:
{ {
currentInfo.reset(); currentInfo.reset();
for (PlayerInstance player : zone.getPlayersInside()) for (PlayerInstance player : _zone.getPlayersInside())
{ {
if (player != null) if (player != null)
{ {
player.sendPacket(new ExSendUIEvent(player)); player.sendPacket(new ExSendUIEvent(player));
} }
} }
String zoneName = zone.getName().toLowerCase().replace(" ", "_"); String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"))); _templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic")));
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null)); _templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
return; return;
@@ -206,7 +206,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentInfo.getZoneStage() < 6) if (currentInfo.getZoneStage() < 6)
{ {
currentInfo.setZoneStage(currentInfo.getZoneStage() + 1); currentInfo.setZoneStage(currentInfo.getZoneStage() + 1);
ThreadPool.schedule(new changeZoneStage(zone), 5000); ThreadPool.schedule(new changeZoneStage(_zone), 5000);
} }
} }
catch (Exception e) catch (Exception e)
@@ -223,7 +223,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
{ {
if (currentZone.getKey().isInsideZone(npc)) if (currentZone.getKey().isInsideZone(npc))
{ {
zoneInfo currentInfo = currentZone.getValue(); final zoneInfo currentInfo = currentZone.getValue();
int currentPoints = currentInfo.getCurrentPoints(); int currentPoints = currentInfo.getCurrentPoints();
if (currentPoints == 300) if (currentPoints == 300)
{ {

View File

@@ -85,6 +85,11 @@ public final class Wastelands extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if ((npc == null) || !npc.isSpawned())
{
return null;
}
switch (event) switch (event)
{ {
case "SOCIAL_SHOW": case "SOCIAL_SHOW":

View File

@@ -54,8 +54,7 @@ public final class ZealotOfShilen extends AbstractNpcAI
return null; return null;
} }
startQuestTimer("WATCHING", 10000, npc, null, true); if (event.equals("WATCHING") && !npc.isAttackingNow() && !npc.isAlikeDead())
if (event.equalsIgnoreCase("WATCHING") && !npc.isAttackingNow())
{ {
World.getInstance().forEachVisibleObject(npc, MonsterInstance.class, character -> World.getInstance().forEachVisibleObject(npc, MonsterInstance.class, character ->
{ {
@@ -66,6 +65,7 @@ public final class ZealotOfShilen extends AbstractNpcAI
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null);
} }
}); });
startQuestTimer("WATCHING", 10000, npc, null);
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -81,13 +81,14 @@ public final class ZealotOfShilen extends AbstractNpcAI
{ {
if (npc.getId() == ZEALOT) if (npc.getId() == ZEALOT)
{ {
npc.setRandomWalking(true); npc.setRandomWalking(false);
} }
else else
{ {
npc.setIsInvul(true); npc.setIsInvul(true);
((Attackable) npc).setCanReturnToSpawnPoint(false); ((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("WATCHING", 10000, npc, null, true); cancelQuestTimer("WATCHING", npc, null);
startQuestTimer("WATCHING", 10000, npc, null);
} }
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -588,6 +588,7 @@ public final class IstinaCavern extends AbstractInstance
npc.setUndying(true); npc.setUndying(true);
npc.setIsInvul(true); npc.setIsInvul(true);
npc.setTargetable(false); npc.setTargetable(false);
getTimers().cancelTimer("BALLISTA_START_TIMER", npc, null);
getTimers().addTimer("BALLISTA_START_TIMER", 10000, npc, null); getTimers().addTimer("BALLISTA_START_TIMER", 10000, npc, null);
} }
} }

View File

@@ -18,10 +18,8 @@ package ai.bosses.QueenAnt;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager; import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager; import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -84,7 +82,6 @@ public final class QueenAnt extends AbstractNpcAI
MonsterInstance _queen = null; MonsterInstance _queen = null;
private MonsterInstance _larva = null; private MonsterInstance _larva = null;
private final Set<MonsterInstance> _nurses = ConcurrentHashMap.newKeySet(); private final Set<MonsterInstance> _nurses = ConcurrentHashMap.newKeySet();
ScheduledFuture<?> _task = null;
private QueenAnt() private QueenAnt()
{ {
@@ -160,7 +157,9 @@ public final class QueenAnt extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if (event.equalsIgnoreCase("heal")) switch (event)
{
case "heal":
{ {
boolean notCasting; boolean notCasting;
final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp()); final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp());
@@ -202,10 +201,11 @@ public final class QueenAnt extends AbstractNpcAI
nurse.setTarget(null); nurse.setTarget(null);
} }
} }
break;
} }
else if (event.equalsIgnoreCase("action") && (npc != null)) case "action":
{ {
if (getRandom(3) == 0) if ((npc != null) && (getRandom(3) == 0))
{ {
if (getRandom(2) == 0) if (getRandom(2) == 0)
{ {
@@ -216,12 +216,28 @@ public final class QueenAnt extends AbstractNpcAI
npc.broadcastSocialAction(4); npc.broadcastSocialAction(4);
} }
} }
break;
} }
else if (event.equalsIgnoreCase("queen_unlock")) case "queen_unlock":
{ {
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0); final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE); GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
spawnBoss(queen); spawnBoss(queen);
break;
}
case "ANT_QUEEN_TASK":
{
if ((_queen == null) || _queen.isDead())
{
cancelQuestTimers("ANT_QUEEN_TASK");
}
else if (_queen.calculateDistance2D(QUEEN_X, QUEEN_Y, QUEEN_Z) > 2000)
{
_queen.clearAggroList();
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
}
break;
}
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -258,7 +274,8 @@ public final class QueenAnt extends AbstractNpcAI
{ {
((MonsterInstance) npc).getMinionList().spawnMinions(npc.getParameters().getMinionList("Privates")); ((MonsterInstance) npc).getMinionList().spawnMinions(npc.getParameters().getMinionList("Privates"));
} }
_task = ThreadPool.scheduleAtFixedRate(new QueenAntTask(), 5 * 1000, 5 * 1000); cancelQuestTimer("ANT_QUEEN_TASK", npc, null);
startQuestTimer("ANT_QUEEN_TASK", 5000, npc, null, true);
break; break;
} }
} }
@@ -360,11 +377,7 @@ public final class QueenAnt extends AbstractNpcAI
_larva.deleteMe(); _larva.deleteMe();
_larva = null; _larva = null;
_queen = null; _queen = null;
if (_task != null) cancelQuestTimers("ANT_QUEEN_TASK");
{
_task.cancel(false);
_task = null;
}
} }
else if ((_queen != null) && !_queen.isAlikeDead()) else if ((_queen != null) && !_queen.isAlikeDead())
{ {
@@ -389,29 +402,6 @@ public final class QueenAnt extends AbstractNpcAI
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);
} }
private class QueenAntTask implements Runnable
{
public QueenAntTask()
{
// Constructor stub
}
@Override
public void run()
{
if ((_queen == null) || _queen.isDead())
{
_task.cancel(false);
_task = null;
}
else if (_queen.calculateDistance2D(QUEEN_X, QUEEN_Y, QUEEN_Z) > 2000.)
{
_queen.clearAggroList();
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
}
}
}
public static void main(String[] args) public static void main(String[] args)
{ {
new QueenAnt(); new QueenAnt();

View File

@@ -92,12 +92,16 @@ public final class AreaSkillNpc extends AbstractNpcAI
final int castTime = npc.getTemplate().getParameters().getInt("i_use_term_time", 5000); final int castTime = npc.getTemplate().getParameters().getInt("i_use_term_time", 5000);
final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000); final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000);
onTimerEvent("SKILL_CAST_BASIC", null, npc, null); // Trigger cast instantly onTimerEvent("SKILL_CAST_BASIC", null, npc, null); // Trigger cast instantly
getTimers().cancelTimer("SKILL_CAST_TIMED", npc, null);
getTimers().cancelTimer("DELETE_ME", npc, null);
getTimers().addTimer("SKILL_CAST_TIMED", castTime, npc, null); getTimers().addTimer("SKILL_CAST_TIMED", castTime, npc, null);
getTimers().addTimer("DELETE_ME", despawnTime, npc, null); getTimers().addTimer("DELETE_ME", despawnTime, npc, null);
} }
else else
{ {
final int despawnTime = npc.getTemplate().getParameters().getInt("despawn_time", 7); final int despawnTime = npc.getTemplate().getParameters().getInt("despawn_time", 7);
getTimers().cancelTimer("SKILL_CAST_TIMED", npc, null);
getTimers().cancelTimer("DELETE_ME", npc, null);
getTimers().addTimer("SKILL_CAST_TIMED", 100, npc, null); getTimers().addTimer("SKILL_CAST_TIMED", 100, npc, null);
getTimers().addTimer("DELETE_ME", (despawnTime * 1000), npc, null); getTimers().addTimer("DELETE_ME", (despawnTime * 1000), npc, null);
} }

View File

@@ -250,6 +250,7 @@ public final class Minigame extends AbstractNpcAI
case TREASURE_BOX: case TREASURE_BOX:
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
cancelQuestTimer("afterthat", npc, null);
startQuestTimer("afterthat", 180000, npc, null); startQuestTimer("afterthat", 180000, npc, null);
break; break;
} }

View File

@@ -128,6 +128,8 @@ public final class WarriorFishingBlock extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SPAWN", npc, null);
cancelQuestTimer("DESPAWN", npc, null);
startQuestTimer("SPAWN", 2000, npc, null); startQuestTimer("SPAWN", 2000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -55,8 +55,11 @@ public class DimensionalTrap extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if (npc != null) if ((npc == null) || npc.isAlikeDead())
{ {
return null;
}
switch (event) switch (event)
{ {
case "debuff_player": case "debuff_player":
@@ -72,7 +75,7 @@ public class DimensionalTrap extends AbstractNpcAI
startQuestTimer("debuff_player", 10000, npc, null); startQuestTimer("debuff_player", 10000, npc, null);
break; break;
} }
case "demage_player": case "damage_player":
{ {
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, _type, p -> World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, _type, p ->
{ {
@@ -82,7 +85,7 @@ public class DimensionalTrap extends AbstractNpcAI
npc.doCast((getRandom(10) < 5) ? TRAP_STUN.getSkill() : TRAP_POYSON.getSkill()); npc.doCast((getRandom(10) < 5) ? TRAP_STUN.getSkill() : TRAP_POYSON.getSkill());
} }
}); });
startQuestTimer("demage_player", 10000, npc, null); startQuestTimer("damage_player", 10000, npc, null);
break; break;
} }
case "heal_player": case "heal_player":
@@ -99,7 +102,6 @@ public class DimensionalTrap extends AbstractNpcAI
break; break;
} }
} }
}
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -133,21 +135,21 @@ public class DimensionalTrap extends AbstractNpcAI
case DIMENSIONAL_DEMAGE_TRAP_1: case DIMENSIONAL_DEMAGE_TRAP_1:
{ {
npc.setDisplayEffect(4); npc.setDisplayEffect(4);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 50; _type = 50;
break; break;
} }
case DIMENSIONAL_DEMAGE_TRAP_2: case DIMENSIONAL_DEMAGE_TRAP_2:
{ {
npc.setDisplayEffect(5); npc.setDisplayEffect(5);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 100; _type = 100;
break; break;
} }
case DIMENSIONAL_DEMAGE_TRAP_3: case DIMENSIONAL_DEMAGE_TRAP_3:
{ {
npc.setDisplayEffect(6); npc.setDisplayEffect(6);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 150; _type = 150;
break; break;
} }

View File

@@ -292,8 +292,7 @@ public class Quest extends AbstractScript implements IIdentifiable
public void startQuestTimer(String name, long time, Npc npc, PlayerInstance player, boolean repeating) public void startQuestTimer(String name, long time, Npc npc, PlayerInstance player, boolean repeating)
{ {
final List<QuestTimer> timers = getQuestTimers().computeIfAbsent(name, k -> new ArrayList<>(1)); final List<QuestTimer> timers = getQuestTimers().computeIfAbsent(name, k -> new ArrayList<>(1));
// if there exists a timer with this name, allow the timer only if the [npc, player] set is unique // If there exists a timer with this name, allow the timer only if the [npc, player] set is unique nulls act as wildcards.
// nulls act as wildcards
if (getQuestTimer(name, npc, player) == null) if (getQuestTimer(name, npc, player) == null)
{ {
_writeLock.lock(); _writeLock.lock();

View File

@@ -230,6 +230,7 @@ public final class Alarm extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SELF_DESTRUCT_IN_60", npc, null);
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null); startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES); npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class); final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class);

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.commons.util.CommonUtil;
@@ -28,6 +28,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.zone.type.EffectZone; import org.l2jmobius.gameserver.model.zone.type.EffectZone;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import org.l2jmobius.gameserver.scripting.annotations.Disabled;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
@@ -35,6 +36,7 @@ import ai.AbstractNpcAI;
* Dummy AI for spawns/respawns only for testing. * Dummy AI for spawns/respawns only for testing.
* @author Gnacik * @author Gnacik
*/ */
@Disabled // Mobius: this needs to be rewritten.
public final class DenOfEvil extends AbstractNpcAI public final class DenOfEvil extends AbstractNpcAI
{ {
// private static final int _buffer_id = 32656; // private static final int _buffer_id = 32656;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.ChatType;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -69,7 +69,6 @@ public final class GainakSiege extends AbstractNpcAI
{ {
addEnterZoneId(GAINAK_SIEGE_ZONE.getId(), GAINAK_TOWN_ZONE.getId()); addEnterZoneId(GAINAK_SIEGE_ZONE.getId(), GAINAK_TOWN_ZONE.getId());
addKillId(ASSASSIN_IDS); addKillId(ASSASSIN_IDS);
addSpawnId(ASSASSIN_IDS);
startQuestTimer("GAINAK_WAR", getTimeBetweenSieges() * 60000, null, null); startQuestTimer("GAINAK_WAR", getTimeBetweenSieges() * 60000, null, null);
} }

View File

@@ -84,6 +84,7 @@ public class GardenWatchman extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SPAWN_TRAP", npc, null);
startQuestTimer("SPAWN_TRAP", 50000, npc, null); startQuestTimer("SPAWN_TRAP", 50000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -66,6 +66,8 @@ public final class GenesisVines extends AbstractNpcAI
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
npc.setScriptValue(1); npc.setScriptValue(1);
cancelQuestTimer("CAST_SKILL", npc, null);
cancelQuestTimer("DELETE", npc, null);
startQuestTimer("CAST_SKILL", 3000, npc, null); startQuestTimer("CAST_SKILL", 3000, npc, null);
startQuestTimer("DELETE", 150000, npc, null); startQuestTimer("DELETE", 150000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -112,16 +112,19 @@ public final class Spirit extends AbstractNpcAI
{ {
case EXECUTED_MAIDEN_VENGEFUL_SPIRIT: case EXECUTED_MAIDEN_VENGEFUL_SPIRIT:
{ {
cancelQuestTimer("SPAM_TEXT1", npc, null);
startQuestTimer("SPAM_TEXT1", 50000, npc, null, true); startQuestTimer("SPAM_TEXT1", 50000, npc, null, true);
break; break;
} }
case SPIRIT_OF_THE_TORTURED_DWARF: case SPIRIT_OF_THE_TORTURED_DWARF:
{ {
cancelQuestTimer("SPAM_TEXT2", npc, null);
startQuestTimer("SPAM_TEXT2", 50000, npc, null, true); startQuestTimer("SPAM_TEXT2", 50000, npc, null, true);
break; break;
} }
case SPIRIT_OF_ONE_BURNED_ALIVE: case SPIRIT_OF_ONE_BURNED_ALIVE:
{ {
cancelQuestTimer("SPAM_TEXT3", npc, null);
startQuestTimer("SPAM_TEXT3", 50000, npc, null, true); startQuestTimer("SPAM_TEXT3", 50000, npc, null, true);
break; break;
} }

View File

@@ -403,6 +403,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IXmlReader
((Attackable) npc).setCanReturnToSpawnPoint(false); ((Attackable) npc).setCanReturnToSpawnPoint(false);
npc.setTargetable(false); npc.setTargetable(false);
npc.setIsInvul(true); npc.setIsInvul(true);
cancelQuestTimer("REMOVE_PETRIFY", npc, null);
startQuestTimer("REMOVE_PETRIFY", 5 * 60 * 1000, npc, null, false); // 5 minutes startQuestTimer("REMOVE_PETRIFY", 5 * 60 * 1000, npc, null, false); // 5 minutes
} }
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -215,6 +215,12 @@ public final class DarkWaterDragon extends AbstractNpcAI
addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR1, x - 100, y - 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR1, x - 100, y - 100, npc.getZ(), 0, false, 40000);
cancelQuestTimer("first_spawn", npc, null);
cancelQuestTimer("second_spawn", npc, null);
cancelQuestTimer("third_spawn", npc, null);
cancelQuestTimer("fourth_spawn", npc, null);
cancelQuestTimer("fafurion_poison", npc, null);
cancelQuestTimer("fafurion_despawn", npc, null);
startQuestTimer("first_spawn", 2000, npc, null); // timer to delay timer "1" startQuestTimer("first_spawn", 2000, npc, null); // timer to delay timer "1"
startQuestTimer("second_spawn", 4000, npc, null); // timer to delay timer "2" startQuestTimer("second_spawn", 4000, npc, null); // timer to delay timer "2"
startQuestTimer("third_spawn", 8000, npc, null); // timer to delay timer "3" startQuestTimer("third_spawn", 8000, npc, null); // timer to delay timer "3"

View File

@@ -73,7 +73,7 @@ public final class HillsOfGold extends AbstractNpcAI
return; return;
} }
}); });
startQuestTimer("SPICULA_AGGRO" + npc.getObjectId(), 10000, npc, null); startQuestTimer("SPICULA_AGGRO", 10000, npc, null);
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -98,7 +98,7 @@ public final class HillsOfGold extends AbstractNpcAI
{ {
if ((npc.getId() == SPICULA_1) || (npc.getId() == SPICULA_2)) if ((npc.getId() == SPICULA_1) || (npc.getId() == SPICULA_2))
{ {
startQuestTimer("SPICULA_AGGRO" + npc.getObjectId(), 5000, npc, null); startQuestTimer("SPICULA_AGGRO", 5000, npc, null);
} }
else else
{ {

View File

@@ -282,6 +282,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
{ {
npc.setIsInvul(true); npc.setIsInvul(true);
npc.disableCoreAI(true); npc.disableCoreAI(true);
cancelQuestTimer("TRAINING", npc, null);
startQuestTimer("TRAINING", 30000, npc, null, true); startQuestTimer("TRAINING", 30000, npc, null, true);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override @Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{ {
if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100))) if ((killer.getRace() == Race.ERTHEIA) && (SPAWN_RATE > getRandom(100)))
{ {
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE; final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@@ -486,6 +486,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
if (CommonUtil.contains(SPRIGNANT, npc.getId())) if (CommonUtil.contains(SPRIGNANT, npc.getId()))
{ {
cancelQuestTimer("USE_SKILL", npc, null);
startQuestTimer("USE_SKILL", 15000, npc, null); startQuestTimer("USE_SKILL", 15000, npc, null);
} }
else if (CommonUtil.contains(TREX, npc.getId())) else if (CommonUtil.contains(TREX, npc.getId()))
@@ -495,6 +496,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if (collectGhost == 1) if (collectGhost == 1)
{ {
cancelQuestTimer("GHOST_DESPAWN", npc, null);
startQuestTimer("GHOST_DESPAWN", collectDespawn * 60000, npc, null); startQuestTimer("GHOST_DESPAWN", collectDespawn * 60000, npc, null);
} }
} }

View File

@@ -263,6 +263,7 @@ public final class SelMahumDrill extends AbstractNpcAI
{ {
if (CommonUtil.contains(MAHUM_CHIEFS, npc.getId())) if (CommonUtil.contains(MAHUM_CHIEFS, npc.getId()))
{ {
cancelQuestTimer("do_social_action", npc, null);
startQuestTimer("do_social_action", 15000, npc, null); startQuestTimer("do_social_action", 15000, npc, null);
} }

View File

@@ -68,7 +68,6 @@ public final class SelMahumSquad extends AbstractNpcAI
private SelMahumSquad() private SelMahumSquad()
{ {
addAttackId(CHEF); addAttackId(CHEF);
addAttackId(SQUAD_LEADERS); addAttackId(SQUAD_LEADERS);
addEventReceivedId(CHEF, FIRE, STOVE); addEventReceivedId(CHEF, FIRE, STOVE);
@@ -320,7 +319,7 @@ public final class SelMahumSquad extends AbstractNpcAI
@Override @Override
public void onMoveFinished(Npc npc) public void onMoveFinished(Npc npc)
{ {
// Npc moves to fire // NPC moves to fire.
if (!npc.isRandomWalkingEnabled() && (npc.getX() == npc.getVariables().getInt("DESTINATION_X")) && (npc.getY() == npc.getVariables().getInt("DESTINATION_Y"))) if (!npc.isRandomWalkingEnabled() && (npc.getX() == npc.getVariables().getInt("DESTINATION_X")) && (npc.getY() == npc.getVariables().getInt("DESTINATION_Y")))
{ {
npc.setRHandId(OHS_Weapon); npc.setRHandId(OHS_Weapon);
@@ -354,6 +353,7 @@ public final class SelMahumSquad extends AbstractNpcAI
} }
else if (npc.getId() == FIRE) else if (npc.getId() == FIRE)
{ {
cancelQuestTimer("fire", npc, null);
startQuestTimer("fire", 1000, npc, null); startQuestTimer("fire", 1000, npc, null);
} }
else if (CommonUtil.contains(SQUAD_LEADERS, npc.getId())) else if (CommonUtil.contains(SQUAD_LEADERS, npc.getId()))

View File

@@ -72,7 +72,9 @@ public final class BoyAndGirl extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("NPC_CHANGEWEAP", npc, null);
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
cancelQuestTimer("NPC_SHOUT", npc, null);
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
npc.setRunning(); npc.setRunning();
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600); final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);

View File

@@ -61,6 +61,7 @@ public final class Handermonkey extends AbstractNpcAI
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
npc.setRunning(); npc.setRunning();
cancelQuestTimer("NPC_MOVE", npc, null);
startQuestTimer("NPC_MOVE", 5000, npc, null, true); startQuestTimer("NPC_MOVE", 5000, npc, null, true);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -123,11 +123,11 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
private static final class changeZoneStage implements Runnable private static final class changeZoneStage implements Runnable
{ {
private final ZoneType zone; private final ZoneType _zone;
public changeZoneStage(ZoneType a) public changeZoneStage(ZoneType zone)
{ {
zone = a; _zone = zone;
} }
@Override @Override
@@ -135,50 +135,50 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
{ {
try try
{ {
zoneInfo currentInfo = _roomInfo.get(zone); zoneInfo currentInfo = _roomInfo.get(_zone);
switch (currentInfo.getZoneStage()) switch (currentInfo.getZoneStage())
{ {
case 0: case 0:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.MONITOR_THE_DAMAGE_FOR_30_SEC, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.MONITOR_THE_DAMAGE_FOR_30_SEC, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 1: case 1:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 2: case 2:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 3: case 3:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIFTEEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIFTEEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 4: case 4:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 5: case 5:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 6: case 6:
{ {
if (currentInfo.getCurrentMonitorizedDamage() >= 10) if (currentInfo.getCurrentMonitorizedDamage() >= 10)
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000));
String zoneName = zone.getName().toLowerCase().replace(" ", "_"); String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName))); _templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName)));
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null)); _templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null));
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED))); _zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
currentInfo.setZoneStage(7); currentInfo.setZoneStage(7);
ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min ThreadPool.schedule(new changeZoneStage(_zone), 600000); // 10min
} }
else else
{ {
@@ -190,14 +190,14 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
case 7: case 7:
{ {
currentInfo.reset(); currentInfo.reset();
for (PlayerInstance player : zone.getPlayersInside()) for (PlayerInstance player : _zone.getPlayersInside())
{ {
if (player != null) if (player != null)
{ {
player.sendPacket(new ExSendUIEvent(player)); player.sendPacket(new ExSendUIEvent(player));
} }
} }
String zoneName = zone.getName().toLowerCase().replace(" ", "_"); String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"))); _templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic")));
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null)); _templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
return; return;
@@ -206,7 +206,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentInfo.getZoneStage() < 6) if (currentInfo.getZoneStage() < 6)
{ {
currentInfo.setZoneStage(currentInfo.getZoneStage() + 1); currentInfo.setZoneStage(currentInfo.getZoneStage() + 1);
ThreadPool.schedule(new changeZoneStage(zone), 5000); ThreadPool.schedule(new changeZoneStage(_zone), 5000);
} }
} }
catch (Exception e) catch (Exception e)
@@ -223,7 +223,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
{ {
if (currentZone.getKey().isInsideZone(npc)) if (currentZone.getKey().isInsideZone(npc))
{ {
zoneInfo currentInfo = currentZone.getValue(); final zoneInfo currentInfo = currentZone.getValue();
int currentPoints = currentInfo.getCurrentPoints(); int currentPoints = currentInfo.getCurrentPoints();
if (currentPoints == 300) if (currentPoints == 300)
{ {

View File

@@ -85,6 +85,11 @@ public final class Wastelands extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if ((npc == null) || !npc.isSpawned())
{
return null;
}
switch (event) switch (event)
{ {
case "SOCIAL_SHOW": case "SOCIAL_SHOW":

View File

@@ -54,8 +54,7 @@ public final class ZealotOfShilen extends AbstractNpcAI
return null; return null;
} }
startQuestTimer("WATCHING", 10000, npc, null, true); if (event.equals("WATCHING") && !npc.isAttackingNow() && !npc.isAlikeDead())
if (event.equalsIgnoreCase("WATCHING") && !npc.isAttackingNow())
{ {
World.getInstance().forEachVisibleObject(npc, MonsterInstance.class, character -> World.getInstance().forEachVisibleObject(npc, MonsterInstance.class, character ->
{ {
@@ -66,6 +65,7 @@ public final class ZealotOfShilen extends AbstractNpcAI
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null);
} }
}); });
startQuestTimer("WATCHING", 10000, npc, null);
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -81,13 +81,14 @@ public final class ZealotOfShilen extends AbstractNpcAI
{ {
if (npc.getId() == ZEALOT) if (npc.getId() == ZEALOT)
{ {
npc.setRandomWalking(true); npc.setRandomWalking(false);
} }
else else
{ {
npc.setIsInvul(true); npc.setIsInvul(true);
((Attackable) npc).setCanReturnToSpawnPoint(false); ((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("WATCHING", 10000, npc, null, true); cancelQuestTimer("WATCHING", npc, null);
startQuestTimer("WATCHING", 10000, npc, null);
} }
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -588,6 +588,7 @@ public final class IstinaCavern extends AbstractInstance
npc.setUndying(true); npc.setUndying(true);
npc.setIsInvul(true); npc.setIsInvul(true);
npc.setTargetable(false); npc.setTargetable(false);
getTimers().cancelTimer("BALLISTA_START_TIMER", npc, null);
getTimers().addTimer("BALLISTA_START_TIMER", 10000, npc, null); getTimers().addTimer("BALLISTA_START_TIMER", 10000, npc, null);
} }
} }

View File

@@ -18,10 +18,8 @@ package ai.bosses.QueenAnt;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager; import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager; import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -84,7 +82,6 @@ public final class QueenAnt extends AbstractNpcAI
MonsterInstance _queen = null; MonsterInstance _queen = null;
private MonsterInstance _larva = null; private MonsterInstance _larva = null;
private final Set<MonsterInstance> _nurses = ConcurrentHashMap.newKeySet(); private final Set<MonsterInstance> _nurses = ConcurrentHashMap.newKeySet();
ScheduledFuture<?> _task = null;
private QueenAnt() private QueenAnt()
{ {
@@ -160,7 +157,9 @@ public final class QueenAnt extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if (event.equalsIgnoreCase("heal")) switch (event)
{
case "heal":
{ {
boolean notCasting; boolean notCasting;
final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp()); final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp());
@@ -202,10 +201,11 @@ public final class QueenAnt extends AbstractNpcAI
nurse.setTarget(null); nurse.setTarget(null);
} }
} }
break;
} }
else if (event.equalsIgnoreCase("action") && (npc != null)) case "action":
{ {
if (getRandom(3) == 0) if ((npc != null) && (getRandom(3) == 0))
{ {
if (getRandom(2) == 0) if (getRandom(2) == 0)
{ {
@@ -216,12 +216,28 @@ public final class QueenAnt extends AbstractNpcAI
npc.broadcastSocialAction(4); npc.broadcastSocialAction(4);
} }
} }
break;
} }
else if (event.equalsIgnoreCase("queen_unlock")) case "queen_unlock":
{ {
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0); final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE); GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
spawnBoss(queen); spawnBoss(queen);
break;
}
case "ANT_QUEEN_TASK":
{
if ((_queen == null) || _queen.isDead())
{
cancelQuestTimers("ANT_QUEEN_TASK");
}
else if (_queen.calculateDistance2D(QUEEN_X, QUEEN_Y, QUEEN_Z) > 2000)
{
_queen.clearAggroList();
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
}
break;
}
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -258,7 +274,8 @@ public final class QueenAnt extends AbstractNpcAI
{ {
((MonsterInstance) npc).getMinionList().spawnMinions(npc.getParameters().getMinionList("Privates")); ((MonsterInstance) npc).getMinionList().spawnMinions(npc.getParameters().getMinionList("Privates"));
} }
_task = ThreadPool.scheduleAtFixedRate(new QueenAntTask(), 5 * 1000, 5 * 1000); cancelQuestTimer("ANT_QUEEN_TASK", npc, null);
startQuestTimer("ANT_QUEEN_TASK", 5000, npc, null, true);
break; break;
} }
} }
@@ -360,11 +377,7 @@ public final class QueenAnt extends AbstractNpcAI
_larva.deleteMe(); _larva.deleteMe();
_larva = null; _larva = null;
_queen = null; _queen = null;
if (_task != null) cancelQuestTimers("ANT_QUEEN_TASK");
{
_task.cancel(false);
_task = null;
}
} }
else if ((_queen != null) && !_queen.isAlikeDead()) else if ((_queen != null) && !_queen.isAlikeDead())
{ {
@@ -389,29 +402,6 @@ public final class QueenAnt extends AbstractNpcAI
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);
} }
private class QueenAntTask implements Runnable
{
public QueenAntTask()
{
// Constructor stub
}
@Override
public void run()
{
if ((_queen == null) || _queen.isDead())
{
_task.cancel(false);
_task = null;
}
else if (_queen.calculateDistance2D(QUEEN_X, QUEEN_Y, QUEEN_Z) > 2000.)
{
_queen.clearAggroList();
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
}
}
}
public static void main(String[] args) public static void main(String[] args)
{ {
new QueenAnt(); new QueenAnt();

View File

@@ -98,12 +98,16 @@ public final class AreaSkillNpc extends AbstractNpcAI
final int castTime = npc.getTemplate().getParameters().getInt("i_use_term_time", 5000); final int castTime = npc.getTemplate().getParameters().getInt("i_use_term_time", 5000);
final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000); final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000);
onTimerEvent("SKILL_CAST_BASIC", null, npc, null); // Trigger cast instantly onTimerEvent("SKILL_CAST_BASIC", null, npc, null); // Trigger cast instantly
getTimers().cancelTimer("SKILL_CAST_TIMED", npc, null);
getTimers().cancelTimer("DELETE_ME", npc, null);
getTimers().addTimer("SKILL_CAST_TIMED", castTime, npc, null); getTimers().addTimer("SKILL_CAST_TIMED", castTime, npc, null);
getTimers().addTimer("DELETE_ME", despawnTime, npc, null); getTimers().addTimer("DELETE_ME", despawnTime, npc, null);
} }
else else
{ {
final int despawnTime = npc.getTemplate().getParameters().getInt("despawn_time", 7); final int despawnTime = npc.getTemplate().getParameters().getInt("despawn_time", 7);
getTimers().cancelTimer("SKILL_CAST_TIMED", npc, null);
getTimers().cancelTimer("DELETE_ME", npc, null);
getTimers().addTimer("SKILL_CAST_TIMED", 100, npc, null); getTimers().addTimer("SKILL_CAST_TIMED", 100, npc, null);
getTimers().addTimer("DELETE_ME", (despawnTime * 1000), npc, null); getTimers().addTimer("DELETE_ME", (despawnTime * 1000), npc, null);
} }

View File

@@ -250,6 +250,7 @@ public final class Minigame extends AbstractNpcAI
case TREASURE_BOX: case TREASURE_BOX:
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
cancelQuestTimer("afterthat", npc, null);
startQuestTimer("afterthat", 180000, npc, null); startQuestTimer("afterthat", 180000, npc, null);
break; break;
} }

View File

@@ -128,6 +128,8 @@ public final class WarriorFishingBlock extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SPAWN", npc, null);
cancelQuestTimer("DESPAWN", npc, null);
startQuestTimer("SPAWN", 2000, npc, null); startQuestTimer("SPAWN", 2000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -55,8 +55,11 @@ public class DimensionalTrap extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if (npc != null) if ((npc == null) || npc.isAlikeDead())
{ {
return null;
}
switch (event) switch (event)
{ {
case "debuff_player": case "debuff_player":
@@ -72,7 +75,7 @@ public class DimensionalTrap extends AbstractNpcAI
startQuestTimer("debuff_player", 10000, npc, null); startQuestTimer("debuff_player", 10000, npc, null);
break; break;
} }
case "demage_player": case "damage_player":
{ {
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, _type, p -> World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, _type, p ->
{ {
@@ -82,7 +85,7 @@ public class DimensionalTrap extends AbstractNpcAI
npc.doCast((getRandom(10) < 5) ? TRAP_STUN.getSkill() : TRAP_POYSON.getSkill()); npc.doCast((getRandom(10) < 5) ? TRAP_STUN.getSkill() : TRAP_POYSON.getSkill());
} }
}); });
startQuestTimer("demage_player", 10000, npc, null); startQuestTimer("damage_player", 10000, npc, null);
break; break;
} }
case "heal_player": case "heal_player":
@@ -99,7 +102,6 @@ public class DimensionalTrap extends AbstractNpcAI
break; break;
} }
} }
}
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -133,21 +135,21 @@ public class DimensionalTrap extends AbstractNpcAI
case DIMENSIONAL_DEMAGE_TRAP_1: case DIMENSIONAL_DEMAGE_TRAP_1:
{ {
npc.setDisplayEffect(4); npc.setDisplayEffect(4);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 50; _type = 50;
break; break;
} }
case DIMENSIONAL_DEMAGE_TRAP_2: case DIMENSIONAL_DEMAGE_TRAP_2:
{ {
npc.setDisplayEffect(5); npc.setDisplayEffect(5);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 100; _type = 100;
break; break;
} }
case DIMENSIONAL_DEMAGE_TRAP_3: case DIMENSIONAL_DEMAGE_TRAP_3:
{ {
npc.setDisplayEffect(6); npc.setDisplayEffect(6);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 150; _type = 150;
break; break;
} }

View File

@@ -294,8 +294,7 @@ public class Quest extends AbstractScript implements IIdentifiable
public void startQuestTimer(String name, long time, Npc npc, PlayerInstance player, boolean repeating) public void startQuestTimer(String name, long time, Npc npc, PlayerInstance player, boolean repeating)
{ {
final List<QuestTimer> timers = getQuestTimers().computeIfAbsent(name, k -> new ArrayList<>(1)); final List<QuestTimer> timers = getQuestTimers().computeIfAbsent(name, k -> new ArrayList<>(1));
// if there exists a timer with this name, allow the timer only if the [npc, player] set is unique // If there exists a timer with this name, allow the timer only if the [npc, player] set is unique nulls act as wildcards.
// nulls act as wildcards
if (getQuestTimer(name, npc, player) == null) if (getQuestTimer(name, npc, player) == null)
{ {
_writeLock.lock(); _writeLock.lock();

View File

@@ -230,6 +230,7 @@ public final class Alarm extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SELF_DESTRUCT_IN_60", npc, null);
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null); startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES); npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class); final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class);

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.commons.util.CommonUtil;
@@ -28,6 +28,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.zone.type.EffectZone; import org.l2jmobius.gameserver.model.zone.type.EffectZone;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import org.l2jmobius.gameserver.scripting.annotations.Disabled;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
@@ -35,6 +36,7 @@ import ai.AbstractNpcAI;
* Dummy AI for spawns/respawns only for testing. * Dummy AI for spawns/respawns only for testing.
* @author Gnacik * @author Gnacik
*/ */
@Disabled // Mobius: this needs to be rewritten.
public final class DenOfEvil extends AbstractNpcAI public final class DenOfEvil extends AbstractNpcAI
{ {
// private static final int _buffer_id = 32656; // private static final int _buffer_id = 32656;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.ChatType;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -69,7 +69,6 @@ public final class GainakSiege extends AbstractNpcAI
{ {
addEnterZoneId(GAINAK_SIEGE_ZONE.getId(), GAINAK_TOWN_ZONE.getId()); addEnterZoneId(GAINAK_SIEGE_ZONE.getId(), GAINAK_TOWN_ZONE.getId());
addKillId(ASSASSIN_IDS); addKillId(ASSASSIN_IDS);
addSpawnId(ASSASSIN_IDS);
startQuestTimer("GAINAK_WAR", getTimeBetweenSieges() * 60000, null, null); startQuestTimer("GAINAK_WAR", getTimeBetweenSieges() * 60000, null, null);
} }

View File

@@ -84,6 +84,7 @@ public class GardenWatchman extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SPAWN_TRAP", npc, null);
startQuestTimer("SPAWN_TRAP", 50000, npc, null); startQuestTimer("SPAWN_TRAP", 50000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -66,6 +66,8 @@ public final class GenesisVines extends AbstractNpcAI
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
npc.setScriptValue(1); npc.setScriptValue(1);
cancelQuestTimer("CAST_SKILL", npc, null);
cancelQuestTimer("DELETE", npc, null);
startQuestTimer("CAST_SKILL", 3000, npc, null); startQuestTimer("CAST_SKILL", 3000, npc, null);
startQuestTimer("DELETE", 150000, npc, null); startQuestTimer("DELETE", 150000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -112,16 +112,19 @@ public final class Spirit extends AbstractNpcAI
{ {
case EXECUTED_MAIDEN_VENGEFUL_SPIRIT: case EXECUTED_MAIDEN_VENGEFUL_SPIRIT:
{ {
cancelQuestTimer("SPAM_TEXT1", npc, null);
startQuestTimer("SPAM_TEXT1", 50000, npc, null, true); startQuestTimer("SPAM_TEXT1", 50000, npc, null, true);
break; break;
} }
case SPIRIT_OF_THE_TORTURED_DWARF: case SPIRIT_OF_THE_TORTURED_DWARF:
{ {
cancelQuestTimer("SPAM_TEXT2", npc, null);
startQuestTimer("SPAM_TEXT2", 50000, npc, null, true); startQuestTimer("SPAM_TEXT2", 50000, npc, null, true);
break; break;
} }
case SPIRIT_OF_ONE_BURNED_ALIVE: case SPIRIT_OF_ONE_BURNED_ALIVE:
{ {
cancelQuestTimer("SPAM_TEXT3", npc, null);
startQuestTimer("SPAM_TEXT3", 50000, npc, null, true); startQuestTimer("SPAM_TEXT3", 50000, npc, null, true);
break; break;
} }

View File

@@ -403,6 +403,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IXmlReader
((Attackable) npc).setCanReturnToSpawnPoint(false); ((Attackable) npc).setCanReturnToSpawnPoint(false);
npc.setTargetable(false); npc.setTargetable(false);
npc.setIsInvul(true); npc.setIsInvul(true);
cancelQuestTimer("REMOVE_PETRIFY", npc, null);
startQuestTimer("REMOVE_PETRIFY", 5 * 60 * 1000, npc, null, false); // 5 minutes startQuestTimer("REMOVE_PETRIFY", 5 * 60 * 1000, npc, null, false); // 5 minutes
} }
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -215,6 +215,12 @@ public final class DarkWaterDragon extends AbstractNpcAI
addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR1, x - 100, y - 100, npc.getZ(), 0, false, 40000); addSpawn(DETRACTOR1, x - 100, y - 100, npc.getZ(), 0, false, 40000);
cancelQuestTimer("first_spawn", npc, null);
cancelQuestTimer("second_spawn", npc, null);
cancelQuestTimer("third_spawn", npc, null);
cancelQuestTimer("fourth_spawn", npc, null);
cancelQuestTimer("fafurion_poison", npc, null);
cancelQuestTimer("fafurion_despawn", npc, null);
startQuestTimer("first_spawn", 2000, npc, null); // timer to delay timer "1" startQuestTimer("first_spawn", 2000, npc, null); // timer to delay timer "1"
startQuestTimer("second_spawn", 4000, npc, null); // timer to delay timer "2" startQuestTimer("second_spawn", 4000, npc, null); // timer to delay timer "2"
startQuestTimer("third_spawn", 8000, npc, null); // timer to delay timer "3" startQuestTimer("third_spawn", 8000, npc, null); // timer to delay timer "3"

View File

@@ -73,7 +73,7 @@ public final class HillsOfGold extends AbstractNpcAI
return; return;
} }
}); });
startQuestTimer("SPICULA_AGGRO" + npc.getObjectId(), 10000, npc, null); startQuestTimer("SPICULA_AGGRO", 10000, npc, null);
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -98,7 +98,7 @@ public final class HillsOfGold extends AbstractNpcAI
{ {
if ((npc.getId() == SPICULA_1) || (npc.getId() == SPICULA_2)) if ((npc.getId() == SPICULA_1) || (npc.getId() == SPICULA_2))
{ {
startQuestTimer("SPICULA_AGGRO" + npc.getObjectId(), 5000, npc, null); startQuestTimer("SPICULA_AGGRO", 5000, npc, null);
} }
else else
{ {

View File

@@ -282,6 +282,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
{ {
npc.setIsInvul(true); npc.setIsInvul(true);
npc.disableCoreAI(true); npc.disableCoreAI(true);
cancelQuestTimer("TRAINING", npc, null);
startQuestTimer("TRAINING", 30000, npc, null, true); startQuestTimer("TRAINING", 30000, npc, null, true);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override @Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{ {
if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100))) if ((killer.getRace() == Race.ERTHEIA) && (SPAWN_RATE > getRandom(100)))
{ {
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE; final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@@ -486,6 +486,7 @@ public final class PrimevalIsle extends AbstractNpcAI
{ {
if (CommonUtil.contains(SPRIGNANT, npc.getId())) if (CommonUtil.contains(SPRIGNANT, npc.getId()))
{ {
cancelQuestTimer("USE_SKILL", npc, null);
startQuestTimer("USE_SKILL", 15000, npc, null); startQuestTimer("USE_SKILL", 15000, npc, null);
} }
else if (CommonUtil.contains(TREX, npc.getId())) else if (CommonUtil.contains(TREX, npc.getId()))
@@ -495,6 +496,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if (collectGhost == 1) if (collectGhost == 1)
{ {
cancelQuestTimer("GHOST_DESPAWN", npc, null);
startQuestTimer("GHOST_DESPAWN", collectDespawn * 60000, npc, null); startQuestTimer("GHOST_DESPAWN", collectDespawn * 60000, npc, null);
} }
} }

View File

@@ -263,6 +263,7 @@ public final class SelMahumDrill extends AbstractNpcAI
{ {
if (CommonUtil.contains(MAHUM_CHIEFS, npc.getId())) if (CommonUtil.contains(MAHUM_CHIEFS, npc.getId()))
{ {
cancelQuestTimer("do_social_action", npc, null);
startQuestTimer("do_social_action", 15000, npc, null); startQuestTimer("do_social_action", 15000, npc, null);
} }

View File

@@ -68,7 +68,6 @@ public final class SelMahumSquad extends AbstractNpcAI
private SelMahumSquad() private SelMahumSquad()
{ {
addAttackId(CHEF); addAttackId(CHEF);
addAttackId(SQUAD_LEADERS); addAttackId(SQUAD_LEADERS);
addEventReceivedId(CHEF, FIRE, STOVE); addEventReceivedId(CHEF, FIRE, STOVE);
@@ -320,7 +319,7 @@ public final class SelMahumSquad extends AbstractNpcAI
@Override @Override
public void onMoveFinished(Npc npc) public void onMoveFinished(Npc npc)
{ {
// Npc moves to fire // NPC moves to fire.
if (!npc.isRandomWalkingEnabled() && (npc.getX() == npc.getVariables().getInt("DESTINATION_X")) && (npc.getY() == npc.getVariables().getInt("DESTINATION_Y"))) if (!npc.isRandomWalkingEnabled() && (npc.getX() == npc.getVariables().getInt("DESTINATION_X")) && (npc.getY() == npc.getVariables().getInt("DESTINATION_Y")))
{ {
npc.setRHandId(OHS_Weapon); npc.setRHandId(OHS_Weapon);
@@ -354,6 +353,7 @@ public final class SelMahumSquad extends AbstractNpcAI
} }
else if (npc.getId() == FIRE) else if (npc.getId() == FIRE)
{ {
cancelQuestTimer("fire", npc, null);
startQuestTimer("fire", 1000, npc, null); startQuestTimer("fire", 1000, npc, null);
} }
else if (CommonUtil.contains(SQUAD_LEADERS, npc.getId())) else if (CommonUtil.contains(SQUAD_LEADERS, npc.getId()))

View File

@@ -72,7 +72,9 @@ public final class BoyAndGirl extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("NPC_CHANGEWEAP", npc, null);
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
cancelQuestTimer("NPC_SHOUT", npc, null);
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null); startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
npc.setRunning(); npc.setRunning();
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600); final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);

View File

@@ -61,6 +61,7 @@ public final class Handermonkey extends AbstractNpcAI
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
npc.setRunning(); npc.setRunning();
cancelQuestTimer("NPC_MOVE", npc, null);
startQuestTimer("NPC_MOVE", 5000, npc, null, true); startQuestTimer("NPC_MOVE", 5000, npc, null, true);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -123,11 +123,11 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
private static final class changeZoneStage implements Runnable private static final class changeZoneStage implements Runnable
{ {
private final ZoneType zone; private final ZoneType _zone;
public changeZoneStage(ZoneType a) public changeZoneStage(ZoneType zone)
{ {
zone = a; _zone = zone;
} }
@Override @Override
@@ -135,50 +135,50 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
{ {
try try
{ {
zoneInfo currentInfo = _roomInfo.get(zone); zoneInfo currentInfo = _roomInfo.get(_zone);
switch (currentInfo.getZoneStage()) switch (currentInfo.getZoneStage())
{ {
case 0: case 0:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.MONITOR_THE_DAMAGE_FOR_30_SEC, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.MONITOR_THE_DAMAGE_FOR_30_SEC, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 1: case 1:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 2: case 2:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TWENTY_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 3: case 3:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIFTEEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIFTEEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 4: case 4:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.TEN_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 5: case 5:
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.FIVE_SECONDS_LEFT, ExShowScreenMessage.TOP_CENTER, 3000));
break; break;
} }
case 6: case 6:
{ {
if (currentInfo.getCurrentMonitorizedDamage() >= 10) if (currentInfo.getCurrentMonitorizedDamage() >= 10)
{ {
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000)); _zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000));
String zoneName = zone.getName().toLowerCase().replace(" ", "_"); String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName))); _templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName)));
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null)); _templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null));
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED))); _zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
currentInfo.setZoneStage(7); currentInfo.setZoneStage(7);
ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min ThreadPool.schedule(new changeZoneStage(_zone), 600000); // 10min
} }
else else
{ {
@@ -190,14 +190,14 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
case 7: case 7:
{ {
currentInfo.reset(); currentInfo.reset();
for (PlayerInstance player : zone.getPlayersInside()) for (PlayerInstance player : _zone.getPlayersInside())
{ {
if (player != null) if (player != null)
{ {
player.sendPacket(new ExSendUIEvent(player)); player.sendPacket(new ExSendUIEvent(player));
} }
} }
String zoneName = zone.getName().toLowerCase().replace(" ", "_"); String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"))); _templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic")));
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null)); _templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
return; return;
@@ -206,7 +206,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentInfo.getZoneStage() < 6) if (currentInfo.getZoneStage() < 6)
{ {
currentInfo.setZoneStage(currentInfo.getZoneStage() + 1); currentInfo.setZoneStage(currentInfo.getZoneStage() + 1);
ThreadPool.schedule(new changeZoneStage(zone), 5000); ThreadPool.schedule(new changeZoneStage(_zone), 5000);
} }
} }
catch (Exception e) catch (Exception e)
@@ -223,7 +223,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
{ {
if (currentZone.getKey().isInsideZone(npc)) if (currentZone.getKey().isInsideZone(npc))
{ {
zoneInfo currentInfo = currentZone.getValue(); final zoneInfo currentInfo = currentZone.getValue();
int currentPoints = currentInfo.getCurrentPoints(); int currentPoints = currentInfo.getCurrentPoints();
if (currentPoints == 300) if (currentPoints == 300)
{ {

View File

@@ -85,6 +85,11 @@ public final class Wastelands extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if ((npc == null) || !npc.isSpawned())
{
return null;
}
switch (event) switch (event)
{ {
case "SOCIAL_SHOW": case "SOCIAL_SHOW":

View File

@@ -54,8 +54,7 @@ public final class ZealotOfShilen extends AbstractNpcAI
return null; return null;
} }
startQuestTimer("WATCHING", 10000, npc, null, true); if (event.equals("WATCHING") && !npc.isAttackingNow() && !npc.isAlikeDead())
if (event.equalsIgnoreCase("WATCHING") && !npc.isAttackingNow())
{ {
World.getInstance().forEachVisibleObject(npc, MonsterInstance.class, character -> World.getInstance().forEachVisibleObject(npc, MonsterInstance.class, character ->
{ {
@@ -66,6 +65,7 @@ public final class ZealotOfShilen extends AbstractNpcAI
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null);
} }
}); });
startQuestTimer("WATCHING", 10000, npc, null);
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -81,13 +81,14 @@ public final class ZealotOfShilen extends AbstractNpcAI
{ {
if (npc.getId() == ZEALOT) if (npc.getId() == ZEALOT)
{ {
npc.setRandomWalking(true); npc.setRandomWalking(false);
} }
else else
{ {
npc.setIsInvul(true); npc.setIsInvul(true);
((Attackable) npc).setCanReturnToSpawnPoint(false); ((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("WATCHING", 10000, npc, null, true); cancelQuestTimer("WATCHING", npc, null);
startQuestTimer("WATCHING", 10000, npc, null);
} }
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -588,6 +588,7 @@ public final class IstinaCavern extends AbstractInstance
npc.setUndying(true); npc.setUndying(true);
npc.setIsInvul(true); npc.setIsInvul(true);
npc.setTargetable(false); npc.setTargetable(false);
getTimers().cancelTimer("BALLISTA_START_TIMER", npc, null);
getTimers().addTimer("BALLISTA_START_TIMER", 10000, npc, null); getTimers().addTimer("BALLISTA_START_TIMER", 10000, npc, null);
} }
} }

View File

@@ -18,10 +18,8 @@ package ai.bosses.QueenAnt;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager; import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager; import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -84,7 +82,6 @@ public final class QueenAnt extends AbstractNpcAI
MonsterInstance _queen = null; MonsterInstance _queen = null;
private MonsterInstance _larva = null; private MonsterInstance _larva = null;
private final Set<MonsterInstance> _nurses = ConcurrentHashMap.newKeySet(); private final Set<MonsterInstance> _nurses = ConcurrentHashMap.newKeySet();
ScheduledFuture<?> _task = null;
private QueenAnt() private QueenAnt()
{ {
@@ -160,7 +157,9 @@ public final class QueenAnt extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if (event.equalsIgnoreCase("heal")) switch (event)
{
case "heal":
{ {
boolean notCasting; boolean notCasting;
final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp()); final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp());
@@ -202,10 +201,11 @@ public final class QueenAnt extends AbstractNpcAI
nurse.setTarget(null); nurse.setTarget(null);
} }
} }
break;
} }
else if (event.equalsIgnoreCase("action") && (npc != null)) case "action":
{ {
if (getRandom(3) == 0) if ((npc != null) && (getRandom(3) == 0))
{ {
if (getRandom(2) == 0) if (getRandom(2) == 0)
{ {
@@ -216,12 +216,28 @@ public final class QueenAnt extends AbstractNpcAI
npc.broadcastSocialAction(4); npc.broadcastSocialAction(4);
} }
} }
break;
} }
else if (event.equalsIgnoreCase("queen_unlock")) case "queen_unlock":
{ {
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0); final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE); GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
spawnBoss(queen); spawnBoss(queen);
break;
}
case "ANT_QUEEN_TASK":
{
if ((_queen == null) || _queen.isDead())
{
cancelQuestTimers("ANT_QUEEN_TASK");
}
else if (_queen.calculateDistance2D(QUEEN_X, QUEEN_Y, QUEEN_Z) > 2000)
{
_queen.clearAggroList();
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
}
break;
}
} }
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -258,7 +274,8 @@ public final class QueenAnt extends AbstractNpcAI
{ {
((MonsterInstance) npc).getMinionList().spawnMinions(npc.getParameters().getMinionList("Privates")); ((MonsterInstance) npc).getMinionList().spawnMinions(npc.getParameters().getMinionList("Privates"));
} }
_task = ThreadPool.scheduleAtFixedRate(new QueenAntTask(), 5 * 1000, 5 * 1000); cancelQuestTimer("ANT_QUEEN_TASK", npc, null);
startQuestTimer("ANT_QUEEN_TASK", 5000, npc, null, true);
break; break;
} }
} }
@@ -360,11 +377,7 @@ public final class QueenAnt extends AbstractNpcAI
_larva.deleteMe(); _larva.deleteMe();
_larva = null; _larva = null;
_queen = null; _queen = null;
if (_task != null) cancelQuestTimers("ANT_QUEEN_TASK");
{
_task.cancel(false);
_task = null;
}
} }
else if ((_queen != null) && !_queen.isAlikeDead()) else if ((_queen != null) && !_queen.isAlikeDead())
{ {
@@ -389,29 +402,6 @@ public final class QueenAnt extends AbstractNpcAI
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);
} }
private class QueenAntTask implements Runnable
{
public QueenAntTask()
{
// Constructor stub
}
@Override
public void run()
{
if ((_queen == null) || _queen.isDead())
{
_task.cancel(false);
_task = null;
}
else if (_queen.calculateDistance2D(QUEEN_X, QUEEN_Y, QUEEN_Z) > 2000.)
{
_queen.clearAggroList();
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
}
}
}
public static void main(String[] args) public static void main(String[] args)
{ {
new QueenAnt(); new QueenAnt();

View File

@@ -98,12 +98,16 @@ public final class AreaSkillNpc extends AbstractNpcAI
final int castTime = npc.getTemplate().getParameters().getInt("i_use_term_time", 5000); final int castTime = npc.getTemplate().getParameters().getInt("i_use_term_time", 5000);
final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000); final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000);
onTimerEvent("SKILL_CAST_BASIC", null, npc, null); // Trigger cast instantly onTimerEvent("SKILL_CAST_BASIC", null, npc, null); // Trigger cast instantly
getTimers().cancelTimer("SKILL_CAST_TIMED", npc, null);
getTimers().cancelTimer("DELETE_ME", npc, null);
getTimers().addTimer("SKILL_CAST_TIMED", castTime, npc, null); getTimers().addTimer("SKILL_CAST_TIMED", castTime, npc, null);
getTimers().addTimer("DELETE_ME", despawnTime, npc, null); getTimers().addTimer("DELETE_ME", despawnTime, npc, null);
} }
else else
{ {
final int despawnTime = npc.getTemplate().getParameters().getInt("despawn_time", 7); final int despawnTime = npc.getTemplate().getParameters().getInt("despawn_time", 7);
getTimers().cancelTimer("SKILL_CAST_TIMED", npc, null);
getTimers().cancelTimer("DELETE_ME", npc, null);
getTimers().addTimer("SKILL_CAST_TIMED", 100, npc, null); getTimers().addTimer("SKILL_CAST_TIMED", 100, npc, null);
getTimers().addTimer("DELETE_ME", (despawnTime * 1000), npc, null); getTimers().addTimer("DELETE_ME", (despawnTime * 1000), npc, null);
} }

View File

@@ -250,6 +250,7 @@ public final class Minigame extends AbstractNpcAI
case TREASURE_BOX: case TREASURE_BOX:
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
cancelQuestTimer("afterthat", npc, null);
startQuestTimer("afterthat", 180000, npc, null); startQuestTimer("afterthat", 180000, npc, null);
break; break;
} }

View File

@@ -128,6 +128,8 @@ public final class WarriorFishingBlock extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SPAWN", npc, null);
cancelQuestTimer("DESPAWN", npc, null);
startQuestTimer("SPAWN", 2000, npc, null); startQuestTimer("SPAWN", 2000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -55,8 +55,11 @@ public class DimensionalTrap extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player) public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{ {
if (npc != null) if ((npc == null) || npc.isAlikeDead())
{ {
return null;
}
switch (event) switch (event)
{ {
case "debuff_player": case "debuff_player":
@@ -72,7 +75,7 @@ public class DimensionalTrap extends AbstractNpcAI
startQuestTimer("debuff_player", 10000, npc, null); startQuestTimer("debuff_player", 10000, npc, null);
break; break;
} }
case "demage_player": case "damage_player":
{ {
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, _type, p -> World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, _type, p ->
{ {
@@ -82,7 +85,7 @@ public class DimensionalTrap extends AbstractNpcAI
npc.doCast((getRandom(10) < 5) ? TRAP_STUN.getSkill() : TRAP_POYSON.getSkill()); npc.doCast((getRandom(10) < 5) ? TRAP_STUN.getSkill() : TRAP_POYSON.getSkill());
} }
}); });
startQuestTimer("demage_player", 10000, npc, null); startQuestTimer("damage_player", 10000, npc, null);
break; break;
} }
case "heal_player": case "heal_player":
@@ -99,7 +102,6 @@ public class DimensionalTrap extends AbstractNpcAI
break; break;
} }
} }
}
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }
@@ -133,21 +135,21 @@ public class DimensionalTrap extends AbstractNpcAI
case DIMENSIONAL_DEMAGE_TRAP_1: case DIMENSIONAL_DEMAGE_TRAP_1:
{ {
npc.setDisplayEffect(4); npc.setDisplayEffect(4);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 50; _type = 50;
break; break;
} }
case DIMENSIONAL_DEMAGE_TRAP_2: case DIMENSIONAL_DEMAGE_TRAP_2:
{ {
npc.setDisplayEffect(5); npc.setDisplayEffect(5);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 100; _type = 100;
break; break;
} }
case DIMENSIONAL_DEMAGE_TRAP_3: case DIMENSIONAL_DEMAGE_TRAP_3:
{ {
npc.setDisplayEffect(6); npc.setDisplayEffect(6);
startQuestTimer("demage_player", 3000, npc, null); startQuestTimer("damage_player", 3000, npc, null);
_type = 150; _type = 150;
break; break;
} }

View File

@@ -295,8 +295,7 @@ public class Quest extends AbstractScript implements IIdentifiable
public void startQuestTimer(String name, long time, Npc npc, PlayerInstance player, boolean repeating) public void startQuestTimer(String name, long time, Npc npc, PlayerInstance player, boolean repeating)
{ {
final List<QuestTimer> timers = getQuestTimers().computeIfAbsent(name, k -> new ArrayList<>(1)); final List<QuestTimer> timers = getQuestTimers().computeIfAbsent(name, k -> new ArrayList<>(1));
// if there exists a timer with this name, allow the timer only if the [npc, player] set is unique // If there exists a timer with this name, allow the timer only if the [npc, player] set is unique nulls act as wildcards.
// nulls act as wildcards
if (getQuestTimer(name, npc, player) == null) if (getQuestTimer(name, npc, player) == null)
{ {
_writeLock.lock(); _writeLock.lock();

View File

@@ -230,6 +230,7 @@ public final class Alarm extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SELF_DESTRUCT_IN_60", npc, null);
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null); startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES); npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class); final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class);

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.commons.util.CommonUtil;
@@ -28,6 +28,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.zone.type.EffectZone; import org.l2jmobius.gameserver.model.zone.type.EffectZone;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import org.l2jmobius.gameserver.scripting.annotations.Disabled;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
@@ -35,6 +36,7 @@ import ai.AbstractNpcAI;
* Dummy AI for spawns/respawns only for testing. * Dummy AI for spawns/respawns only for testing.
* @author Gnacik * @author Gnacik
*/ */
@Disabled // Mobius: this needs to be rewritten.
public final class DenOfEvil extends AbstractNpcAI public final class DenOfEvil extends AbstractNpcAI
{ {
// private static final int _buffer_id = 32656; // private static final int _buffer_id = 32656;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.ChatType;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.DenOfDevil; package ai.areas.DenOfEvil;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Npc;

View File

@@ -69,7 +69,6 @@ public final class GainakSiege extends AbstractNpcAI
{ {
addEnterZoneId(GAINAK_SIEGE_ZONE.getId(), GAINAK_TOWN_ZONE.getId()); addEnterZoneId(GAINAK_SIEGE_ZONE.getId(), GAINAK_TOWN_ZONE.getId());
addKillId(ASSASSIN_IDS); addKillId(ASSASSIN_IDS);
addSpawnId(ASSASSIN_IDS);
startQuestTimer("GAINAK_WAR", getTimeBetweenSieges() * 60000, null, null); startQuestTimer("GAINAK_WAR", getTimeBetweenSieges() * 60000, null, null);
} }

View File

@@ -84,6 +84,7 @@ public class GardenWatchman extends AbstractNpcAI
@Override @Override
public String onSpawn(Npc npc) public String onSpawn(Npc npc)
{ {
cancelQuestTimer("SPAWN_TRAP", npc, null);
startQuestTimer("SPAWN_TRAP", 50000, npc, null); startQuestTimer("SPAWN_TRAP", 50000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);
} }

View File

@@ -66,6 +66,8 @@ public final class GenesisVines extends AbstractNpcAI
{ {
npc.disableCoreAI(true); npc.disableCoreAI(true);
npc.setScriptValue(1); npc.setScriptValue(1);
cancelQuestTimer("CAST_SKILL", npc, null);
cancelQuestTimer("DELETE", npc, null);
startQuestTimer("CAST_SKILL", 3000, npc, null); startQuestTimer("CAST_SKILL", 3000, npc, null);
startQuestTimer("DELETE", 150000, npc, null); startQuestTimer("DELETE", 150000, npc, null);
return super.onSpawn(npc); return super.onSpawn(npc);

View File

@@ -112,16 +112,19 @@ public final class Spirit extends AbstractNpcAI
{ {
case EXECUTED_MAIDEN_VENGEFUL_SPIRIT: case EXECUTED_MAIDEN_VENGEFUL_SPIRIT:
{ {
cancelQuestTimer("SPAM_TEXT1", npc, null);
startQuestTimer("SPAM_TEXT1", 50000, npc, null, true); startQuestTimer("SPAM_TEXT1", 50000, npc, null, true);
break; break;
} }
case SPIRIT_OF_THE_TORTURED_DWARF: case SPIRIT_OF_THE_TORTURED_DWARF:
{ {
cancelQuestTimer("SPAM_TEXT2", npc, null);
startQuestTimer("SPAM_TEXT2", 50000, npc, null, true); startQuestTimer("SPAM_TEXT2", 50000, npc, null, true);
break; break;
} }
case SPIRIT_OF_ONE_BURNED_ALIVE: case SPIRIT_OF_ONE_BURNED_ALIVE:
{ {
cancelQuestTimer("SPAM_TEXT3", npc, null);
startQuestTimer("SPAM_TEXT3", 50000, npc, null, true); startQuestTimer("SPAM_TEXT3", 50000, npc, null, true);
break; break;
} }

View File

@@ -403,6 +403,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IXmlReader
((Attackable) npc).setCanReturnToSpawnPoint(false); ((Attackable) npc).setCanReturnToSpawnPoint(false);
npc.setTargetable(false); npc.setTargetable(false);
npc.setIsInvul(true); npc.setIsInvul(true);
cancelQuestTimer("REMOVE_PETRIFY", npc, null);
startQuestTimer("REMOVE_PETRIFY", 5 * 60 * 1000, npc, null, false); // 5 minutes startQuestTimer("REMOVE_PETRIFY", 5 * 60 * 1000, npc, null, false); // 5 minutes
} }
return super.onSpawn(npc); return super.onSpawn(npc);

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