Replaced some timers.
This commit is contained in:
parent
bde00f08b9
commit
eb40a8e984
@ -17,7 +17,6 @@
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
@ -47,23 +46,20 @@ public final class CrumaTower extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("MESSAGE") && (npc != null))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_GO_TO_UNDERGROUND_LV_3_USING_THE_ELEVATOR_IN_THE_BACK);
|
||||
getTimers().addTimer(event, 15000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onTimerEvent(event, params, npc, player);
|
||||
startQuestTimer(event, 15000, npc, player);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("MESSAGE", 15000, npc, null);
|
||||
startQuestTimer("MESSAGE", 15000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,11 @@ public final class DragonVortex extends AbstractNpcAI
|
||||
raid = RAIDS[0]; // Emerald Horn
|
||||
}
|
||||
addSpawn(raid, npc.getX() + getRandom(-500, 500), npc.getY() + getRandom(-500, 500), npc.getZ() + 10, 0, false, DESPAWN_DELAY, true);
|
||||
getTimers().addTimer("RESET", 60000, t -> npc.setScriptValue(0));
|
||||
startQuestTimer("RESET", 60000, npc, null);
|
||||
}
|
||||
else if ("RESET".equals(event))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package ai.areas.GardenOfGenesis;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -43,7 +42,7 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("CAST_SKILL") && npc.isScriptValue(1))
|
||||
{
|
||||
@ -52,13 +51,14 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
{
|
||||
addSkillCastDesire(npc, npc, skill, 23);
|
||||
}
|
||||
getTimers().addTimer("CAST_SKILL", 3000, npc, null);
|
||||
startQuestTimer("CAST_SKILL", 3000, npc, null);
|
||||
}
|
||||
else if (event.equals("DELETE"))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,8 +66,8 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
{
|
||||
npc.disableCoreAI(true);
|
||||
npc.setScriptValue(1);
|
||||
getTimers().addTimer("CAST_SKILL", 3000, npc, null);
|
||||
getTimers().addTimer("DELETE", 150000, npc, null);
|
||||
startQuestTimer("CAST_SKILL", 3000, npc, null);
|
||||
startQuestTimer("DELETE", 150000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -65,23 +65,29 @@ public final class Statues extends AbstractNpcAI
|
||||
switch (npc.getId())
|
||||
{
|
||||
case STATUE_1:
|
||||
{
|
||||
loc = LOC_1;
|
||||
npcId = STATUE_KEEPER_1;
|
||||
break;
|
||||
}
|
||||
case STATUE_2:
|
||||
{
|
||||
loc = LOC_2;
|
||||
npcId = STATUE_KEEPER_2;
|
||||
break;
|
||||
}
|
||||
case STATUE_3:
|
||||
{
|
||||
loc = LOC_3;
|
||||
npcId = STATUE_KEEPER_3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((loc != null) && (npcId != -1))
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
getTimers().addTimer("FUNCTION_REUSE", 900000, evnt -> npc.setScriptValue(0));
|
||||
startQuestTimer("FUNCTION_REUSE", 900000, npc, null);
|
||||
final L2Npc keeper = addSpawn(npcId, loc, false, 900000);
|
||||
addAttackPlayerDesire(keeper, player);
|
||||
}
|
||||
@ -91,6 +97,10 @@ public final class Statues extends AbstractNpcAI
|
||||
htmltext = npc.getId() + "-no.html";
|
||||
}
|
||||
}
|
||||
else if (event.equals("FUNCTION_REUSE"))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.RuinsOfAgony;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class RoAGuard extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_IS_RUINS_OF_AGONY_WHERE_KANILOV_IS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.RuinsOfDespair;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class RoDGuard extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_IS_THE_RUINS_OF_AGONY_WHERE_POSLOF_IS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ package ai.areas.TalkingIsland.Apprentice;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -71,22 +70,17 @@ public final class Apprentice extends AbstractNpcAI
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_T_RIDE_A_KUKURI_NOW);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("SPAM_TEXT") && (npc != null))
|
||||
else if (event.equals("SPAM_TEXT") && (npc != null))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRY_RIDING_A_KUKURI, 1000);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addRepeatingTimer("SPAM_TEXT", 12000, npc, null);
|
||||
startQuestTimer("SPAM_TEXT", 12000, npc, null, true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,27 +38,37 @@ public final class Banette extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (getRandom(4))
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
case 0:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUND_IS_LOCATED_STRAIGHT_AHEAD);
|
||||
break;
|
||||
case 1:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHILE_TRAINING_IN_THE_TRAINING_GROUNDS_IT_BECOMES_PROGRESSIVELY_DIFFICULT);
|
||||
break;
|
||||
case 2:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUNDS_ACCESS_YOU_NEED_TO_SPEAK_WITH_PANTHEON_IN_THE_MUSEUM);
|
||||
break;
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUND_IS_LOCATED_STRAIGHT_AHEAD);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHILE_TRAINING_IN_THE_TRAINING_GROUNDS_IT_BECOMES_PROGRESSIVELY_DIFFICULT);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUNDS_ACCESS_YOU_NEED_TO_SPEAK_WITH_PANTHEON_IN_THE_MUSEUM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -46,7 +45,7 @@ public final class BoyAndGirl extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_CHANGEWEAP"))
|
||||
{
|
||||
@ -60,20 +59,21 @@ public final class BoyAndGirl extends AbstractNpcAI
|
||||
npc.setRHandId(WEAPON);
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
getTimers().addTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, npc.getId() == BOY ? NpcStringId.WEEE : NpcStringId.BOYS_ARE_SO_ANNOYING);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
npc.setIsRunning(true);
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Devno extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,31 +50,38 @@ public final class Devno extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.CARRY_OUT_YOUR_QUESTS_FAITHFULLY_IN_TALKING_ISLAND_AND_YOU_LL_GET_TO_THE_1ST_CLASS_TRANSFER_IN_NO_TIME);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_SEE_THAT_ADVENTURERS_ARE_RETURNING_TO_TALKING_ISLAND_FOR_THE_AWAKENING);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_SEE_VARIOUS_STATISTICS_IN_THE_MUSEUM_STATS_IN_THE_MAIN_MENU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Eleve extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Eleve extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Eleve extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_YOU_SEE_A_SCROLL_ICON_GO_THAT_LOCATION);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Hera extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.DOES_THE_GODDESS_SEE_WHAT_SHE_HAS_DONE : NpcStringId.WHY_HAVE_THE_HEROES_ABANDONED_US);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,27 +38,37 @@ public final class Heymond extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (getRandom(4))
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
case 0:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.VIEW_OUR_WIDE_VARIETY_OF_ACCESSORIES);
|
||||
break;
|
||||
case 1:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_BEST_WEAPON_DOESN_T_MAKE_YOU_THE_BEST);
|
||||
break;
|
||||
case 2:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_BUY_AND_SELL_COME_TAKE_A_LOOK);
|
||||
break;
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.VIEW_OUR_WIDE_VARIETY_OF_ACCESSORIES);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_BEST_WEAPON_DOESN_T_MAKE_YOU_THE_BEST);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_BUY_AND_SELL_COME_TAKE_A_LOOK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Karonf extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Karonf extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Karonf extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SOME_FOLKS_DON_T_KNOW_WHAT_THEY_ARE_DOING);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Marsha extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Marsha extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Marsha extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ISN_T_THERE_AN_EASIER_WAY_TO_GET_THERE);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Morgan extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Morgan extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Morgan extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BELOW_LEVEL_75_BE_SURE_TO_RECEIVE_NEWBIE_BUFFS);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Rubentis extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Rubentis extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Rubentis extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ONLY_THE_STRONG_SURVIVE_AT_RUINS_OF_YE_SAGIRA);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Ruks extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THE_SEVEN_SIGNS_ENDED : NpcStringId.WE_NEED_TO_FIND_HER_WEAKNESS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.WindmillHill;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Commando extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_RE_COLLECTING_SEEKER_OF_ADEN);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -78,34 +78,29 @@ public final class Cannon extends AbstractNpcAI
|
||||
{
|
||||
String htmltext = null;
|
||||
|
||||
if (event.equals("useCannonBall"))
|
||||
{
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
htmltext = "cannon-recharge.html";
|
||||
}
|
||||
else if (getQuestItemsCount(player, CANNONBALL) == 0)
|
||||
{
|
||||
htmltext = "cannon-noItem.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
takeItems(player, CANNONBALL, 1);
|
||||
npc.setScriptValue(0);
|
||||
npc.setTitleString(NpcStringId.CANNON_IS_LOADING);
|
||||
npc.broadcastInfo();
|
||||
addSkillCastDesire(npc, npc, PRESENT_SKILL, 23);
|
||||
getTimers().addTimer("CANNON_RECHARGE", 300000, npc, null);
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "useCannonBall":
|
||||
{
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
htmltext = "cannon-recharge.html";
|
||||
}
|
||||
else if (getQuestItemsCount(player, CANNONBALL) == 0)
|
||||
{
|
||||
htmltext = "cannon-noItem.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
takeItems(player, CANNONBALL, 1);
|
||||
npc.setScriptValue(0);
|
||||
npc.setTitleString(NpcStringId.CANNON_IS_LOADING);
|
||||
npc.broadcastInfo();
|
||||
addSkillCastDesire(npc, npc, PRESENT_SKILL, 23);
|
||||
startQuestTimer("CANNON_RECHARGE", 300000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CANNON_RECHARGE":
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
@ -123,7 +118,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
final L2Npc transformed = addSpawn(TRANSFORM_DATA.get(monster.getId()), monster);
|
||||
transformed.getVariables().set("DROP_MEMORY_FRAGMENT", true);
|
||||
transformed.getVariables().set("COUNTDOWN_TIME", 21);
|
||||
getTimers().addTimer("COUTDOWN", 100, transformed, null);
|
||||
startQuestTimer("COUTDOWN", 100, transformed, null);
|
||||
monster.deleteMe();
|
||||
}
|
||||
});
|
||||
@ -141,11 +136,12 @@ public final class Cannon extends AbstractNpcAI
|
||||
else if (!npc.isDead())
|
||||
{
|
||||
npc.getVariables().set("COUNTDOWN_TIME", time);
|
||||
getTimers().addTimer("COUTDOWN", 1000, npc, null);
|
||||
startQuestTimer("COUTDOWN", 1000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -166,7 +162,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("CANNON_RECHARGE", 1000, npc, null);
|
||||
startQuestTimer("CANNON_RECHARGE", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@ -180,7 +176,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
npc.broadcastPacket(new Earthquake(npc, 10, 5));
|
||||
npc.broadcastPacket(new OnEventTrigger(npcParams.getInt("TRIGGER_ID"), true));
|
||||
final L2Npc light = addSpawn(INVISIBLE_NPC, npcParams.getInt("LIGHT_ZONE_POS_X"), npcParams.getInt("LIGHT_ZONE_POS_Y"), npcParams.getInt("LIGHT_ZONE_POS_Z"), 0, false, 10000);
|
||||
getTimers().addTimer("LIGHT_CHECK", 500, light, null);
|
||||
startQuestTimer("LIGHT_CHECK", 500, light, null);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package ai.others.ArenaManager;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -72,7 +71,7 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
if (player.getAdena() >= CP_COST)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, CP_COST);
|
||||
getTimers().addTimer("CPrecovery_delay", 2000, npc, player);
|
||||
startQuestTimer("CPrecovery_delay", 2000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -85,7 +84,7 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
if (player.getAdena() >= HP_COST)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, HP_COST);
|
||||
getTimers().addTimer("HPrecovery_delay", 2000, npc, player);
|
||||
startQuestTimer("HPrecovery_delay", 2000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -110,28 +109,28 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CPrecovery_delay":
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(CP_RECOVERY.getSkill());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "HPrecovery_delay":
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(HP_RECOVERY.getSkill());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
if (event.equals("CPrecovery_delay"))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(CP_RECOVERY.getSkill());
|
||||
}
|
||||
else if (event.equals("HPrecovery_delay"))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(HP_RECOVERY.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ArenaManager();
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.others.GravitoryCore;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.WarpedSpaceManager;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
@ -39,6 +38,16 @@ public class GravityCore extends AbstractNpcAI
|
||||
addDespawnId(GRAVITY_CORE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("DELETE_ME") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
@ -53,7 +62,7 @@ public class GravityCore extends AbstractNpcAI
|
||||
}
|
||||
|
||||
final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000);
|
||||
getTimers().addTimer("DELETE_ME", despawnTime, npc, player);
|
||||
startQuestTimer("DELETE_ME", despawnTime, npc, player);
|
||||
|
||||
WarpedSpaceManager.getInstance().addWarpedSpace(npc, 100);
|
||||
}
|
||||
@ -67,15 +76,6 @@ public class GravityCore extends AbstractNpcAI
|
||||
WarpedSpaceManager.getInstance().removeWarpedSpace(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("DELETE_ME"))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new GravityCore();
|
||||
|
@ -84,10 +84,14 @@ public final class OlyBuffer extends AbstractNpcAI
|
||||
if (npc.getScriptValue() >= 5)
|
||||
{
|
||||
htmltext = "OlyBuffer-noMore.html";
|
||||
getTimers().addTimer("DELETE_ME", 5000, evnt -> npc.deleteMe());
|
||||
startQuestTimer("DELETE_ME", 5000, npc, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equals("DELETE_ME") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ import java.util.logging.Logger;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.instancemanager.DBSpawnManager;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
@ -46,13 +47,23 @@ public final class EilhalderVonHellmann extends AbstractNpcAI
|
||||
addSpawnId(EILHALDER_VON_HELLMANN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("delete") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
// Spawn that comes from RaidBossSpawnManager
|
||||
if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null))
|
||||
{
|
||||
getTimers().addTimer("delete", 1000, event -> npc.deleteMe());
|
||||
startQuestTimer("delete", 1000, npc, null);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
@ -112,16 +112,24 @@ public final class TersisHerald extends AbstractNpcAI
|
||||
switch (npc.getId())
|
||||
{
|
||||
case ANTHARAS:
|
||||
{
|
||||
npcStringId = NpcStringId.THE_EVIL_LAND_DRAGON_ANTHARAS_HAS_BEEN_DEFEATED_BY_BRAVE_HEROES;
|
||||
break;
|
||||
}
|
||||
case VALAKAS:
|
||||
{
|
||||
npcStringId = NpcStringId.THE_EVIL_FIRE_DRAGON_VALAKAS_HAS_BEEN_DEFEATED;
|
||||
break;
|
||||
}
|
||||
case LINDVIOR:
|
||||
{
|
||||
npcStringId = NpcStringId.HONORABLE_WARRIORS_HAVE_DRIVEN_OFF_LINDVIOR_THE_EVIL_WIND_DRAGON;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
}
|
||||
|
||||
L2World.getInstance().getPlayers().stream().forEach(p -> showOnScreenMsg(p, npcStringId, 2, 10000, true));
|
||||
|
@ -19,7 +19,6 @@ package instances.NightmareKamaloka;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@ -62,29 +61,25 @@ public final class NightmareKamaloka extends AbstractInstance
|
||||
addKillId(BOSS_MAP.keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "SPAWN_BOSSES":
|
||||
{
|
||||
instance.spawnGroup("BOSSES");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("enterInstance"))
|
||||
switch (event)
|
||||
{
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
case "enterInstance":
|
||||
{
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
break;
|
||||
}
|
||||
case "SPAWN_BOSSES":
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
instance.spawnGroup("BOSSES");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
@ -97,7 +92,7 @@ public final class NightmareKamaloka extends AbstractInstance
|
||||
{
|
||||
if (npc.getId() == INVISIBLE_NPC)
|
||||
{
|
||||
getTimers().addTimer("SPAWN_BOSSES", 10000, npc, null);
|
||||
startQuestTimer("SPAWN_BOSSES", 10000, npc, null);
|
||||
}
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
|
@ -132,7 +132,6 @@ public final class TalkingIslandPast extends AbstractInstance
|
||||
knight.setIsRunning(true);
|
||||
showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000);
|
||||
getTimers().addTimer("MSG", null, 5000, npc, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
package quests.Q10709_TheStolenSeed;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
@ -83,7 +82,7 @@ public final class Q10709_TheStolenSeed extends Quest
|
||||
embryo.setIsInvul(true);
|
||||
akum.setIsInvul(true);
|
||||
|
||||
getTimers().addTimer("EMBRYO_DELAY", 3000, embryo, player);
|
||||
startQuestTimer("EMBRYO_DELAY", 3000, embryo, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -126,29 +125,23 @@ public final class Q10709_TheStolenSeed extends Quest
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("EMBRYO_DELAY"))
|
||||
{
|
||||
final L2Npc akum = (L2Npc) npc.getTarget();
|
||||
final QuestState st = getQuestState(player, true);
|
||||
|
||||
if ((akum != null) && (st != null))
|
||||
case "EMBRYO_DELAY":
|
||||
{
|
||||
st.setCond(2, true);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.KARTIA_S_SEED_GOT_IT);
|
||||
akum.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARGHH);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WORTHLESS_GIANT_CURSE_YOU_FOR_ETERNITY);
|
||||
addSpawn(CURSED_AKUM, akum);
|
||||
npc.deleteMe();
|
||||
akum.deleteMe();
|
||||
final L2Npc akum = (L2Npc) npc.getTarget();
|
||||
if (akum != null)
|
||||
{
|
||||
st.setCond(2, true);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.KARTIA_S_SEED_GOT_IT);
|
||||
akum.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARGHH);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WORTHLESS_GIANT_CURSE_YOU_FOR_ETERNITY);
|
||||
addSpawn(CURSED_AKUM, akum);
|
||||
npc.deleteMe();
|
||||
akum.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -75,7 +75,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
case "30484-02.htm":
|
||||
case "30484-03.htm":
|
||||
case "30484-04.htm":
|
||||
{
|
||||
break;
|
||||
}
|
||||
case "30484-05.htm":
|
||||
{
|
||||
qs.startQuest();
|
||||
@ -94,7 +96,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
htmltext = null;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
@ -116,14 +120,20 @@ public final class Q10771_VolatilePower extends Quest
|
||||
switch (qs.getState())
|
||||
{
|
||||
case State.CREATED:
|
||||
{
|
||||
htmltext = "30484-01.htm";
|
||||
break;
|
||||
}
|
||||
case State.STARTED:
|
||||
{
|
||||
htmltext = (qs.isCond(1)) ? "30484-06.html" : "30484-07.html";
|
||||
break;
|
||||
}
|
||||
case State.COMPLETED:
|
||||
{
|
||||
htmltext = getAlreadyCompletedMsg(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (qs.isStarted())
|
||||
@ -204,7 +214,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
super.onTimerEvent(event, params, npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
@ -47,23 +46,20 @@ public final class CrumaTower extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("MESSAGE") && (npc != null))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_GO_TO_UNDERGROUND_LV_3_USING_THE_ELEVATOR_IN_THE_BACK);
|
||||
getTimers().addTimer(event, 15000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onTimerEvent(event, params, npc, player);
|
||||
startQuestTimer(event, 15000, npc, player);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("MESSAGE", 15000, npc, null);
|
||||
startQuestTimer("MESSAGE", 15000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,11 @@ public final class DragonVortex extends AbstractNpcAI
|
||||
raid = RAIDS[0]; // Emerald Horn
|
||||
}
|
||||
addSpawn(raid, npc.getX() + getRandom(-500, 500), npc.getY() + getRandom(-500, 500), npc.getZ() + 10, 0, false, DESPAWN_DELAY, true);
|
||||
getTimers().addTimer("RESET", 60000, t -> npc.setScriptValue(0));
|
||||
startQuestTimer("RESET", 60000, npc, null);
|
||||
}
|
||||
else if ("RESET".equals(event))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package ai.areas.GardenOfGenesis;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -43,7 +42,7 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("CAST_SKILL") && npc.isScriptValue(1))
|
||||
{
|
||||
@ -52,13 +51,14 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
{
|
||||
addSkillCastDesire(npc, npc, skill, 23);
|
||||
}
|
||||
getTimers().addTimer("CAST_SKILL", 3000, npc, null);
|
||||
startQuestTimer("CAST_SKILL", 3000, npc, null);
|
||||
}
|
||||
else if (event.equals("DELETE"))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,8 +66,8 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
{
|
||||
npc.disableCoreAI(true);
|
||||
npc.setScriptValue(1);
|
||||
getTimers().addTimer("CAST_SKILL", 3000, npc, null);
|
||||
getTimers().addTimer("DELETE", 150000, npc, null);
|
||||
startQuestTimer("CAST_SKILL", 3000, npc, null);
|
||||
startQuestTimer("DELETE", 150000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -65,23 +65,29 @@ public final class Statues extends AbstractNpcAI
|
||||
switch (npc.getId())
|
||||
{
|
||||
case STATUE_1:
|
||||
{
|
||||
loc = LOC_1;
|
||||
npcId = STATUE_KEEPER_1;
|
||||
break;
|
||||
}
|
||||
case STATUE_2:
|
||||
{
|
||||
loc = LOC_2;
|
||||
npcId = STATUE_KEEPER_2;
|
||||
break;
|
||||
}
|
||||
case STATUE_3:
|
||||
{
|
||||
loc = LOC_3;
|
||||
npcId = STATUE_KEEPER_3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((loc != null) && (npcId != -1))
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
getTimers().addTimer("FUNCTION_REUSE", 900000, evnt -> npc.setScriptValue(0));
|
||||
startQuestTimer("FUNCTION_REUSE", 900000, npc, null);
|
||||
final L2Npc keeper = addSpawn(npcId, loc, false, 900000);
|
||||
addAttackPlayerDesire(keeper, player);
|
||||
}
|
||||
@ -91,6 +97,10 @@ public final class Statues extends AbstractNpcAI
|
||||
htmltext = npc.getId() + "-no.html";
|
||||
}
|
||||
}
|
||||
else if (event.equals("FUNCTION_REUSE"))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.RuinsOfAgony;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class RoAGuard extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_IS_RUINS_OF_AGONY_WHERE_KANILOV_IS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.RuinsOfDespair;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class RoDGuard extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_IS_THE_RUINS_OF_AGONY_WHERE_POSLOF_IS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ package ai.areas.TalkingIsland.Apprentice;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -71,22 +70,17 @@ public final class Apprentice extends AbstractNpcAI
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_T_RIDE_A_KUKURI_NOW);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("SPAM_TEXT") && (npc != null))
|
||||
else if (event.equals("SPAM_TEXT") && (npc != null))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRY_RIDING_A_KUKURI, 1000);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addRepeatingTimer("SPAM_TEXT", 12000, npc, null);
|
||||
startQuestTimer("SPAM_TEXT", 12000, npc, null, true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,27 +38,37 @@ public final class Banette extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (getRandom(4))
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
case 0:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUND_IS_LOCATED_STRAIGHT_AHEAD);
|
||||
break;
|
||||
case 1:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHILE_TRAINING_IN_THE_TRAINING_GROUNDS_IT_BECOMES_PROGRESSIVELY_DIFFICULT);
|
||||
break;
|
||||
case 2:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUNDS_ACCESS_YOU_NEED_TO_SPEAK_WITH_PANTHEON_IN_THE_MUSEUM);
|
||||
break;
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUND_IS_LOCATED_STRAIGHT_AHEAD);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHILE_TRAINING_IN_THE_TRAINING_GROUNDS_IT_BECOMES_PROGRESSIVELY_DIFFICULT);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUNDS_ACCESS_YOU_NEED_TO_SPEAK_WITH_PANTHEON_IN_THE_MUSEUM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -46,7 +45,7 @@ public final class BoyAndGirl extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_CHANGEWEAP"))
|
||||
{
|
||||
@ -60,20 +59,21 @@ public final class BoyAndGirl extends AbstractNpcAI
|
||||
npc.setRHandId(WEAPON);
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
getTimers().addTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, npc.getId() == BOY ? NpcStringId.WEEE : NpcStringId.BOYS_ARE_SO_ANNOYING);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
npc.setIsRunning(true);
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Devno extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,31 +50,38 @@ public final class Devno extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.CARRY_OUT_YOUR_QUESTS_FAITHFULLY_IN_TALKING_ISLAND_AND_YOU_LL_GET_TO_THE_1ST_CLASS_TRANSFER_IN_NO_TIME);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_SEE_THAT_ADVENTURERS_ARE_RETURNING_TO_TALKING_ISLAND_FOR_THE_AWAKENING);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_SEE_VARIOUS_STATISTICS_IN_THE_MUSEUM_STATS_IN_THE_MAIN_MENU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Eleve extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Eleve extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Eleve extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_YOU_SEE_A_SCROLL_ICON_GO_THAT_LOCATION);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Hera extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.DOES_THE_GODDESS_SEE_WHAT_SHE_HAS_DONE : NpcStringId.WHY_HAVE_THE_HEROES_ABANDONED_US);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,27 +38,37 @@ public final class Heymond extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (getRandom(4))
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
case 0:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.VIEW_OUR_WIDE_VARIETY_OF_ACCESSORIES);
|
||||
break;
|
||||
case 1:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_BEST_WEAPON_DOESN_T_MAKE_YOU_THE_BEST);
|
||||
break;
|
||||
case 2:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_BUY_AND_SELL_COME_TAKE_A_LOOK);
|
||||
break;
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.VIEW_OUR_WIDE_VARIETY_OF_ACCESSORIES);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_BEST_WEAPON_DOESN_T_MAKE_YOU_THE_BEST);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_BUY_AND_SELL_COME_TAKE_A_LOOK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Karonf extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Karonf extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Karonf extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SOME_FOLKS_DON_T_KNOW_WHAT_THEY_ARE_DOING);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Marsha extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Marsha extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Marsha extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ISN_T_THERE_AN_EASIER_WAY_TO_GET_THERE);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Morgan extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Morgan extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Morgan extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BELOW_LEVEL_75_BE_SURE_TO_RECEIVE_NEWBIE_BUFFS);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Rubentis extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Rubentis extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Rubentis extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ONLY_THE_STRONG_SURVIVE_AT_RUINS_OF_YE_SAGIRA);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Ruks extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THE_SEVEN_SIGNS_ENDED : NpcStringId.WE_NEED_TO_FIND_HER_WEAKNESS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.WindmillHill;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Commando extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_RE_COLLECTING_SEEKER_OF_ADEN);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -78,34 +78,29 @@ public final class Cannon extends AbstractNpcAI
|
||||
{
|
||||
String htmltext = null;
|
||||
|
||||
if (event.equals("useCannonBall"))
|
||||
{
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
htmltext = "cannon-recharge.html";
|
||||
}
|
||||
else if (getQuestItemsCount(player, CANNONBALL) == 0)
|
||||
{
|
||||
htmltext = "cannon-noItem.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
takeItems(player, CANNONBALL, 1);
|
||||
npc.setScriptValue(0);
|
||||
npc.setTitleString(NpcStringId.CANNON_IS_LOADING);
|
||||
npc.broadcastInfo();
|
||||
addSkillCastDesire(npc, npc, PRESENT_SKILL, 23);
|
||||
getTimers().addTimer("CANNON_RECHARGE", 300000, npc, null);
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "useCannonBall":
|
||||
{
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
htmltext = "cannon-recharge.html";
|
||||
}
|
||||
else if (getQuestItemsCount(player, CANNONBALL) == 0)
|
||||
{
|
||||
htmltext = "cannon-noItem.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
takeItems(player, CANNONBALL, 1);
|
||||
npc.setScriptValue(0);
|
||||
npc.setTitleString(NpcStringId.CANNON_IS_LOADING);
|
||||
npc.broadcastInfo();
|
||||
addSkillCastDesire(npc, npc, PRESENT_SKILL, 23);
|
||||
startQuestTimer("CANNON_RECHARGE", 300000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CANNON_RECHARGE":
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
@ -123,7 +118,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
final L2Npc transformed = addSpawn(TRANSFORM_DATA.get(monster.getId()), monster);
|
||||
transformed.getVariables().set("DROP_MEMORY_FRAGMENT", true);
|
||||
transformed.getVariables().set("COUNTDOWN_TIME", 21);
|
||||
getTimers().addTimer("COUTDOWN", 100, transformed, null);
|
||||
startQuestTimer("COUTDOWN", 100, transformed, null);
|
||||
monster.deleteMe();
|
||||
}
|
||||
});
|
||||
@ -141,11 +136,12 @@ public final class Cannon extends AbstractNpcAI
|
||||
else if (!npc.isDead())
|
||||
{
|
||||
npc.getVariables().set("COUNTDOWN_TIME", time);
|
||||
getTimers().addTimer("COUTDOWN", 1000, npc, null);
|
||||
startQuestTimer("COUTDOWN", 1000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -166,7 +162,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("CANNON_RECHARGE", 1000, npc, null);
|
||||
startQuestTimer("CANNON_RECHARGE", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@ -180,7 +176,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
npc.broadcastPacket(new Earthquake(npc, 10, 5));
|
||||
npc.broadcastPacket(new OnEventTrigger(npcParams.getInt("TRIGGER_ID"), true));
|
||||
final L2Npc light = addSpawn(INVISIBLE_NPC, npcParams.getInt("LIGHT_ZONE_POS_X"), npcParams.getInt("LIGHT_ZONE_POS_Y"), npcParams.getInt("LIGHT_ZONE_POS_Z"), 0, false, 10000);
|
||||
getTimers().addTimer("LIGHT_CHECK", 500, light, null);
|
||||
startQuestTimer("LIGHT_CHECK", 500, light, null);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package ai.others.ArenaManager;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -72,7 +71,7 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
if (player.getAdena() >= CP_COST)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, CP_COST);
|
||||
getTimers().addTimer("CPrecovery_delay", 2000, npc, player);
|
||||
startQuestTimer("CPrecovery_delay", 2000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -85,7 +84,7 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
if (player.getAdena() >= HP_COST)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, HP_COST);
|
||||
getTimers().addTimer("HPrecovery_delay", 2000, npc, player);
|
||||
startQuestTimer("HPrecovery_delay", 2000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -110,28 +109,28 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CPrecovery_delay":
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(CP_RECOVERY.getSkill());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "HPrecovery_delay":
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(HP_RECOVERY.getSkill());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
if (event.equals("CPrecovery_delay"))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(CP_RECOVERY.getSkill());
|
||||
}
|
||||
else if (event.equals("HPrecovery_delay"))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(HP_RECOVERY.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ArenaManager();
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.others.GravitoryCore;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.WarpedSpaceManager;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
@ -39,6 +38,16 @@ public class GravityCore extends AbstractNpcAI
|
||||
addDespawnId(GRAVITY_CORE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("DELETE_ME") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
@ -53,7 +62,7 @@ public class GravityCore extends AbstractNpcAI
|
||||
}
|
||||
|
||||
final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000);
|
||||
getTimers().addTimer("DELETE_ME", despawnTime, npc, player);
|
||||
startQuestTimer("DELETE_ME", despawnTime, npc, player);
|
||||
|
||||
WarpedSpaceManager.getInstance().addWarpedSpace(npc, 100);
|
||||
}
|
||||
@ -67,15 +76,6 @@ public class GravityCore extends AbstractNpcAI
|
||||
WarpedSpaceManager.getInstance().removeWarpedSpace(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("DELETE_ME"))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new GravityCore();
|
||||
|
@ -84,10 +84,14 @@ public final class OlyBuffer extends AbstractNpcAI
|
||||
if (npc.getScriptValue() >= 5)
|
||||
{
|
||||
htmltext = "OlyBuffer-noMore.html";
|
||||
getTimers().addTimer("DELETE_ME", 5000, evnt -> npc.deleteMe());
|
||||
startQuestTimer("DELETE_ME", 5000, npc, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equals("DELETE_ME") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ import java.util.logging.Logger;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.instancemanager.DBSpawnManager;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
@ -46,13 +47,23 @@ public final class EilhalderVonHellmann extends AbstractNpcAI
|
||||
addSpawnId(EILHALDER_VON_HELLMANN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("delete") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
// Spawn that comes from RaidBossSpawnManager
|
||||
if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null))
|
||||
{
|
||||
getTimers().addTimer("delete", 1000, event -> npc.deleteMe());
|
||||
startQuestTimer("delete", 1000, npc, null);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
@ -112,16 +112,24 @@ public final class TersisHerald extends AbstractNpcAI
|
||||
switch (npc.getId())
|
||||
{
|
||||
case ANTHARAS:
|
||||
{
|
||||
npcStringId = NpcStringId.THE_EVIL_LAND_DRAGON_ANTHARAS_HAS_BEEN_DEFEATED_BY_BRAVE_HEROES;
|
||||
break;
|
||||
}
|
||||
case VALAKAS:
|
||||
{
|
||||
npcStringId = NpcStringId.THE_EVIL_FIRE_DRAGON_VALAKAS_HAS_BEEN_DEFEATED;
|
||||
break;
|
||||
}
|
||||
case LINDVIOR:
|
||||
{
|
||||
npcStringId = NpcStringId.HONORABLE_WARRIORS_HAVE_DRIVEN_OFF_LINDVIOR_THE_EVIL_WIND_DRAGON;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
}
|
||||
|
||||
L2World.getInstance().getPlayers().stream().forEach(p -> showOnScreenMsg(p, npcStringId, 2, 10000, true));
|
||||
|
@ -19,7 +19,6 @@ package instances.NightmareKamaloka;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@ -62,29 +61,25 @@ public final class NightmareKamaloka extends AbstractInstance
|
||||
addKillId(BOSS_MAP.keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "SPAWN_BOSSES":
|
||||
{
|
||||
instance.spawnGroup("BOSSES");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("enterInstance"))
|
||||
switch (event)
|
||||
{
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
case "enterInstance":
|
||||
{
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
break;
|
||||
}
|
||||
case "SPAWN_BOSSES":
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
instance.spawnGroup("BOSSES");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
@ -97,7 +92,7 @@ public final class NightmareKamaloka extends AbstractInstance
|
||||
{
|
||||
if (npc.getId() == INVISIBLE_NPC)
|
||||
{
|
||||
getTimers().addTimer("SPAWN_BOSSES", 10000, npc, null);
|
||||
startQuestTimer("SPAWN_BOSSES", 10000, npc, null);
|
||||
}
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
|
@ -132,7 +132,6 @@ public final class TalkingIslandPast extends AbstractInstance
|
||||
knight.setIsRunning(true);
|
||||
showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000);
|
||||
getTimers().addTimer("MSG", null, 5000, npc, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
package quests.Q10709_TheStolenSeed;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
@ -83,7 +82,7 @@ public final class Q10709_TheStolenSeed extends Quest
|
||||
embryo.setIsInvul(true);
|
||||
akum.setIsInvul(true);
|
||||
|
||||
getTimers().addTimer("EMBRYO_DELAY", 3000, embryo, player);
|
||||
startQuestTimer("EMBRYO_DELAY", 3000, embryo, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -126,29 +125,23 @@ public final class Q10709_TheStolenSeed extends Quest
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("EMBRYO_DELAY"))
|
||||
{
|
||||
final L2Npc akum = (L2Npc) npc.getTarget();
|
||||
final QuestState st = getQuestState(player, true);
|
||||
|
||||
if ((akum != null) && (st != null))
|
||||
case "EMBRYO_DELAY":
|
||||
{
|
||||
st.setCond(2, true);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.KARTIA_S_SEED_GOT_IT);
|
||||
akum.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARGHH);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WORTHLESS_GIANT_CURSE_YOU_FOR_ETERNITY);
|
||||
addSpawn(CURSED_AKUM, akum);
|
||||
npc.deleteMe();
|
||||
akum.deleteMe();
|
||||
final L2Npc akum = (L2Npc) npc.getTarget();
|
||||
if (akum != null)
|
||||
{
|
||||
st.setCond(2, true);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.KARTIA_S_SEED_GOT_IT);
|
||||
akum.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARGHH);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WORTHLESS_GIANT_CURSE_YOU_FOR_ETERNITY);
|
||||
addSpawn(CURSED_AKUM, akum);
|
||||
npc.deleteMe();
|
||||
akum.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -75,7 +75,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
case "30484-02.htm":
|
||||
case "30484-03.htm":
|
||||
case "30484-04.htm":
|
||||
{
|
||||
break;
|
||||
}
|
||||
case "30484-05.htm":
|
||||
{
|
||||
qs.startQuest();
|
||||
@ -94,7 +96,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
htmltext = null;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
@ -116,14 +120,20 @@ public final class Q10771_VolatilePower extends Quest
|
||||
switch (qs.getState())
|
||||
{
|
||||
case State.CREATED:
|
||||
{
|
||||
htmltext = "30484-01.htm";
|
||||
break;
|
||||
}
|
||||
case State.STARTED:
|
||||
{
|
||||
htmltext = (qs.isCond(1)) ? "30484-06.html" : "30484-07.html";
|
||||
break;
|
||||
}
|
||||
case State.COMPLETED:
|
||||
{
|
||||
htmltext = getAlreadyCompletedMsg(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (qs.isStarted())
|
||||
@ -204,7 +214,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
super.onTimerEvent(event, params, npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
@ -47,23 +46,20 @@ public final class CrumaTower extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("MESSAGE") && (npc != null))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_GO_TO_UNDERGROUND_LV_3_USING_THE_ELEVATOR_IN_THE_BACK);
|
||||
getTimers().addTimer(event, 15000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onTimerEvent(event, params, npc, player);
|
||||
startQuestTimer(event, 15000, npc, player);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("MESSAGE", 15000, npc, null);
|
||||
startQuestTimer("MESSAGE", 15000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,11 @@ public final class DragonVortex extends AbstractNpcAI
|
||||
raid = RAIDS[0]; // Emerald Horn
|
||||
}
|
||||
addSpawn(raid, npc.getX() + getRandom(-500, 500), npc.getY() + getRandom(-500, 500), npc.getZ() + 10, 0, false, DESPAWN_DELAY, true);
|
||||
getTimers().addTimer("RESET", 60000, t -> npc.setScriptValue(0));
|
||||
startQuestTimer("RESET", 60000, npc, null);
|
||||
}
|
||||
else if ("RESET".equals(event))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package ai.areas.GardenOfGenesis;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -43,7 +42,7 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("CAST_SKILL") && npc.isScriptValue(1))
|
||||
{
|
||||
@ -52,13 +51,14 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
{
|
||||
addSkillCastDesire(npc, npc, skill, 23);
|
||||
}
|
||||
getTimers().addTimer("CAST_SKILL", 3000, npc, null);
|
||||
startQuestTimer("CAST_SKILL", 3000, npc, null);
|
||||
}
|
||||
else if (event.equals("DELETE"))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,8 +66,8 @@ public final class GenesisVines extends AbstractNpcAI
|
||||
{
|
||||
npc.disableCoreAI(true);
|
||||
npc.setScriptValue(1);
|
||||
getTimers().addTimer("CAST_SKILL", 3000, npc, null);
|
||||
getTimers().addTimer("DELETE", 150000, npc, null);
|
||||
startQuestTimer("CAST_SKILL", 3000, npc, null);
|
||||
startQuestTimer("DELETE", 150000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -65,23 +65,29 @@ public final class Statues extends AbstractNpcAI
|
||||
switch (npc.getId())
|
||||
{
|
||||
case STATUE_1:
|
||||
{
|
||||
loc = LOC_1;
|
||||
npcId = STATUE_KEEPER_1;
|
||||
break;
|
||||
}
|
||||
case STATUE_2:
|
||||
{
|
||||
loc = LOC_2;
|
||||
npcId = STATUE_KEEPER_2;
|
||||
break;
|
||||
}
|
||||
case STATUE_3:
|
||||
{
|
||||
loc = LOC_3;
|
||||
npcId = STATUE_KEEPER_3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((loc != null) && (npcId != -1))
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
getTimers().addTimer("FUNCTION_REUSE", 900000, evnt -> npc.setScriptValue(0));
|
||||
startQuestTimer("FUNCTION_REUSE", 900000, npc, null);
|
||||
final L2Npc keeper = addSpawn(npcId, loc, false, 900000);
|
||||
addAttackPlayerDesire(keeper, player);
|
||||
}
|
||||
@ -91,6 +97,10 @@ public final class Statues extends AbstractNpcAI
|
||||
htmltext = npc.getId() + "-no.html";
|
||||
}
|
||||
}
|
||||
else if (event.equals("FUNCTION_REUSE"))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.RuinsOfAgony;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class RoAGuard extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_IS_RUINS_OF_AGONY_WHERE_KANILOV_IS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.RuinsOfDespair;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class RoDGuard extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_IS_THE_RUINS_OF_AGONY_WHERE_POSLOF_IS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland.Apprentice;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -58,22 +57,17 @@ public final class Apprentice extends AbstractNpcAI
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_T_RIDE_A_KUKURI_NOW);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("SPAM_TEXT") && (npc != null))
|
||||
else if (event.equals("SPAM_TEXT") && (npc != null))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRY_RIDING_A_KUKURI, 1000);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addRepeatingTimer("SPAM_TEXT", 12000, npc, null);
|
||||
startQuestTimer("SPAM_TEXT", 12000, npc, null, true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,27 +38,37 @@ public final class Banette extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (getRandom(4))
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
case 0:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUND_IS_LOCATED_STRAIGHT_AHEAD);
|
||||
break;
|
||||
case 1:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHILE_TRAINING_IN_THE_TRAINING_GROUNDS_IT_BECOMES_PROGRESSIVELY_DIFFICULT);
|
||||
break;
|
||||
case 2:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUNDS_ACCESS_YOU_NEED_TO_SPEAK_WITH_PANTHEON_IN_THE_MUSEUM);
|
||||
break;
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUND_IS_LOCATED_STRAIGHT_AHEAD);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHILE_TRAINING_IN_THE_TRAINING_GROUNDS_IT_BECOMES_PROGRESSIVELY_DIFFICULT);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRAINING_GROUNDS_ACCESS_YOU_NEED_TO_SPEAK_WITH_PANTHEON_IN_THE_MUSEUM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -46,7 +45,7 @@ public final class BoyAndGirl extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_CHANGEWEAP"))
|
||||
{
|
||||
@ -60,20 +59,21 @@ public final class BoyAndGirl extends AbstractNpcAI
|
||||
npc.setRHandId(WEAPON);
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
getTimers().addTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, npc.getId() == BOY ? NpcStringId.WEEE : NpcStringId.BOYS_ARE_SO_ANNOYING);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
npc.setIsRunning(true);
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Devno extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,31 +50,38 @@ public final class Devno extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.CARRY_OUT_YOUR_QUESTS_FAITHFULLY_IN_TALKING_ISLAND_AND_YOU_LL_GET_TO_THE_1ST_CLASS_TRANSFER_IN_NO_TIME);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_SEE_THAT_ADVENTURERS_ARE_RETURNING_TO_TALKING_ISLAND_FOR_THE_AWAKENING);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_SEE_VARIOUS_STATISTICS_IN_THE_MUSEUM_STATS_IN_THE_MAIN_MENU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Eleve extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Eleve extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Eleve extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_YOU_SEE_A_SCROLL_ICON_GO_THAT_LOCATION);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Hera extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.DOES_THE_GODDESS_SEE_WHAT_SHE_HAS_DONE : NpcStringId.WHY_HAVE_THE_HEROES_ABANDONED_US);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,27 +38,37 @@ public final class Heymond extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (getRandom(4))
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
case 0:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.VIEW_OUR_WIDE_VARIETY_OF_ACCESSORIES);
|
||||
break;
|
||||
case 1:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_BEST_WEAPON_DOESN_T_MAKE_YOU_THE_BEST);
|
||||
break;
|
||||
case 2:
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_BUY_AND_SELL_COME_TAKE_A_LOOK);
|
||||
break;
|
||||
switch (getRandom(4))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.VIEW_OUR_WIDE_VARIETY_OF_ACCESSORIES);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_BEST_WEAPON_DOESN_T_MAKE_YOU_THE_BEST);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_BUY_AND_SELL_COME_TAKE_A_LOOK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Karonf extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Karonf extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Karonf extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SOME_FOLKS_DON_T_KNOW_WHAT_THEY_ARE_DOING);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Marsha extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Marsha extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Marsha extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ISN_T_THERE_AN_EASIER_WAY_TO_GET_THERE);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Morgan extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Morgan extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Morgan extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BELOW_LEVEL_75_BE_SURE_TO_RECEIVE_NEWBIE_BUFFS);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ package ai.areas.TalkingIsland;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -42,7 +41,7 @@ public final class Rubentis extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_MOVE"))
|
||||
{
|
||||
@ -51,7 +50,7 @@ public final class Rubentis extends AbstractNpcAI
|
||||
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
|
||||
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
|
||||
}
|
||||
getTimers().addTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
else if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
@ -64,15 +63,16 @@ public final class Rubentis extends AbstractNpcAI
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ONLY_THE_STRONG_SURVIVE_AT_RUINS_OF_YE_SAGIRA);
|
||||
}
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
startQuestTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.TalkingIsland;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Ruks extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THE_SEVEN_SIGNS_ENDED : NpcStringId.WE_NEED_TO_FIND_HER_WEAKNESS);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.areas.WindmillHill;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@ -39,19 +38,20 @@ public final class Commando extends AbstractNpcAI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("NPC_SHOUT"))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_RE_COLLECTING_SEEKER_OF_ADEN);
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
startQuestTimer("NPC_SHOUT", (10 + getRandom(5)) * 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@ -78,34 +78,29 @@ public final class Cannon extends AbstractNpcAI
|
||||
{
|
||||
String htmltext = null;
|
||||
|
||||
if (event.equals("useCannonBall"))
|
||||
{
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
htmltext = "cannon-recharge.html";
|
||||
}
|
||||
else if (getQuestItemsCount(player, CANNONBALL) == 0)
|
||||
{
|
||||
htmltext = "cannon-noItem.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
takeItems(player, CANNONBALL, 1);
|
||||
npc.setScriptValue(0);
|
||||
npc.setTitleString(NpcStringId.CANNON_IS_LOADING);
|
||||
npc.broadcastInfo();
|
||||
addSkillCastDesire(npc, npc, PRESENT_SKILL, 23);
|
||||
getTimers().addTimer("CANNON_RECHARGE", 300000, npc, null);
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "useCannonBall":
|
||||
{
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
htmltext = "cannon-recharge.html";
|
||||
}
|
||||
else if (getQuestItemsCount(player, CANNONBALL) == 0)
|
||||
{
|
||||
htmltext = "cannon-noItem.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
takeItems(player, CANNONBALL, 1);
|
||||
npc.setScriptValue(0);
|
||||
npc.setTitleString(NpcStringId.CANNON_IS_LOADING);
|
||||
npc.broadcastInfo();
|
||||
addSkillCastDesire(npc, npc, PRESENT_SKILL, 23);
|
||||
startQuestTimer("CANNON_RECHARGE", 300000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CANNON_RECHARGE":
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
@ -123,7 +118,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
final L2Npc transformed = addSpawn(TRANSFORM_DATA.get(monster.getId()), monster);
|
||||
transformed.getVariables().set("DROP_MEMORY_FRAGMENT", true);
|
||||
transformed.getVariables().set("COUNTDOWN_TIME", 21);
|
||||
getTimers().addTimer("COUTDOWN", 100, transformed, null);
|
||||
startQuestTimer("COUTDOWN", 100, transformed, null);
|
||||
monster.deleteMe();
|
||||
}
|
||||
});
|
||||
@ -141,11 +136,12 @@ public final class Cannon extends AbstractNpcAI
|
||||
else if (!npc.isDead())
|
||||
{
|
||||
npc.getVariables().set("COUNTDOWN_TIME", time);
|
||||
getTimers().addTimer("COUTDOWN", 1000, npc, null);
|
||||
startQuestTimer("COUTDOWN", 1000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -166,7 +162,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
getTimers().addTimer("CANNON_RECHARGE", 1000, npc, null);
|
||||
startQuestTimer("CANNON_RECHARGE", 1000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@ -180,7 +176,7 @@ public final class Cannon extends AbstractNpcAI
|
||||
npc.broadcastPacket(new Earthquake(npc, 10, 5));
|
||||
npc.broadcastPacket(new OnEventTrigger(npcParams.getInt("TRIGGER_ID"), true));
|
||||
final L2Npc light = addSpawn(INVISIBLE_NPC, npcParams.getInt("LIGHT_ZONE_POS_X"), npcParams.getInt("LIGHT_ZONE_POS_Y"), npcParams.getInt("LIGHT_ZONE_POS_Z"), 0, false, 10000);
|
||||
getTimers().addTimer("LIGHT_CHECK", 500, light, null);
|
||||
startQuestTimer("LIGHT_CHECK", 500, light, null);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package ai.others.ArenaManager;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@ -72,7 +71,7 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
if (player.getAdena() >= CP_COST)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, CP_COST);
|
||||
getTimers().addTimer("CPrecovery_delay", 2000, npc, player);
|
||||
startQuestTimer("CPrecovery_delay", 2000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -85,7 +84,7 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
if (player.getAdena() >= HP_COST)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, HP_COST);
|
||||
getTimers().addTimer("HPrecovery_delay", 2000, npc, player);
|
||||
startQuestTimer("HPrecovery_delay", 2000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -110,28 +109,28 @@ public final class ArenaManager extends AbstractNpcAI
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CPrecovery_delay":
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(CP_RECOVERY.getSkill());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "HPrecovery_delay":
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(HP_RECOVERY.getSkill());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ((player != null) && !player.isInsideZone(ZoneId.PVP))
|
||||
{
|
||||
if (event.equals("CPrecovery_delay"))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(CP_RECOVERY.getSkill());
|
||||
}
|
||||
else if (event.equals("HPrecovery_delay"))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(HP_RECOVERY.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ArenaManager();
|
||||
|
@ -17,7 +17,6 @@
|
||||
package ai.others.GravitoryCore;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.WarpedSpaceManager;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
@ -39,6 +38,16 @@ public class GravityCore extends AbstractNpcAI
|
||||
addDespawnId(GRAVITY_CORE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("DELETE_ME") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
@ -53,7 +62,7 @@ public class GravityCore extends AbstractNpcAI
|
||||
}
|
||||
|
||||
final int despawnTime = npc.getTemplate().getParameters().getInt("i_despawn_time", 30000);
|
||||
getTimers().addTimer("DELETE_ME", despawnTime, npc, player);
|
||||
startQuestTimer("DELETE_ME", despawnTime, npc, player);
|
||||
|
||||
WarpedSpaceManager.getInstance().addWarpedSpace(npc, 100);
|
||||
}
|
||||
@ -67,15 +76,6 @@ public class GravityCore extends AbstractNpcAI
|
||||
WarpedSpaceManager.getInstance().removeWarpedSpace(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("DELETE_ME"))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new GravityCore();
|
||||
|
@ -84,10 +84,14 @@ public final class OlyBuffer extends AbstractNpcAI
|
||||
if (npc.getScriptValue() >= 5)
|
||||
{
|
||||
htmltext = "OlyBuffer-noMore.html";
|
||||
getTimers().addTimer("DELETE_ME", 5000, evnt -> npc.deleteMe());
|
||||
startQuestTimer("DELETE_ME", 5000, npc, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equals("DELETE_ME") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ import java.util.logging.Logger;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.instancemanager.DBSpawnManager;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
@ -46,13 +47,23 @@ public final class EilhalderVonHellmann extends AbstractNpcAI
|
||||
addSpawnId(EILHALDER_VON_HELLMANN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("delete") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
// Spawn that comes from RaidBossSpawnManager
|
||||
if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null))
|
||||
{
|
||||
getTimers().addTimer("delete", 1000, event -> npc.deleteMe());
|
||||
startQuestTimer("delete", 1000, npc, null);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
@ -112,16 +112,24 @@ public final class TersisHerald extends AbstractNpcAI
|
||||
switch (npc.getId())
|
||||
{
|
||||
case ANTHARAS:
|
||||
{
|
||||
npcStringId = NpcStringId.THE_EVIL_LAND_DRAGON_ANTHARAS_HAS_BEEN_DEFEATED_BY_BRAVE_HEROES;
|
||||
break;
|
||||
}
|
||||
case VALAKAS:
|
||||
{
|
||||
npcStringId = NpcStringId.THE_EVIL_FIRE_DRAGON_VALAKAS_HAS_BEEN_DEFEATED;
|
||||
break;
|
||||
}
|
||||
case LINDVIOR:
|
||||
{
|
||||
npcStringId = NpcStringId.HONORABLE_WARRIORS_HAVE_DRIVEN_OFF_LINDVIOR_THE_EVIL_WIND_DRAGON;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
}
|
||||
|
||||
L2World.getInstance().getPlayers().stream().forEach(p -> showOnScreenMsg(p, npcStringId, 2, 10000, true));
|
||||
|
@ -19,7 +19,6 @@ package instances.NightmareKamaloka;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@ -62,29 +61,25 @@ public final class NightmareKamaloka extends AbstractInstance
|
||||
addKillId(BOSS_MAP.keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "SPAWN_BOSSES":
|
||||
{
|
||||
instance.spawnGroup("BOSSES");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("enterInstance"))
|
||||
switch (event)
|
||||
{
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
case "enterInstance":
|
||||
{
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
break;
|
||||
}
|
||||
case "SPAWN_BOSSES":
|
||||
{
|
||||
final Instance instance = npc.getInstanceWorld();
|
||||
if (isInInstance(instance))
|
||||
{
|
||||
instance.spawnGroup("BOSSES");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
@ -97,7 +92,7 @@ public final class NightmareKamaloka extends AbstractInstance
|
||||
{
|
||||
if (npc.getId() == INVISIBLE_NPC)
|
||||
{
|
||||
getTimers().addTimer("SPAWN_BOSSES", 10000, npc, null);
|
||||
startQuestTimer("SPAWN_BOSSES", 10000, npc, null);
|
||||
}
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
|
@ -132,7 +132,6 @@ public final class TalkingIslandPast extends AbstractInstance
|
||||
knight.setIsRunning(true);
|
||||
showOnScreenMsg(player, NpcStringId.A_MYSTERIOUS_DARK_KNIGHT_IS_HERE, ExShowScreenMessage.TOP_CENTER, 5000);
|
||||
getTimers().addTimer("MSG", null, 5000, npc, player, n -> showOnScreenMsg(n.getPlayer(), NpcStringId.TALK_TO_THE_MYSTERIOUS_DARK_KNIGHT, ExShowScreenMessage.TOP_CENTER, 5000));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
package quests.Q10709_TheStolenSeed;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
@ -83,7 +82,7 @@ public final class Q10709_TheStolenSeed extends Quest
|
||||
embryo.setIsInvul(true);
|
||||
akum.setIsInvul(true);
|
||||
|
||||
getTimers().addTimer("EMBRYO_DELAY", 3000, embryo, player);
|
||||
startQuestTimer("EMBRYO_DELAY", 3000, embryo, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -128,29 +127,23 @@ public final class Q10709_TheStolenSeed extends Quest
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("EMBRYO_DELAY"))
|
||||
{
|
||||
final L2Npc akum = (L2Npc) npc.getTarget();
|
||||
final QuestState st = getQuestState(player, true);
|
||||
|
||||
if ((akum != null) && (st != null))
|
||||
case "EMBRYO_DELAY":
|
||||
{
|
||||
st.setCond(2, true);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.KARTIA_S_SEED_GOT_IT);
|
||||
akum.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARGHH);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WORTHLESS_GIANT_CURSE_YOU_FOR_ETERNITY);
|
||||
addSpawn(CURSED_AKUM, akum);
|
||||
npc.deleteMe();
|
||||
akum.deleteMe();
|
||||
final L2Npc akum = (L2Npc) npc.getTarget();
|
||||
if (akum != null)
|
||||
{
|
||||
st.setCond(2, true);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.KARTIA_S_SEED_GOT_IT);
|
||||
akum.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARGHH);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WORTHLESS_GIANT_CURSE_YOU_FOR_ETERNITY);
|
||||
addSpawn(CURSED_AKUM, akum);
|
||||
npc.deleteMe();
|
||||
akum.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -75,7 +75,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
case "30484-02.htm":
|
||||
case "30484-03.htm":
|
||||
case "30484-04.htm":
|
||||
{
|
||||
break;
|
||||
}
|
||||
case "30484-05.htm":
|
||||
{
|
||||
qs.startQuest();
|
||||
@ -94,7 +96,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
htmltext = null;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
@ -116,14 +120,20 @@ public final class Q10771_VolatilePower extends Quest
|
||||
switch (qs.getState())
|
||||
{
|
||||
case State.CREATED:
|
||||
{
|
||||
htmltext = "30484-01.htm";
|
||||
break;
|
||||
}
|
||||
case State.STARTED:
|
||||
{
|
||||
htmltext = (qs.isCond(1)) ? "30484-06.html" : "30484-07.html";
|
||||
break;
|
||||
}
|
||||
case State.COMPLETED:
|
||||
{
|
||||
htmltext = getAlreadyCompletedMsg(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (qs.isStarted())
|
||||
@ -204,7 +214,9 @@ public final class Q10771_VolatilePower extends Quest
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
super.onTimerEvent(event, params, npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import java.util.logging.Logger;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.instancemanager.DBSpawnManager;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
@ -46,13 +47,23 @@ public final class EilhalderVonHellmann extends AbstractNpcAI
|
||||
addSpawnId(EILHALDER_VON_HELLMANN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("delete") && (npc != null))
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
// Spawn that comes from RaidBossSpawnManager
|
||||
if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null))
|
||||
{
|
||||
getTimers().addTimer("delete", 1000, event -> npc.deleteMe());
|
||||
startQuestTimer("delete", 1000, npc, null);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user