diff --git a/L2J_Mobius_01.0_Ertheia/.classpath b/L2J_Mobius_01.0_Ertheia/.classpath
index 8d6bb1b024..a4d82b44e8 100644
--- a/L2J_Mobius_01.0_Ertheia/.classpath
+++ b/L2J_Mobius_01.0_Ertheia/.classpath
@@ -5,7 +5,6 @@
-
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/config/AdminCommands.xml b/L2J_Mobius_01.0_Ertheia/dist/game/config/AdminCommands.xml
index c7a1a461b6..9b610a1b81 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/config/AdminCommands.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/config/AdminCommands.xml
@@ -222,32 +222,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/CeremonyOfChaos.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/events/CeremonyOfChaos.xml
deleted file mode 100644
index 7331135977..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/CeremonyOfChaos.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 224
- 225
- 226
- 227
-
-
-
-
-
-
- Ceremony of Chaos has ended.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- start
- end
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/ClanHallAuction.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/events/ClanHallAuction.xml
deleted file mode 100644
index 1ef53637ee..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/ClanHallAuction.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- startAuction
- endAuction
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/DailyTasks.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/events/DailyTasks.xml
deleted file mode 100644
index 087cf3ce1a..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/DailyTasks.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Elpies.txt b/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Elpies.txt
deleted file mode 100644
index 2fb8a72306..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Elpies.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Rabbits.txt b/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Rabbits.txt
deleted file mode 100644
index f4a59b3018..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Rabbits.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Race.txt b/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Race.txt
deleted file mode 100644
index 7ef1d86347..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/Race.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/TeamVsTeam.txt b/L2J_Mobius_01.0_Ertheia/dist/game/data/events/TeamVsTeam.txt
deleted file mode 100644
index 9b02fa4d43..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/events/TeamVsTeam.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/html/mods/EventEngine/Participating.htm b/L2J_Mobius_01.0_Ertheia/dist/game/data/html/mods/EventEngine/Participating.htm
deleted file mode 100644
index 4724f31677..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/html/mods/EventEngine/Participating.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
- %eventName% by %eventCreator%
-
- %eventInfo%
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/html/mods/EventEngine/Participation.htm b/L2J_Mobius_01.0_Ertheia/dist/game/data/html/mods/EventEngine/Participation.htm
deleted file mode 100644
index 93445c87d9..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/html/mods/EventEngine/Participation.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
- %eventName% by %eventCreator%
-
- %eventInfo%
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index e25a8f60d2..e6bafc3ed3 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -155,7 +155,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + ClanHallAuctionManager.getInstance().getRemainingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -190,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
- final long remainingTime = clanHallAuction.getRemaingTime();
+ final long remainingTime = ClanHallAuctionManager.getInstance().getRemainingTime();
final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
@@ -248,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
{
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
- final long remainingTime = clanHallAuction.getRemaingTime();
+ final long remainingTime = ClanHallAuctionManager.getInstance().getRemainingTime();
final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
@@ -298,7 +298,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0] ");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + ClanHallAuctionManager.getInstance().getRemainingTime()).atZone(ZoneId.systemDefault())));
sb.append(" ");
sb.append(auction.getHighestBid());
sb.append(" ");
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/LaVieEnRose/LaVieEnRose.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/LaVieEnRose/LaVieEnRose.java
index 92f5f478a9..848e1d690e 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/LaVieEnRose/LaVieEnRose.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/LaVieEnRose/LaVieEnRose.java
@@ -19,7 +19,6 @@ package ai.others.LaVieEnRose;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -128,13 +127,7 @@ public class LaVieEnRose extends AbstractNpcAI
return false;
}
- if (player.isOnEvent(CeremonyOfChaosEvent.class))
- {
- player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_WHILE_REGISTERED_IN_THE_CEREMONY_OF_CHAOS);
- return false;
- }
-
- if (player.isOnEvent()) // custom event message
+ if (player.isRegisteredOnEvent())
{
player.sendMessage("You cannot use the Beauty Shop while registered in an event.");
return false;
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
index 19b18e1eed..35fb822883 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
@@ -336,9 +336,9 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
player.sendPacket(SystemMessageId.THE_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
return false;
}
- else if (player.isOnEvent())
+ else if (player.isRegisteredOnEvent())
{
- player.sendMessage("You can not observe games while registered on an event");
+ player.sendMessage("You can not observe games while registered on an event.");
return false;
}
else
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index a3c74220a9..3afbd5674c 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -24,7 +24,6 @@ import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
@@ -266,11 +265,7 @@ public class TrainingCamp extends AbstractNpcAI
{
return false;
}
- else if (player.isOnEvent(CeremonyOfChaosEvent.class) || (player.getBlockCheckerArena() > -1)) // TODO underground coliseum and kratei checks.
- {
- return false;
- }
- else if (player.isOnEvent()) // custom event message
+ else if (player.isRegisteredOnEvent() || (player.getBlockCheckerArena() > -1)) // TODO underground coliseum and kratei checks.
{
return false;
}
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/custom/events/TeamVsTeam/TvT.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/custom/events/TeamVsTeam/TvT.java
index 64b03b6011..fe12cb8e73 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/custom/events/TeamVsTeam/TvT.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/custom/events/TeamVsTeam/TvT.java
@@ -147,7 +147,7 @@ public class TvT extends Event
{
PLAYER_LIST.add(player);
PLAYER_SCORES.put(player, 0);
- player.setOnCustomEvent(true);
+ player.setRegisteredOnEvent(true);
addLogoutListener(player);
htmltext = "registration-success.html";
}
@@ -172,13 +172,13 @@ public class TvT extends Event
PLAYER_LIST.remove(player);
PLAYER_SCORES.remove(player);
removeListeners(player);
- player.setOnCustomEvent(false);
+ player.setRegisteredOnEvent(false);
htmltext = "registration-canceled.html";
break;
}
case "BuffHeal":
{
- if (player.isOnCustomEvent() || player.isGM())
+ if (player.isOnEvent() || player.isGM())
{
if (player.isInCombat())
{
@@ -227,7 +227,7 @@ public class TvT extends Event
for (PlayerInstance participant : PLAYER_LIST)
{
removeListeners(participant);
- participant.setOnCustomEvent(false);
+ participant.setRegisteredOnEvent(false);
}
EVENT_ACTIVE = false;
return null;
@@ -264,6 +264,7 @@ public class TvT extends Event
team = true;
}
addDeathListener(participant);
+ participant.setOnEvent(true);
}
// Make Blue CC.
if (BLUE_TEAM.size() > 1)
@@ -454,7 +455,7 @@ public class TvT extends Event
{
removeListeners(participant);
participant.setTeam(Team.NONE);
- participant.setOnCustomEvent(false);
+ participant.setOnEvent(false);
participant.leaveParty();
}
// Destroy world.
@@ -481,7 +482,7 @@ public class TvT extends Event
}
case "ResurrectPlayer":
{
- if (player.isDead() && player.isOnCustomEvent())
+ if (player.isDead() && player.isOnEvent())
{
if (BLUE_TEAM.contains(player))
{
@@ -534,7 +535,7 @@ public class TvT extends Event
PLAYER_SCORES.remove(player);
BLUE_TEAM.remove(player);
RED_TEAM.remove(player);
- player.setOnCustomEvent(false);
+ player.setOnEvent(false);
removeListeners(player);
player.sendMessage("You have been kicked for been inactive.");
if (PVP_WORLD != null)
@@ -581,7 +582,7 @@ public class TvT extends Event
@Override
public String onEnterZone(Creature creature, ZoneType zone)
{
- if (creature.isPlayable() && creature.getActingPlayer().isOnCustomEvent())
+ if (creature.isPlayable() && creature.getActingPlayer().isOnEvent())
{
// Kick enemy players.
if ((zone == BLUE_PEACE_ZONE) && (creature.getTeam() == Team.RED))
@@ -608,7 +609,7 @@ public class TvT extends Event
@Override
public String onExitZone(Creature creature, ZoneType zone)
{
- if (creature.isPlayer() && creature.getActingPlayer().isOnCustomEvent())
+ if (creature.isPlayer() && creature.getActingPlayer().isOnEvent())
{
final PlayerInstance player = creature.getActingPlayer();
cancelQuestTimer("KickPlayer" + creature.getObjectId(), null, player);
@@ -639,7 +640,7 @@ public class TvT extends Event
player.sendMessage("Your level is too high to participate.");
return false;
}
- if (player.isOnEvent() || (player.getBlockCheckerArena() > -1))
+ if (player.isRegisteredOnEvent() || (player.getBlockCheckerArena() > -1))
{
player.sendMessage("You are already registered on an event.");
return false;
@@ -726,7 +727,7 @@ public class TvT extends Event
private void addLogoutListener(PlayerInstance player)
{
- player.addListener(new ConsumerEventListener(player, EventType.ON_PLAYER_LOGOUT, (OnPlayerLogout event) -> OnPlayerLogout(event), this));
+ player.addListener(new ConsumerEventListener(player, EventType.ON_PLAYER_LOGOUT, (OnPlayerLogout event) -> onPlayerLogout(event), this));
}
private void addDeathListener(PlayerInstance player)
@@ -778,7 +779,7 @@ public class TvT extends Event
}
@RegisterEvent(EventType.ON_PLAYER_LOGOUT)
- private void OnPlayerLogout(OnPlayerLogout event)
+ private void onPlayerLogout(OnPlayerLogout event)
{
final PlayerInstance player = event.getPlayer();
// Remove player from lists.
@@ -883,7 +884,7 @@ public class TvT extends Event
{
removeListeners(participant);
participant.setTeam(Team.NONE);
- participant.setOnCustomEvent(false);
+ participant.setRegisteredOnEvent(false);
}
if (PVP_WORLD != null)
{
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java
index 68a5265488..11d3a31b90 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java
@@ -76,7 +76,6 @@ import handlers.admincommandhandlers.AdminEditChar;
import handlers.admincommandhandlers.AdminEffects;
import handlers.admincommandhandlers.AdminElement;
import handlers.admincommandhandlers.AdminEnchant;
-import handlers.admincommandhandlers.AdminEventEngine;
import handlers.admincommandhandlers.AdminEvents;
import handlers.admincommandhandlers.AdminExpSp;
import handlers.admincommandhandlers.AdminFakePlayers;
@@ -143,7 +142,6 @@ import handlers.bypasshandlers.Buy;
import handlers.bypasshandlers.ChangePlayerName;
import handlers.bypasshandlers.ChatLink;
import handlers.bypasshandlers.ClanWarehouse;
-import handlers.bypasshandlers.EventEngine;
import handlers.bypasshandlers.FindPvP;
import handlers.bypasshandlers.Freight;
import handlers.bypasshandlers.ItemAuctionLink;
@@ -410,7 +408,6 @@ public class MasterHandler
AdminEffects.class,
AdminElement.class,
AdminEnchant.class,
- AdminEventEngine.class,
AdminEvents.class,
AdminExpSp.class,
AdminFakePlayers.class,
@@ -479,7 +476,6 @@ public class MasterHandler
ChangePlayerName.class,
ChatLink.class,
ClanWarehouse.class,
- EventEngine.class,
FindPvP.class,
Freight.class,
ItemAuctionLink.class,
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
index 95af1dea6b..f075754123 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
@@ -99,7 +99,7 @@ public class SkillConditionMasterHandler
SkillConditionHandler.getInstance().registerHandler("OpNeedSummonOrPet", OpNeedSummonOrPetSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotAffectedBySkill", OpNotAffectedBySkillSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotCursed", OpNotCursedSkillCondition::new);
- SkillConditionHandler.getInstance().registerHandler("OpNotInCeremonyOfChaos", OpNotInCeremonyOfChaosSkillCondition::new);
+ SkillConditionHandler.getInstance().registerHandler("OpNotInEvent", OpNotInEventSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotInPeacezone", OpNotInPeacezoneSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotInstantzone", OpNotInstantzoneSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotOlympiad", OpNotOlympiadSkillCondition::new);
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/actionhandlers/NpcAction.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/actionhandlers/NpcAction.java
index 4b75e2bfb8..5823646cf7 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/actionhandlers/NpcAction.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/actionhandlers/NpcAction.java
@@ -22,7 +22,6 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.InstanceType;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.handler.IActionHandler;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -118,25 +117,19 @@ public class NpcAction implements IActionHandler
}
// Open a chat window on client with the text of the Npc
- if (npc.hasVariables() && npc.getVariables().getBoolean("eventmob", false))
+ if (npc.hasListener(EventType.ON_NPC_QUEST_START))
{
- GameEvent.showEventHtml(player, String.valueOf(target.getObjectId()));
+ player.setLastQuestNpcObject(target.getObjectId());
+ }
+ if (npc.hasListener(EventType.ON_NPC_FIRST_TALK))
+ {
+ EventDispatcher.getInstance().notifyEventAsync(new OnNpcFirstTalk(npc, player), npc);
}
else
{
- if (npc.hasListener(EventType.ON_NPC_QUEST_START))
- {
- player.setLastQuestNpcObject(target.getObjectId());
- }
- if (npc.hasListener(EventType.ON_NPC_FIRST_TALK))
- {
- EventDispatcher.getInstance().notifyEventAsync(new OnNpcFirstTalk(npc, player), npc);
- }
- else
- {
- npc.showChatWindow(player);
- }
+ npc.showChatWindow(player);
}
+
if (Config.PLAYER_MOVEMENT_BLOCK_TIME > 0)
{
player.updateNotMoveUntil();
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java
deleted file mode 100644
index 2d7e669ac4..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java
+++ /dev/null
@@ -1,548 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package handlers.admincommandhandlers;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.DataInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStreamReader;
-import java.io.PrintStream;
-import java.util.StringTokenizer;
-
-import org.l2jmobius.Config;
-import org.l2jmobius.commons.util.Rnd;
-import org.l2jmobius.gameserver.data.xml.AdminData;
-import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent.EventState;
-import org.l2jmobius.gameserver.model.World;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
-import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
-import org.l2jmobius.gameserver.util.Broadcast;
-
-/**
- * This class handles following admin commands: - admin = shows menu
- * @version $Revision: 1.3.2.1.2.4 $ $Date: 2005/04/11 10:06:06 $
- */
-public class AdminEventEngine implements IAdminCommandHandler
-{
- private static final String[] ADMIN_COMMANDS =
- {
- "admin_event",
- "admin_event_new",
- "admin_event_choose",
- "admin_event_store",
- "admin_event_set",
- "admin_event_change_teams_number",
- "admin_event_announce",
- "admin_event_panel",
- "admin_event_control_begin",
- "admin_event_control_teleport",
- "admin_add",
- "admin_event_see",
- "admin_event_del",
- "admin_delete_buffer",
- "admin_event_control_sit",
- "admin_event_name",
- "admin_event_control_kill",
- "admin_event_control_res",
- "admin_event_control_transform",
- "admin_event_control_untransform",
- "admin_event_control_prize",
- "admin_event_control_chatban",
- "admin_event_control_kick",
- "admin_event_control_finish"
- };
-
- private static String tempBuffer = "";
- private static String tempName = "";
- private static boolean npcsDeleted = false;
-
- @Override
- public boolean useAdminCommand(String command, PlayerInstance activeChar)
- {
- StringTokenizer st = new StringTokenizer(command);
- final String actualCommand = st.nextToken();
- try
- {
- if (actualCommand.equals("admin_event"))
- {
- if (GameEvent.eventState != EventState.OFF)
- {
- showEventControl(activeChar);
- }
- else
- {
- showMainPage(activeChar);
- }
- }
-
- else if (actualCommand.equals("admin_event_new"))
- {
- showNewEventPage(activeChar);
- }
- else if (actualCommand.startsWith("admin_add"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event info.
- tempBuffer += command.substring(10);
- showNewEventPage(activeChar);
-
- }
- else if (actualCommand.startsWith("admin_event_see"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
- final String eventName = command.substring(16);
- try
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(Config.DATAPACK_ROOT + "/data/events/" + eventName)));
- final BufferedReader inbr = new BufferedReader(new InputStreamReader(in));
- adminReply.setFile(null, "data/html/mods/EventEngine/Participation.htm");
- adminReply.replace("%eventName%", eventName);
- adminReply.replace("%eventCreator%", inbr.readLine());
- adminReply.replace("%eventInfo%", inbr.readLine());
- adminReply.replace("npc_%objectId%_event_participate", "admin_event"); // Weird, but nice hack, isnt it? :)
- adminReply.replace("button value=\"Participate\"", "button value=\"Back\"");
- activeChar.sendPacket(adminReply);
- inbr.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- else if (actualCommand.startsWith("admin_event_del"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
- final String eventName = command.substring(16);
- final File file = new File(Config.DATAPACK_ROOT + "/data/events/" + eventName);
- file.delete();
- showMainPage(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_name"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
- tempName += command.substring(17);
- showNewEventPage(activeChar);
- }
- else if (actualCommand.equalsIgnoreCase("admin_delete_buffer"))
- {
- tempBuffer = "";
- showNewEventPage(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_store"))
- {
- try
- {
- final FileOutputStream file = new FileOutputStream(new File(Config.DATAPACK_ROOT, "data/events/" + tempName));
- final PrintStream p = new PrintStream(file);
- p.println(activeChar.getName());
- p.println(tempBuffer);
- file.close();
- p.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- tempBuffer = "";
- tempName = "";
- showMainPage(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_set"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
- GameEvent._eventName = command.substring(16);
- showEventParameters(activeChar, 2);
- }
- else if (actualCommand.startsWith("admin_event_change_teams_number"))
- {
- showEventParameters(activeChar, Integer.parseInt(st.nextToken()));
- }
- else if (actualCommand.startsWith("admin_event_panel"))
- {
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_announce"))
- {
- GameEvent._npcId = Integer.parseInt(st.nextToken());
- GameEvent._teamsNumber = Integer.parseInt(st.nextToken());
- String temp = " ";
- String temp2 = "";
- while (st.hasMoreElements())
- {
- temp += st.nextToken() + " ";
- }
-
- st = new StringTokenizer(temp, "-");
- Integer i = 1;
-
- while (st.hasMoreElements())
- {
- temp2 = st.nextToken();
- if (!temp2.equals(" "))
- {
- GameEvent._teamNames.put(i++, temp2.substring(1, temp2.length() - 1));
- }
- }
-
- activeChar.sendMessage(GameEvent.startEventParticipation());
- Broadcast.toAllOnlinePlayers(activeChar.getName() + " has started an event. You will find a participation NPC somewhere around you.");
-
- final PlaySound snd = new PlaySound(1, "B03_F", 0, 0, 0, 0, 0);
- activeChar.sendPacket(snd);
- activeChar.broadcastPacket(snd);
-
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final String replyMSG = "[ L2J EVENT ENGINE ] The event " + GameEvent._eventName + " has been announced, now you can type //event_panel to see the event panel control ";
- adminReply.setHtml(replyMSG);
- activeChar.sendPacket(adminReply);
- }
- else if (actualCommand.startsWith("admin_event_control_begin"))
- {
- // Starts the event and sends a message of the result
- activeChar.sendMessage(GameEvent.startEvent());
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_finish"))
- {
- // Finishes the event and sends a message of the result
- activeChar.sendMessage(GameEvent.finishEvent());
- }
- else if (actualCommand.startsWith("admin_event_control_teleport"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- final int teamId = Integer.parseInt(st.nextToken());
- for (PlayerInstance player : GameEvent._teams.get(teamId))
- {
- player.setTitle(GameEvent._teamNames.get(teamId));
- player.teleToLocation(activeChar.getLocation(), true, activeChar.getInstanceWorld());
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_sit"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- // Integer.parseInt(st.nextToken()) == teamId
- for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
- {
- if (player.getEventStatus() == null)
- {
- continue;
- }
-
- player.getEventStatus().setSitForced(!player.getEventStatus().isSitForced());
- if (player.getEventStatus().isSitForced())
- {
- player.sitDown();
- }
- else
- {
- player.standUp();
- }
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_kill"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
- {
- player.reduceCurrentHp(player.getMaxHp() + player.getMaxCp() + 1, activeChar, null);
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_res"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
- {
- if ((player == null) || !player.isDead())
- {
- continue;
- }
- player.restoreExp(100.0);
- player.doRevive();
- player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
- player.setCurrentCp(player.getMaxCp());
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_transform"))
- {
- final int teamId = Integer.parseInt(st.nextToken());
- final int[] transIds = new int[st.countTokens()];
- int i = 0;
- while (st.hasMoreElements()) // Every next ST should be a transform ID
- {
- transIds[i++] = Integer.parseInt(st.nextToken());
- }
-
- for (PlayerInstance player : GameEvent._teams.get(teamId))
- {
- final int transId = transIds[Rnd.get(transIds.length)];
- if (!player.transform(transId, true))
- {
- AdminData.getInstance().broadcastMessageToGMs("EventEngine: Unknow transformation id: " + transId);
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_untransform"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
- {
- player.stopTransformation(true);
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_kick"))
- {
- if (st.hasMoreElements()) // If has next token, it should be player name.
- {
- while (st.hasMoreElements())
- {
- final PlayerInstance player = World.getInstance().getPlayer(st.nextToken());
- if (player != null)
- {
- GameEvent.removeAndResetPlayer(player);
- }
- }
- }
- else if ((activeChar.getTarget() != null) && (activeChar.getTarget().isPlayer()))
- {
- GameEvent.removeAndResetPlayer((PlayerInstance) activeChar.getTarget());
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_prize"))
- {
- final int[] teamIds = new int[st.countTokens() - 2];
- int i = 0;
- while ((st.countTokens() - 2) > 0) // The last 2 tokens are used for "n" and "item id"
- {
- teamIds[i++] = Integer.parseInt(st.nextToken());
- }
-
- final String[] n = st.nextToken().split("\\*");
- final int itemId = Integer.parseInt(st.nextToken());
- for (int teamId : teamIds)
- {
- rewardTeam(activeChar, teamId, Integer.parseInt(n[0]), itemId, n.length == 2 ? n[1] : "");
- }
- showEventControl(activeChar);
- }
- }
- catch (Exception e)
- {
- AdminData.getInstance().broadcastMessageToGMs("EventEngine: Error! Possible blank boxes while executing a command which requires a value in the box?");
- }
- return true;
- }
-
- @Override
- public String[] getAdminCommandList()
- {
- return ADMIN_COMMANDS;
- }
-
- private String showStoredEvents()
- {
- final File dir = new File(Config.DATAPACK_ROOT, "/data/events");
- if (dir.isFile())
- {
- return "The directory '" + dir.getAbsolutePath() + "' is a file or is corrupted! ";
- }
-
- String note = "";
- if (!dir.exists())
- {
- note = "The directory '" + dir.getAbsolutePath() + "' does not exist! Trying to create it now... ";
- if (dir.mkdirs())
- {
- note += "The directory '" + dir.getAbsolutePath() + "' has been created! ";
- }
- else
- {
- note += "The directory '" + dir.getAbsolutePath() + "' hasn't been created! ";
- return note;
- }
- }
-
- final String[] files = dir.list();
- final StringBuilder result = new StringBuilder(files.length * 500);
- result.append("");
- for (String fileName : files)
- {
- result.append("");
- result.append(fileName);
- result.append(" ");
- }
-
- result.append("
");
-
- return note + result;
- }
-
- private void showMainPage(PlayerInstance activeChar)
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final String replyMSG = "[ L2J EVENT ENGINE ] Stored Events: " + showStoredEvents() + "";
- adminReply.setHtml(replyMSG);
- activeChar.sendPacket(adminReply);
- }
-
- private void showNewEventPage(PlayerInstance activeChar)
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final StringBuilder replyMSG = new StringBuilder(512);
- replyMSG.append("[ L2J EVENT ENGINE ] Event name: ");
- if (tempName.isEmpty())
- {
- replyMSG.append("You can also use //event_name text to insert a new title");
- replyMSG.append(" ");
- }
- else
- {
- replyMSG.append(tempName);
- }
-
- replyMSG.append("Event description: ");
- if (tempBuffer.isEmpty())
- {
- replyMSG.append("You can also use //add text to add text or //delete_buffer to remove the text.");
- }
- else
- {
- replyMSG.append(tempBuffer);
- }
-
- replyMSG.append(" ");
- replyMSG.append("");
- if (!(tempName.isEmpty() && tempBuffer.isEmpty()))
- {
- replyMSG.append("");
- }
-
- replyMSG.append(" ");
-
- adminReply.setHtml(replyMSG.toString());
- activeChar.sendPacket(adminReply);
- }
-
- private void showEventParameters(PlayerInstance activeChar, int teamnumbers)
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final StringBuilder sb = new StringBuilder();
- sb.append("[ L2J EVENT ENGINE ] Current event: ");
- sb.append(GameEvent._eventName);
- sb.append(" INFO: To start an event, you must first set the number of teams, then type their names in the boxes and finally type the NPC ID that will be the event manager (can be any existing npc) next to the \"Announce Event!\" button.");
- sb.append(" ");
- sb.append(" ");
- sb.append(" ");
- sb.append(" ");
- sb.append("
");
- sb.append("Teams' names: ");
- for (int i = 1; (i - 1) < teamnumbers; i++) // Team names params
- {
- sb.append("Team #");
- sb.append(i);
- sb.append(" name: ");
- }
- sb.append("
");
-
- adminReply.setHtml(sb.toString());
- activeChar.sendPacket(adminReply);
- }
-
- private void showEventControl(PlayerInstance activeChar)
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final StringBuilder sb = new StringBuilder();
- sb.append("[ EVENT ENGINE ] Current event: ");
- sb.append(GameEvent._eventName);
- sb.append(" Type the team ID(s) that will be affected by the commands. Commands with '*' work with only 1 team ID in the field, while '!' - none. ");
- sb.append(" ");
- if (!npcsDeleted)
- {
- sb.append("Destroys all event npcs so no more people can't participate now on ");
- }
-
- sb.append(" Teleports the specified team to your position Sits/Stands up the team Finish with the life of all the players in the selected team Resurrect Team's members Transforms the team into the transformation with the ID specified. Multiple IDs result in randomly chosen one for each player. Untransforms the team Give the specified item id to every single member of the team, you can put 5*level, 5*kills or 5 in the number field for example Kicks the specified player(s) from the event. Blank field kicks target. Will finish the event teleporting back all the players
");
- adminReply.setHtml(sb.toString());
- activeChar.sendPacket(adminReply);
- }
-
- private void rewardTeam(PlayerInstance activeChar, int team, int n, int id, String type)
- {
- int num = n;
- for (PlayerInstance player : GameEvent._teams.get(team))
- {
- if (type.equalsIgnoreCase("level"))
- {
- num = n * player.getLevel();
- }
- else if (type.equalsIgnoreCase("kills") && (player.getEventStatus() != null))
- {
- num = n * player.getEventStatus().getKills().size();
- }
- else
- {
- num = n;
- }
-
- player.addItem("Event", id, num, activeChar, true);
-
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- adminReply.setHtml(" CONGRATULATIONS! You should have been rewarded. ");
- player.sendPacket(adminReply);
- }
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/EventEngine.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/EventEngine.java
deleted file mode 100644
index 081bbe2c2b..0000000000
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/EventEngine.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package handlers.bypasshandlers;
-
-import java.util.logging.Level;
-
-import org.l2jmobius.gameserver.handler.IBypassHandler;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
-import org.l2jmobius.gameserver.model.actor.Creature;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-
-public class EventEngine implements IBypassHandler
-{
- private static final String[] COMMANDS =
- {
- "event_participate",
- "event_unregister"
- };
-
- @Override
- public boolean useBypass(String command, PlayerInstance player, Creature target)
- {
- if (!target.isNpc())
- {
- return false;
- }
-
- try
- {
- if (command.equalsIgnoreCase("event_participate"))
- {
- GameEvent.registerPlayer(player);
- return true;
- }
- else if (command.equalsIgnoreCase("event_unregister"))
- {
- GameEvent.removeAndResetPlayer(player);
- return true;
- }
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, "Exception in " + getClass().getSimpleName(), e);
- }
- return false;
- }
-
- @Override
- public String[] getBypassList()
- {
- return COMMANDS;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/Observation.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/Observation.java
index 46a386ddd4..a7bde42217 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/Observation.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/Observation.java
@@ -99,9 +99,9 @@ public class Observation implements IBypassHandler
player.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_SIEGE_WITH_A_PET_OR_SERVITOR_SUMMONED);
return false;
}
- if (player.isOnEvent())
+ if (player.isRegisteredOnEvent())
{
- player.sendMessage("Cannot use while current Event");
+ player.sendMessage("Cannot use while registered on an event.");
return false;
}
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInCeremonyOfChaosSkillCondition.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInEventSkillCondition.java
similarity index 80%
rename from L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInCeremonyOfChaosSkillCondition.java
rename to L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInEventSkillCondition.java
index b5cefc61cc..8b23f3b8b5 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInCeremonyOfChaosSkillCondition.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInEventSkillCondition.java
@@ -19,22 +19,21 @@ package handlers.skillconditionhandlers;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.skills.ISkillCondition;
import org.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
-public class OpNotInCeremonyOfChaosSkillCondition implements ISkillCondition
+public class OpNotInEventSkillCondition implements ISkillCondition
{
- public OpNotInCeremonyOfChaosSkillCondition(StatSet params)
+ public OpNotInEventSkillCondition(StatSet params)
{
}
@Override
public boolean canUse(Creature caster, Skill skill, WorldObject target)
{
- return (caster.isPlayer() && !caster.getActingPlayer().isOnEvent(CeremonyOfChaosEvent.class));
+ return (caster.isPlayer() && !caster.getActingPlayer().isOnEvent());
}
}
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriend.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriend.java
index 69a319ab14..e871e36f2c 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriend.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriend.java
@@ -79,7 +79,7 @@ public class NotFriend implements IAffectObjectHandler
}
// Events.
- if (player.isOnCustomEvent() && (player.getTeam() == target.getTeam()))
+ if (player.isOnEvent() && (player.getTeam() == target.getTeam()))
{
return false;
}
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriendPc.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriendPc.java
index 9b51f9f573..28a3260b12 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriendPc.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriendPc.java
@@ -79,7 +79,7 @@ public class NotFriendPc implements IAffectObjectHandler
}
// Events.
- if (player.isOnCustomEvent() && (player.getTeam() == target.getTeam()))
+ if (player.isOnEvent() && (player.getTeam() == target.getTeam()))
{
return false;
}
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00000-00099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00000-00099.xml
index b268c62dbf..3f269150cf 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00000-00099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00000-00099.xml
@@ -1159,7 +1159,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00700-00799.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00700-00799.xml
index 4ab3bcdd10..26338a1796 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00700-00799.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00700-00799.xml
@@ -393,7 +393,7 @@
-
+
@@ -412,7 +412,7 @@
-
+
@@ -436,7 +436,7 @@
-
+
@@ -452,7 +452,7 @@
-
+
@@ -491,7 +491,7 @@
-
+
@@ -507,7 +507,7 @@
-
+
@@ -520,7 +520,7 @@
-
+
@@ -537,7 +537,7 @@
-
+
@@ -554,7 +554,7 @@
-
+
@@ -577,7 +577,7 @@
-
+
@@ -598,7 +598,7 @@
-
+
@@ -615,7 +615,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00900-00999.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00900-00999.xml
index 8bbc2e27d6..642b1c5816 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00900-00999.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/00900-00999.xml
@@ -728,7 +728,7 @@
-
+
@@ -746,7 +746,7 @@
-
+
@@ -761,7 +761,7 @@
-
+
@@ -773,7 +773,7 @@
-
+
@@ -788,7 +788,7 @@
-
+
@@ -806,7 +806,7 @@
-
+
@@ -821,7 +821,7 @@
-
+
@@ -833,7 +833,7 @@
-
+
@@ -848,7 +848,7 @@
-
+
@@ -866,7 +866,7 @@
-
+
@@ -881,7 +881,7 @@
-
+
@@ -893,7 +893,7 @@
-
+
@@ -908,7 +908,7 @@
-
+
@@ -926,7 +926,7 @@
-
+
@@ -941,7 +941,7 @@
-
+
@@ -953,7 +953,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/01000-01099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/01000-01099.xml
index 376059b37f..fc841aa214 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/01000-01099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/01000-01099.xml
@@ -700,7 +700,7 @@
-
+
@@ -723,7 +723,7 @@
-
+
@@ -881,7 +881,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/01500-01599.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/01500-01599.xml
index 8888cc8475..c4d8cb861a 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/01500-01599.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/01500-01599.xml
@@ -467,7 +467,7 @@
-
+
@@ -490,7 +490,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/05200-05299.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/05200-05299.xml
index 41f9c9bdff..b4bc93f358 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/05200-05299.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/05200-05299.xml
@@ -488,7 +488,7 @@
-
+
@@ -509,7 +509,7 @@
-
+
@@ -530,7 +530,7 @@
-
+
@@ -551,7 +551,7 @@
-
+
@@ -572,7 +572,7 @@
-
+
@@ -593,7 +593,7 @@
-
+
@@ -614,7 +614,7 @@
-
+
@@ -635,7 +635,7 @@
-
+
@@ -656,7 +656,7 @@
-
+
@@ -677,7 +677,7 @@
-
+
@@ -698,7 +698,7 @@
-
+
@@ -719,7 +719,7 @@
-
+
@@ -740,7 +740,7 @@
-
+
@@ -761,7 +761,7 @@
-
+
@@ -782,7 +782,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/05500-05599.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/05500-05599.xml
index 3eb8c37aaf..9eb2b65043 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/05500-05599.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/05500-05599.xml
@@ -1079,7 +1079,7 @@
-
+
@@ -1098,7 +1098,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/06400-06499.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/06400-06499.xml
index 8ef613c844..6515069390 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/06400-06499.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/06400-06499.xml
@@ -72,7 +72,7 @@
-
+
@@ -85,7 +85,7 @@
-
+
@@ -117,7 +117,7 @@
-
+
@@ -135,7 +135,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08100-08199.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08100-08199.xml
index 1aa073404f..62dbdd0134 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08100-08199.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08100-08199.xml
@@ -2125,7 +2125,7 @@
-
+
@@ -2142,7 +2142,7 @@
-
+
@@ -2159,7 +2159,7 @@
-
+
@@ -2176,7 +2176,7 @@
-
+
@@ -2193,7 +2193,7 @@
-
+
@@ -2210,7 +2210,7 @@
-
+
@@ -2227,7 +2227,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08200-08299.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08200-08299.xml
index 6cc38a1670..7a75f6d934 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08200-08299.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08200-08299.xml
@@ -12,7 +12,7 @@
-
+
@@ -27,7 +27,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08600-08699.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08600-08699.xml
index 9e294e80c3..754444f349 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08600-08699.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08600-08699.xml
@@ -374,7 +374,7 @@
-
+
@@ -512,7 +512,7 @@
-
+
@@ -635,7 +635,7 @@
-
+
@@ -966,7 +966,7 @@
-
+
@@ -982,7 +982,7 @@
-
+
@@ -998,7 +998,7 @@
-
+
@@ -1014,7 +1014,7 @@
-
+
@@ -1030,7 +1030,7 @@
-
+
@@ -1046,7 +1046,7 @@
-
+
@@ -1062,7 +1062,7 @@
-
+
@@ -1078,7 +1078,7 @@
-
+
@@ -1094,7 +1094,7 @@
-
+
@@ -1110,7 +1110,7 @@
-
+
@@ -1126,7 +1126,7 @@
-
+
@@ -1142,7 +1142,7 @@
-
+
@@ -1158,7 +1158,7 @@
-
+
@@ -1174,7 +1174,7 @@
-
+
@@ -1190,7 +1190,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08700-08799.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08700-08799.xml
index 84d81a4b37..5c70280280 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08700-08799.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/08700-08799.xml
@@ -1104,7 +1104,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/09200-09299.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/09200-09299.xml
index f3f49fe32f..11c96612e9 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/09200-09299.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/09200-09299.xml
@@ -116,7 +116,7 @@
-
+
@@ -138,7 +138,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/09700-09799.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/09700-09799.xml
index d2a62b73c7..f13f9c2df8 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/09700-09799.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/09700-09799.xml
@@ -46,7 +46,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/10100-10199.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/10100-10199.xml
index c8687ccd43..04d979d53c 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/10100-10199.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/10100-10199.xml
@@ -1118,7 +1118,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/13000-13099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/13000-13099.xml
index 9d3ea6de89..19dbfcfeff 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/13000-13099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/13000-13099.xml
@@ -516,7 +516,7 @@
-
+
@@ -936,7 +936,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/13700-13799.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/13700-13799.xml
index 7736498d85..fb0f27ccee 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/13700-13799.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/13700-13799.xml
@@ -820,7 +820,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/14600-14699.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/14600-14699.xml
index f7b7a38d3e..53e1f3568c 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/14600-14699.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/14600-14699.xml
@@ -1802,7 +1802,7 @@
-
+
@@ -1935,7 +1935,7 @@
-
+
@@ -2051,7 +2051,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/14700-14799.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/14700-14799.xml
index 7a2470d9a5..6dccf6872c 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/14700-14799.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/14700-14799.xml
@@ -13,7 +13,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/17000-17099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/17000-17099.xml
index e4db24ccca..23ee5675ea 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/17000-17099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/17000-17099.xml
@@ -97,7 +97,7 @@
-
+
@@ -352,7 +352,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/20300-20399.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/20300-20399.xml
index f5dd8f4ded..81e4cd8741 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/20300-20399.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/20300-20399.xml
@@ -988,7 +988,7 @@
-
+
@@ -1104,7 +1104,7 @@
-
+
@@ -1220,7 +1220,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21000-21099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21000-21099.xml
index 44902598f6..46768f5a9e 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21000-21099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21000-21099.xml
@@ -686,7 +686,7 @@
-
+
@@ -764,7 +764,7 @@
-
+
@@ -786,7 +786,7 @@
-
+
@@ -808,7 +808,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21100-21199.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21100-21199.xml
index 353014adc4..d9f9c4906a 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21100-21199.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21100-21199.xml
@@ -1575,7 +1575,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21200-21299.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21200-21299.xml
index 57dd45dbc8..bfc7a6f496 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21200-21299.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/21200-21299.xml
@@ -203,7 +203,7 @@
-
+
@@ -793,7 +793,7 @@
-
+
@@ -812,7 +812,7 @@
-
+
@@ -861,7 +861,7 @@
-
+
@@ -880,7 +880,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22000-22099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22000-22099.xml
index 28a985b04c..ff10de6179 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22000-22099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22000-22099.xml
@@ -449,7 +449,7 @@
-
+
@@ -472,7 +472,7 @@
-
+
@@ -495,7 +495,7 @@
-
+
@@ -616,7 +616,7 @@
-
+
@@ -737,7 +737,7 @@
-
+
@@ -760,7 +760,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22500-22599.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22500-22599.xml
index 11efd9599e..3f5dc58143 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22500-22599.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22500-22599.xml
@@ -1030,7 +1030,7 @@
-
+
@@ -1050,7 +1050,7 @@
-
+
@@ -1070,7 +1070,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22600-22699.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22600-22699.xml
index 29c89bdbca..9aa039c3fd 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22600-22699.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/22600-22699.xml
@@ -432,7 +432,7 @@
-
+
@@ -455,7 +455,7 @@
-
+
@@ -478,7 +478,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23200-23299.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23200-23299.xml
index 53723c8767..070aeb5463 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23200-23299.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23200-23299.xml
@@ -163,7 +163,7 @@
-
+
@@ -180,7 +180,7 @@
-
+
@@ -525,7 +525,7 @@
-
+
@@ -560,7 +560,7 @@
-
+
@@ -575,7 +575,7 @@
-
+
@@ -588,7 +588,7 @@
-
+
@@ -606,7 +606,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23300-23399.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23300-23399.xml
index d2e2cc7586..7c82299cb2 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23300-23399.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23300-23399.xml
@@ -481,7 +481,7 @@
-
+
@@ -501,7 +501,7 @@
-
+
@@ -1393,7 +1393,7 @@
-
+
@@ -1411,7 +1411,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23400-23499.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23400-23499.xml
index 10b8102445..1bece4192b 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23400-23499.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23400-23499.xml
@@ -1092,7 +1092,7 @@
-
+
@@ -1110,7 +1110,7 @@
-
+
@@ -1164,7 +1164,7 @@
-
+
@@ -1426,7 +1426,7 @@
-
+
@@ -1443,7 +1443,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23500-23599.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23500-23599.xml
index e548f3cf94..80ac77ad4f 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23500-23599.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23500-23599.xml
@@ -93,7 +93,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23600-23699.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23600-23699.xml
index 56e3bf15c5..8e91aeeadf 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23600-23699.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/23600-23699.xml
@@ -189,7 +189,7 @@
-
+
@@ -566,7 +566,7 @@
-
+
@@ -760,7 +760,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/30300-30399.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/30300-30399.xml
index b1377f4134..b372975b62 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/30300-30399.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/30300-30399.xml
@@ -985,7 +985,7 @@
-
+
@@ -1009,7 +1009,7 @@
-
+
@@ -1033,7 +1033,7 @@
-
+
@@ -1053,7 +1053,7 @@
-
+
@@ -1076,7 +1076,7 @@
-
+
@@ -1099,7 +1099,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/34000-34099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/34000-34099.xml
index 02171dbb9f..c6a6b1ec48 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/34000-34099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/34000-34099.xml
@@ -180,7 +180,7 @@
-
+
@@ -200,7 +200,7 @@
-
+
@@ -220,7 +220,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/34600-34699.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/34600-34699.xml
index 325d50dbf3..5ea3af8dcf 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/34600-34699.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/34600-34699.xml
@@ -41,7 +41,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35600-35699.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35600-35699.xml
index 998febc75b..cfef5598f2 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35600-35699.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35600-35699.xml
@@ -1422,7 +1422,7 @@
-
+
@@ -1442,7 +1442,7 @@
-
+
@@ -1462,7 +1462,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35700-35799.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35700-35799.xml
index c21fcd9241..79735f3d88 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35700-35799.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35700-35799.xml
@@ -771,7 +771,7 @@
-
+
@@ -791,7 +791,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35900-35999.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35900-35999.xml
index cb68c773cf..8e17b26d1d 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35900-35999.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/35900-35999.xml
@@ -475,7 +475,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36000-36099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36000-36099.xml
index 4daa3a510e..0d06fd6ba4 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36000-36099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36000-36099.xml
@@ -377,7 +377,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36200-36299.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36200-36299.xml
index 3fa4f438f2..1b29c7fd47 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36200-36299.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36200-36299.xml
@@ -785,7 +785,7 @@
-
+
@@ -1073,7 +1073,7 @@
-
+
@@ -1090,7 +1090,7 @@
-
+
@@ -1107,7 +1107,7 @@
-
+
@@ -1124,7 +1124,7 @@
-
+
@@ -1140,7 +1140,7 @@
-
+
@@ -1152,7 +1152,7 @@
-
+
@@ -1204,7 +1204,7 @@
-
+
@@ -1241,7 +1241,7 @@
-
+
@@ -1259,7 +1259,7 @@
-
+
@@ -1277,7 +1277,7 @@
-
+
@@ -1295,7 +1295,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36300-36399.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36300-36399.xml
index f15411962f..10fdcf788b 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36300-36399.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36300-36399.xml
@@ -48,7 +48,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
@@ -80,7 +80,7 @@
-
+
@@ -97,7 +97,7 @@
-
+
@@ -119,7 +119,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/37600-37699.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/37600-37699.xml
index d21592eeff..e4c536411b 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/37600-37699.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/37600-37699.xml
@@ -1389,7 +1389,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/38200-38299.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/38200-38299.xml
index 4f97ee8996..5e77eccd1f 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/38200-38299.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/38200-38299.xml
@@ -358,7 +358,7 @@
-
+
@@ -375,7 +375,7 @@
-
+
@@ -392,7 +392,7 @@
-
+
@@ -409,7 +409,7 @@
-
+
@@ -426,7 +426,7 @@
-
+
@@ -443,7 +443,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/40000-40099.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/40000-40099.xml
index 0e63b269f4..fc3356895e 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/40000-40099.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/40000-40099.xml
@@ -870,7 +870,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/xsd/items.xsd b/L2J_Mobius_01.0_Ertheia/dist/game/data/xsd/items.xsd
index fb24816202..3468fc197e 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/xsd/items.xsd
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/xsd/items.xsd
@@ -90,7 +90,7 @@
-
+
diff --git a/L2J_Mobius_01.0_Ertheia/dist/libs/cron4j-2.2.5-sources.jar b/L2J_Mobius_01.0_Ertheia/dist/libs/cron4j-2.2.5-sources.jar
deleted file mode 100644
index 92e6ad0656..0000000000
Binary files a/L2J_Mobius_01.0_Ertheia/dist/libs/cron4j-2.2.5-sources.jar and /dev/null differ
diff --git a/L2J_Mobius_01.0_Ertheia/dist/libs/cron4j-2.2.5.jar b/L2J_Mobius_01.0_Ertheia/dist/libs/cron4j-2.2.5.jar
deleted file mode 100644
index fe30013168..0000000000
Binary files a/L2J_Mobius_01.0_Ertheia/dist/libs/cron4j-2.2.5.jar and /dev/null differ
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java
index da9ad63253..2d0add5089 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java
@@ -67,7 +67,6 @@ import org.l2jmobius.gameserver.data.xml.EnchantItemGroupsData;
import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData;
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
import org.l2jmobius.gameserver.data.xml.EnchantSkillGroupsData;
-import org.l2jmobius.gameserver.data.xml.EventEngineData;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.data.xml.FakePlayerData;
import org.l2jmobius.gameserver.data.xml.FenceData;
@@ -381,8 +380,6 @@ public class GameServer
SpawnData.getInstance().init();
DBSpawnManager.getInstance();
- printSection("Event Engine");
- EventEngineData.getInstance();
VoteSystem.initialize();
printSection("Siege");
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/Shutdown.java
index 9e0bc3126c..02419a263c 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/Shutdown.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.CastleManorManager;
-import org.l2jmobius.gameserver.instancemanager.CeremonyOfChaosManager;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
@@ -452,8 +451,6 @@ public class Shutdown extends Thread
LOGGER.info("Item Auction Manager: All tasks stopped(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
Olympiad.getInstance().saveOlympiadStatus();
LOGGER.info("Olympiad System: Data saved(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
- CeremonyOfChaosManager.getInstance().stopScheduler();
- LOGGER.info("CeremonyOfChaosManager: Scheduler stopped(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
Hero.getInstance().shutdown();
LOGGER.info("Hero System: Data saved(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/data/xml/EventEngineData.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/data/xml/EventEngineData.java
deleted file mode 100644
index 29c1ceab09..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/data/xml/EventEngineData.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.data.xml;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import org.l2jmobius.commons.util.IXmlReader;
-import org.l2jmobius.gameserver.model.Location;
-import org.l2jmobius.gameserver.model.StatSet;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.EventMethodNotification;
-import org.l2jmobius.gameserver.model.eventengine.EventScheduler;
-import org.l2jmobius.gameserver.model.eventengine.IConditionalEventScheduler;
-import org.l2jmobius.gameserver.model.eventengine.conditions.BetweenConditionalScheduler;
-import org.l2jmobius.gameserver.model.eventengine.conditions.HaventRunConditionalScheduler;
-import org.l2jmobius.gameserver.model.eventengine.drop.EventDropGroup;
-import org.l2jmobius.gameserver.model.eventengine.drop.EventDropItem;
-import org.l2jmobius.gameserver.model.eventengine.drop.EventDrops;
-import org.l2jmobius.gameserver.model.eventengine.drop.GroupedDrop;
-import org.l2jmobius.gameserver.model.eventengine.drop.IEventDrop;
-import org.l2jmobius.gameserver.model.eventengine.drop.NormalDrop;
-import org.l2jmobius.gameserver.model.holders.ItemHolder;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-
-/**
- * @author UnAfraid
- */
-public class EventEngineData implements IXmlReader
-{
- private static final Logger LOGGER = Logger.getLogger(EventEngineData.class.getName());
-
- protected EventEngineData()
- {
- load();
- }
-
- @Override
- public void load()
- {
- parseDatapackDirectory("data/events", true);
- }
-
- @Override
- public void parseDocument(Document doc, File f)
- {
- for (Node listNode = doc.getFirstChild(); listNode != null; listNode = listNode.getNextSibling())
- {
- if ("list".equals(listNode.getNodeName()))
- {
- for (Node eventNode = listNode.getFirstChild(); eventNode != null; eventNode = eventNode.getNextSibling())
- {
- if ("event".equals(eventNode.getNodeName()))
- {
- parseEvent(eventNode);
- }
- }
- }
- }
- }
-
- /**
- * @param eventNode
- */
- private void parseEvent(Node eventNode)
- {
- final String eventName = parseString(eventNode.getAttributes(), "name");
- final String className = parseString(eventNode.getAttributes(), "class");
- AbstractEventManager> eventManager = null;
- try
- {
- final Class> clazz = Class.forName(className);
-
- // Attempt to find getInstance() method
- for (Method method : clazz.getMethods())
- {
- if (Modifier.isStatic(method.getModifiers()) && AbstractEventManager.class.isAssignableFrom(method.getReturnType()) && (method.getParameterCount() == 0))
- {
- eventManager = (AbstractEventManager>) method.invoke(null);
- break;
- }
- }
-
- if (eventManager == null)
- {
- throw new NoSuchMethodError("Couldn't method that gives instance of AbstractEventManager!");
- }
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't locate event manager instance for event: " + eventName + " !", e);
- return;
- }
-
- for (Node innerNode = eventNode.getFirstChild(); innerNode != null; innerNode = innerNode.getNextSibling())
- {
- if ("variables".equals(innerNode.getNodeName()))
- {
- parseVariables(eventManager, innerNode);
- }
- else if ("scheduler".equals(innerNode.getNodeName()))
- {
- parseScheduler(eventManager, innerNode);
- }
- else if ("rewards".equals(innerNode.getNodeName()))
- {
- parseRewards(eventManager, innerNode);
- }
- }
-
- // Assign event name
- eventManager.setName(eventName);
-
- // Start the scheduler
- eventManager.startScheduler();
-
- // Start conditional schedulers
- eventManager.startConditionalSchedulers();
-
- // Notify the event manager that we've done initializing its stuff
- eventManager.onInitialized();
-
- LOGGER.info(getClass().getSimpleName() + ": " + eventManager.getClass().getSimpleName() + ": Initialized.");
- }
-
- /**
- * @param eventManager
- * @param innerNode
- */
- private void parseVariables(AbstractEventManager> eventManager, Node innerNode)
- {
- final StatSet variables = new StatSet(LinkedHashMap::new);
- for (Node variableNode = innerNode.getFirstChild(); variableNode != null; variableNode = variableNode.getNextSibling())
- {
- if ("variable".equals(variableNode.getNodeName()))
- {
- variables.set(parseString(variableNode.getAttributes(), "name"), parseString(variableNode.getAttributes(), "value"));
- }
- else if ("list".equals(variableNode.getNodeName()))
- {
- parseListVariables(eventManager, variables, variableNode);
- }
- else if ("map".equals(variableNode.getNodeName()))
- {
- parseMapVariables(eventManager, variables, variableNode);
- }
- }
- eventManager.setVariables(variables);
- }
-
- /**
- * @param eventManager
- * @param innerNode
- */
- private void parseScheduler(AbstractEventManager> eventManager, Node innerNode)
- {
- eventManager.stopScheduler();
- final Set schedulers = new LinkedHashSet<>();
- final Set conditionalSchedulers = new LinkedHashSet<>();
- for (Node scheduleNode = innerNode.getFirstChild(); scheduleNode != null; scheduleNode = scheduleNode.getNextSibling())
- {
- if ("schedule".equals(scheduleNode.getNodeName()))
- {
- final StatSet params = new StatSet(LinkedHashMap::new);
- final NamedNodeMap attrs = scheduleNode.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++)
- {
- final Node node = attrs.item(i);
- params.set(node.getNodeName(), node.getNodeValue());
- }
-
- final EventScheduler scheduler = new EventScheduler(eventManager, params);
- for (Node eventNode = scheduleNode.getFirstChild(); eventNode != null; eventNode = eventNode.getNextSibling())
- {
- if ("event".equals(eventNode.getNodeName()))
- {
- String methodName = parseString(eventNode.getAttributes(), "name");
- if (methodName.charAt(0) == '#')
- {
- methodName = methodName.substring(1);
- }
-
- final List args = new ArrayList<>();
- for (Node argsNode = eventNode.getFirstChild(); argsNode != null; argsNode = argsNode.getNextSibling())
- {
- if ("arg".equals(argsNode.getNodeName()))
- {
- final String type = parseString(argsNode.getAttributes(), "type");
- final Object value = parseObject(eventManager, type, argsNode.getTextContent());
- if (value != null)
- {
- args.add(value);
- }
- }
- }
-
- try
- {
- scheduler.addEventNotification(new EventMethodNotification(eventManager, methodName, args));
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't add event notification for " + eventManager.getClass().getSimpleName(), e);
- }
- }
- }
- schedulers.add(scheduler);
- }
- else if ("conditionalSchedule".equals(scheduleNode.getNodeName()))
- {
- final StatSet params = new StatSet(LinkedHashMap::new);
- final NamedNodeMap attrs = scheduleNode.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++)
- {
- final Node node = attrs.item(i);
- params.set(node.getNodeName(), node.getNodeValue());
- }
-
- for (Node eventNode = scheduleNode.getFirstChild(); eventNode != null; eventNode = eventNode.getNextSibling())
- {
- if ("run".equals(eventNode.getNodeName()))
- {
- final String name = parseString(eventNode.getAttributes(), "name");
- final String ifType = parseString(eventNode.getAttributes(), "if", "BETWEEN").toUpperCase();
- switch (ifType)
- {
- case "BETWEEN":
- {
- final List names = new ArrayList<>(2);
- for (Node innerData = eventNode.getFirstChild(); innerData != null; innerData = innerData.getNextSibling())
- {
- if ("name".equals(innerData.getNodeName()))
- {
- names.add(innerData.getTextContent());
- }
- }
- if (names.size() != 2)
- {
- LOGGER.warning(getClass().getSimpleName() + ": Event: " + eventManager.getClass().getSimpleName() + " has incorrect amount of scheduler names: " + names + " expected: 2 found: " + names.size());
- }
- else
- {
- conditionalSchedulers.add(new BetweenConditionalScheduler(eventManager, name, names.get(0), names.get(1)));
- }
- break;
- }
- case "HASNT_RUN":
- {
- conditionalSchedulers.add(new HaventRunConditionalScheduler(eventManager, name));
- break;
- }
- }
- }
- }
- }
- }
- eventManager.setSchedulers(schedulers);
- eventManager.setConditionalSchedulers(conditionalSchedulers);
- }
-
- /**
- * @param eventManager
- * @param innerNode
- */
- private void parseRewards(AbstractEventManager> eventManager, Node innerNode)
- {
- final Map rewards = new LinkedHashMap<>();
- forEach(innerNode, IXmlReader::isNode, rewardsNode ->
- {
- if ("reward".equalsIgnoreCase(rewardsNode.getNodeName()))
- {
- final String name = parseString(rewardsNode.getAttributes(), "name");
- final EventDrops dropType = parseEnum(rewardsNode.getAttributes(), EventDrops.class, "type");
- switch (dropType)
- {
- case GROUPED:
- {
- final GroupedDrop droplist = dropType.newInstance();
- forEach(rewardsNode, "group", groupsNode ->
- {
- final EventDropGroup group = new EventDropGroup(parseDouble(groupsNode.getAttributes(), "chance"));
- forEach(groupsNode, "item", itemNode ->
- {
- final NamedNodeMap attrs = itemNode.getAttributes();
- final int id = parseInteger(attrs, "id");
- final int min = parseInteger(attrs, "min");
- final int max = parseInteger(attrs, "max");
- final double chance = parseDouble(attrs, "chance");
- group.addItem(new EventDropItem(id, min, max, chance));
- });
- });
- rewards.put(name, droplist);
- break;
- }
- case NORMAL:
- {
- final NormalDrop droplist = dropType.newInstance();
- forEach(rewardsNode, "item", itemNode ->
- {
- final NamedNodeMap attrs = itemNode.getAttributes();
- final int id = parseInteger(attrs, "id");
- final int min = parseInteger(attrs, "min");
- final int max = parseInteger(attrs, "max");
- final double chance = parseDouble(attrs, "chance");
- droplist.addItem(new EventDropItem(id, min, max, chance));
- });
- rewards.put(name, droplist);
- break;
- }
- }
- }
- });
- eventManager.setRewards(rewards);
- }
-
- /**
- * @param eventManager
- * @param variables
- * @param variableNode
- */
- @SuppressWarnings("unchecked")
- private void parseListVariables(AbstractEventManager> eventManager, StatSet variables, Node variableNode)
- {
- final String name = parseString(variableNode.getAttributes(), "name");
- final String type = parseString(variableNode.getAttributes(), "type");
- final Class> classType = getClassByName(eventManager, type);
- final List> values = newList(classType);
- switch (type)
- {
- case "Byte":
- case "Short":
- case "Integer":
- case "Float":
- case "Long":
- case "Double":
- case "String":
- {
- for (Node stringNode = variableNode.getFirstChild(); stringNode != null; stringNode = stringNode.getNextSibling())
- {
- if ("value".equals(stringNode.getNodeName()))
- {
- ((List) values).add(parseObject(eventManager, type, stringNode.getTextContent()));
- }
- }
- break;
- }
- case "ItemHolder":
- {
- for (Node stringNode = variableNode.getFirstChild(); stringNode != null; stringNode = stringNode.getNextSibling())
- {
- if ("item".equals(stringNode.getNodeName()))
- {
- ((List) values).add(new ItemHolder(parseInteger(stringNode.getAttributes(), "id"), parseLong(stringNode.getAttributes(), "count", 1L)));
- }
- }
- break;
- }
- case "SkillHolder":
- {
- for (Node stringNode = variableNode.getFirstChild(); stringNode != null; stringNode = stringNode.getNextSibling())
- {
- if ("skill".equals(stringNode.getNodeName()))
- {
- ((List) values).add(new SkillHolder(parseInteger(stringNode.getAttributes(), "id"), parseInteger(stringNode.getAttributes(), "level", 1)));
- }
- }
- break;
- }
- case "Location":
- {
- for (Node stringNode = variableNode.getFirstChild(); stringNode != null; stringNode = stringNode.getNextSibling())
- {
- if ("location".equals(stringNode.getNodeName()))
- {
- ((List) values).add(new Location(parseInteger(stringNode.getAttributes(), "x"), parseInteger(stringNode.getAttributes(), "y"), parseInteger(stringNode.getAttributes(), "z", parseInteger(stringNode.getAttributes(), "heading", 0))));
- }
- }
- break;
- }
- default:
- {
- LOGGER.info(getClass().getSimpleName() + ": Unhandled list case: " + type + " for event: " + eventManager.getClass().getSimpleName());
- break;
- }
- }
- variables.set(name, values);
- }
-
- /**
- * @param eventManager
- * @param variables
- * @param variableNode
- */
- @SuppressWarnings("unchecked")
- private void parseMapVariables(AbstractEventManager> eventManager, StatSet variables, Node variableNode)
- {
- final String name = parseString(variableNode.getAttributes(), "name");
- final String keyType = parseString(variableNode.getAttributes(), "keyType");
- final String valueType = parseString(variableNode.getAttributes(), "valueType");
- final Class> keyClass = getClassByName(eventManager, keyType);
- final Class> valueClass = getClassByName(eventManager, valueType);
- final Map, ?> map = newMap(keyClass, valueClass);
- forEach(variableNode, IXmlReader::isNode, stringNode ->
- {
- switch (stringNode.getNodeName())
- {
- case "entry":
- {
- final NamedNodeMap attrs = stringNode.getAttributes();
- ((Map) map).put(parseObject(eventManager, keyType, parseString(attrs, "key")), parseObject(eventManager, valueType, parseString(attrs, "value")));
- break;
- }
- case "item":
- {
- final NamedNodeMap attrs = stringNode.getAttributes();
- ((Map) map).put(parseObject(eventManager, keyType, parseString(attrs, "key")), new ItemHolder(parseInteger(stringNode.getAttributes(), "id"), parseLong(stringNode.getAttributes(), "count")));
- break;
- }
- case "skill":
- {
- final NamedNodeMap attrs = stringNode.getAttributes();
- ((Map) map).put(parseObject(eventManager, keyType, parseString(attrs, "key")), new SkillHolder(parseInteger(stringNode.getAttributes(), "id"), parseInteger(stringNode.getAttributes(), "level")));
- break;
- }
- case "location":
- {
- final NamedNodeMap attrs = stringNode.getAttributes();
- ((Map) map).put(parseObject(eventManager, keyType, parseString(attrs, "key")), new Location(parseInteger(stringNode.getAttributes(), "x"), parseInteger(stringNode.getAttributes(), "y"), parseInteger(stringNode.getAttributes(), "z", parseInteger(stringNode.getAttributes(), "heading", 0))));
- break;
- }
- default:
- {
- LOGGER.warning(getClass().getSimpleName() + ": Unhandled map case: " + name + " " + stringNode.getNodeName() + " for event: " + eventManager.getClass().getSimpleName());
- }
- }
- });
- variables.set(name, map);
- }
-
- private Class> getClassByName(AbstractEventManager> eventManager, String name)
- {
- switch (name)
- {
- case "Byte":
- {
- return Byte.class;
- }
- case "Short":
- {
- return Short.class;
- }
- case "Integer":
- {
- return Integer.class;
- }
- case "Float":
- {
- return Float.class;
- }
- case "Long":
- {
- return Long.class;
- }
- case "Double":
- {
- return Double.class;
- }
- case "String":
- {
- return String.class;
- }
- case "ItemHolder":
- {
- return ItemHolder.class;
- }
- case "SkillHolder":
- {
- return SkillHolder.class;
- }
- case "Location":
- {
- return Location.class;
- }
- default:
- {
- LOGGER.warning(getClass().getSimpleName() + ": Unhandled class case: " + name + " for event: " + eventManager.getClass().getSimpleName());
- return Object.class;
- }
- }
- }
-
- private Object parseObject(AbstractEventManager> eventManager, String type, String value)
- {
- switch (type)
- {
- case "Byte":
- {
- return Byte.decode(value);
- }
- case "Short":
- {
- return Short.decode(value);
- }
- case "Integer":
- {
- return Integer.decode(value);
- }
- case "Float":
- {
- return Float.parseFloat(value);
- }
- case "Long":
- {
- return Long.decode(value);
- }
- case "Double":
- {
- return Double.parseDouble(value);
- }
- case "String":
- {
- return value;
- }
- default:
- {
- LOGGER.warning(getClass().getSimpleName() + ": Unhandled object case: " + type + " for event: " + eventManager.getClass().getSimpleName());
- return null;
- }
- }
- }
-
- private static List newList(Class type)
- {
- return new ArrayList<>();
- }
-
- private static Map newMap(Class keyClass, Class valueClass)
- {
- return new LinkedHashMap<>();
- }
-
- /**
- * Gets the single instance of EventEngineData.
- * @return single instance of EventEngineData
- */
- public static EventEngineData getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
- private static class SingletonHolder
- {
- protected static final EventEngineData INSTANCE = new EventEngineData();
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/enums/CeremonyOfChaosState.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/enums/CeremonyOfChaosState.java
deleted file mode 100644
index cfa14a8f1c..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/enums/CeremonyOfChaosState.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.enums;
-
-import org.l2jmobius.gameserver.model.eventengine.IEventState;
-
-/**
- * @author Sdw
- */
-public enum CeremonyOfChaosState implements IEventState
-{
- SCHEDULED,
- REGISTRATION,
- PREPARING_FOR_TELEPORT,
- PREPARING_FOR_FIGHT,
- RUNNING
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CeremonyOfChaosManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CeremonyOfChaosManager.java
deleted file mode 100644
index fcf73e07ba..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CeremonyOfChaosManager.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.instancemanager;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.util.Comparator;
-import java.util.List;
-import java.util.logging.Logger;
-import java.util.stream.Collectors;
-
-import org.l2jmobius.commons.database.DatabaseFactory;
-import org.l2jmobius.commons.util.Rnd;
-import org.l2jmobius.gameserver.enums.CategoryType;
-import org.l2jmobius.gameserver.enums.CeremonyOfChaosState;
-import org.l2jmobius.gameserver.model.StatSet;
-import org.l2jmobius.gameserver.model.World;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosMember;
-import org.l2jmobius.gameserver.model.clan.Clan;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.ScheduleTarget;
-import org.l2jmobius.gameserver.model.events.EventType;
-import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
-import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
-import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerBypass;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
-import org.l2jmobius.gameserver.model.events.returns.TerminateReturn;
-import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
-import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
-import org.l2jmobius.gameserver.model.punishment.PunishmentType;
-import org.l2jmobius.gameserver.model.variables.PlayerVariables;
-import org.l2jmobius.gameserver.model.zone.ZoneId;
-import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseState;
-
-/**
- * @author Sdw
- */
-public class CeremonyOfChaosManager extends AbstractEventManager
-{
- protected static final Logger LOGGER = Logger.getLogger(CeremonyOfChaosManager.class.getName());
-
- public static final String INITIAL_BUFF_KEY = "initial_buff";
- public static final String INITIAL_ITEMS_KEY = "initial_items";
- public static final String MAX_PLAYERS_KEY = "max_players";
- public static final String MAX_ARENAS_KEY = "max_arenas";
- public static final String INSTANCE_TEMPLATES_KEY = "instance_templates";
- public static final String END_BUFFS_KEYH = "end_buffs";
-
- protected CeremonyOfChaosManager()
- {
- }
-
- @Override
- public void onInitialized()
- {
- if (getState() == null)
- {
- setState(CeremonyOfChaosState.SCHEDULED);
- }
- }
-
- @ScheduleTarget
- private void onPeriodEnd(String text)
- {
- // Set monthly true hero.
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TRUE_HERO, GlobalVariablesManager.getInstance().getInt(GlobalVariablesManager.COC_TOP_MEMBER, 0));
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TRUE_HERO_REWARDED, false);
- // Reset monthly winner.
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TOP_MARKS, 0);
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TOP_MEMBER, 0);
-
- try (Connection con = DatabaseFactory.getConnection();
- PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
- {
- ps.setString(1, PlayerVariables.CEREMONY_OF_CHAOS_MARKS);
- ps.execute();
- }
- catch (Exception e)
- {
- LOGGER.severe(getClass().getSimpleName() + ": Could not reset Ceremony Of Chaos victories: " + e);
- }
-
- try (Connection con = DatabaseFactory.getConnection();
- PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
- {
- ps.setString(1, PlayerVariables.CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES);
- ps.execute();
- }
- catch (Exception e)
- {
- LOGGER.severe(getClass().getSimpleName() + ": Could not reset Ceremony Of Chaos penalties: " + e);
- }
-
- // Update data for online players.
- for (PlayerInstance player : World.getInstance().getPlayers())
- {
- player.getVariables().remove(PlayerVariables.CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES);
- player.getVariables().remove(PlayerVariables.CEREMONY_OF_CHAOS_MARKS);
- player.getVariables().storeMe();
- }
-
- LOGGER.info(getClass().getSimpleName() + ": Ceremony of Chaos variables have been reset.");
- LOGGER.info(getClass().getSimpleName() + ": Ceremony of Chaos period has ended!");
- }
-
- @ScheduleTarget
- private void onEventStart()
- {
- LOGGER.info(getClass().getSimpleName() + ": Ceremony of Chaos event has started!");
- }
-
- @ScheduleTarget
- private void onEventEnd()
- {
- PunishmentManager.getInstance().stopPunishment(PunishmentAffect.CHARACTER, PunishmentType.COC_BAN);
- LOGGER.info(getClass().getSimpleName() + ": Ceremony of Chaos event has ended!");
- }
-
- @ScheduleTarget
- private void onRegistrationStart()
- {
- if (getState() != CeremonyOfChaosState.SCHEDULED)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.REGISTRATION);
- for (PlayerInstance player : World.getInstance().getPlayers())
- {
- if (player.isOnline())
- {
- player.sendPacket(SystemMessageId.REGISTRATION_FOR_THE_CEREMONY_OF_CHAOS_HAS_BEGUN);
- if (canRegister(player, false))
- {
- player.sendPacket(ExCuriousHouseState.REGISTRATION_PACKET);
- }
- }
- }
- }
-
- @ScheduleTarget
- private void onRegistrationEnd()
- {
- if (getState() != CeremonyOfChaosState.REGISTRATION)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.PREPARING_FOR_TELEPORT);
- for (PlayerInstance player : World.getInstance().getPlayers())
- {
- if (player.isOnline())
- {
- player.sendPacket(SystemMessageId.REGISTRATION_FOR_THE_CEREMONY_OF_CHAOS_HAS_ENDED);
- if (!isRegistered(player))
- {
- player.sendPacket(ExCuriousHouseState.IDLE_PACKET);
- }
- }
- }
- final StatSet params = new StatSet();
- params.set("time", 60);
- getTimers().addTimer("count_down", params, 60 * 1000, null, null);
- }
-
- @ScheduleTarget
- private void onPrepareForFight()
- {
- if (getState() != CeremonyOfChaosState.PREPARING_FOR_TELEPORT)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.PREPARING_FOR_FIGHT);
- int eventId = 0;
- int position = 1;
- CeremonyOfChaosEvent event = null;
- final List players = getRegisteredPlayers().stream().sorted(Comparator.comparingInt(PlayerInstance::getLevel)).collect(Collectors.toList());
- final int maxPlayers = getMaxPlayersInArena();
- final List templates = getVariables().getList(INSTANCE_TEMPLATES_KEY, Integer.class);
- for (PlayerInstance player : players)
- {
- if (player.isOnline() && canRegister(player, true))
- {
- if ((event == null) || (event.getMembers().size() >= maxPlayers))
- {
- final int template = templates.get(Rnd.get(templates.size()));
- event = new CeremonyOfChaosEvent(eventId++, InstanceManager.getInstance().getInstanceTemplate(template));
- position = 1;
- getEvents().add(event);
- }
-
- event.addMember(new CeremonyOfChaosMember(player, event, position++));
- }
- else
- {
- player.prohibiteCeremonyOfChaos();
- player.sendPacket(ExCuriousHouseState.IDLE_PACKET);
- }
- }
-
- // Clear previously registrated players
- getRegisteredPlayers().clear();
-
- // Prepare all event's players for start
- getEvents().forEach(CeremonyOfChaosEvent::preparePlayers);
- }
-
- @ScheduleTarget
- private void onStartFight()
- {
- if (getState() != CeremonyOfChaosState.PREPARING_FOR_FIGHT)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.RUNNING);
- getEvents().forEach(CeremonyOfChaosEvent::startFight);
- }
-
- @ScheduleTarget
- private void onEndFight()
- {
- if (getState() != CeremonyOfChaosState.RUNNING)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.SCHEDULED);
- getEvents().forEach(CeremonyOfChaosEvent::stopFight);
- getEvents().clear();
- }
-
- @Override
- public void onTimerEvent(String event, StatSet params, Npc npc, PlayerInstance player)
- {
- switch (event)
- {
- case "count_down":
- {
- final int time = params.getInt("time", 0);
- final SystemMessage countdown = new SystemMessage(SystemMessageId.YOU_WILL_BE_MOVED_TO_THE_ARENA_IN_S1_SECOND_S);
- countdown.addByte(time);
- broadcastPacket(countdown);
-
- // Reschedule
- if (time == 60)
- {
- params.set("time", 10);
- getTimers().addTimer(event, params, 50 * 1000, null, null);
- }
- else if (time == 10)
- {
- params.set("time", 5);
- getTimers().addTimer(event, params, 5 * 1000, null, null);
- }
- else if ((time > 1) && (time <= 5))
- {
- params.set("time", time - 1);
- getTimers().addTimer(event, params, 1000, null, null);
- }
- break;
- }
- }
- }
-
- public void broadcastPacket(IClientOutgoingPacket... packets)
- {
- getRegisteredPlayers().forEach(member -> member.sendPacket(packets));
- }
-
- @Override
- public boolean canRegister(PlayerInstance player, boolean sendMessage)
- {
- boolean canRegister = true;
-
- final Clan clan = player.getClan();
- SystemMessageId sm = null;
- if (player.getLevel() < 85)
- {
- sm = SystemMessageId.ONLY_CHARACTERS_LEVEL_85_OR_ABOVE_MAY_PARTICIPATE_IN_THE_TOURNAMENT;
- canRegister = false;
- }
- else if (player.isFlyingMounted())
- {
- sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_AS_A_FLYING_TRANSFORMED_OBJECT;
- canRegister = false;
- }
- else if (!player.isInCategory(CategoryType.SIXTH_CLASS_GROUP))
- {
- sm = SystemMessageId.ONLY_CHARACTERS_WHO_HAVE_COMPLETED_THE_3RD_CLASS_TRANSFER_MAY_PARTICIPATE;
- canRegister = false;
- }
- else if (!player.isInventoryUnder80(false) || (player.getWeightPenalty() != 0))
- {
- sm = SystemMessageId.UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY;
- canRegister = false;
- }
- else if ((clan == null) || (clan.getLevel() < 3))
- {
- sm = SystemMessageId.ONLY_CHARACTERS_WHO_ARE_A_PART_OF_A_CLAN_OF_LEVEL_3_OR_ABOVE_MAY_PARTICIPATE;
- canRegister = false;
- }
- else if (getRegisteredPlayers().size() >= (getVariables().getInt(MAX_ARENAS_KEY, 5) * getMaxPlayersInArena()))
- {
- sm = SystemMessageId.THERE_ARE_TOO_MANY_CHALLENGERS_YOU_CANNOT_PARTICIPATE_NOW;
- canRegister = false;
- }
- else if (player.isCursedWeaponEquipped() || (player.getReputation() < 0))
- {
- sm = SystemMessageId.WAITING_LIST_REGISTRATION_IS_NOT_ALLOWED_WHILE_THE_CURSED_SWORD_IS_BEING_USED_OR_THE_STATUS_IS_IN_A_CHAOTIC_STATE;
- canRegister = false;
- }
- else if (player.isInDuel())
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_IN_THE_WAITING_LIST_DURING_A_DUEL;
- canRegister = false;
- }
- else if (player.isInOlympiadMode() || OlympiadManager.getInstance().isRegistered(player))
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_IN_THE_WAITING_LIST_WHILE_PARTICIPATING_IN_OLYMPIAD;
- canRegister = false;
- }
- else if (player.isOnEvent(CeremonyOfChaosEvent.class) || (player.getBlockCheckerArena() > -1)) // TODO underground coliseum and kratei checks.
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_FOR_THE_WAITING_LIST_WHILE_PARTICIPATING_IN_THE_BLOCK_CHECKER_COLISEUM_OLYMPIAD_KRATEI_S_CUBE_CEREMONY_OF_CHAOS;
- canRegister = false;
- }
- else if (player.isInInstance())
- {
- sm = SystemMessageId.YOU_MAY_NOT_REGISTER_WHILE_USING_THE_INSTANT_ZONE;
- canRegister = false;
- }
- else if (player.isInSiege())
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_FOR_THE_WAITING_LIST_ON_THE_BATTLEFIELD_CASTLE_SIEGE_FORTRESS_SIEGE;
- canRegister = false;
- }
- else if (player.isInsideZone(ZoneId.SIEGE))
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_IN_THE_WAITING_LIST_WHILE_BEING_INSIDE_OF_A_BATTLEGROUND_CASTLE_SIEGE_FORTRESS_SIEGE;
- canRegister = false;
- }
- else if (player.isFlyingMounted())
- {
- sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_AS_A_FLYING_TRANSFORMED_OBJECT;
- canRegister = false;
- }
- else if (player.isFishing())
- {
- sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_WHILE_FISHING;
- canRegister = false;
- }
- else if (player.isCeremonyOfChaosProhibited())
- {
- canRegister = false;
- }
-
- // TODO : One player can take part in 16 matches per day.
- if ((sm != null) && sendMessage)
- {
- player.sendPacket(sm);
- }
-
- return canRegister;
- }
-
- @RegisterEvent(EventType.ON_PLAYER_BYPASS)
- @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
- public TerminateReturn OnPlayerBypass(OnPlayerBypass event)
- {
- final PlayerInstance player = event.getPlayer();
- if (player == null)
- {
- return null;
- }
-
- if (event.getCommand().equalsIgnoreCase("pledgegame?command=apply"))
- {
- if (registerPlayer(player))
- {
- player.sendPacket(SystemMessageId.YOU_ARE_NOW_ON_THE_WAITING_LIST_YOU_WILL_AUTOMATICALLY_BE_TELEPORTED_WHEN_THE_TOURNAMENT_STARTS_AND_WILL_BE_REMOVED_FROM_THE_WAITING_LIST_IF_YOU_LOG_OUT_IF_YOU_CANCEL_REGISTRATION_WITHIN_THE_LAST_MINUTE_OF_ENTERING_THE_ARENA_AFTER_SIGNING_UP_30_TIMES_OR_MORE_OR_FORFEIT_AFTER_ENTERING_THE_ARENA_30_TIMES_OR_MORE_DURING_A_CYCLE_YOU_BECOME_INELIGIBLE_FOR_PARTICIPATION_IN_THE_CEREMONY_OF_CHAOS_UNTIL_THE_NEXT_CYCLE_ALL_THE_BUFFS_EXCEPT_THE_VITALITY_BUFF_WILL_BE_REMOVED_ONCE_YOU_ENTER_THE_ARENAS);
- player.sendPacket(SystemMessageId.EXCEPT_THE_VITALITY_BUFF_ALL_BUFFS_INCLUDING_ART_OF_SEDUCTION_WILL_BE_DELETED);
- player.sendPacket(ExCuriousHouseState.PREPARE_PACKET);
- }
- return new TerminateReturn(true, false, false);
- }
- return null;
- }
-
- @RegisterEvent(EventType.ON_PLAYER_LOGIN)
- @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
- public void OnPlayerLogin(OnPlayerLogin event)
- {
- if (getState() == CeremonyOfChaosState.REGISTRATION)
- {
- final PlayerInstance player = event.getPlayer();
- if (canRegister(player, false))
- {
- player.sendPacket(ExCuriousHouseState.REGISTRATION_PACKET);
- }
- }
- }
-
- @Override
- @RegisterEvent(EventType.ON_PLAYER_LOGOUT)
- @RegisterType(ListenerRegisterType.GLOBAL)
- public void OnPlayerLogout(OnPlayerLogout event)
- {
- if (getState() == CeremonyOfChaosState.REGISTRATION)
- {
- final PlayerInstance player = event.getPlayer();
- if (getRegisteredPlayers().contains(player))
- {
- getRegisteredPlayers().remove(player);
- }
- }
- }
-
- // player leave clan
-
- public int getMaxPlayersInArena()
- {
- return getVariables().getInt(MAX_PLAYERS_KEY, 18);
- }
-
- public static CeremonyOfChaosManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
- private static class SingletonHolder
- {
- protected static final CeremonyOfChaosManager INSTANCE = new CeremonyOfChaosManager();
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java
index 380d97e557..0c3214c9a3 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java
@@ -16,56 +16,77 @@
*/
package org.l2jmobius.gameserver.instancemanager;
+import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
+import org.l2jmobius.commons.threads.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.model.clan.Clan;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.ScheduleTarget;
import org.l2jmobius.gameserver.model.residences.ClanHallAuction;
/**
* @author Sdw
*/
-public class ClanHallAuctionManager extends AbstractEventManager>
+public class ClanHallAuctionManager
{
private static final Logger LOGGER = Logger.getLogger(ClanHallAuctionManager.class.getName());
private static final Map AUCTIONS = new HashMap<>();
+ private static ScheduledFuture> _endTask;
protected ClanHallAuctionManager()
{
+ // Schedule of the start, next Wednesday at 19:00.
+ final Calendar start = Calendar.getInstance();
+ if ((start.get(Calendar.DAY_OF_WEEK) >= Calendar.WEDNESDAY))
+ {
+ start.add(Calendar.DAY_OF_YEAR, 7);
+ }
+ start.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);
+ start.set(Calendar.HOUR_OF_DAY, 19);
+ start.set(Calendar.MINUTE, 0);
+ start.set(Calendar.SECOND, 0);
+ final long startDelay = Math.max(0, start.getTimeInMillis() - Chronos.currentTimeMillis());
+ ThreadPool.scheduleAtFixedRate(() -> onStart(), startDelay, 604800000); // 604800000 = 1 week
+ if (startDelay > 0)
+ {
+ onStart();
+ }
+
+ // Schedule of the end, next Wednesday at 11:00.
+ final Calendar end = Calendar.getInstance();
+ if ((end.get(Calendar.DAY_OF_WEEK) >= Calendar.WEDNESDAY))
+ {
+ end.add(Calendar.DAY_OF_YEAR, 7);
+ }
+ end.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);
+ end.set(Calendar.HOUR_OF_DAY, 11);
+ end.set(Calendar.MINUTE, 0);
+ end.set(Calendar.SECOND, 0);
+ final long endDelay = Math.max(0, end.getTimeInMillis() - Chronos.currentTimeMillis());
+ _endTask = ThreadPool.scheduleAtFixedRate(() -> onEnd(), endDelay, 604800000); // 604800000 = 1 week
}
- @ScheduleTarget
- private void onEventStart()
+ private void onStart()
{
LOGGER.info(getClass().getSimpleName() + ": Clan Hall Auction has started!");
AUCTIONS.clear();
-
- //@formatter:off
- ClanHallData.getInstance().getFreeAuctionableHall()
- .forEach(c -> AUCTIONS.put(c.getResidenceId(), new ClanHallAuction(c.getResidenceId())));
- //@formatter:on
+ ClanHallData.getInstance().getFreeAuctionableHall().forEach(c -> AUCTIONS.put(c.getResidenceId(), new ClanHallAuction(c.getResidenceId())));
}
- @ScheduleTarget
- private void onEventEnd()
+ private void onEnd()
{
AUCTIONS.values().forEach(ClanHallAuction::finalizeAuctions);
AUCTIONS.clear();
LOGGER.info(getClass().getSimpleName() + ": Clan Hall Auction has ended!");
}
- @Override
- public void onInitialized()
- {
- }
-
public ClanHallAuction getClanHallAuctionById(int clanHallId)
{
return AUCTIONS.get(clanHallId);
@@ -95,6 +116,11 @@ public class ClanHallAuctionManager extends AbstractEventManager>
+public class DailyTaskManager
{
private static final Logger LOGGER = Logger.getLogger(DailyTaskManager.class.getName());
+ private final static int[] RESET_SKILLS =
+ {
+ 2510, // Wondrous Cubic
+ 22180, // Wondrous Cubic - 1 time use
+ };
+
protected DailyTaskManager()
{
+ // Schedule reset everyday at 6:30.
+ final Calendar calendar = Calendar.getInstance();
+ if ((calendar.get(Calendar.HOUR_OF_DAY) > 6) && (calendar.get(Calendar.MINUTE) > 30))
+ {
+ calendar.add(Calendar.DAY_OF_YEAR, 1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 6);
+ calendar.set(Calendar.MINUTE, 30);
+ calendar.set(Calendar.SECOND, 0);
+ final long startDelay = Math.max(0, calendar.getTimeInMillis() - Chronos.currentTimeMillis());
+ ThreadPool.scheduleAtFixedRate(() -> onReset(), startDelay, 86400000); // 86400000 = 1 day
+
+ // Global save task.
+ ThreadPool.scheduleAtFixedRate(() -> onSave(), 1800000, 1800000); // 1800000 = 30 minutes
}
- @Override
- public void onInitialized()
- {
- }
-
- @ScheduleTarget
private void onReset()
{
+ if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY)
+ {
+ clanLeaderApply();
+ resetVitalityWeekly();
+ }
+ else
+ {
+ resetVitalityDaily();
+ }
+
resetClanBonus();
resetDailySkills();
- resetRecommends();
resetWorldChatPoints();
+ resetRecommends();
resetTrainingCamp();
}
- @ScheduleTarget
private void onSave()
{
GlobalVariablesManager.getInstance().storeMe();
@@ -79,8 +99,7 @@ public class DailyTaskManager extends AbstractEventManager>
}
}
- @ScheduleTarget
- private void onClanLeaderApply()
+ private void clanLeaderApply()
{
for (Clan clan : ClanTable.getInstance().getClans())
{
@@ -98,8 +117,49 @@ public class DailyTaskManager extends AbstractEventManager>
LOGGER.info("Clan leaders has been updated.");
}
- @ScheduleTarget
- private void onVitalityReset()
+ private void resetVitalityDaily()
+ {
+ if (!Config.ENABLE_VITALITY)
+ {
+ return;
+ }
+
+ int vitality = PlayerStat.MAX_VITALITY_POINTS / 4;
+ for (PlayerInstance player : World.getInstance().getPlayers())
+ {
+ final int VP = player.getVitalityPoints();
+ player.setVitalityPoints(VP + vitality, false);
+ for (SubClassHolder subclass : player.getSubClasses().values())
+ {
+ final int VPS = subclass.getVitalityPoints();
+ subclass.setVitalityPoints(VPS + vitality);
+ }
+ }
+
+ try (Connection con = DatabaseFactory.getConnection())
+ {
+ try (PreparedStatement st = con.prepareStatement("UPDATE character_subclasses SET vitality_points = IF(vitality_points = ?, vitality_points, vitality_points + ?)"))
+ {
+ st.setInt(1, PlayerStat.MAX_VITALITY_POINTS);
+ st.setInt(2, PlayerStat.MAX_VITALITY_POINTS / 4);
+ st.execute();
+ }
+
+ try (PreparedStatement st = con.prepareStatement("UPDATE characters SET vitality_points = IF(vitality_points = ?, vitality_points, vitality_points + ?)"))
+ {
+ st.setInt(1, PlayerStat.MAX_VITALITY_POINTS);
+ st.setInt(2, PlayerStat.MAX_VITALITY_POINTS / 4);
+ st.execute();
+ }
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Error while updating vitality", e);
+ }
+ LOGGER.info("Daily Vitality Added");
+ }
+
+ private void resetVitalityWeekly()
{
if (!Config.ENABLE_VITALITY)
{
@@ -146,12 +206,11 @@ public class DailyTaskManager extends AbstractEventManager>
{
try (Connection con = DatabaseFactory.getConnection())
{
- final List dailySkills = getVariables().getList("reset_skills", SkillHolder.class, Collections.emptyList());
- for (SkillHolder skill : dailySkills)
+ for (int skill : RESET_SKILLS)
{
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
{
- ps.setInt(1, skill.getSkillId());
+ ps.setInt(1, skill);
ps.execute();
}
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
index 4f663f1e96..4835e884e6 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
@@ -168,9 +168,9 @@ public class HandysBlockCheckerManager
return false;
}
- if (player.isOnEvent() || player.isInOlympiadMode())
+ if (player.isRegisteredOnEvent() || player.isInOlympiadMode())
{
- player.sendMessage("Couldnt register you due other event participation");
+ player.sendMessage("Couldnt register you due other event participation.");
return false;
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/SellBuffsManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/SellBuffsManager.java
index 4769b0fc3e..49193aacf4 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/SellBuffsManager.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/SellBuffsManager.java
@@ -401,12 +401,7 @@ public class SellBuffsManager implements IXmlReader
player.sendMessage("You can't sell buffs with Olympiad status!");
return false;
}
- else if (CeremonyOfChaosManager.getInstance().isRegistered(player))
- {
- player.sendMessage("You can't sell buffs with Ceremony of Chaos status!");
- return false;
- }
- else if (player.isOnEvent()) // custom event message
+ else if (player.isRegisteredOnEvent())
{
player.sendMessage("You can't sell buffs while registered in an event!");
return false;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/ElpiesManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/ElpiesManager.java
deleted file mode 100644
index 9f5b5c6c97..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/ElpiesManager.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.instancemanager.events;
-
-import org.l2jmobius.gameserver.instancemanager.QuestManager;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.ScheduleTarget;
-import org.l2jmobius.gameserver.model.quest.Event;
-
-/**
- * @author Mobius
- */
-public class ElpiesManager extends AbstractEventManager>
-{
- protected ElpiesManager()
- {
- }
-
- @Override
- public void onInitialized()
- {
- }
-
- @ScheduleTarget
- protected void startEvent()
- {
- final Event event = (Event) QuestManager.getInstance().getQuest("Elpies");
- if (event != null)
- {
- event.eventStart(null);
- }
- }
-
- public static ElpiesManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
- private static class SingletonHolder
- {
- protected static final ElpiesManager INSTANCE = new ElpiesManager();
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/GameEvent.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/GameEvent.java
deleted file mode 100644
index c0cc276691..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/GameEvent.java
+++ /dev/null
@@ -1,548 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.instancemanager.events;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.l2jmobius.Config;
-import org.l2jmobius.gameserver.cache.HtmCache;
-import org.l2jmobius.gameserver.data.SpawnTable;
-import org.l2jmobius.gameserver.data.xml.NpcData;
-import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
-import org.l2jmobius.gameserver.model.Spawn;
-import org.l2jmobius.gameserver.model.World;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.holders.PlayerEventHolder;
-import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
-import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
-
-/**
- * @author Nik
- * @Since 2011/05/17 21:51:39
- */
-public class GameEvent
-{
- protected static final Logger LOGGER = Logger.getLogger(GameEvent.class.getName());
- public static EventState eventState = EventState.OFF;
- public static String _eventName = "";
- public static String _eventCreator = "";
- public static String _eventInfo = "";
- public static int _teamsNumber = 0;
- public static final Map _teamNames = new ConcurrentHashMap<>();
- public static final Set _registeredPlayers = ConcurrentHashMap.newKeySet();
- public static final Map> _teams = new ConcurrentHashMap<>();
- public static int _npcId = 0;
- private static final Map _connectionLossData = new ConcurrentHashMap<>();
-
- public enum EventState
- {
- OFF, // Not running
- STANDBY, // Waiting for participants to register
- ON // Registration is over and the event has started.
- }
-
- /**
- * @param player
- * @return The team ID where the player is in, or -1 if player is null or team not found.
- */
- public static int getPlayerTeamId(PlayerInstance player)
- {
- if (player == null)
- {
- return -1;
- }
-
- for (Entry> team : _teams.entrySet())
- {
- if (team.getValue().contains(player))
- {
- return team.getKey();
- }
- }
-
- return -1;
- }
-
- public static List getTopNKillers(int n)
- {
- final Map tmp = new HashMap<>();
- for (Set teamList : _teams.values())
- {
- for (PlayerInstance player : teamList)
- {
- if (player.getEventStatus() == null)
- {
- continue;
- }
- tmp.put(player, player.getEventStatus().getKills().size());
- }
- }
-
- sortByValue(tmp);
-
- // If the map size is less than "n", n will be as much as the map size
- if (tmp.size() <= n)
- {
- return new ArrayList<>(tmp.keySet());
- }
-
- final List toReturn = new ArrayList<>(tmp.keySet());
- return toReturn.subList(1, n);
- }
-
- public static void showEventHtml(PlayerInstance player, String objectid)
- {
- // TODO: work on this
- if (eventState == EventState.STANDBY)
- {
- try
- {
- final String htmContent;
- final NpcHtmlMessage html = new NpcHtmlMessage(Integer.parseInt(objectid));
- if (_registeredPlayers.contains(player))
- {
- htmContent = HtmCache.getInstance().getHtm(player, "data/html/mods/EventEngine/Participating.htm");
- }
- else
- {
- htmContent = HtmCache.getInstance().getHtm(player, "data/html/mods/EventEngine/Participation.htm");
- }
-
- if (htmContent != null)
- {
- html.setHtml(htmContent);
- }
-
- html.replace("%objectId%", objectid); // Yeah, we need this.
- html.replace("%eventName%", _eventName);
- html.replace("%eventCreator%", _eventCreator);
- html.replace("%eventInfo%", _eventInfo);
- player.sendPacket(html);
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, "Exception on showEventHtml(): " + e.getMessage(), e);
- }
- }
- }
-
- /**
- * Spawns an event participation NPC near the player. The npc id used to spawning is GameEvent._npcId
- * @param target
- */
- public static void spawnEventNpc(PlayerInstance target)
- {
- try
- {
- final Spawn spawn = new Spawn(_npcId);
- spawn.setXYZ(target.getX() + 50, target.getY() + 50, target.getZ());
- spawn.setAmount(1);
- spawn.setHeading(target.getHeading());
- spawn.stopRespawn();
- SpawnTable.getInstance().addNewSpawn(spawn, false);
- spawn.init();
- spawn.getLastSpawn().setCurrentHp(999999999);
- spawn.getLastSpawn().setTitle(_eventName);
- spawn.getLastSpawn().getVariables().set("eventmob", true);
- spawn.getLastSpawn().setInvul(true);
- // spawn.getLastSpawn().decayMe();
- // spawn.getLastSpawn().spawnMe(spawn.getLastSpawn().getX(), spawn.getLastSpawn().getY(), spawn.getLastSpawn().getZ());
- spawn.getLastSpawn().broadcastPacket(new MagicSkillUse(spawn.getLastSpawn(), spawn.getLastSpawn(), 1034, 1, 1, 1));
-
- // _npcs.add(spawn.getLastSpawn());
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, "Exception on spawn(): " + e.getMessage(), e);
- }
- }
-
- /**
- * Zoey76: TODO: Rewrite this in a way that doesn't iterate over all spawns.
- */
- public static void unspawnEventNpcs()
- {
- SpawnTable.getInstance().forEachSpawn(spawn ->
- {
- final Npc npc = spawn.getLastSpawn();
- if ((npc != null) && npc.getVariables().getBoolean("eventmob", false))
- {
- npc.deleteMe();
- spawn.stopRespawn();
- SpawnTable.getInstance().deleteSpawn(spawn, false);
- }
- return true;
- });
- }
-
- /**
- * @param player
- * @return False: If player is null, his event status is null or the event state is off. True: if the player is inside the _registeredPlayers list while the event state is STANDBY. If the event state is ON, it will check if the player is inside in one of the teams.
- */
- public static boolean isParticipant(PlayerInstance player)
- {
- if ((player == null) || (player.getEventStatus() == null))
- {
- return false;
- }
-
- switch (eventState)
- {
- case OFF:
- {
- return false;
- }
- case STANDBY:
- {
- return _registeredPlayers.contains(player);
- }
- case ON:
- {
- for (Set teamList : _teams.values())
- {
- if (teamList.contains(player))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Adds the player to the list of participants. If the event state is NOT STANDBY, the player wont be registered.
- * @param player
- */
- public static void registerPlayer(PlayerInstance player)
- {
- if (eventState != EventState.STANDBY)
- {
- player.sendMessage("The registration period for this event is over.");
- return;
- }
-
- if ((Config.DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP == 0) || AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.L2EVENT_ID, player, Config.DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP))
- {
- _registeredPlayers.add(player);
- }
- else
- {
- player.sendMessage("You have reached the maximum allowed participants per IP.");
- }
- }
-
- /**
- * Removes the player from the participating players and the teams and restores his init stats before he registered at the event (loc, pvp, pk, title etc)
- * @param player
- */
- public static void removeAndResetPlayer(PlayerInstance player)
- {
- try
- {
- if (isParticipant(player))
- {
- if (player.isDead())
- {
- player.restoreExp(100.0);
- player.doRevive();
- player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
- player.setCurrentCp(player.getMaxCp());
- }
-
- player.decayMe();
- player.spawnMe(player.getX(), player.getY(), player.getZ());
- player.broadcastUserInfo();
-
- player.stopTransformation(true);
- }
-
- if (player.getEventStatus() != null)
- {
- player.getEventStatus().restorePlayerStats();
- }
-
- player.setEventStatus(null);
-
- _registeredPlayers.remove(player);
- final int teamId = getPlayerTeamId(player);
- if (_teams.containsKey(teamId))
- {
- _teams.get(teamId).remove(player);
- }
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, "Error at unregisterAndResetPlayer in the event:" + e.getMessage(), e);
- }
- }
-
- /**
- * The player's event status will be saved at _connectionLossData
- * @param player
- */
- public static void savePlayerEventStatus(PlayerInstance player)
- {
- _connectionLossData.put(player, player.getEventStatus());
- }
-
- /**
- * If _connectionLossData contains the player, it will restore the player's event status. Also it will remove the player from the _connectionLossData.
- * @param player
- */
- public static void restorePlayerEventStatus(PlayerInstance player)
- {
- if (_connectionLossData.containsKey(player))
- {
- player.setEventStatus(_connectionLossData.get(player));
- _connectionLossData.remove(player);
- }
- }
-
- /**
- * If the event is ON or STANDBY, it will not start. Sets the event state to STANDBY and spawns registration NPCs
- * @return a string with information if the event participation has been successfully started or not.
- */
- public static String startEventParticipation()
- {
- try
- {
- switch (eventState)
- {
- case ON:
- {
- return "Cannot start event, it is already on.";
- }
- case STANDBY:
- {
- return "Cannot start event, it is on standby mode.";
- }
- case OFF: // Event is off, so no problem turning it on.
- {
- eventState = EventState.STANDBY;
- break;
- }
- }
-
- // Register the event at AntiFeedManager and clean it for just in case if the event is already registered.
- AntiFeedManager.getInstance().registerEvent(AntiFeedManager.L2EVENT_ID);
- AntiFeedManager.getInstance().clear(AntiFeedManager.L2EVENT_ID);
-
- // Just in case
- unspawnEventNpcs();
- _registeredPlayers.clear();
- // _npcs.clear();
- if (NpcData.getInstance().getTemplate(_npcId) == null)
- {
- return "Cannot start event, invalid npc id.";
- }
-
- try (FileReader fr = new FileReader(Config.DATAPACK_ROOT + "/data/events/" + _eventName);
- BufferedReader br = new BufferedReader(fr))
- {
- _eventCreator = br.readLine();
- _eventInfo = br.readLine();
- }
-
- final Set temp = new HashSet<>();
- for (PlayerInstance player : World.getInstance().getPlayers())
- {
- if (!player.isOnline())
- {
- continue;
- }
-
- if (!temp.contains(player))
- {
- spawnEventNpc(player);
- temp.add(player);
- }
-
- World.getInstance().forEachVisibleObjectInRange(player, PlayerInstance.class, 1000, temp::add);
- }
- }
- catch (Exception e)
- {
- LOGGER.warning("Event: " + e.getMessage());
- return "Cannot start event participation, an error has occured.";
- }
-
- return "The event participation has been successfully started.";
- }
-
- /**
- * If the event is ON or OFF, it will not start. Sets the event state to ON, creates the teams, adds the registered players ordered by level at the teams and adds a new event status to the players.
- * @return a string with information if the event has been successfully started or not.
- */
- public static String startEvent()
- {
- try
- {
- switch (eventState)
- {
- case ON:
- {
- return "Cannot start event, it is already on.";
- }
- case STANDBY:
- {
- eventState = EventState.ON;
- break;
- }
- case OFF: // Event is off, so no problem turning it on.
- {
- return "Cannot start event, it is off. Participation start is required.";
- }
- }
-
- // Clean the things we will use, just in case.
- unspawnEventNpcs();
- _teams.clear();
- _connectionLossData.clear();
-
- // Insert empty lists at _teams.
- for (int i = 0; i < _teamsNumber; i++)
- {
- _teams.put(i + 1, ConcurrentHashMap.newKeySet());
- }
-
- int i = 0;
- while (!_registeredPlayers.isEmpty())
- {
- // Get the player with the biggest level
- int max = 0;
- PlayerInstance biggestLvlPlayer = null;
- for (PlayerInstance player : _registeredPlayers)
- {
- if (player == null)
- {
- continue;
- }
-
- if (max < player.getLevel())
- {
- max = player.getLevel();
- biggestLvlPlayer = player;
- }
- }
-
- if (biggestLvlPlayer == null)
- {
- continue;
- }
-
- _registeredPlayers.remove(biggestLvlPlayer);
- _teams.get(i + 1).add(biggestLvlPlayer);
- biggestLvlPlayer.setEventStatus();
- i = (i + 1) % _teamsNumber;
- }
- }
- catch (Exception e)
- {
- LOGGER.warning("Event: " + e.getMessage());
- return "Cannot start event, an error has occured.";
- }
-
- return "The event has been successfully started.";
- }
-
- /**
- * If the event state is OFF, it will not finish. Sets the event state to OFF, unregisters and resets the players, unspawns and clers the event NPCs, clears the teams, registered players, connection loss data, sets the teams number to 0, sets the event name to empty.
- * @return a string with information if the event has been successfully stopped or not.
- */
- public static String finishEvent()
- {
- switch (eventState)
- {
- case OFF:
- {
- return "Cannot finish event, it is already off.";
- }
- case STANDBY:
- {
- for (PlayerInstance player : _registeredPlayers)
- {
- removeAndResetPlayer(player);
- }
-
- unspawnEventNpcs();
- // _npcs.clear();
- _registeredPlayers.clear();
- _teams.clear();
- _connectionLossData.clear();
- _teamsNumber = 0;
- _eventName = "";
- eventState = EventState.OFF;
- return "The event has been stopped at STANDBY mode, all players unregistered and all event npcs unspawned.";
- }
- case ON:
- {
- for (Set teamList : _teams.values())
- {
- for (PlayerInstance player : teamList)
- {
- removeAndResetPlayer(player);
- }
- }
-
- eventState = EventState.OFF;
- AntiFeedManager.getInstance().clear(AntiFeedManager.TVT_ID);
- unspawnEventNpcs(); // Just in case
- // _npcs.clear();
- _registeredPlayers.clear();
- _teams.clear();
- _connectionLossData.clear();
- _teamsNumber = 0;
- _eventName = "";
- _npcId = 0;
- _eventCreator = "";
- _eventInfo = "";
- return "The event has been stopped, all players unregistered and all event npcs unspawned.";
- }
- }
-
- return "The event has been successfully finished.";
- }
-
- private static Map sortByValue(Map unsortMap)
- {
- final List> list = new LinkedList<>(unsortMap.entrySet());
- list.sort(Comparator.comparing(Entry::getValue));
-
- final Map sortedMap = new LinkedHashMap<>();
- for (Entry entry : list)
- {
- sortedMap.put(entry.getKey(), entry.getValue());
- }
- return sortedMap;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/RabbitsManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/RabbitsManager.java
deleted file mode 100644
index 534ac04f62..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/RabbitsManager.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.instancemanager.events;
-
-import org.l2jmobius.gameserver.instancemanager.QuestManager;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.ScheduleTarget;
-import org.l2jmobius.gameserver.model.quest.Event;
-
-/**
- * @author Mobius
- */
-public class RabbitsManager extends AbstractEventManager>
-{
- protected RabbitsManager()
- {
- }
-
- @Override
- public void onInitialized()
- {
- }
-
- @ScheduleTarget
- protected void startEvent()
- {
- final Event event = (Event) QuestManager.getInstance().getQuest("Rabbits");
- if (event != null)
- {
- event.eventStart(null);
- }
- }
-
- public static RabbitsManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
- private static class SingletonHolder
- {
- protected static final RabbitsManager INSTANCE = new RabbitsManager();
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/RaceManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/RaceManager.java
deleted file mode 100644
index 719e20495f..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/RaceManager.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.instancemanager.events;
-
-import org.l2jmobius.gameserver.instancemanager.QuestManager;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.ScheduleTarget;
-import org.l2jmobius.gameserver.model.quest.Event;
-
-/**
- * @author Mobius
- */
-public class RaceManager extends AbstractEventManager>
-{
- protected RaceManager()
- {
- }
-
- @Override
- public void onInitialized()
- {
- }
-
- @ScheduleTarget
- protected void startEvent()
- {
- final Event event = (Event) QuestManager.getInstance().getQuest("Race");
- if (event != null)
- {
- event.eventStart(null);
- }
- }
-
- public static RaceManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
- private static class SingletonHolder
- {
- protected static final RaceManager INSTANCE = new RaceManager();
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/TeamVsTeamManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/TeamVsTeamManager.java
deleted file mode 100644
index d106fa64ad..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/events/TeamVsTeamManager.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.instancemanager.events;
-
-import org.l2jmobius.gameserver.instancemanager.QuestManager;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.ScheduleTarget;
-import org.l2jmobius.gameserver.model.quest.Event;
-
-/**
- * @author Mobius
- */
-public class TeamVsTeamManager extends AbstractEventManager>
-{
- protected TeamVsTeamManager()
- {
- }
-
- @Override
- public void onInitialized()
- {
- }
-
- @ScheduleTarget
- protected void startEvent()
- {
- final Event event = (Event) QuestManager.getInstance().getQuest("TvT");
- if (event != null)
- {
- event.eventStart(null);
- }
- }
-
- public static TeamVsTeamManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
- private static class SingletonHolder
- {
- protected static final TeamVsTeamManager INSTANCE = new TeamVsTeamManager();
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 1c96c824c0..2c3916a99c 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -1022,7 +1022,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
return;
}
// Events.
- else if (getActingPlayer().isOnCustomEvent() && target.isPlayable() && (getActingPlayer().getTeam() == target.getActingPlayer().getTeam()))
+ else if (getActingPlayer().isOnEvent() && target.isPlayable() && (getActingPlayer().getTeam() == target.getActingPlayer().getTeam()))
{
sendPacket(ActionFailed.STATIC_PACKET);
return;
@@ -5037,15 +5037,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
return false;
}
- /**
- * Dummy method overriden in {@link PlayerInstance}
- * @return {@code true} if player is on event, {@code false} otherwise.
- */
- public boolean isOnEvent()
- {
- return false;
- }
-
/**
* Dummy method overriden in {@link PlayerInstance}
* @return the clan id of current character.
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Playable.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Playable.java
index 91982b9430..53b5ba8394 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Playable.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Playable.java
@@ -307,6 +307,11 @@ public abstract class Playable extends Creature
public abstract void restoreEffects();
+ public boolean isOnEvent()
+ {
+ return false;
+ }
+
@Override
public boolean isPlayable()
{
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 919cda941e..6115effc29 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -1131,4 +1131,10 @@ public abstract class Summon extends Playable
{
return super.isTargetable() && getTemplate().isTargetable();
}
+
+ @Override
+ public boolean isOnEvent()
+ {
+ return (_owner != null) && _owner.isOnEvent();
+ }
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index eebbf498cd..1fd1ab70c7 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -126,7 +126,6 @@ import org.l2jmobius.gameserver.instancemanager.RecipeManager;
import org.l2jmobius.gameserver.instancemanager.SellBuffsManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
import org.l2jmobius.gameserver.model.AccessLevel;
import org.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import org.l2jmobius.gameserver.model.BlockList;
@@ -181,7 +180,6 @@ import org.l2jmobius.gameserver.model.actor.tasks.player.WarnUserTakeBreakTask;
import org.l2jmobius.gameserver.model.actor.tasks.player.WaterTask;
import org.l2jmobius.gameserver.model.actor.templates.PlayerTemplate;
import org.l2jmobius.gameserver.model.actor.transform.Transform;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.clan.ClanPrivilege;
@@ -189,7 +187,6 @@ import org.l2jmobius.gameserver.model.clan.ClanWar;
import org.l2jmobius.gameserver.model.cubic.CubicInstance;
import org.l2jmobius.gameserver.model.effects.EffectFlag;
import org.l2jmobius.gameserver.model.effects.EffectType;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
@@ -215,7 +212,6 @@ import org.l2jmobius.gameserver.model.events.timers.TimerHolder;
import org.l2jmobius.gameserver.model.fishing.Fishing;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.holders.MovieHolder;
-import org.l2jmobius.gameserver.model.holders.PlayerEventHolder;
import org.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder;
import org.l2jmobius.gameserver.model.holders.SellBuffHolder;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -692,10 +688,6 @@ public class PlayerInstance extends Playable
private final Map _lastCommissionInfos = new ConcurrentHashMap<>();
- @SuppressWarnings("rawtypes")
- private final Map, AbstractEvent>> _events = new ConcurrentHashMap<>();
- private boolean _isOnCustomEvent = false;
-
// protects a char from aggro mobs when getting up from fake death
private long _recentFakeDeathEndTime = 0;
@@ -722,7 +714,9 @@ public class PlayerInstance extends Playable
private BroochJewel _activeShappireJewel = null;
/** Event parameters */
- private PlayerEventHolder eventStatus = null;
+ private boolean _isRegisteredOnEvent = false;
+ private boolean _isOnSoloEvent = false;
+ private boolean _isOnEvent = false;
private byte _handysBlockCheckerEventArena = -1;
@@ -845,7 +839,7 @@ public class PlayerInstance extends Playable
// Shared dualclass skills.
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
- private static final int[] DUAL_CLASS_SKILLS = new int[]
+ private static final int[] DUAL_CLASS_SKILLS =
{
19222, // Dignity of the Exalted
19223, // Belief of the Exalted
@@ -2927,11 +2921,7 @@ public class PlayerInstance extends Playable
*/
public void standUp()
{
- if (GameEvent.isParticipant(this) && eventStatus.isSitForced())
- {
- sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up...");
- }
- else if (_waitTypeSitting && !isInStoreMode() && !isAlikeDead())
+ if (_waitTypeSitting && !isInStoreMode() && !isAlikeDead())
{
if (getEffectList().isAffected(EffectFlag.RELAXING))
{
@@ -4867,10 +4857,6 @@ public class PlayerInstance extends Playable
if (pk != null)
{
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerPvPKill(pk, this), this);
- if (GameEvent.isParticipant(pk))
- {
- pk.getEventStatus().addKill(this);
- }
// pvp/pk item rewards
if (!(Config.DISABLE_REWARDS_IN_INSTANCES && (getInstanceId() != 0)) && //
@@ -5034,7 +5020,7 @@ public class PlayerInstance extends Playable
private void onDieDropItem(Creature killer)
{
- if (GameEvent.isParticipant(this) || (killer == null))
+ if (isOnEvent() || (killer == null))
{
return;
}
@@ -5360,7 +5346,7 @@ public class PlayerInstance extends Playable
// Calculate the Experience loss
long lostExp = 0;
- if (!GameEvent.isParticipant(this))
+ if (!isOnEvent())
{
if (lvl < ExperienceData.getInstance().getMaxLevel())
{
@@ -8120,7 +8106,7 @@ public class PlayerInstance extends Playable
return false;
}
- if (isBlockedFromExit())
+ if (isRegisteredOnEvent())
{
return false;
}
@@ -8181,22 +8167,13 @@ public class PlayerInstance extends Playable
// Check if the attacker is in olympia and olympia start
if (attacker.isPlayer() && attacker.getActingPlayer().isInOlympiadMode())
{
- if (_inOlympiadMode && _olympiadStart && (((PlayerInstance) attacker).getOlympiadGameId() == getOlympiadGameId()))
- {
- return true;
- }
- return false;
+ return _inOlympiadMode && _olympiadStart && (((PlayerInstance) attacker).getOlympiadGameId() == getOlympiadGameId());
}
- if (_isOnCustomEvent && (getTeam() == attacker.getTeam()))
- {
- return false;
- }
-
- // CoC needs this check?
+ // Check if the attacker is in an event
if (isOnEvent())
{
- return true;
+ return isOnSoloEvent() || (getTeam() != attacker.getTeam());
}
// Check if the attacker is a Playable
@@ -9371,12 +9348,7 @@ public class PlayerInstance extends Playable
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_ALREADY_ENGAGED_IN_A_DUEL;
return false;
}
- if (_inOlympiadMode || isOnEvent(CeremonyOfChaosEvent.class))
- {
- _noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_PARTICIPATING_IN_THE_OLYMPIAD_OR_THE_CEREMONY_OF_CHAOS;
- return false;
- }
- if (isOnEvent()) // custom event message
+ if (_inOlympiadMode || isRegisteredOnEvent())
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_CURRENTLY_ENGAGED_IN_BATTLE;
return false;
@@ -11174,12 +11146,6 @@ public class PlayerInstance extends Playable
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerMentorStatus(this, false), this);
}
- // we store all data from players who are disconnected while in an event in order to restore it in the next login
- if (GameEvent.isParticipant(this))
- {
- GameEvent.savePlayerEventStatus(this);
- }
-
try
{
notifyFriends(FriendStatus.MODE_OFFLINE);
@@ -13047,16 +13013,6 @@ public class PlayerInstance extends Playable
_adminConfirmCmd = adminConfirmCmd;
}
- public void setBlockCheckerArena(byte arena)
- {
- _handysBlockCheckerEventArena = arena;
- }
-
- public int getBlockCheckerArena()
- {
- return _handysBlockCheckerEventArena;
- }
-
/**
* Load PlayerInstance Recommendations data.
*/
@@ -13154,21 +13110,6 @@ public class PlayerInstance extends Playable
return _contactList;
}
- public void setEventStatus()
- {
- eventStatus = new PlayerEventHolder(this);
- }
-
- public void setEventStatus(PlayerEventHolder pes)
- {
- eventStatus = pes;
- }
-
- public PlayerEventHolder getEventStatus()
- {
- return eventStatus;
- }
-
public long getNotMoveUntil()
{
return _notMoveUntil;
@@ -13228,13 +13169,6 @@ public class PlayerInstance extends Playable
@Override
public boolean canRevive()
{
- for (AbstractEvent> listener : _events.values())
- {
- if (listener.isOnEvent(this) && !listener.canRevive(this))
- {
- return false;
- }
- }
return _canRevive;
}
@@ -13248,66 +13182,50 @@ public class PlayerInstance extends Playable
_canRevive = value;
}
- public boolean isOnCustomEvent()
+ public boolean isRegisteredOnEvent()
{
- return _isOnCustomEvent;
+ return _isRegisteredOnEvent || _isOnEvent;
}
- public void setOnCustomEvent(boolean value)
+ public void setRegisteredOnEvent(boolean value)
{
- _isOnCustomEvent = value;
+ _isRegisteredOnEvent = value;
}
- /**
- * @return {@code true} if player is on event, {@code false} otherwise.
- */
@Override
public boolean isOnEvent()
{
- if (_isOnCustomEvent)
- {
- return true;
- }
- for (AbstractEvent> listener : _events.values())
- {
- if (listener.isOnEvent(this))
- {
- return true;
- }
- }
- return super.isOnEvent();
+ return _isOnEvent;
}
- public boolean isBlockedFromExit()
+ public void setOnEvent(boolean value)
{
- if (_isOnCustomEvent)
- {
- return true;
- }
- for (AbstractEvent> listener : _events.values())
- {
- if (listener.isOnEvent(this) && listener.isBlockingExit(this))
- {
- return true;
- }
- }
- return false;
+ _isOnEvent = value;
+ }
+
+ public boolean isOnSoloEvent()
+ {
+ return _isOnSoloEvent;
+ }
+
+ public void setOnSoloEvent(boolean value)
+ {
+ _isOnSoloEvent = value;
}
public boolean isBlockedFromDeathPenalty()
{
- if (_isOnCustomEvent)
- {
- return true;
- }
- for (AbstractEvent> listener : _events.values())
- {
- if (listener.isOnEvent(this) && listener.isBlockingDeathPenalty(this))
- {
- return true;
- }
- }
- return isAffected(EffectFlag.PROTECT_DEATH_PENALTY);
+ return _isOnEvent || isAffected(EffectFlag.PROTECT_DEATH_PENALTY);
+ }
+
+ public void setBlockCheckerArena(byte arena)
+ {
+ _handysBlockCheckerEventArena = arena;
+ }
+
+ public int getBlockCheckerArena()
+ {
+ return _handysBlockCheckerEventArena;
}
public void setOriginalCpHpMp(double cp, double hp, double mp)
@@ -13866,63 +13784,6 @@ public class PlayerInstance extends Playable
sendPacket(new ExUserInfoInvenWeight(this));
}
- /**
- * @param event
- * @return {@code true} if event is successfuly registered, {@code false} in case events map is not initialized yet or event is not registered
- */
- public boolean registerOnEvent(AbstractEvent> event)
- {
- return _events.putIfAbsent(event.getClass(), event) == null;
- }
-
- /**
- * @param event
- * @return {@code true} if event is successfuly removed, {@code false} in case events map is not initialized yet or event is not registered
- */
- public boolean removeFromEvent(AbstractEvent> event)
- {
- return _events.remove(event.getClass()) != null;
- }
-
- /**
- * @param
- * @param clazz
- * @return the event instance or null in case events map is not initialized yet or event is not registered
- */
- @SuppressWarnings("unchecked")
- public > T getEvent(Class clazz)
- {
- for (AbstractEvent> event : _events.values())
- {
- if (clazz.isAssignableFrom(event.getClass()))
- {
- return (T) event;
- }
- }
- return null;
- }
-
- /**
- * @return the first event that player participates on or null if he doesn't
- */
- public AbstractEvent> getEvent()
- {
- for (AbstractEvent> event : _events.values())
- {
- return event;
- }
- return null;
- }
-
- /**
- * @param clazz
- * @return {@code true} if player is registered on specified event, {@code false} in case events map is not initialized yet or event is not registered
- */
- public boolean isOnEvent(Class extends AbstractEvent>> clazz)
- {
- return _events.containsKey(clazz);
- }
-
public Fishing getFishing()
{
return _fishing;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
deleted file mode 100644
index a30002000f..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.ceremonyofchaos;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.OptionalInt;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Logger;
-import java.util.stream.Collectors;
-
-import org.l2jmobius.commons.util.Chronos;
-import org.l2jmobius.commons.util.Rnd;
-import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
-import org.l2jmobius.gameserver.instancemanager.CeremonyOfChaosManager;
-import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
-import org.l2jmobius.gameserver.instancemanager.InstanceManager;
-import org.l2jmobius.gameserver.model.Location;
-import org.l2jmobius.gameserver.model.Party;
-import org.l2jmobius.gameserver.model.Party.MessageType;
-import org.l2jmobius.gameserver.model.StatSet;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Summon;
-import org.l2jmobius.gameserver.model.actor.appearance.PlayerAppearance;
-import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
-import org.l2jmobius.gameserver.model.events.EventDispatcher;
-import org.l2jmobius.gameserver.model.events.EventType;
-import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
-import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
-import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
-import org.l2jmobius.gameserver.model.events.impl.ceremonyofchaos.OnCeremonyOfChaosMatchResult;
-import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
-import org.l2jmobius.gameserver.model.holders.ItemHolder;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.instancezone.InstanceTemplate;
-import org.l2jmobius.gameserver.model.skills.Skill;
-import org.l2jmobius.gameserver.model.variables.PlayerVariables;
-import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.DeleteObject;
-import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoAbnormalVisualEffect;
-import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
-import org.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
-import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import org.l2jmobius.gameserver.network.serverpackets.appearance.ExCuriousHouseMemberUpdate;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseEnter;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseLeave;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseMemberList;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseObserveMode;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseRemainTime;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseResult;
-
-/**
- * @author UnAfraid
- */
-public class CeremonyOfChaosEvent extends AbstractEvent
-{
- private static final Logger LOGGER = Logger.getLogger(CeremonyOfChaosEvent.class.getName());
-
- private final int _id;
- private final Instance _instance;
- private final Set _monsters = ConcurrentHashMap.newKeySet();
- private long _battleStartTime = 0;
-
- public CeremonyOfChaosEvent(int id, InstanceTemplate template)
- {
- _id = id;
- _instance = InstanceManager.getInstance().createInstance(template, null);
- if (_instance.getEnterLocations().size() < CeremonyOfChaosManager.getInstance().getMaxPlayersInArena())
- {
- LOGGER.warning("There are more member slots: " + _instance.getEnterLocations().size() + " then instance entrance positions: " + CeremonyOfChaosManager.getInstance().getMaxPlayersInArena() + "!");
- }
- }
-
- public int getId()
- {
- return _id;
- }
-
- public int getInstanceId()
- {
- return _instance.getId();
- }
-
- public Instance getInstance()
- {
- return _instance;
- }
-
- public Set getMonsters()
- {
- return _monsters;
- }
-
- public void preparePlayers()
- {
- final Map members = getMembers();
- final ExCuriousHouseMemberList membersList = new ExCuriousHouseMemberList(_id, CeremonyOfChaosManager.getInstance().getMaxPlayersInArena(), members.values());
- final NpcHtmlMessage msg = new NpcHtmlMessage(0);
- int index = 0;
- for (CeremonyOfChaosMember member : members.values())
- {
- final PlayerInstance player = member.getPlayer();
- if (player.inObserverMode())
- {
- player.leaveObserverMode();
- }
-
- if (player.isInDuel())
- {
- player.setInDuel(0);
- }
-
- // Remember player's last location
- player.setLastLocation();
-
- // Hide player information
- final PlayerAppearance app = player.getAppearance();
- app.setVisibleName("Challenger" + member.getPosition());
- app.setVisibleTitle("");
- app.setVisibleClanData(0, 0, 0, 0, 0);
-
- // Register the event instance
- player.registerOnEvent(this);
-
- // Load the html
- msg.setFile(player, "data/html/CeremonyOfChaos/started.htm");
-
- // Remove buffs
- player.stopAllEffectsExceptThoseThatLastThroughDeath();
- player.getEffectList().stopEffects(info -> info.getSkill().isBlockedInOlympiad(), true, true);
-
- // Player shouldn't be able to move and is hidden
- player.setImmobilized(true);
- player.setInvisible(true);
-
- // Same goes for summon
- player.getServitors().values().forEach(s ->
- {
- s.stopAllEffectsExceptThoseThatLastThroughDeath();
- s.setInvisible(true);
- s.setImmobilized(true);
- });
-
- if (player.isFlyingMounted())
- {
- player.untransform();
- }
-
- // If player is dead, revive it
- if (player.isDead())
- {
- player.doRevive();
- }
-
- // If player is sitting, stand up
- if (player.isSitting())
- {
- player.standUp();
- }
-
- // If player in party, leave it
- final Party party = player.getParty();
- if (party != null)
- {
- party.removePartyMember(player, MessageType.EXPELLED);
- }
-
- // Cancel any started action
- player.abortAttack();
- player.abortCast();
- player.stopMove(null);
- player.setTarget(null);
-
- // Unsummon pet
- final Summon pet = player.getPet();
- if (pet != null)
- {
- pet.unSummon(player);
- }
-
- // Unsummon agathion
- if (player.getAgathionId() > 0)
- {
- player.setAgathionId(0);
- }
-
- // The character’s HP, MP, and CP are fully recovered.
- player.setCurrentHp(player.getMaxHp());
- player.setCurrentMp(player.getMaxMp());
- player.setCurrentCp(player.getMaxCp());
-
- // Skill reuse timers for all skills that have less than 15 minutes of cooldown time are reset.
- for (Skill skill : player.getAllSkills())
- {
- if (skill.getReuseDelay() <= 900000)
- {
- player.enableSkill(skill);
- }
- }
-
- player.sendSkillList();
- player.sendPacket(new SkillCoolTime(player));
-
- // Apply the Energy of Chaos skill
- for (SkillHolder holder : CeremonyOfChaosManager.getInstance().getVariables().getList(CeremonyOfChaosManager.INITIAL_BUFF_KEY, SkillHolder.class))
- {
- holder.getSkill().activateSkill(player, player);
- }
-
- // Send Enter packet
- player.sendPacket(ExCuriousHouseEnter.STATIC_PACKET);
-
- // Send all members
- player.sendPacket(membersList);
-
- // Send the entrance html
- player.sendPacket(msg);
-
- // Send support items to player
- for (ItemHolder holder : CeremonyOfChaosManager.getInstance().getRewards(CeremonyOfChaosManager.INITIAL_ITEMS_KEY).calculateDrops())
- {
- player.addItem("CoC", holder, null, true);
- }
-
- // Teleport player to the arena
- player.teleToLocation(_instance.getEnterLocations().get(index++), 0, _instance);
- }
-
- final StatSet params = new StatSet();
- params.set("time", 60);
- getTimers().addTimer("match_start_countdown", params, 100, null, null);
- getTimers().addTimer("teleport_message1", 10000, null, null);
- getTimers().addTimer("teleport_message2", 14000, null, null);
- getTimers().addTimer("teleport_message3", 18000, null, null);
- }
-
- public void startFight()
- {
- for (CeremonyOfChaosMember member : getMembers().values())
- {
- final PlayerInstance player = member.getPlayer();
- if (player != null)
- {
- player.sendPacket(SystemMessageId.THE_MATCH_HAS_STARTED_FIGHT);
- player.setImmobilized(false);
- player.setInvisible(false);
- player.broadcastInfo();
- player.sendPacket(new ExUserInfoAbnormalVisualEffect(player));
- player.getServitors().values().forEach(s ->
- {
- s.setInvisible(false);
- s.setImmobilized(false);
- s.broadcastInfo();
- });
- }
- }
- _battleStartTime = Chronos.currentTimeMillis();
- getTimers().addRepeatingTimer("update", 1000, null, null);
- }
-
- public void stopFight()
- {
- final Map members = getMembers();
- for (CeremonyOfChaosMember member : members.values())
- {
- if (member.getLifeTime() == 0)
- {
- updateLifeTime(member);
- }
- }
- validateWinner();
-
- final List winners = getWinners();
- final List memberList = new ArrayList<>(members.size());
- SystemMessage msg = null;
- if (winners.isEmpty() || (winners.size() > 1))
- {
- msg = new SystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE);
- }
- else
- {
- final PlayerInstance winner = winners.get(0).getPlayer();
- if (winner != null)
- {
- msg = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
- msg.addString(winner.getName());
-
- // Rewards according to https://l2wiki.com/Ceremony_of_Chaos
- final int marksRewarded = Rnd.get(2, 4);
- winner.addItem("CoC-Winner", 34900, marksRewarded, winner, true); // Mysterious Marks
-
- // Possible additional rewards
-
- // Improved Life Stone
- if (Rnd.get(10) < 3) // Chance to get reward (30%)
- {
- switch (Rnd.get(4))
- {
- case 0:
- {
- winner.addItem("CoC-Winner", 18570, 1, winner, true); // Improved Life Stone (R95-grade)
- break;
- }
- case 1:
- {
- winner.addItem("CoC-Winner", 18571, 1, winner, true); // Improved Life Stone (R95-grade)
- break;
- }
- case 2:
- {
- winner.addItem("CoC-Winner", 18575, 1, winner, true); // Improved Life Stone (R99-grade)
- break;
- }
- case 3:
- {
- winner.addItem("CoC-Winner", 18576, 1, winner, true); // Improved Life Stone (R99-grade)
- break;
- }
- }
- }
- // Soul Crystal Fragment
- else if (Rnd.get(10) < 3) // Chance to get reward (30%)
- {
- switch (Rnd.get(6))
- {
- case 0:
- {
- winner.addItem("CoC-Winner", 19467, 1, winner, true); // Yellow Soul Crystal Fragment (R99-Grade)
- break;
- }
- case 1:
- {
- winner.addItem("CoC-Winner", 19468, 1, winner, true); // Teal Soul Crystal Fragment (R99-Grade)
- break;
- }
- case 2:
- {
- winner.addItem("CoC-Winner", 19469, 1, winner, true); // Purple Soul Crystal Fragment (R99-Grade)
- break;
- }
- case 3:
- {
- winner.addItem("CoC-Winner", 19511, 1, winner, true); // Yellow Soul Crystal Fragment (R95-Grade)
- break;
- }
- case 4:
- {
- winner.addItem("CoC-Winner", 19512, 1, winner, true); // Teal Soul Crystal Fragment (R95-Grade)
- break;
- }
- case 5:
- {
- winner.addItem("CoC-Winner", 19513, 1, winner, true); // Purple Soul Crystal Fragment (R95-Grade)
- break;
- }
- }
- }
- // Mysterious Belt
- else if (Rnd.get(10) < 1) // Chance to get reward (10%)
- {
- winner.addItem("CoC-Winner", 35565, 1, winner, true); // Mysterious Belt
- }
-
- // Save monthly progress.
- final int totalMarks = winner.getVariables().getInt(PlayerVariables.CEREMONY_OF_CHAOS_MARKS, 0) + marksRewarded;
- winner.getVariables().set(PlayerVariables.CEREMONY_OF_CHAOS_MARKS, totalMarks);
- if (totalMarks > GlobalVariablesManager.getInstance().getInt(GlobalVariablesManager.COC_TOP_MARKS, 0))
- {
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TOP_MARKS, totalMarks);
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TOP_MEMBER, winner.getObjectId());
- }
- }
- }
-
- for (CeremonyOfChaosMember member : members.values())
- {
- final PlayerInstance player = member.getPlayer();
- if (player != null)
- {
- // Send winner message
- if (msg != null)
- {
- player.sendPacket(msg);
- }
-
- // Send result
- player.sendPacket(new ExCuriousHouseResult(member.getResultType(), this));
- memberList.add(member);
- }
- }
- getTimers().cancelTimer("update", null, null);
- final StatSet params = new StatSet();
- params.set("time", 30);
- getTimers().addTimer("match_end_countdown", params, 30 * 1000, null, null);
- EventDispatcher.getInstance().notifyEvent(new OnCeremonyOfChaosMatchResult(winners, memberList));
- }
-
- private void teleportPlayersOut()
- {
- for (CeremonyOfChaosMember member : getMembers().values())
- {
- final PlayerInstance player = member.getPlayer();
- if (player != null)
- {
- // Leaves observer mode
- if (player.inObserverMode())
- {
- player.setObserving(false);
- }
-
- // Revive the player
- player.doRevive();
-
- // Remove Energy of Chaos
- for (SkillHolder holder : CeremonyOfChaosManager.getInstance().getVariables().getList(CeremonyOfChaosManager.INITIAL_BUFF_KEY, SkillHolder.class))
- {
- player.stopSkillEffects(holder.getSkill());
- }
-
- // Apply buffs on players
- for (SkillHolder holder : CeremonyOfChaosManager.getInstance().getVariables().getList(CeremonyOfChaosManager.END_BUFFS_KEYH, SkillHolder.class))
- {
- holder.getSkill().activateSkill(player, player);
- }
-
- // Remove quit button
- player.sendPacket(ExCuriousHouseLeave.STATIC_PACKET);
-
- // Remove spectator mode
- player.setObserving(false);
- player.sendPacket(ExCuriousHouseObserveMode.STATIC_DISABLED);
-
- // Teleport player back
- final Location lastLocation = player.getLastLocation();
- player.teleToLocation(lastLocation != null ? lastLocation : new Location(82201, 147587, -3473), null);
-
- // Restore player information
- final PlayerAppearance app = player.getAppearance();
- app.setVisibleName(null);
- app.setVisibleTitle(null);
- app.setVisibleClanData(-1, -1, -1, -1, -1);
-
- // Remove player from event
- player.removeFromEvent(this);
- }
- }
-
- clearMembers();
- _instance.destroy();
- }
-
- private void updateLifeTime(CeremonyOfChaosMember member)
- {
- member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
- }
-
- public List getWinners()
- {
- final List winners = new ArrayList<>();
- final Map members = getMembers();
-
- //@formatter:off
- final OptionalInt winnerLifeTime = members.values().stream()
- .mapToInt(CeremonyOfChaosMember::getLifeTime)
- .max();
-
- if(winnerLifeTime.isPresent())
- {
- members.values().stream()
- .sorted(Comparator.comparingLong(CeremonyOfChaosMember::getLifeTime)
- .reversed()
- .thenComparingInt(CeremonyOfChaosMember::getScore)
- .reversed())
- .filter(member -> member.getLifeTime() == winnerLifeTime.getAsInt())
- .collect(Collectors.toCollection(() -> winners));
- }
-
- //@formatter:on
-
- return winners;
- }
-
- private void validateWinner()
- {
- final List winners = getWinners();
- winners.forEach(winner -> winner.setResultType(winners.size() > 1 ? CeremonyOfChaosResult.TIE : CeremonyOfChaosResult.WIN));
- }
-
- @Override
- public void onTimerEvent(String event, StatSet params, Npc npc, PlayerInstance player)
- {
- switch (event)
- {
- case "update":
- {
- final Map members = getMembers();
-
- final int time = (int) CeremonyOfChaosManager.getInstance().getScheduler("stopFight").getRemainingTime(TimeUnit.SECONDS);
- broadcastPacket(new ExCuriousHouseRemainTime(time));
- members.values().forEach(p -> broadcastPacket(new ExCuriousHouseMemberUpdate(p)));
-
- // Validate winner
- int count = 0;
- for (CeremonyOfChaosMember member : members.values())
- {
- if (!member.isDefeated())
- {
- count++;
- }
- }
- if (count <= 1)
- {
- stopFight();
- }
- break;
- }
- case "teleport_message1":
- {
- broadcastPacket(new SystemMessage(SystemMessageId.PROVE_YOUR_ABILITIES));
- break;
- }
- case "teleport_message2":
- {
- broadcastPacket(new SystemMessage(SystemMessageId.THERE_ARE_NO_ALLIES_HERE_EVERYONE_IS_AN_ENEMY));
- break;
- }
- case "teleport_message3":
- {
- broadcastPacket(new SystemMessage(SystemMessageId.IT_WILL_BE_A_LONELY_BATTLE_BUT_I_WISH_YOU_VICTORY));
- break;
- }
- case "match_start_countdown":
- {
- final int time = params.getInt("time", 0);
- final SystemMessage countdown = new SystemMessage(SystemMessageId.THE_MATCH_WILL_START_IN_S1_SECOND_S);
- countdown.addByte(time);
- broadcastPacket(countdown);
-
- // Reschedule
- if (time == 60)
- {
- params.set("time", 30);
- getTimers().addTimer(event, params, 30 * 1000, null, null);
- }
- else if ((time == 30) || (time == 20))
- {
- params.set("time", time - 10);
- getTimers().addTimer(event, params, 10 * 1000, null, null);
- }
- else if (time == 10)
- {
- params.set("time", 5);
- getTimers().addTimer(event, params, 5 * 1000, null, null);
- }
- else if ((time > 1) && (time <= 5))
- {
- params.set("time", time - 1);
- getTimers().addTimer(event, params, 1000, null, null);
- }
- break;
- }
- case "match_end_countdown":
- {
- final int time = params.getInt("time", 0);
- final SystemMessage countdown = new SystemMessage(SystemMessageId.IN_S1_SECOND_S_YOU_WILL_BE_MOVED_TO_WHERE_YOU_WERE_BEFORE_PARTICIPATING_IN_THE_CEREMONY_OF_CHAOS);
- countdown.addByte(time);
- broadcastPacket(countdown);
-
- // Reschedule
- if ((time == 30) || (time == 20))
- {
- params.set("time", time - 10);
- getTimers().addTimer(event, params, 10 * 1000, null, null);
- }
- else if ((time > 0) && (time <= 10))
- {
- params.set("time", time - 1);
- getTimers().addTimer(event, params, 1000, null, null);
- }
- else if (time == 0)
- {
- teleportPlayersOut();
- }
- break;
- }
- }
- }
-
- @RegisterEvent(EventType.ON_PLAYER_LOGOUT)
- @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
- private void OnPlayerLogout(OnPlayerLogout event)
- {
- final PlayerInstance player = event.getPlayer();
- if (player != null)
- {
- final Map members = getMembers();
- final int playerObjectId = player.getObjectId();
- if (members.containsKey(playerObjectId))
- {
- removeMember(playerObjectId);
- if (members.size() <= 1)
- {
- stopFight();
- }
- }
- }
- }
-
- @RegisterEvent(EventType.ON_CREATURE_DEATH)
- @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
- public void onPlayerDeath(OnCreatureDeath event)
- {
- if (event.getAttacker().isPlayer() && event.getTarget().isPlayer())
- {
- final PlayerInstance attackerPlayer = event.getAttacker().getActingPlayer();
- final PlayerInstance targetPlayer = event.getTarget().getActingPlayer();
- final Map members = getMembers();
- final CeremonyOfChaosMember attackerMember = members.get(attackerPlayer.getObjectId());
- final CeremonyOfChaosMember targetMember = members.get(targetPlayer.getObjectId());
- final DeleteObject deleteObject = new DeleteObject(targetPlayer);
- if ((attackerMember != null) && (targetMember != null))
- {
- attackerMember.incrementScore();
- updateLifeTime(targetMember);
-
- // Mark player as defeated
- targetMember.setDefeated(true);
-
- // Delete target player
- for (CeremonyOfChaosMember member : members.values())
- {
- if (member.getObjectId() != targetPlayer.getObjectId())
- {
- deleteObject.sendTo(member.getPlayer());
- }
- }
-
- // Make the target observer
- targetPlayer.setObserving(true);
-
- // Make the target spectator
- targetPlayer.sendPacket(ExCuriousHouseObserveMode.STATIC_ENABLED);
- }
- }
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosMember.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosMember.java
deleted file mode 100644
index e9d986ace4..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosMember.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.ceremonyofchaos;
-
-import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventMember;
-
-/**
- * @author UnAfraid
- */
-public class CeremonyOfChaosMember extends AbstractEventMember
-{
- private final int _position;
- private int _lifeTime = 0;
- private CeremonyOfChaosResult _resultType = CeremonyOfChaosResult.LOSE;
- private boolean _isDefeated = false;
-
- public CeremonyOfChaosMember(PlayerInstance player, CeremonyOfChaosEvent event, int position)
- {
- super(player, event);
- _position = position;
- }
-
- public int getPosition()
- {
- return _position;
- }
-
- public void setLifeTime(int time)
- {
- _lifeTime = time;
- }
-
- public int getLifeTime()
- {
- return _lifeTime;
- }
-
- public CeremonyOfChaosResult getResultType()
- {
- return _resultType;
- }
-
- public void setResultType(CeremonyOfChaosResult resultType)
- {
- _resultType = resultType;
- }
-
- public boolean isDefeated()
- {
- return _isDefeated;
- }
-
- public void setDefeated(boolean isDefeated)
- {
- _isDefeated = isDefeated;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanEscape.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanEscape.java
index 1b7f3dd4a6..8eaf188159 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanEscape.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanEscape.java
@@ -63,7 +63,7 @@ public class ConditionPlayerCanEscape extends Condition
{
canTeleport = false;
}
- else if (player.isOnCustomEvent())
+ else if (player.isOnEvent())
{
canTeleport = false;
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSwitchSubclass.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSwitchSubclass.java
index 0b10e75f59..94eee3bae6 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSwitchSubclass.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSwitchSubclass.java
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.model.conditions;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.effects.EffectFlag;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -61,12 +60,7 @@ public class ConditionPlayerCanSwitchSubclass extends Condition
player.sendPacket(SystemMessageId.A_SUBCLASS_CANNOT_BE_CREATED_OR_CHANGED_WHILE_YOU_ARE_OVER_YOUR_WEIGHT_LIMIT);
canSwitchSub = false;
}
- else if (player.isOnEvent(CeremonyOfChaosEvent.class))
- {
- player.sendPacket(SystemMessageId.YOU_CANNOT_CHANGE_YOUR_SUBCLASS_WHILE_REGISTERED_IN_THE_CEREMONY_OF_CHAOS);
- canSwitchSub = false;
- }
- else if (player.isOnEvent())
+ else if (player.isRegisteredOnEvent())
{
player.sendMessage("You cannot change your subclass while registered in an event.");
canSwitchSub = false;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanTransform.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanTransform.java
index 245c7b084b..682d2ec2b1 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanTransform.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanTransform.java
@@ -64,7 +64,7 @@ public class ConditionPlayerCanTransform extends Condition
player.sendPacket(SystemMessageId.YOU_CANNOT_TRANSFORM_WHILE_RIDING_A_PET);
canTransform = false;
}
- else if (player.isOnCustomEvent())
+ else if (player.isOnEvent())
{
player.sendMessage("You cannot transform while registered on an event.");
canTransform = false;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEvent.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEvent.java
deleted file mode 100644
index c7d0cb125f..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEvent.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine;
-
-import java.nio.file.Path;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.events.AbstractScript;
-import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
-
-/**
- * @author UnAfraid
- * @param
- */
-public abstract class AbstractEvent>extends AbstractScript
-{
- private final Map _members = new ConcurrentHashMap<>();
- private IEventState _state;
-
- public Map getMembers()
- {
- final Map members = new HashMap<>();
- for (Entry entry : _members.entrySet())
- {
- final T member = entry.getValue();
- if (member != null)
- {
- final PlayerInstance player = member.getPlayer();
- if ((player != null) && player.isOnline() && !player.isInOfflineMode())
- {
- members.putIfAbsent(entry.getKey(), member);
- }
- }
- }
- return members;
- }
-
- public T getMember(int objectId)
- {
- return getMembers().get(objectId);
- }
-
- public void addMember(T member)
- {
- _members.put(member.getObjectId(), member);
- }
-
- public void removeMember(int objectId)
- {
- _members.remove(objectId);
- }
-
- public void clearMembers()
- {
- _members.clear();
- }
-
- public void broadcastPacket(IClientOutgoingPacket... packets)
- {
- _members.values().forEach(member -> member.sendPacket(packets));
- }
-
- public IEventState getState()
- {
- return _state;
- }
-
- public void setState(IEventState state)
- {
- _state = state;
- }
-
- @Override
- public String getScriptName()
- {
- return getClass().getSimpleName();
- }
-
- @Override
- public Path getScriptPath()
- {
- return null;
- }
-
- /**
- * @param player
- * @return {@code true} if player is on event, {@code false} otherwise.
- */
- public boolean isOnEvent(PlayerInstance player)
- {
- return _members.containsKey(player.getObjectId());
- }
-
- /**
- * @param player
- * @return {@code true} if player is blocked from leaving the game, {@code false} otherwise.
- */
- public boolean isBlockingExit(PlayerInstance player)
- {
- return false;
- }
-
- /**
- * @param player
- * @return {@code true} if player is blocked from receiving death penalty upon death, {@code false} otherwise.
- */
- public boolean isBlockingDeathPenalty(PlayerInstance player)
- {
- return false;
- }
-
- /**
- * @param player
- * @return {@code true} if player can revive after death, {@code false} otherwise.
- */
- public boolean canRevive(PlayerInstance player)
- {
- return true;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEventManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEventManager.java
deleted file mode 100644
index a1a0b03fdf..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEventManager.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine;
-
-import java.nio.file.Path;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedDeque;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.l2jmobius.gameserver.model.StatSet;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.eventengine.drop.IEventDrop;
-import org.l2jmobius.gameserver.model.events.AbstractScript;
-import org.l2jmobius.gameserver.model.events.EventType;
-import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
-import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
-import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
-
-/**
- * @author UnAfraid
- * @param
- */
-public abstract class AbstractEventManager>extends AbstractScript
-{
- private String _name;
- private StatSet _variables = StatSet.EMPTY_STATSET;
- private Set _schedulers = Collections.emptySet();
- private Set _conditionalSchedulers = Collections.emptySet();
- private Map _rewards = Collections.emptyMap();
-
- private final Set _events = ConcurrentHashMap.newKeySet();
- private final Queue _registeredPlayers = new ConcurrentLinkedDeque<>();
- private final AtomicReference _state = new AtomicReference<>();
-
- public abstract void onInitialized();
-
- /* ********************** */
-
- public String getName()
- {
- return _name;
- }
-
- public void setName(String name)
- {
- _name = name;
- }
-
- /* ********************** */
-
- public StatSet getVariables()
- {
- return _variables;
- }
-
- public void setVariables(StatSet variables)
- {
- _variables = new StatSet(Collections.unmodifiableMap(variables.getSet()));
- }
-
- /* ********************** */
-
- public EventScheduler getScheduler(String name)
- {
- for (EventScheduler scheduler : _schedulers)
- {
- if (scheduler.getName().equalsIgnoreCase(name))
- {
- return scheduler;
- }
- }
- return null;
- }
-
- public void setSchedulers(Set schedulers)
- {
- _schedulers = Collections.unmodifiableSet(schedulers);
- }
-
- /* ********************** */
-
- public Set getConditionalSchedulers()
- {
- return _conditionalSchedulers;
- }
-
- public void setConditionalSchedulers(Set schedulers)
- {
- _conditionalSchedulers = Collections.unmodifiableSet(schedulers);
- }
-
- /* ********************** */
-
- public IEventDrop getRewards(String name)
- {
- return _rewards.get(name);
- }
-
- public void setRewards(Map rewards)
- {
- _rewards = Collections.unmodifiableMap(rewards);
- }
-
- /* ********************** */
-
- public Set getEvents()
- {
- return _events;
- }
-
- /* ********************** */
-
- public void startScheduler()
- {
- _schedulers.forEach(EventScheduler::startScheduler);
- }
-
- public void stopScheduler()
- {
- _schedulers.forEach(EventScheduler::stopScheduler);
- }
-
- public void startConditionalSchedulers()
- {
- for (IConditionalEventScheduler scheduler : _conditionalSchedulers)
- {
- if (scheduler.test())
- {
- scheduler.run();
- }
- }
- }
-
- /* ********************** */
-
- public IEventState getState()
- {
- return _state.get();
- }
-
- public void setState(IEventState newState)
- {
- final IEventState previousState = _state.get();
- _state.set(newState);
- onStateChange(previousState, newState);
- }
-
- public boolean setState(IEventState previousState, IEventState newState)
- {
- if (_state.compareAndSet(previousState, newState))
- {
- onStateChange(previousState, newState);
- return true;
- }
- return false;
- }
-
- /* ********************** */
-
- public boolean registerPlayer(PlayerInstance player)
- {
- return canRegister(player, true) && _registeredPlayers.offer(player);
- }
-
- public boolean unregisterPlayer(PlayerInstance player)
- {
- return _registeredPlayers.remove(player);
- }
-
- public boolean isRegistered(PlayerInstance player)
- {
- return _registeredPlayers.contains(player);
- }
-
- public boolean canRegister(PlayerInstance player, boolean sendMessage)
- {
- return !_registeredPlayers.contains(player);
- }
-
- public Queue getRegisteredPlayers()
- {
- return _registeredPlayers;
- }
-
- /* ********************** */
- @RegisterEvent(EventType.ON_PLAYER_LOGOUT)
- @RegisterType(ListenerRegisterType.GLOBAL)
- public void OnPlayerLogout(OnPlayerLogout event)
- {
- final PlayerInstance player = event.getPlayer();
- if (_registeredPlayers.remove(player))
- {
- onUnregisteredPlayer(player);
- }
- }
-
- /* ********************** */
-
- /**
- * Triggered when a player is automatically removed from the event manager because he disconnected
- * @param player
- */
- protected void onUnregisteredPlayer(PlayerInstance player)
- {
- }
-
- /**
- * Triggered when state is changed
- * @param previousState
- * @param newState
- */
- protected void onStateChange(IEventState previousState, IEventState newState)
- {
- }
-
- /* ********************** */
- @Override
- public String getScriptName()
- {
- return getClass().getSimpleName();
- }
-
- @Override
- public Path getScriptPath()
- {
- return null;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEventMember.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEventMember.java
deleted file mode 100644
index 383739dc5f..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/AbstractEventMember.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.l2jmobius.gameserver.model.World;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
-
-/**
- * @author UnAfraid
- * @param
- */
-public abstract class AbstractEventMember>
-{
- private final int _objectId;
- private final T _event;
- private final AtomicInteger _score = new AtomicInteger();
-
- public AbstractEventMember(PlayerInstance player, T event)
- {
- _objectId = player.getObjectId();
- _event = event;
- }
-
- public int getObjectId()
- {
- return _objectId;
- }
-
- public PlayerInstance getPlayer()
- {
- return World.getInstance().getPlayer(_objectId);
- }
-
- public void sendPacket(IClientOutgoingPacket... packets)
- {
- final PlayerInstance player = getPlayer();
- if ((player != null) && player.isOnline() && !player.isInOfflineMode())
- {
- for (IClientOutgoingPacket packet : packets)
- {
- player.sendPacket(packet);
- }
- }
- }
-
- public int getClassId()
- {
- final PlayerInstance player = getPlayer();
- if (player != null)
- {
- return player.getClassId().getId();
- }
- return 0;
- }
-
- public void setScore(int score)
- {
- _score.set(score);
- }
-
- public int getScore()
- {
- return _score.get();
- }
-
- public int incrementScore()
- {
- return _score.incrementAndGet();
- }
-
- public int decrementScore()
- {
- return _score.decrementAndGet();
- }
-
- public int addScore(int score)
- {
- return _score.addAndGet(score);
- }
-
- public T getEvent()
- {
- return _event;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventMethodNotification.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventMethodNotification.java
deleted file mode 100644
index 518929826a..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventMethodNotification.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.List;
-
-/**
- * @author UnAfraid
- */
-public class EventMethodNotification
-{
- private final AbstractEventManager> _manager;
- private final Method _method;
- private final Object[] _args;
-
- /**
- * @param manager
- * @param methodName
- * @param args
- * @throws NoSuchMethodException
- */
- public EventMethodNotification(AbstractEventManager> manager, String methodName, List args) throws NoSuchMethodException
- {
- _manager = manager;
- _method = manager.getClass().getDeclaredMethod(methodName, args.stream().map(Object::getClass).toArray(Class[]::new));
- _args = args.toArray();
- }
-
- public AbstractEventManager> getManager()
- {
- return _manager;
- }
-
- public Method getMethod()
- {
- return _method;
- }
-
- public void execute() throws Exception
- {
- if (Modifier.isStatic(_method.getModifiers()))
- {
- invoke(null);
- }
- else
- {
- // Attempt to find getInstance() method
- for (Method method : _manager.getClass().getMethods())
- {
- if (Modifier.isStatic(method.getModifiers()) && (_manager.getClass().isAssignableFrom(method.getReturnType())) && (method.getParameterCount() == 0))
- {
- final Object instance = method.invoke(null);
- invoke(instance);
- }
- }
- }
- }
-
- private void invoke(Object instance) throws Exception
- {
- // Java 1.8
- // final boolean wasAccessible = _method.isAccessible();
- // Java 10
- final boolean wasAccessible = _method.canAccess(instance);
- if (!wasAccessible)
- {
- _method.setAccessible(true);
- }
- _method.invoke(instance, _args);
- _method.setAccessible(wasAccessible);
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
deleted file mode 100644
index 3769381acd..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.l2jmobius.commons.database.DatabaseFactory;
-import org.l2jmobius.commons.threads.ThreadPool;
-import org.l2jmobius.commons.util.Chronos;
-import org.l2jmobius.gameserver.model.StatSet;
-
-import it.sauronsoftware.cron4j.PastPredictor;
-import it.sauronsoftware.cron4j.Predictor;
-
-/**
- * @author UnAfraid
- */
-public class EventScheduler
-{
- private static final Logger LOGGER = Logger.getLogger(EventScheduler.class.getName());
- private final AbstractEventManager> _eventManager;
- private final String _name;
- private final String _pattern;
- private final boolean _repeat;
- private List _notifications;
- private ScheduledFuture> _task;
-
- public EventScheduler(AbstractEventManager> manager, StatSet set)
- {
- _eventManager = manager;
- _name = set.getString("name", "");
- _pattern = set.getString("minute", "*") + " " + set.getString("hour", "*") + " " + set.getString("dayOfMonth", "*") + " " + set.getString("month", "*") + " " + set.getString("dayOfWeek", "*");
- _repeat = set.getBoolean("repeat", false);
- }
-
- public String getName()
- {
- return _name;
- }
-
- public long getNextSchedule()
- {
- final Predictor predictor = new Predictor(_pattern);
- return predictor.nextMatchingTime();
- }
-
- public long getNextSchedule(long fromTime)
- {
- final Predictor predictor = new Predictor(_pattern, fromTime);
- return predictor.nextMatchingTime();
- }
-
- public long getPrevSchedule()
- {
- final PastPredictor predictor = new PastPredictor(_pattern);
- return predictor.prevMatchingTime();
- }
-
- public long getPrevSchedule(long fromTime)
- {
- final PastPredictor predictor = new PastPredictor(_pattern, fromTime);
- return predictor.prevMatchingTime();
- }
-
- public boolean isRepeating()
- {
- return _repeat;
- }
-
- public void addEventNotification(EventMethodNotification notification)
- {
- if (_notifications == null)
- {
- _notifications = new ArrayList<>();
- }
- _notifications.add(notification);
- }
-
- public List getEventNotifications()
- {
- return _notifications;
- }
-
- public void startScheduler()
- {
- if (_notifications == null)
- {
- LOGGER.info("Scheduler without notificator manager: " + _eventManager.getClass().getSimpleName() + " pattern: " + _pattern);
- return;
- }
-
- final Predictor predictor = new Predictor(_pattern);
- final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
- if (timeSchedule <= (30 * 1000))
- {
- LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
- ThreadPool.schedule(this::startScheduler, timeSchedule + 1000);
- return;
- }
-
- if (_task != null)
- {
- _task.cancel(false);
- }
-
- _task = ThreadPool.schedule(() ->
- {
- run();
- updateLastRun();
-
- if (_repeat)
- {
- ThreadPool.schedule(this::startScheduler, 1000);
- }
- }, timeSchedule);
- }
-
- public boolean updateLastRun()
- {
- try (Connection con = DatabaseFactory.getConnection();
- PreparedStatement ps = con.prepareStatement("INSERT INTO event_schedulers (eventName, schedulerName, lastRun) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE eventName = ?, schedulerName = ?, lastRun = ?"))
- {
- ps.setString(1, _eventManager.getName());
- ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
- ps.setString(4, _eventManager.getName());
- ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
- ps.execute();
- return true;
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, "Failed to insert/update information for scheduled task manager: " + _eventManager.getClass().getSimpleName() + " scheduler: " + _name, e);
- }
- return false;
- }
-
- public void stopScheduler()
- {
- if (_task != null)
- {
- _task.cancel(false);
- _task = null;
- }
- }
-
- public long getRemainingTime(TimeUnit unit)
- {
- return (_task != null) && !_task.isDone() ? _task.getDelay(unit) : 0;
- }
-
- public void run()
- {
- for (EventMethodNotification notification : _notifications)
- {
- try
- {
- notification.execute();
- }
- catch (Exception e)
- {
- LOGGER.warning("Failed to notify to event manager: " + notification.getManager().getClass().getSimpleName() + " method: " + notification.getMethod().getName());
- }
- }
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/IConditionalEventScheduler.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/IConditionalEventScheduler.java
deleted file mode 100644
index 8f9beba7d0..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/IConditionalEventScheduler.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine;
-
-/**
- * @author UnAfraid
- */
-public interface IConditionalEventScheduler
-{
- boolean test();
-
- void run();
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/ScheduleTarget.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/ScheduleTarget.java
deleted file mode 100644
index 01a47eb7d1..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/ScheduleTarget.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @author UnAfraid
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.SOURCE)
-public @interface ScheduleTarget
-{
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/conditions/BetweenConditionalScheduler.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/conditions/BetweenConditionalScheduler.java
deleted file mode 100644
index 52e5787a4b..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/conditions/BetweenConditionalScheduler.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine.conditions;
-
-import java.util.Objects;
-import java.util.logging.Logger;
-
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.EventScheduler;
-import org.l2jmobius.gameserver.model.eventengine.IConditionalEventScheduler;
-
-/**
- * @author UnAfraid
- */
-public class BetweenConditionalScheduler implements IConditionalEventScheduler
-{
- private static final Logger LOGGER = Logger.getLogger(BetweenConditionalScheduler.class.getName());
- private final AbstractEventManager> _eventManager;
- private final String _name;
- private final String _scheduler1;
- private final String _scheduler2;
-
- public BetweenConditionalScheduler(AbstractEventManager> eventManager, String name, String scheduler1, String scheduler2)
- {
- Objects.requireNonNull(eventManager);
- Objects.requireNonNull(name);
- Objects.requireNonNull(scheduler1);
- Objects.requireNonNull(scheduler2);
-
- _eventManager = eventManager;
- _name = name;
- _scheduler1 = scheduler1;
- _scheduler2 = scheduler2;
- }
-
- @Override
- public boolean test()
- {
- final EventScheduler scheduler1 = _eventManager.getScheduler(_scheduler1);
- final EventScheduler scheduler2 = _eventManager.getScheduler(_scheduler2);
- if (scheduler1 == null)
- {
- throw new NullPointerException("Scheduler1 not found: " + _scheduler1);
- }
- else if (scheduler2 == null)
- {
- throw new NullPointerException("Scheduler2 not found: " + _scheduler2);
- }
-
- final long previousStart = scheduler1.getPrevSchedule();
- final long previousEnd = scheduler2.getPrevSchedule();
- return previousStart > previousEnd;
- }
-
- @Override
- public void run()
- {
- final EventScheduler mainScheduler = _eventManager.getScheduler(_name);
- if (mainScheduler == null)
- {
- throw new NullPointerException("Main scheduler not found: " + _name);
- }
- mainScheduler.run();
- LOGGER.info("Event " + _eventManager.getClass().getSimpleName() + " will resume because is within the event period.");
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/conditions/HaventRunConditionalScheduler.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/conditions/HaventRunConditionalScheduler.java
deleted file mode 100644
index 58dec3f542..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/conditions/HaventRunConditionalScheduler.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine.conditions;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.l2jmobius.commons.database.DatabaseFactory;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.EventScheduler;
-import org.l2jmobius.gameserver.model.eventengine.IConditionalEventScheduler;
-
-/**
- * @author UnAfraid
- */
-public class HaventRunConditionalScheduler implements IConditionalEventScheduler
-{
- private static final Logger LOGGER = Logger.getLogger(HaventRunConditionalScheduler.class.getName());
- private final AbstractEventManager> _eventManager;
- private final String _name;
-
- public HaventRunConditionalScheduler(AbstractEventManager> eventManager, String name)
- {
- _eventManager = eventManager;
- _name = name;
- }
-
- @Override
- public boolean test()
- {
- final EventScheduler mainScheduler = _eventManager.getScheduler(_name);
- if (mainScheduler == null)
- {
- throw new NullPointerException("Scheduler not found: " + _name);
- }
-
- try (Connection con = DatabaseFactory.getConnection();
- PreparedStatement ps = con.prepareStatement("SELECT lastRun FROM event_schedulers WHERE eventName = ? AND schedulerName = ?"))
- {
- ps.setString(1, _eventManager.getName());
- ps.setString(2, mainScheduler.getName());
- try (ResultSet rs = ps.executeQuery())
- {
- if (rs.next())
- {
- final long lastRun = rs.getTimestamp(1).getTime();
- final long lastPossibleRun = mainScheduler.getPrevSchedule();
- return (lastPossibleRun > lastRun) && (Math.abs(lastPossibleRun - lastRun) > 1000);
- }
- }
- }
- catch (SQLException e)
- {
- LOGGER.log(Level.WARNING, "Failed to retreive information for scheduled task event manager: " + _eventManager.getClass().getSimpleName() + " scheduler: " + _name, e);
- }
- return false;
- }
-
- @Override
- public void run()
- {
- final EventScheduler mainScheduler = _eventManager.getScheduler(_name);
- if (mainScheduler == null)
- {
- throw new NullPointerException("Scheduler not found: " + _name);
- }
-
- if (mainScheduler.updateLastRun())
- {
- mainScheduler.run();
- }
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDropGroup.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDropGroup.java
deleted file mode 100644
index f4f1746b1b..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDropGroup.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine.drop;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author UnAfraid
- */
-public class EventDropGroup
-{
- private final List _items = new ArrayList<>();
- private final double _chance;
-
- public EventDropGroup(double chance)
- {
- _chance = chance;
- }
-
- public double getChance()
- {
- return _chance;
- }
-
- public List getItems()
- {
- return _items;
- }
-
- public void addItem(EventDropItem item)
- {
- _items.add(item);
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDropItem.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDropItem.java
deleted file mode 100644
index 5a3da46555..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDropItem.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine.drop;
-
-/**
- * @author UnAfraid
- */
-public class EventDropItem
-{
- private final int _id;
- private final int _min;
- private final int _max;
- private final double _chance;
-
- public EventDropItem(int id, int min, int max, double chance)
- {
- _id = id;
- _min = min;
- _max = max;
- _chance = chance;
- }
-
- public int getId()
- {
- return _id;
- }
-
- public int getMin()
- {
- return _min;
- }
-
- public int getMax()
- {
- return _max;
- }
-
- public double getChance()
- {
- return _chance;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDrops.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDrops.java
deleted file mode 100644
index 3220986aaa..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/EventDrops.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine.drop;
-
-import java.util.function.Supplier;
-
-/**
- * @author UnAfraid
- */
-public enum EventDrops
-{
- GROUPED(GroupedDrop::new),
- NORMAL(NormalDrop::new);
-
- private final Supplier extends IEventDrop> _supplier;
-
- private EventDrops(Supplier supplier)
- {
- _supplier = supplier;
- }
-
- @SuppressWarnings("unchecked")
- public T newInstance()
- {
- return (T) (_supplier.get());
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/GroupedDrop.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/GroupedDrop.java
deleted file mode 100644
index 5766d47a81..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/GroupedDrop.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine.drop;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.l2jmobius.commons.util.Rnd;
-import org.l2jmobius.gameserver.model.holders.ItemHolder;
-
-/**
- * @author UnAfraid
- */
-public class GroupedDrop implements IEventDrop
-{
- private final List _groups = new ArrayList<>();
-
- public List getGroups()
- {
- return _groups;
- }
-
- public void addGroup(EventDropGroup group)
- {
- _groups.add(group);
- }
-
- @Override
- public Collection calculateDrops()
- {
- final List rewards = new ArrayList<>();
- for (EventDropGroup group : _groups)
- {
- if ((Rnd.nextDouble() * 100) < group.getChance())
- {
- double totalChance = 0;
- final double random = (Rnd.nextDouble() * 100);
- for (EventDropItem item : group.getItems())
- {
- totalChance += item.getChance();
- if (totalChance > random)
- {
- final long count = Rnd.get(item.getMin(), item.getMax());
- if (count > 0)
- {
- rewards.add(new ItemHolder(item.getId(), count));
- break;
- }
- }
- }
- }
- }
- return rewards;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/IEventDrop.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/IEventDrop.java
deleted file mode 100644
index a3c5178486..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/IEventDrop.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine.drop;
-
-import java.util.Collection;
-
-import org.l2jmobius.gameserver.model.holders.ItemHolder;
-
-/**
- * @author UnAfraid
- */
-public interface IEventDrop
-{
- Collection calculateDrops();
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/NormalDrop.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/NormalDrop.java
deleted file mode 100644
index 1a99a540e0..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/drop/NormalDrop.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.eventengine.drop;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.l2jmobius.commons.util.Rnd;
-import org.l2jmobius.gameserver.model.holders.ItemHolder;
-
-/**
- * @author UnAfraid
- */
-public class NormalDrop implements IEventDrop
-{
- private final List _items = new ArrayList<>();
-
- public List getItems()
- {
- return _items;
- }
-
- public void addItem(EventDropItem item)
- {
- _items.add(item);
- }
-
- @Override
- public Collection calculateDrops()
- {
- final List rewards = new ArrayList<>();
- double totalChance = 0;
- final double random = (Rnd.nextDouble() * 100);
- for (EventDropItem item : _items)
- {
- totalChance += item.getChance();
- if (totalChance > random)
- {
- final long count = Rnd.get(item.getMin(), item.getMax());
- if (count > 0)
- {
- rewards.add(new ItemHolder(item.getId(), count));
- }
- }
- }
- return rewards;
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/events/impl/ceremonyofchaos/OnCeremonyOfChaosMatchResult.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/events/impl/ceremonyofchaos/OnCeremonyOfChaosMatchResult.java
index fb0f2bb3da..06efad6874 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/events/impl/ceremonyofchaos/OnCeremonyOfChaosMatchResult.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/events/impl/ceremonyofchaos/OnCeremonyOfChaosMatchResult.java
@@ -18,7 +18,7 @@ package org.l2jmobius.gameserver.model.events.impl.ceremonyofchaos;
import java.util.List;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosMember;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
@@ -27,21 +27,21 @@ import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
*/
public class OnCeremonyOfChaosMatchResult implements IBaseEvent
{
- private final List _winners;
- private final List _members;
+ private final List _winners;
+ private final List _members;
- public OnCeremonyOfChaosMatchResult(List winners, List members)
+ public OnCeremonyOfChaosMatchResult(List winners, List members)
{
_winners = winners;
_members = members;
}
- public List getWinners()
+ public List getWinners()
{
return _winners;
}
- public List getMembers()
+ public List getMembers()
{
return _members;
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/holders/PlayerEventHolder.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/holders/PlayerEventHolder.java
deleted file mode 100644
index a5f6f9f161..0000000000
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/holders/PlayerEventHolder.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.model.holders;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.l2jmobius.Config;
-import org.l2jmobius.gameserver.data.sql.CharNameTable;
-import org.l2jmobius.gameserver.data.sql.ClanTable;
-import org.l2jmobius.gameserver.model.Location;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-
-/**
- * Player event holder, meant for restoring player after event has finished.
- * Allows you to restore following information about player:
- *
- * Name
- * Title
- * Clan
- * Location
- * PvP Kills
- * PK Kills
- * Karma
- *
- * @author Nik, xban1x
- */
-public class PlayerEventHolder
-{
- private final PlayerInstance _player;
- private final String _name;
- private final String _title;
- private final int _clanId;
- private final Location _loc;
- private final int _pvpKills;
- private final int _pkKills;
- private final int _reputation;
-
- private final Map _kills = new ConcurrentHashMap<>();
- private boolean _sitForced;
-
- public PlayerEventHolder(PlayerInstance player)
- {
- this(player, false);
- }
-
- public PlayerEventHolder(PlayerInstance player, boolean sitForced)
- {
- _player = player;
- _name = player.getName();
- _title = player.getTitle();
- _clanId = player.getClanId();
- _loc = new Location(player);
- _pvpKills = player.getPvpKills();
- _pkKills = player.getPkKills();
- _reputation = player.getReputation();
- _sitForced = sitForced;
- }
-
- public void restorePlayerStats()
- {
- _player.setName(_name);
- if (Config.CACHE_CHAR_NAMES)
- {
- CharNameTable.getInstance().addName(_player);
- }
- _player.setTitle(_title);
- _player.setClan(ClanTable.getInstance().getClan(_clanId));
- _player.teleToLocation(_loc, true);
- _player.setPvpKills(_pvpKills);
- _player.setPkKills(_pkKills);
- _player.setReputation(_reputation);
- }
-
- public void setSitForced(boolean sitForced)
- {
- _sitForced = sitForced;
- }
-
- public boolean isSitForced()
- {
- return _sitForced;
- }
-
- public Map getKills()
- {
- return Collections.unmodifiableMap(_kills);
- }
-
- public void addKill(PlayerInstance player)
- {
- _kills.merge(player, 1, Integer::sum);
- }
-}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index b323a33915..29cce0c911 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -978,7 +978,7 @@ public class Instance implements IIdentifiable, INamable
*/
public void onDeath(PlayerInstance player)
{
- if (!player.isOnCustomEvent() && (_template.getEjectTime() > 0))
+ if (!player.isOnEvent() && (_template.getEjectTime() > 0))
{
// Send message
final SystemMessage sm = new SystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/items/Item.java
index 5556524f8d..4e8384244c 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/items/Item.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/items/Item.java
@@ -37,7 +37,6 @@ import org.l2jmobius.gameserver.model.PlayerCondOverride;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.commission.CommissionItemType;
import org.l2jmobius.gameserver.model.conditions.Condition;
import org.l2jmobius.gameserver.model.events.ListenersContainer;
@@ -146,7 +145,7 @@ public abstract class Item extends ListenersContainer implements IIdentifiable
private boolean _freightable;
private boolean _allowSelfResurrection;
private boolean _isOlyRestricted;
- private boolean _isCocRestricted;
+ private boolean _isEventRestricted;
private boolean _forNpc;
private boolean _common;
private boolean _heroItem;
@@ -219,7 +218,7 @@ public abstract class Item extends ListenersContainer implements IIdentifiable
_freightable = set.getBoolean("is_freightable", false);
_allowSelfResurrection = set.getBoolean("allow_self_resurrection", false);
_isOlyRestricted = set.getBoolean("is_oly_restricted", false);
- _isCocRestricted = set.getBoolean("is_coc_restricted", false);
+ _isEventRestricted = set.getBoolean("is_event_restricted", false);
_forNpc = set.getBoolean("for_npc", false);
_isAppearanceable = set.getBoolean("isAppearanceable", false);
_isBlessed = set.getBoolean("blessed", false);
@@ -854,9 +853,9 @@ public abstract class Item extends ListenersContainer implements IIdentifiable
return false;
}
- if (_isCocRestricted && (creature.isPlayer() && (creature.getActingPlayer().isOnEvent(CeremonyOfChaosEvent.class))))
+ if (_isEventRestricted && (creature.isPlayer() && (creature.getActingPlayer().isOnEvent())))
{
- creature.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_ITEM_IN_THE_TOURNAMENT);
+ creature.sendMessage("You cannot use this item in the event.");
return false;
}
@@ -931,11 +930,11 @@ public abstract class Item extends ListenersContainer implements IIdentifiable
}
/**
- * @return {@code true} if item cannot be used in Ceremony of Chaos games.
+ * @return {@code true} if item cannot be used in event games.
*/
- public boolean isCocRestrictedItem()
+ public boolean isEventRestrictedItem()
{
- return _isCocRestricted;
+ return _isEventRestricted;
}
public boolean isForNpc()
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
index f89ea497b6..6d8f4d70e0 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
@@ -221,9 +221,9 @@ public class OlympiadManager
{
case CLASSED:
{
- if (player.isOnEvent())
+ if (player.isRegisteredOnEvent())
{
- player.sendMessage("You can't join olympiad while participating on an Event.");
+ player.sendMessage("You can't join olympiad while participating on an event.");
return false;
}
@@ -248,9 +248,9 @@ public class OlympiadManager
}
case NON_CLASSED:
{
- if (player.isOnEvent())
+ if (player.isRegisteredOnEvent())
{
- player.sendMessage("You can't join olympiad while participating on TvT Event.");
+ player.sendMessage("You can't join olympiad while participating on an event.");
return false;
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index faac3921be..e95dffcbba 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -25,7 +25,6 @@ import java.util.Comparator;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -33,7 +32,6 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
-import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -186,9 +184,4 @@ public class ClanHallAuction
{
return _clanHallId;
}
-
- public long getRemaingTime()
- {
- return ClanHallAuctionManager.getInstance().getScheduler("endAuction").getRemainingTime(TimeUnit.MILLISECONDS);
- }
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/skills/SkillCaster.java
index ae3afaba5c..d71e1bc592 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/skills/SkillCaster.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/skills/SkillCaster.java
@@ -1122,7 +1122,7 @@ public class SkillCaster implements Runnable
}
// Events.
- if (player.isOnCustomEvent())
+ if (player.isOnEvent())
{
if (skill.hasEffectType(EffectType.TELEPORT)) // Disable teleport skills.
{
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index d9a271f737..f9b4342d3c 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -45,7 +45,6 @@ import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -419,11 +418,6 @@ public class EnterWorld implements IClientIncomingPacket
player.sendPacket(new ExRotation(player.getObjectId(), player.getHeading()));
player.getInventory().applyItemSkills();
- if (GameEvent.isParticipant(player))
- {
- GameEvent.restorePlayerEventStatus(player);
- }
-
if (player.isCursedWeaponEquipped())
{
CursedWeaponsManager.getInstance().getCursedWeapon(player.getCursedWeaponEquippedId()).cursedOnLogin();
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
index 6ec63191f5..fe866ac5d9 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.Party;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PartyRequest;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -120,13 +119,7 @@ public class RequestJoinParty implements IClientIncomingPacket
return;
}
- if (requestor.isOnEvent(CeremonyOfChaosEvent.class))
- {
- client.sendPacket(SystemMessageId.YOU_CANNOT_INVITE_A_FRIEND_OR_PARTY_WHILE_PARTICIPATING_IN_THE_CEREMONY_OF_CHAOS);
- return;
- }
-
- if (requestor.isOnEvent()) // custom event message
+ if (requestor.isRegisteredOnEvent())
{
requestor.sendMessage("You cannot invite to a party while participating in an event.");
return;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreBuy.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreBuy.java
index 369a4fa9b1..2db83440a2 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreBuy.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreBuy.java
@@ -30,9 +30,7 @@ import org.l2jmobius.gameserver.model.TradeList;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import org.l2jmobius.gameserver.util.Util;
@@ -87,14 +85,7 @@ public class RequestPrivateStoreBuy implements IClientIncomingPacket
return;
}
- // Cannot set private store in Ceremony of Chaos event.
- if (player.isOnEvent(CeremonyOfChaosEvent.class))
- {
- client.sendPacket(SystemMessageId.YOU_CANNOT_OPEN_A_PRIVATE_STORE_OR_WORKSHOP_IN_THE_CEREMONY_OF_CHAOS);
- return;
- }
-
- if (player.isOnEvent()) // custom event message
+ if (player.isRegisteredOnEvent())
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreSell.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreSell.java
index 39e28b4a7e..a1b584e066 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreSell.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreSell.java
@@ -26,9 +26,7 @@ import org.l2jmobius.gameserver.model.ItemRequest;
import org.l2jmobius.gameserver.model.TradeList;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
/**
@@ -84,14 +82,7 @@ public class RequestPrivateStoreSell implements IClientIncomingPacket
return;
}
- // Cannot set private store in Ceremony of Chaos event.
- if (player.isOnEvent(CeremonyOfChaosEvent.class))
- {
- client.sendPacket(SystemMessageId.YOU_CANNOT_OPEN_A_PRIVATE_STORE_OR_WORKSHOP_IN_THE_CEREMONY_OF_CHAOS);
- return;
- }
-
- if (player.isOnEvent()) // custom event message
+ if (player.isRegisteredOnEvent())
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 7422523bd3..328bd7d26d 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -95,7 +95,7 @@ public class RequestRestartPoint implements IClientIncomingPacket
}
// Custom event resurrection management.
- if (player.isOnCustomEvent())
+ if (player.isOnEvent())
{
for (AbstractEventListener listener : player.getListeners(EventType.ON_CREATURE_DEATH))
{
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/Say2.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/Say2.java
index b0676e562d..c2cb56b495 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/Say2.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/Say2.java
@@ -24,7 +24,6 @@ import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.ChatHandler;
import org.l2jmobius.gameserver.handler.IChatHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.effects.EffectFlag;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerChat;
@@ -162,12 +161,6 @@ public class Say2 implements IClientIncomingPacket
return;
}
- if (player.isOnEvent(CeremonyOfChaosEvent.class))
- {
- player.sendPacket(SystemMessageId.YOU_CANNOT_CHAT_IN_THE_CEREMONY_OF_CHAOS);
- return;
- }
-
if (player.isJailed() && Config.JAIL_DISABLE_CHAT && ((chatType == ChatType.WHISPER) || (chatType == ChatType.SHOUT) || (chatType == ChatType.TRADE) || (chatType == ChatType.HERO_VOICE)))
{
player.sendMessage("You can not chat with players outside of the jail.");
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestAcquireAbilityList.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestAcquireAbilityList.java
index 1484aa6a78..c8902e8330 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestAcquireAbilityList.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestAcquireAbilityList.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.model.SkillLearn;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.GameClient;
@@ -95,12 +94,12 @@ public class RequestAcquireAbilityList implements IClientIncomingPacket
player.sendPacket(SystemMessageId.ABILITIES_CAN_BE_USED_BY_NOBLESSE_EXALTED_LV_99_OR_ABOVE);
return;
}
- else if (player.isInOlympiadMode() || player.isOnEvent(CeremonyOfChaosEvent.class))
+ else if (player.isInOlympiadMode())
{
player.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
- else if (player.isOnEvent()) // custom event message
+ else if (player.isOnEvent())
{
player.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestChangeAbilityPoint.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestChangeAbilityPoint.java
index b56146b9f3..71a226b8be 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestChangeAbilityPoint.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestChangeAbilityPoint.java
@@ -21,7 +21,6 @@ import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.data.xml.AbilityPointsData;
import org.l2jmobius.gameserver.enums.UserInfoType;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -66,12 +65,13 @@ public class RequestChangeAbilityPoint implements IClientIncomingPacket
return;
}
- if (player.isInOlympiadMode() || player.isOnEvent(CeremonyOfChaosEvent.class))
+ if (player.isInOlympiadMode())
{
player.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
- else if (player.isOnEvent()) // custom event message
+
+ if (player.isOnEvent())
{
player.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestResetAbilityPoint.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestResetAbilityPoint.java
index 572d41545f..589cbaf37c 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestResetAbilityPoint.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ability/RequestResetAbilityPoint.java
@@ -23,7 +23,6 @@ import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.enums.SkillFinishType;
import org.l2jmobius.gameserver.model.SkillLearn;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -64,12 +63,12 @@ public class RequestResetAbilityPoint implements IClientIncomingPacket
client.sendPacket(SystemMessageId.ABILITIES_CAN_BE_USED_BY_NOBLESSE_EXALTED_LV_99_OR_ABOVE);
return;
}
- else if (player.isInOlympiadMode() || player.isOnEvent(CeremonyOfChaosEvent.class))
+ else if (player.isInOlympiadMode())
{
client.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
- else if (player.isOnEvent()) // custom event message
+ else if (player.isOnEvent())
{
player.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestCancelCuriousHouse.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestCancelCuriousHouse.java
index ce871f6a18..88a7ec13b1 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestCancelCuriousHouse.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestCancelCuriousHouse.java
@@ -17,13 +17,9 @@
package org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos;
import org.l2jmobius.commons.network.PacketReader;
-import org.l2jmobius.gameserver.enums.CeremonyOfChaosState;
-import org.l2jmobius.gameserver.instancemanager.CeremonyOfChaosManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseState;
/**
* @author Sdw
@@ -46,15 +42,15 @@ public class RequestCancelCuriousHouse implements IClientIncomingPacket
return;
}
- if (CeremonyOfChaosManager.getInstance().unregisterPlayer(player))
- {
- player.sendPacket(SystemMessageId.YOU_HAVE_BEEN_TAKEN_OFF_THE_WAIT_LIST_YOU_MAY_ONLY_ENTER_THE_WAIT_LIST_ON_MON_THURS_EVERY_QUARTER_OF_AN_HOUR_FOR_5_MINUTES_BETWEEN_20_00_AND_23_40_IF_YOU_CANCEL_REGISTRATION_OR_CHOOSE_TO_FORFEIT_AFTER_ENTERING_A_MATCH_30_TIMES_OR_MORE_DURING_A_CYCLE_YOU_MUST_WAIT_UNTIL_THE_NEXT_CYCLE_TO_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_UPON_ENTERING_THE_ARENA_ALL_BUFFS_EXCLUDING_VITALITY_BUFFS_ARE_REMOVED);
- player.sendPacket(ExCuriousHouseState.IDLE_PACKET);
-
- if (CeremonyOfChaosManager.getInstance().getState() == CeremonyOfChaosState.PREPARING_FOR_TELEPORT)
- {
- player.prohibiteCeremonyOfChaos();
- }
- }
+ // if (CeremonyOfChaosManager.getInstance().unregisterPlayer(player))
+ // {
+ // player.sendPacket(SystemMessageId.YOU_HAVE_BEEN_TAKEN_OFF_THE_WAIT_LIST_YOU_MAY_ONLY_ENTER_THE_WAIT_LIST_ON_MON_THURS_EVERY_QUARTER_OF_AN_HOUR_FOR_5_MINUTES_BETWEEN_20_00_AND_23_40_IF_YOU_CANCEL_REGISTRATION_OR_CHOOSE_TO_FORFEIT_AFTER_ENTERING_A_MATCH_30_TIMES_OR_MORE_DURING_A_CYCLE_YOU_MUST_WAIT_UNTIL_THE_NEXT_CYCLE_TO_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_UPON_ENTERING_THE_ARENA_ALL_BUFFS_EXCLUDING_VITALITY_BUFFS_ARE_REMOVED);
+ // player.sendPacket(ExCuriousHouseState.IDLE_PACKET);
+ //
+ // if (CeremonyOfChaosManager.getInstance().getState() == CeremonyOfChaosState.PREPARING_FOR_TELEPORT)
+ // {
+ // player.prohibiteCeremonyOfChaos();
+ // }
+ // }
}
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestCuriousHouseHtml.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestCuriousHouseHtml.java
index a4e6f04627..c9e0872ac9 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestCuriousHouseHtml.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestCuriousHouseHtml.java
@@ -17,13 +17,9 @@
package org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos;
import org.l2jmobius.commons.network.PacketReader;
-import org.l2jmobius.gameserver.enums.CeremonyOfChaosState;
-import org.l2jmobius.gameserver.instancemanager.CeremonyOfChaosManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
/**
* @author Sdw
@@ -46,21 +42,21 @@ public class RequestCuriousHouseHtml implements IClientIncomingPacket
return;
}
- if (CeremonyOfChaosManager.getInstance().getState() != CeremonyOfChaosState.REGISTRATION)
- {
- return;
- }
- else if (CeremonyOfChaosManager.getInstance().isRegistered(player))
- {
- player.sendPacket(SystemMessageId.YOU_ARE_ON_THE_WAITING_LIST_FOR_THE_CEREMONY_OF_CHAOS);
- return;
- }
-
- if (CeremonyOfChaosManager.getInstance().canRegister(player, true))
- {
- final NpcHtmlMessage message = new NpcHtmlMessage(0);
- message.setFile(player, "data/html/CeremonyOfChaos/invite.htm");
- player.sendPacket(message);
- }
+ // if (CeremonyOfChaosManager.getInstance().getState() != CeremonyOfChaosState.REGISTRATION)
+ // {
+ // return;
+ // }
+ // else if (CeremonyOfChaosManager.getInstance().isRegistered(player))
+ // {
+ // player.sendPacket(SystemMessageId.YOU_ARE_ON_THE_WAITING_LIST_FOR_THE_CEREMONY_OF_CHAOS);
+ // return;
+ // }
+ //
+ // if (CeremonyOfChaosManager.getInstance().canRegister(player, true))
+ // {
+ // final NpcHtmlMessage message = new NpcHtmlMessage(0);
+ // message.setFile(player, "data/html/CeremonyOfChaos/invite.htm");
+ // player.sendPacket(message);
+ // }
}
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestJoinCuriousHouse.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestJoinCuriousHouse.java
index 33ca3d7b33..9fd38f3805 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestJoinCuriousHouse.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ceremonyofchaos/RequestJoinCuriousHouse.java
@@ -17,13 +17,9 @@
package org.l2jmobius.gameserver.network.clientpackets.ceremonyofchaos;
import org.l2jmobius.commons.network.PacketReader;
-import org.l2jmobius.gameserver.enums.CeremonyOfChaosState;
-import org.l2jmobius.gameserver.instancemanager.CeremonyOfChaosManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseState;
/**
* @author Sdw
@@ -46,25 +42,25 @@ public class RequestJoinCuriousHouse implements IClientIncomingPacket
return;
}
- if (CeremonyOfChaosManager.getInstance().getState() != CeremonyOfChaosState.REGISTRATION)
- {
- return;
- }
- else if (CeremonyOfChaosManager.getInstance().isRegistered(player))
- {
- player.sendPacket(SystemMessageId.YOU_ARE_ON_THE_WAITING_LIST_FOR_THE_CEREMONY_OF_CHAOS);
- return;
- }
-
- if (CeremonyOfChaosManager.getInstance().registerPlayer(player))
- {
- player.sendPacket(SystemMessageId.YOU_ARE_NOW_ON_THE_WAITING_LIST_YOU_WILL_AUTOMATICALLY_BE_TELEPORTED_WHEN_THE_TOURNAMENT_STARTS_AND_WILL_BE_REMOVED_FROM_THE_WAITING_LIST_IF_YOU_LOG_OUT_IF_YOU_CANCEL_REGISTRATION_WITHIN_THE_LAST_MINUTE_OF_ENTERING_THE_ARENA_AFTER_SIGNING_UP_30_TIMES_OR_MORE_OR_FORFEIT_AFTER_ENTERING_THE_ARENA_30_TIMES_OR_MORE_DURING_A_CYCLE_YOU_BECOME_INELIGIBLE_FOR_PARTICIPATION_IN_THE_CEREMONY_OF_CHAOS_UNTIL_THE_NEXT_CYCLE_ALL_THE_BUFFS_EXCEPT_THE_VITALITY_BUFF_WILL_BE_REMOVED_ONCE_YOU_ENTER_THE_ARENAS);
- player.sendPacket(SystemMessageId.EXCEPT_THE_VITALITY_BUFF_ALL_BUFFS_INCLUDING_ART_OF_SEDUCTION_WILL_BE_DELETED);
- player.sendPacket(ExCuriousHouseState.PREPARE_PACKET);
- }
- else
- {
- player.sendPacket(SystemMessageId.THERE_ARE_TOO_MANY_CHALLENGERS_YOU_CANNOT_PARTICIPATE_NOW);
- }
+ // if (CeremonyOfChaosManager.getInstance().getState() != CeremonyOfChaosState.REGISTRATION)
+ // {
+ // return;
+ // }
+ // else if (CeremonyOfChaosManager.getInstance().isRegistered(player))
+ // {
+ // player.sendPacket(SystemMessageId.YOU_ARE_ON_THE_WAITING_LIST_FOR_THE_CEREMONY_OF_CHAOS);
+ // return;
+ // }
+ //
+ // if (CeremonyOfChaosManager.getInstance().registerPlayer(player))
+ // {
+ // player.sendPacket(SystemMessageId.YOU_ARE_NOW_ON_THE_WAITING_LIST_YOU_WILL_AUTOMATICALLY_BE_TELEPORTED_WHEN_THE_TOURNAMENT_STARTS_AND_WILL_BE_REMOVED_FROM_THE_WAITING_LIST_IF_YOU_LOG_OUT_IF_YOU_CANCEL_REGISTRATION_WITHIN_THE_LAST_MINUTE_OF_ENTERING_THE_ARENA_AFTER_SIGNING_UP_30_TIMES_OR_MORE_OR_FORFEIT_AFTER_ENTERING_THE_ARENA_30_TIMES_OR_MORE_DURING_A_CYCLE_YOU_BECOME_INELIGIBLE_FOR_PARTICIPATION_IN_THE_CEREMONY_OF_CHAOS_UNTIL_THE_NEXT_CYCLE_ALL_THE_BUFFS_EXCEPT_THE_VITALITY_BUFF_WILL_BE_REMOVED_ONCE_YOU_ENTER_THE_ARENAS);
+ // player.sendPacket(SystemMessageId.EXCEPT_THE_VITALITY_BUFF_ALL_BUFFS_INCLUDING_ART_OF_SEDUCTION_WILL_BE_DELETED);
+ // player.sendPacket(ExCuriousHouseState.PREPARE_PACKET);
+ // }
+ // else
+ // {
+ // player.sendPacket(SystemMessageId.THERE_ARE_TOO_MANY_CHALLENGERS_YOU_CANNOT_PARTICIPATE_NOW);
+ // }
}
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
index 22893c183a..b281e4e8b7 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
@@ -22,7 +22,6 @@ import org.l2jmobius.gameserver.data.xml.FakePlayerData;
import org.l2jmobius.gameserver.model.BlockList;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -98,10 +97,10 @@ public class RequestFriendInvite implements IClientIncomingPacket
return;
}
- // Cannot request friendship in Ceremony of Chaos event.
- if (player.isOnEvent(CeremonyOfChaosEvent.class))
+ // Cannot request friendship in an event.
+ if (player.isOnEvent())
{
- client.sendPacket(SystemMessageId.YOU_CANNOT_INVITE_A_FRIEND_OR_PARTY_WHILE_PARTICIPATING_IN_THE_CEREMONY_OF_CHAOS);
+ player.sendMessage("You cannot request friendship while participating in an event.");
return;
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
index 0b991b2326..741cec4a27 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
@@ -24,8 +24,6 @@ import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.VariationInstance;
import org.l2jmobius.gameserver.model.actor.instance.DecoyInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosMember;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.interfaces.ILocational;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -121,8 +119,6 @@ public class CharInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.CHAR_INFO.writeId(packet);
- final CeremonyOfChaosEvent event = _player.getEvent(CeremonyOfChaosEvent.class);
- final CeremonyOfChaosMember cocPlayer = event != null ? event.getMember(_player.getObjectId()) : null;
packet.writeD(_x); // Confirmed
packet.writeD(_y); // Confirmed
packet.writeD(_z); // Confirmed
@@ -265,7 +261,7 @@ public class CharInfo implements IClientOutgoingPacket
{
packet.writeH(AbnormalVisualEffect.STEALTH.getClientId());
}
- packet.writeC(cocPlayer != null ? cocPlayer.getPosition() : _player.isTrueHero() ? 100 : 0);
+ packet.writeC(_player.isTrueHero() ? 100 : 0);
packet.writeC(_player.isHairAccessoryEnabled() ? 0x01 : 0x00); // Hair accessory
packet.writeC(_player.getAbilityPointsUsed()); // Used Ability Points
return true;
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/appearance/ExCuriousHouseMemberUpdate.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/appearance/ExCuriousHouseMemberUpdate.java
index a62954d653..735171b345 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/appearance/ExCuriousHouseMemberUpdate.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/appearance/ExCuriousHouseMemberUpdate.java
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.network.serverpackets.appearance;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosMember;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
@@ -33,24 +32,13 @@ public class ExCuriousHouseMemberUpdate implements IClientOutgoingPacket
public int _currentHp;
public int _currentCp;
- public ExCuriousHouseMemberUpdate(CeremonyOfChaosMember member)
+ public ExCuriousHouseMemberUpdate(PlayerInstance player)
{
- _objId = member.getObjectId();
- final PlayerInstance player = member.getPlayer();
- if (player != null)
- {
- _maxHp = player.getMaxHp();
- _maxCp = player.getMaxCp();
- _currentHp = (int) player.getCurrentHp();
- _currentCp = (int) player.getCurrentCp();
- }
- else
- {
- _maxHp = 0;
- _maxCp = 0;
- _currentHp = 0;
- _currentCp = 0;
- }
+ _objId = player.getObjectId();
+ _maxHp = player.getMaxHp();
+ _maxCp = player.getMaxCp();
+ _currentHp = (int) player.getCurrentHp();
+ _currentCp = (int) player.getCurrentCp();
}
@Override
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseMemberList.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseMemberList.java
index d26eee8d89..7c74a35616 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseMemberList.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseMemberList.java
@@ -20,7 +20,6 @@ import java.util.Collection;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosMember;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
@@ -31,9 +30,9 @@ public class ExCuriousHouseMemberList implements IClientOutgoingPacket
{
private final int _id;
private final int _maxPlayers;
- private final Collection _players;
+ private final Collection _players;
- public ExCuriousHouseMemberList(int id, int maxPlayers, Collection players)
+ public ExCuriousHouseMemberList(int id, int maxPlayers, Collection players)
{
_id = id;
_maxPlayers = maxPlayers;
@@ -48,25 +47,14 @@ public class ExCuriousHouseMemberList implements IClientOutgoingPacket
packet.writeD(_id);
packet.writeD(_maxPlayers);
packet.writeD(_players.size());
- for (CeremonyOfChaosMember cocPlayer : _players)
+ for (PlayerInstance player : _players)
{
- final PlayerInstance player = cocPlayer.getPlayer();
- packet.writeD(cocPlayer.getObjectId());
- packet.writeD(cocPlayer.getPosition());
- if (player != null)
- {
- packet.writeD(player.getMaxHp());
- packet.writeD(player.getMaxCp());
- packet.writeD((int) player.getCurrentHp());
- packet.writeD((int) player.getCurrentCp());
- }
- else
- {
- packet.writeD(0x00);
- packet.writeD(0x00);
- packet.writeD(0x00);
- packet.writeD(0x00);
- }
+ packet.writeD(player.getObjectId());
+ packet.writeD(0x00); // cocPlayer.getPosition
+ packet.writeD(player.getMaxHp());
+ packet.writeD(player.getMaxCp());
+ packet.writeD((int) player.getCurrentHp());
+ packet.writeD((int) player.getCurrentCp());
}
return true;
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseResult.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseResult.java
index 1f09c4de0d..27605b732b 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseResult.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseResult.java
@@ -16,10 +16,11 @@
*/
package org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos;
+import java.util.Collection;
+
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
-import org.l2jmobius.gameserver.instancemanager.CeremonyOfChaosManager;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
@@ -29,30 +30,30 @@ import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
public class ExCuriousHouseResult implements IClientOutgoingPacket
{
private final CeremonyOfChaosResult _result;
- private final CeremonyOfChaosEvent _event;
+ private final Collection _players;
- public ExCuriousHouseResult(CeremonyOfChaosResult result, CeremonyOfChaosEvent event)
+ public ExCuriousHouseResult(CeremonyOfChaosResult result, Collection players)
{
_result = result;
- _event = event;
+ _players = players;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_CURIOUS_HOUSE_RESULT.writeId(packet);
- packet.writeD(_event.getId());
+ packet.writeD(0); // _event.getId()
packet.writeH(_result.ordinal());
- packet.writeD(CeremonyOfChaosManager.getInstance().getMaxPlayersInArena());
- packet.writeD(_event.getMembers().size());
- _event.getMembers().values().forEach(m ->
+ packet.writeD(_players.size()); // CeremonyOfChaosManager.getInstance().getMaxPlayersInArena()
+ packet.writeD(_players.size());
+ for (PlayerInstance player : _players)
{
- packet.writeD(m.getObjectId());
- packet.writeD(m.getPosition());
- packet.writeD(m.getClassId());
- packet.writeD(m.getLifeTime());
- packet.writeD(m.getScore());
- });
+ packet.writeD(player.getObjectId());
+ packet.writeD(0x00); // cocPlayer.getPosition
+ packet.writeD(player.getClassId().getId());
+ packet.writeD(0x00); // getLifeTime
+ packet.writeD(0x00); // getScore
+ }
return true;
}
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index d6580161c7..68100c5557 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -48,7 +48,7 @@ public class OfflineTradeUtil
*/
private static boolean offlineMode(PlayerInstance player)
{
- if ((player == null) || player.isInOlympiadMode() || player.isBlockedFromExit() || player.isJailed() || (player.getVehicle() != null))
+ if ((player == null) || player.isInOlympiadMode() || player.isRegisteredOnEvent() || player.isJailed() || (player.getVehicle() != null))
{
return false;
}
diff --git a/L2J_Mobius_02.5_Underground/.classpath b/L2J_Mobius_02.5_Underground/.classpath
index 8d6bb1b024..a4d82b44e8 100644
--- a/L2J_Mobius_02.5_Underground/.classpath
+++ b/L2J_Mobius_02.5_Underground/.classpath
@@ -5,7 +5,6 @@
-
diff --git a/L2J_Mobius_02.5_Underground/dist/game/config/AdminCommands.xml b/L2J_Mobius_02.5_Underground/dist/game/config/AdminCommands.xml
index c7a1a461b6..9b610a1b81 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/config/AdminCommands.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/config/AdminCommands.xml
@@ -222,32 +222,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/events/CeremonyOfChaos.xml b/L2J_Mobius_02.5_Underground/dist/game/data/events/CeremonyOfChaos.xml
deleted file mode 100644
index 7331135977..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/events/CeremonyOfChaos.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 224
- 225
- 226
- 227
-
-
-
-
-
-
- Ceremony of Chaos has ended.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- start
- end
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/events/ClanHallAuction.xml b/L2J_Mobius_02.5_Underground/dist/game/data/events/ClanHallAuction.xml
deleted file mode 100644
index 1ef53637ee..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/events/ClanHallAuction.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- startAuction
- endAuction
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/events/DailyTasks.xml b/L2J_Mobius_02.5_Underground/dist/game/data/events/DailyTasks.xml
deleted file mode 100644
index 087cf3ce1a..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/events/DailyTasks.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/events/Elpies.txt b/L2J_Mobius_02.5_Underground/dist/game/data/events/Elpies.txt
deleted file mode 100644
index 2fb8a72306..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/events/Elpies.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/events/Rabbits.txt b/L2J_Mobius_02.5_Underground/dist/game/data/events/Rabbits.txt
deleted file mode 100644
index f4a59b3018..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/events/Rabbits.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/events/Race.txt b/L2J_Mobius_02.5_Underground/dist/game/data/events/Race.txt
deleted file mode 100644
index 7ef1d86347..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/events/Race.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/events/TeamVsTeam.txt b/L2J_Mobius_02.5_Underground/dist/game/data/events/TeamVsTeam.txt
deleted file mode 100644
index 9b02fa4d43..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/events/TeamVsTeam.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/html/mods/EventEngine/Participating.htm b/L2J_Mobius_02.5_Underground/dist/game/data/html/mods/EventEngine/Participating.htm
deleted file mode 100644
index 4724f31677..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/html/mods/EventEngine/Participating.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
- %eventName% by %eventCreator%
-
- %eventInfo%
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/html/mods/EventEngine/Participation.htm b/L2J_Mobius_02.5_Underground/dist/game/data/html/mods/EventEngine/Participation.htm
deleted file mode 100644
index 93445c87d9..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/html/mods/EventEngine/Participation.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
- %eventName% by %eventCreator%
-
- %eventInfo%
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index eaf1654a53..5aa0dcadd7 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -155,7 +155,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + ClanHallAuctionManager.getInstance().getRemainingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -190,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
- final long remainingTime = clanHallAuction.getRemaingTime();
+ final long remainingTime = ClanHallAuctionManager.getInstance().getRemainingTime();
final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
@@ -248,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
{
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
- final long remainingTime = clanHallAuction.getRemaingTime();
+ final long remainingTime = ClanHallAuctionManager.getInstance().getRemainingTime();
final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
@@ -298,7 +298,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0] ");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + ClanHallAuctionManager.getInstance().getRemainingTime()).atZone(ZoneId.systemDefault())));
sb.append(" ");
sb.append(auction.getHighestBid());
sb.append(" ");
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/LaVieEnRose/LaVieEnRose.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/LaVieEnRose/LaVieEnRose.java
index 92f5f478a9..848e1d690e 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/LaVieEnRose/LaVieEnRose.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/LaVieEnRose/LaVieEnRose.java
@@ -19,7 +19,6 @@ package ai.others.LaVieEnRose;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -128,13 +127,7 @@ public class LaVieEnRose extends AbstractNpcAI
return false;
}
- if (player.isOnEvent(CeremonyOfChaosEvent.class))
- {
- player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_WHILE_REGISTERED_IN_THE_CEREMONY_OF_CHAOS);
- return false;
- }
-
- if (player.isOnEvent()) // custom event message
+ if (player.isRegisteredOnEvent())
{
player.sendMessage("You cannot use the Beauty Shop while registered in an event.");
return false;
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
index b8821136b1..f128e32650 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
@@ -336,9 +336,9 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
player.sendPacket(SystemMessageId.THE_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
return false;
}
- else if (player.isOnEvent())
+ else if (player.isRegisteredOnEvent())
{
- player.sendMessage("You can not observe games while registered on an event");
+ player.sendMessage("You can not observe games while registered on an event.");
return false;
}
else
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index a3c74220a9..3afbd5674c 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -24,7 +24,6 @@ import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
@@ -266,11 +265,7 @@ public class TrainingCamp extends AbstractNpcAI
{
return false;
}
- else if (player.isOnEvent(CeremonyOfChaosEvent.class) || (player.getBlockCheckerArena() > -1)) // TODO underground coliseum and kratei checks.
- {
- return false;
- }
- else if (player.isOnEvent()) // custom event message
+ else if (player.isRegisteredOnEvent() || (player.getBlockCheckerArena() > -1)) // TODO underground coliseum and kratei checks.
{
return false;
}
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/custom/events/TeamVsTeam/TvT.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/custom/events/TeamVsTeam/TvT.java
index 64b03b6011..fe12cb8e73 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/custom/events/TeamVsTeam/TvT.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/custom/events/TeamVsTeam/TvT.java
@@ -147,7 +147,7 @@ public class TvT extends Event
{
PLAYER_LIST.add(player);
PLAYER_SCORES.put(player, 0);
- player.setOnCustomEvent(true);
+ player.setRegisteredOnEvent(true);
addLogoutListener(player);
htmltext = "registration-success.html";
}
@@ -172,13 +172,13 @@ public class TvT extends Event
PLAYER_LIST.remove(player);
PLAYER_SCORES.remove(player);
removeListeners(player);
- player.setOnCustomEvent(false);
+ player.setRegisteredOnEvent(false);
htmltext = "registration-canceled.html";
break;
}
case "BuffHeal":
{
- if (player.isOnCustomEvent() || player.isGM())
+ if (player.isOnEvent() || player.isGM())
{
if (player.isInCombat())
{
@@ -227,7 +227,7 @@ public class TvT extends Event
for (PlayerInstance participant : PLAYER_LIST)
{
removeListeners(participant);
- participant.setOnCustomEvent(false);
+ participant.setRegisteredOnEvent(false);
}
EVENT_ACTIVE = false;
return null;
@@ -264,6 +264,7 @@ public class TvT extends Event
team = true;
}
addDeathListener(participant);
+ participant.setOnEvent(true);
}
// Make Blue CC.
if (BLUE_TEAM.size() > 1)
@@ -454,7 +455,7 @@ public class TvT extends Event
{
removeListeners(participant);
participant.setTeam(Team.NONE);
- participant.setOnCustomEvent(false);
+ participant.setOnEvent(false);
participant.leaveParty();
}
// Destroy world.
@@ -481,7 +482,7 @@ public class TvT extends Event
}
case "ResurrectPlayer":
{
- if (player.isDead() && player.isOnCustomEvent())
+ if (player.isDead() && player.isOnEvent())
{
if (BLUE_TEAM.contains(player))
{
@@ -534,7 +535,7 @@ public class TvT extends Event
PLAYER_SCORES.remove(player);
BLUE_TEAM.remove(player);
RED_TEAM.remove(player);
- player.setOnCustomEvent(false);
+ player.setOnEvent(false);
removeListeners(player);
player.sendMessage("You have been kicked for been inactive.");
if (PVP_WORLD != null)
@@ -581,7 +582,7 @@ public class TvT extends Event
@Override
public String onEnterZone(Creature creature, ZoneType zone)
{
- if (creature.isPlayable() && creature.getActingPlayer().isOnCustomEvent())
+ if (creature.isPlayable() && creature.getActingPlayer().isOnEvent())
{
// Kick enemy players.
if ((zone == BLUE_PEACE_ZONE) && (creature.getTeam() == Team.RED))
@@ -608,7 +609,7 @@ public class TvT extends Event
@Override
public String onExitZone(Creature creature, ZoneType zone)
{
- if (creature.isPlayer() && creature.getActingPlayer().isOnCustomEvent())
+ if (creature.isPlayer() && creature.getActingPlayer().isOnEvent())
{
final PlayerInstance player = creature.getActingPlayer();
cancelQuestTimer("KickPlayer" + creature.getObjectId(), null, player);
@@ -639,7 +640,7 @@ public class TvT extends Event
player.sendMessage("Your level is too high to participate.");
return false;
}
- if (player.isOnEvent() || (player.getBlockCheckerArena() > -1))
+ if (player.isRegisteredOnEvent() || (player.getBlockCheckerArena() > -1))
{
player.sendMessage("You are already registered on an event.");
return false;
@@ -726,7 +727,7 @@ public class TvT extends Event
private void addLogoutListener(PlayerInstance player)
{
- player.addListener(new ConsumerEventListener(player, EventType.ON_PLAYER_LOGOUT, (OnPlayerLogout event) -> OnPlayerLogout(event), this));
+ player.addListener(new ConsumerEventListener(player, EventType.ON_PLAYER_LOGOUT, (OnPlayerLogout event) -> onPlayerLogout(event), this));
}
private void addDeathListener(PlayerInstance player)
@@ -778,7 +779,7 @@ public class TvT extends Event
}
@RegisterEvent(EventType.ON_PLAYER_LOGOUT)
- private void OnPlayerLogout(OnPlayerLogout event)
+ private void onPlayerLogout(OnPlayerLogout event)
{
final PlayerInstance player = event.getPlayer();
// Remove player from lists.
@@ -883,7 +884,7 @@ public class TvT extends Event
{
removeListeners(participant);
participant.setTeam(Team.NONE);
- participant.setOnCustomEvent(false);
+ participant.setRegisteredOnEvent(false);
}
if (PVP_WORLD != null)
{
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java
index 5ee9ecb5d7..bf5e891fec 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java
@@ -76,7 +76,6 @@ import handlers.admincommandhandlers.AdminEditChar;
import handlers.admincommandhandlers.AdminEffects;
import handlers.admincommandhandlers.AdminElement;
import handlers.admincommandhandlers.AdminEnchant;
-import handlers.admincommandhandlers.AdminEventEngine;
import handlers.admincommandhandlers.AdminEvents;
import handlers.admincommandhandlers.AdminExpSp;
import handlers.admincommandhandlers.AdminFakePlayers;
@@ -144,7 +143,6 @@ import handlers.bypasshandlers.ChangePlayerName;
import handlers.bypasshandlers.ChatLink;
import handlers.bypasshandlers.ClanWarehouse;
import handlers.bypasshandlers.EnsoulWindow;
-import handlers.bypasshandlers.EventEngine;
import handlers.bypasshandlers.FindPvP;
import handlers.bypasshandlers.Freight;
import handlers.bypasshandlers.ItemAuctionLink;
@@ -411,7 +409,6 @@ public class MasterHandler
AdminEffects.class,
AdminElement.class,
AdminEnchant.class,
- AdminEventEngine.class,
AdminEvents.class,
AdminExpSp.class,
AdminFakePlayers.class,
@@ -481,7 +478,6 @@ public class MasterHandler
ChatLink.class,
ClanWarehouse.class,
EnsoulWindow.class,
- EventEngine.class,
FindPvP.class,
Freight.class,
ItemAuctionLink.class,
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
index 95af1dea6b..f075754123 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/SkillConditionMasterHandler.java
@@ -99,7 +99,7 @@ public class SkillConditionMasterHandler
SkillConditionHandler.getInstance().registerHandler("OpNeedSummonOrPet", OpNeedSummonOrPetSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotAffectedBySkill", OpNotAffectedBySkillSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotCursed", OpNotCursedSkillCondition::new);
- SkillConditionHandler.getInstance().registerHandler("OpNotInCeremonyOfChaos", OpNotInCeremonyOfChaosSkillCondition::new);
+ SkillConditionHandler.getInstance().registerHandler("OpNotInEvent", OpNotInEventSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotInPeacezone", OpNotInPeacezoneSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotInstantzone", OpNotInstantzoneSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("OpNotOlympiad", OpNotOlympiadSkillCondition::new);
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/actionhandlers/NpcAction.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/actionhandlers/NpcAction.java
index 4b75e2bfb8..5823646cf7 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/actionhandlers/NpcAction.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/actionhandlers/NpcAction.java
@@ -22,7 +22,6 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.InstanceType;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.handler.IActionHandler;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -118,25 +117,19 @@ public class NpcAction implements IActionHandler
}
// Open a chat window on client with the text of the Npc
- if (npc.hasVariables() && npc.getVariables().getBoolean("eventmob", false))
+ if (npc.hasListener(EventType.ON_NPC_QUEST_START))
{
- GameEvent.showEventHtml(player, String.valueOf(target.getObjectId()));
+ player.setLastQuestNpcObject(target.getObjectId());
+ }
+ if (npc.hasListener(EventType.ON_NPC_FIRST_TALK))
+ {
+ EventDispatcher.getInstance().notifyEventAsync(new OnNpcFirstTalk(npc, player), npc);
}
else
{
- if (npc.hasListener(EventType.ON_NPC_QUEST_START))
- {
- player.setLastQuestNpcObject(target.getObjectId());
- }
- if (npc.hasListener(EventType.ON_NPC_FIRST_TALK))
- {
- EventDispatcher.getInstance().notifyEventAsync(new OnNpcFirstTalk(npc, player), npc);
- }
- else
- {
- npc.showChatWindow(player);
- }
+ npc.showChatWindow(player);
}
+
if (Config.PLAYER_MOVEMENT_BLOCK_TIME > 0)
{
player.updateNotMoveUntil();
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java
deleted file mode 100644
index 2d7e669ac4..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java
+++ /dev/null
@@ -1,548 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package handlers.admincommandhandlers;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.DataInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStreamReader;
-import java.io.PrintStream;
-import java.util.StringTokenizer;
-
-import org.l2jmobius.Config;
-import org.l2jmobius.commons.util.Rnd;
-import org.l2jmobius.gameserver.data.xml.AdminData;
-import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent.EventState;
-import org.l2jmobius.gameserver.model.World;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
-import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
-import org.l2jmobius.gameserver.util.Broadcast;
-
-/**
- * This class handles following admin commands: - admin = shows menu
- * @version $Revision: 1.3.2.1.2.4 $ $Date: 2005/04/11 10:06:06 $
- */
-public class AdminEventEngine implements IAdminCommandHandler
-{
- private static final String[] ADMIN_COMMANDS =
- {
- "admin_event",
- "admin_event_new",
- "admin_event_choose",
- "admin_event_store",
- "admin_event_set",
- "admin_event_change_teams_number",
- "admin_event_announce",
- "admin_event_panel",
- "admin_event_control_begin",
- "admin_event_control_teleport",
- "admin_add",
- "admin_event_see",
- "admin_event_del",
- "admin_delete_buffer",
- "admin_event_control_sit",
- "admin_event_name",
- "admin_event_control_kill",
- "admin_event_control_res",
- "admin_event_control_transform",
- "admin_event_control_untransform",
- "admin_event_control_prize",
- "admin_event_control_chatban",
- "admin_event_control_kick",
- "admin_event_control_finish"
- };
-
- private static String tempBuffer = "";
- private static String tempName = "";
- private static boolean npcsDeleted = false;
-
- @Override
- public boolean useAdminCommand(String command, PlayerInstance activeChar)
- {
- StringTokenizer st = new StringTokenizer(command);
- final String actualCommand = st.nextToken();
- try
- {
- if (actualCommand.equals("admin_event"))
- {
- if (GameEvent.eventState != EventState.OFF)
- {
- showEventControl(activeChar);
- }
- else
- {
- showMainPage(activeChar);
- }
- }
-
- else if (actualCommand.equals("admin_event_new"))
- {
- showNewEventPage(activeChar);
- }
- else if (actualCommand.startsWith("admin_add"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event info.
- tempBuffer += command.substring(10);
- showNewEventPage(activeChar);
-
- }
- else if (actualCommand.startsWith("admin_event_see"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
- final String eventName = command.substring(16);
- try
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(Config.DATAPACK_ROOT + "/data/events/" + eventName)));
- final BufferedReader inbr = new BufferedReader(new InputStreamReader(in));
- adminReply.setFile(null, "data/html/mods/EventEngine/Participation.htm");
- adminReply.replace("%eventName%", eventName);
- adminReply.replace("%eventCreator%", inbr.readLine());
- adminReply.replace("%eventInfo%", inbr.readLine());
- adminReply.replace("npc_%objectId%_event_participate", "admin_event"); // Weird, but nice hack, isnt it? :)
- adminReply.replace("button value=\"Participate\"", "button value=\"Back\"");
- activeChar.sendPacket(adminReply);
- inbr.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- else if (actualCommand.startsWith("admin_event_del"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
- final String eventName = command.substring(16);
- final File file = new File(Config.DATAPACK_ROOT + "/data/events/" + eventName);
- file.delete();
- showMainPage(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_name"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
- tempName += command.substring(17);
- showNewEventPage(activeChar);
- }
- else if (actualCommand.equalsIgnoreCase("admin_delete_buffer"))
- {
- tempBuffer = "";
- showNewEventPage(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_store"))
- {
- try
- {
- final FileOutputStream file = new FileOutputStream(new File(Config.DATAPACK_ROOT, "data/events/" + tempName));
- final PrintStream p = new PrintStream(file);
- p.println(activeChar.getName());
- p.println(tempBuffer);
- file.close();
- p.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- tempBuffer = "";
- tempName = "";
- showMainPage(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_set"))
- {
- // There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
- GameEvent._eventName = command.substring(16);
- showEventParameters(activeChar, 2);
- }
- else if (actualCommand.startsWith("admin_event_change_teams_number"))
- {
- showEventParameters(activeChar, Integer.parseInt(st.nextToken()));
- }
- else if (actualCommand.startsWith("admin_event_panel"))
- {
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_announce"))
- {
- GameEvent._npcId = Integer.parseInt(st.nextToken());
- GameEvent._teamsNumber = Integer.parseInt(st.nextToken());
- String temp = " ";
- String temp2 = "";
- while (st.hasMoreElements())
- {
- temp += st.nextToken() + " ";
- }
-
- st = new StringTokenizer(temp, "-");
- Integer i = 1;
-
- while (st.hasMoreElements())
- {
- temp2 = st.nextToken();
- if (!temp2.equals(" "))
- {
- GameEvent._teamNames.put(i++, temp2.substring(1, temp2.length() - 1));
- }
- }
-
- activeChar.sendMessage(GameEvent.startEventParticipation());
- Broadcast.toAllOnlinePlayers(activeChar.getName() + " has started an event. You will find a participation NPC somewhere around you.");
-
- final PlaySound snd = new PlaySound(1, "B03_F", 0, 0, 0, 0, 0);
- activeChar.sendPacket(snd);
- activeChar.broadcastPacket(snd);
-
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final String replyMSG = "[ L2J EVENT ENGINE ] The event " + GameEvent._eventName + " has been announced, now you can type //event_panel to see the event panel control ";
- adminReply.setHtml(replyMSG);
- activeChar.sendPacket(adminReply);
- }
- else if (actualCommand.startsWith("admin_event_control_begin"))
- {
- // Starts the event and sends a message of the result
- activeChar.sendMessage(GameEvent.startEvent());
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_finish"))
- {
- // Finishes the event and sends a message of the result
- activeChar.sendMessage(GameEvent.finishEvent());
- }
- else if (actualCommand.startsWith("admin_event_control_teleport"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- final int teamId = Integer.parseInt(st.nextToken());
- for (PlayerInstance player : GameEvent._teams.get(teamId))
- {
- player.setTitle(GameEvent._teamNames.get(teamId));
- player.teleToLocation(activeChar.getLocation(), true, activeChar.getInstanceWorld());
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_sit"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- // Integer.parseInt(st.nextToken()) == teamId
- for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
- {
- if (player.getEventStatus() == null)
- {
- continue;
- }
-
- player.getEventStatus().setSitForced(!player.getEventStatus().isSitForced());
- if (player.getEventStatus().isSitForced())
- {
- player.sitDown();
- }
- else
- {
- player.standUp();
- }
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_kill"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
- {
- player.reduceCurrentHp(player.getMaxHp() + player.getMaxCp() + 1, activeChar, null);
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_res"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
- {
- if ((player == null) || !player.isDead())
- {
- continue;
- }
- player.restoreExp(100.0);
- player.doRevive();
- player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
- player.setCurrentCp(player.getMaxCp());
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_transform"))
- {
- final int teamId = Integer.parseInt(st.nextToken());
- final int[] transIds = new int[st.countTokens()];
- int i = 0;
- while (st.hasMoreElements()) // Every next ST should be a transform ID
- {
- transIds[i++] = Integer.parseInt(st.nextToken());
- }
-
- for (PlayerInstance player : GameEvent._teams.get(teamId))
- {
- final int transId = transIds[Rnd.get(transIds.length)];
- if (!player.transform(transId, true))
- {
- AdminData.getInstance().broadcastMessageToGMs("EventEngine: Unknow transformation id: " + transId);
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_untransform"))
- {
- while (st.hasMoreElements()) // Every next ST should be a team number
- {
- for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
- {
- player.stopTransformation(true);
- }
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_kick"))
- {
- if (st.hasMoreElements()) // If has next token, it should be player name.
- {
- while (st.hasMoreElements())
- {
- final PlayerInstance player = World.getInstance().getPlayer(st.nextToken());
- if (player != null)
- {
- GameEvent.removeAndResetPlayer(player);
- }
- }
- }
- else if ((activeChar.getTarget() != null) && (activeChar.getTarget().isPlayer()))
- {
- GameEvent.removeAndResetPlayer((PlayerInstance) activeChar.getTarget());
- }
- showEventControl(activeChar);
- }
- else if (actualCommand.startsWith("admin_event_control_prize"))
- {
- final int[] teamIds = new int[st.countTokens() - 2];
- int i = 0;
- while ((st.countTokens() - 2) > 0) // The last 2 tokens are used for "n" and "item id"
- {
- teamIds[i++] = Integer.parseInt(st.nextToken());
- }
-
- final String[] n = st.nextToken().split("\\*");
- final int itemId = Integer.parseInt(st.nextToken());
- for (int teamId : teamIds)
- {
- rewardTeam(activeChar, teamId, Integer.parseInt(n[0]), itemId, n.length == 2 ? n[1] : "");
- }
- showEventControl(activeChar);
- }
- }
- catch (Exception e)
- {
- AdminData.getInstance().broadcastMessageToGMs("EventEngine: Error! Possible blank boxes while executing a command which requires a value in the box?");
- }
- return true;
- }
-
- @Override
- public String[] getAdminCommandList()
- {
- return ADMIN_COMMANDS;
- }
-
- private String showStoredEvents()
- {
- final File dir = new File(Config.DATAPACK_ROOT, "/data/events");
- if (dir.isFile())
- {
- return "The directory '" + dir.getAbsolutePath() + "' is a file or is corrupted! ";
- }
-
- String note = "";
- if (!dir.exists())
- {
- note = "The directory '" + dir.getAbsolutePath() + "' does not exist! Trying to create it now... ";
- if (dir.mkdirs())
- {
- note += "The directory '" + dir.getAbsolutePath() + "' has been created! ";
- }
- else
- {
- note += "The directory '" + dir.getAbsolutePath() + "' hasn't been created! ";
- return note;
- }
- }
-
- final String[] files = dir.list();
- final StringBuilder result = new StringBuilder(files.length * 500);
- result.append("");
- for (String fileName : files)
- {
- result.append("");
- result.append(fileName);
- result.append(" ");
- }
-
- result.append("
");
-
- return note + result;
- }
-
- private void showMainPage(PlayerInstance activeChar)
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final String replyMSG = "[ L2J EVENT ENGINE ] Stored Events: " + showStoredEvents() + "";
- adminReply.setHtml(replyMSG);
- activeChar.sendPacket(adminReply);
- }
-
- private void showNewEventPage(PlayerInstance activeChar)
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final StringBuilder replyMSG = new StringBuilder(512);
- replyMSG.append("[ L2J EVENT ENGINE ] Event name: ");
- if (tempName.isEmpty())
- {
- replyMSG.append("You can also use //event_name text to insert a new title");
- replyMSG.append(" ");
- }
- else
- {
- replyMSG.append(tempName);
- }
-
- replyMSG.append("Event description: ");
- if (tempBuffer.isEmpty())
- {
- replyMSG.append("You can also use //add text to add text or //delete_buffer to remove the text.");
- }
- else
- {
- replyMSG.append(tempBuffer);
- }
-
- replyMSG.append(" ");
- replyMSG.append("");
- if (!(tempName.isEmpty() && tempBuffer.isEmpty()))
- {
- replyMSG.append("");
- }
-
- replyMSG.append(" ");
-
- adminReply.setHtml(replyMSG.toString());
- activeChar.sendPacket(adminReply);
- }
-
- private void showEventParameters(PlayerInstance activeChar, int teamnumbers)
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final StringBuilder sb = new StringBuilder();
- sb.append("[ L2J EVENT ENGINE ] Current event: ");
- sb.append(GameEvent._eventName);
- sb.append(" INFO: To start an event, you must first set the number of teams, then type their names in the boxes and finally type the NPC ID that will be the event manager (can be any existing npc) next to the \"Announce Event!\" button.");
- sb.append(" ");
- sb.append(" ");
- sb.append(" ");
- sb.append(" ");
- sb.append("
");
- sb.append("Teams' names: ");
- for (int i = 1; (i - 1) < teamnumbers; i++) // Team names params
- {
- sb.append("Team #");
- sb.append(i);
- sb.append(" name: ");
- }
- sb.append("
");
-
- adminReply.setHtml(sb.toString());
- activeChar.sendPacket(adminReply);
- }
-
- private void showEventControl(PlayerInstance activeChar)
- {
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- final StringBuilder sb = new StringBuilder();
- sb.append("[ EVENT ENGINE ] Current event: ");
- sb.append(GameEvent._eventName);
- sb.append(" Type the team ID(s) that will be affected by the commands. Commands with '*' work with only 1 team ID in the field, while '!' - none. ");
- sb.append(" ");
- if (!npcsDeleted)
- {
- sb.append("Destroys all event npcs so no more people can't participate now on ");
- }
-
- sb.append(" Teleports the specified team to your position Sits/Stands up the team Finish with the life of all the players in the selected team Resurrect Team's members Transforms the team into the transformation with the ID specified. Multiple IDs result in randomly chosen one for each player. Untransforms the team Give the specified item id to every single member of the team, you can put 5*level, 5*kills or 5 in the number field for example Kicks the specified player(s) from the event. Blank field kicks target. Will finish the event teleporting back all the players
");
- adminReply.setHtml(sb.toString());
- activeChar.sendPacket(adminReply);
- }
-
- private void rewardTeam(PlayerInstance activeChar, int team, int n, int id, String type)
- {
- int num = n;
- for (PlayerInstance player : GameEvent._teams.get(team))
- {
- if (type.equalsIgnoreCase("level"))
- {
- num = n * player.getLevel();
- }
- else if (type.equalsIgnoreCase("kills") && (player.getEventStatus() != null))
- {
- num = n * player.getEventStatus().getKills().size();
- }
- else
- {
- num = n;
- }
-
- player.addItem("Event", id, num, activeChar, true);
-
- final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
- adminReply.setHtml(" CONGRATULATIONS! You should have been rewarded. ");
- player.sendPacket(adminReply);
- }
- }
-}
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/EventEngine.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/EventEngine.java
deleted file mode 100644
index 081bbe2c2b..0000000000
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/EventEngine.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package handlers.bypasshandlers;
-
-import java.util.logging.Level;
-
-import org.l2jmobius.gameserver.handler.IBypassHandler;
-import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
-import org.l2jmobius.gameserver.model.actor.Creature;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-
-public class EventEngine implements IBypassHandler
-{
- private static final String[] COMMANDS =
- {
- "event_participate",
- "event_unregister"
- };
-
- @Override
- public boolean useBypass(String command, PlayerInstance player, Creature target)
- {
- if (!target.isNpc())
- {
- return false;
- }
-
- try
- {
- if (command.equalsIgnoreCase("event_participate"))
- {
- GameEvent.registerPlayer(player);
- return true;
- }
- else if (command.equalsIgnoreCase("event_unregister"))
- {
- GameEvent.removeAndResetPlayer(player);
- return true;
- }
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, "Exception in " + getClass().getSimpleName(), e);
- }
- return false;
- }
-
- @Override
- public String[] getBypassList()
- {
- return COMMANDS;
- }
-}
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/Observation.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/Observation.java
index 46a386ddd4..a7bde42217 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/Observation.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/Observation.java
@@ -99,9 +99,9 @@ public class Observation implements IBypassHandler
player.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_SIEGE_WITH_A_PET_OR_SERVITOR_SUMMONED);
return false;
}
- if (player.isOnEvent())
+ if (player.isRegisteredOnEvent())
{
- player.sendMessage("Cannot use while current Event");
+ player.sendMessage("Cannot use while registered on an event.");
return false;
}
diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInCeremonyOfChaosSkillCondition.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInEventSkillCondition.java
similarity index 80%
rename from L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInCeremonyOfChaosSkillCondition.java
rename to L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInEventSkillCondition.java
index b5cefc61cc..8b23f3b8b5 100644
--- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInCeremonyOfChaosSkillCondition.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpNotInEventSkillCondition.java
@@ -19,22 +19,21 @@ package handlers.skillconditionhandlers;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
import org.l2jmobius.gameserver.model.skills.ISkillCondition;
import org.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
-public class OpNotInCeremonyOfChaosSkillCondition implements ISkillCondition
+public class OpNotInEventSkillCondition implements ISkillCondition
{
- public OpNotInCeremonyOfChaosSkillCondition(StatSet params)
+ public OpNotInEventSkillCondition(StatSet params)
{
}
@Override
public boolean canUse(Creature caster, Skill skill, WorldObject target)
{
- return (caster.isPlayer() && !caster.getActingPlayer().isOnEvent(CeremonyOfChaosEvent.class));
+ return (caster.isPlayer() && !caster.getActingPlayer().isOnEvent());
}
}
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriend.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriend.java
index dd5edc672a..92ef49a349 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriend.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriend.java
@@ -80,7 +80,7 @@ public class NotFriend implements IAffectObjectHandler
}
// Events.
- if (player.isOnCustomEvent() && (player.getTeam() == target.getTeam()))
+ if (player.isOnEvent() && (player.getTeam() == target.getTeam()))
{
return false;
}
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriendPc.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriendPc.java
index c7e56162c7..ae271764f0 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriendPc.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/targethandlers/affectobject/NotFriendPc.java
@@ -80,7 +80,7 @@ public class NotFriendPc implements IAffectObjectHandler
}
// Events.
- if (player.isOnCustomEvent() && (player.getTeam() == target.getTeam()))
+ if (player.isOnEvent() && (player.getTeam() == target.getTeam()))
{
return false;
}
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/quests/Q10813_ForGlory/Q10813_ForGlory.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/quests/Q10813_ForGlory/Q10813_ForGlory.java
index 6ef0fa1dfd..ab21b5df1b 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/quests/Q10813_ForGlory/Q10813_ForGlory.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/quests/Q10813_ForGlory/Q10813_ForGlory.java
@@ -162,7 +162,7 @@ public class Q10813_ForGlory extends Quest
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
private void onCeremonyOfChaosMatchResult(OnCeremonyOfChaosMatchResult event)
{
- event.getMembers().forEach(player -> manageQuestProgress(player.getPlayer()));
+ event.getMembers().forEach(player -> manageQuestProgress(player));
}
@RegisterEvent(EventType.ON_OLYMPIAD_MATCH_RESULT)
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/quests/Q10819_ForHonor/Q10819_ForHonor.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/quests/Q10819_ForHonor/Q10819_ForHonor.java
index 86ea55caf9..0ea6ef37e1 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/quests/Q10819_ForHonor/Q10819_ForHonor.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/quests/Q10819_ForHonor/Q10819_ForHonor.java
@@ -169,7 +169,7 @@ public class Q10819_ForHonor extends Quest
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
private void onCeremonyOfChaosMatchResult(OnCeremonyOfChaosMatchResult event)
{
- event.getMembers().forEach(player -> manageQuestProgress(player.getPlayer()));
+ event.getMembers().forEach(player -> manageQuestProgress(player));
}
@RegisterEvent(EventType.ON_OLYMPIAD_MATCH_RESULT)
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00000-00099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00000-00099.xml
index d5f8ced8f0..9f10cb6efc 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00000-00099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00000-00099.xml
@@ -1159,7 +1159,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00700-00799.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00700-00799.xml
index 4ab3bcdd10..26338a1796 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00700-00799.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00700-00799.xml
@@ -393,7 +393,7 @@
-
+
@@ -412,7 +412,7 @@
-
+
@@ -436,7 +436,7 @@
-
+
@@ -452,7 +452,7 @@
-
+
@@ -491,7 +491,7 @@
-
+
@@ -507,7 +507,7 @@
-
+
@@ -520,7 +520,7 @@
-
+
@@ -537,7 +537,7 @@
-
+
@@ -554,7 +554,7 @@
-
+
@@ -577,7 +577,7 @@
-
+
@@ -598,7 +598,7 @@
-
+
@@ -615,7 +615,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00900-00999.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00900-00999.xml
index 8bbc2e27d6..642b1c5816 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00900-00999.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/00900-00999.xml
@@ -728,7 +728,7 @@
-
+
@@ -746,7 +746,7 @@
-
+
@@ -761,7 +761,7 @@
-
+
@@ -773,7 +773,7 @@
-
+
@@ -788,7 +788,7 @@
-
+
@@ -806,7 +806,7 @@
-
+
@@ -821,7 +821,7 @@
-
+
@@ -833,7 +833,7 @@
-
+
@@ -848,7 +848,7 @@
-
+
@@ -866,7 +866,7 @@
-
+
@@ -881,7 +881,7 @@
-
+
@@ -893,7 +893,7 @@
-
+
@@ -908,7 +908,7 @@
-
+
@@ -926,7 +926,7 @@
-
+
@@ -941,7 +941,7 @@
-
+
@@ -953,7 +953,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/01000-01099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/01000-01099.xml
index 376059b37f..fc841aa214 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/01000-01099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/01000-01099.xml
@@ -700,7 +700,7 @@
-
+
@@ -723,7 +723,7 @@
-
+
@@ -881,7 +881,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/01500-01599.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/01500-01599.xml
index 8888cc8475..c4d8cb861a 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/01500-01599.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/01500-01599.xml
@@ -467,7 +467,7 @@
-
+
@@ -490,7 +490,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/05200-05299.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/05200-05299.xml
index 925ff562c3..a9bcee9133 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/05200-05299.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/05200-05299.xml
@@ -488,7 +488,7 @@
-
+
@@ -509,7 +509,7 @@
-
+
@@ -530,7 +530,7 @@
-
+
@@ -551,7 +551,7 @@
-
+
@@ -572,7 +572,7 @@
-
+
@@ -593,7 +593,7 @@
-
+
@@ -614,7 +614,7 @@
-
+
@@ -635,7 +635,7 @@
-
+
@@ -656,7 +656,7 @@
-
+
@@ -677,7 +677,7 @@
-
+
@@ -698,7 +698,7 @@
-
+
@@ -719,7 +719,7 @@
-
+
@@ -740,7 +740,7 @@
-
+
@@ -761,7 +761,7 @@
-
+
@@ -782,7 +782,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/05500-05599.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/05500-05599.xml
index 3eb8c37aaf..9eb2b65043 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/05500-05599.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/05500-05599.xml
@@ -1079,7 +1079,7 @@
-
+
@@ -1098,7 +1098,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/06400-06499.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/06400-06499.xml
index 8ef613c844..6515069390 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/06400-06499.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/06400-06499.xml
@@ -72,7 +72,7 @@
-
+
@@ -85,7 +85,7 @@
-
+
@@ -117,7 +117,7 @@
-
+
@@ -135,7 +135,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08100-08199.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08100-08199.xml
index dbafd283b3..e020ccd2fe 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08100-08199.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08100-08199.xml
@@ -2125,7 +2125,7 @@
-
+
@@ -2142,7 +2142,7 @@
-
+
@@ -2159,7 +2159,7 @@
-
+
@@ -2176,7 +2176,7 @@
-
+
@@ -2193,7 +2193,7 @@
-
+
@@ -2210,7 +2210,7 @@
-
+
@@ -2227,7 +2227,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08200-08299.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08200-08299.xml
index 6cc38a1670..7a75f6d934 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08200-08299.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08200-08299.xml
@@ -12,7 +12,7 @@
-
+
@@ -27,7 +27,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08600-08699.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08600-08699.xml
index 81c97902a7..17833c5c07 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08600-08699.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08600-08699.xml
@@ -374,7 +374,7 @@
-
+
@@ -512,7 +512,7 @@
-
+
@@ -635,7 +635,7 @@
-
+
@@ -966,7 +966,7 @@
-
+
@@ -982,7 +982,7 @@
-
+
@@ -998,7 +998,7 @@
-
+
@@ -1014,7 +1014,7 @@
-
+
@@ -1030,7 +1030,7 @@
-
+
@@ -1046,7 +1046,7 @@
-
+
@@ -1062,7 +1062,7 @@
-
+
@@ -1078,7 +1078,7 @@
-
+
@@ -1094,7 +1094,7 @@
-
+
@@ -1110,7 +1110,7 @@
-
+
@@ -1126,7 +1126,7 @@
-
+
@@ -1142,7 +1142,7 @@
-
+
@@ -1158,7 +1158,7 @@
-
+
@@ -1174,7 +1174,7 @@
-
+
@@ -1190,7 +1190,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08700-08799.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08700-08799.xml
index 84d81a4b37..5c70280280 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08700-08799.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/08700-08799.xml
@@ -1104,7 +1104,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/09200-09299.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/09200-09299.xml
index 4798a0c5e1..a2a47efb81 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/09200-09299.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/09200-09299.xml
@@ -116,7 +116,7 @@
-
+
@@ -138,7 +138,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/09700-09799.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/09700-09799.xml
index d2a62b73c7..f13f9c2df8 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/09700-09799.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/09700-09799.xml
@@ -46,7 +46,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/10100-10199.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/10100-10199.xml
index b72857a8ca..fdcf620c10 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/10100-10199.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/10100-10199.xml
@@ -1118,7 +1118,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/13000-13099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/13000-13099.xml
index 9d3ea6de89..19dbfcfeff 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/13000-13099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/13000-13099.xml
@@ -516,7 +516,7 @@
-
+
@@ -936,7 +936,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/13700-13799.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/13700-13799.xml
index 7736498d85..fb0f27ccee 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/13700-13799.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/13700-13799.xml
@@ -820,7 +820,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/14600-14699.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/14600-14699.xml
index f7b7a38d3e..53e1f3568c 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/14600-14699.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/14600-14699.xml
@@ -1802,7 +1802,7 @@
-
+
@@ -1935,7 +1935,7 @@
-
+
@@ -2051,7 +2051,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/14700-14799.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/14700-14799.xml
index 7a2470d9a5..6dccf6872c 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/14700-14799.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/14700-14799.xml
@@ -13,7 +13,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/17000-17099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/17000-17099.xml
index e4db24ccca..23ee5675ea 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/17000-17099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/17000-17099.xml
@@ -97,7 +97,7 @@
-
+
@@ -352,7 +352,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/20300-20399.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/20300-20399.xml
index ef0b89cf97..050b1ff7b0 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/20300-20399.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/20300-20399.xml
@@ -988,7 +988,7 @@
-
+
@@ -1104,7 +1104,7 @@
-
+
@@ -1220,7 +1220,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21000-21099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21000-21099.xml
index d6fb37f7f8..c828247562 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21000-21099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21000-21099.xml
@@ -686,7 +686,7 @@
-
+
@@ -764,7 +764,7 @@
-
+
@@ -786,7 +786,7 @@
-
+
@@ -808,7 +808,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21100-21199.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21100-21199.xml
index 353014adc4..d9f9c4906a 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21100-21199.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21100-21199.xml
@@ -1575,7 +1575,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21200-21299.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21200-21299.xml
index 57dd45dbc8..bfc7a6f496 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21200-21299.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/21200-21299.xml
@@ -203,7 +203,7 @@
-
+
@@ -793,7 +793,7 @@
-
+
@@ -812,7 +812,7 @@
-
+
@@ -861,7 +861,7 @@
-
+
@@ -880,7 +880,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22000-22099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22000-22099.xml
index f31bc26203..643896e06b 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22000-22099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22000-22099.xml
@@ -449,7 +449,7 @@
-
+
@@ -472,7 +472,7 @@
-
+
@@ -495,7 +495,7 @@
-
+
@@ -616,7 +616,7 @@
-
+
@@ -737,7 +737,7 @@
-
+
@@ -760,7 +760,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22500-22599.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22500-22599.xml
index 11efd9599e..3f5dc58143 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22500-22599.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22500-22599.xml
@@ -1030,7 +1030,7 @@
-
+
@@ -1050,7 +1050,7 @@
-
+
@@ -1070,7 +1070,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22600-22699.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22600-22699.xml
index 609260e195..445d53ef3e 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22600-22699.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/22600-22699.xml
@@ -432,7 +432,7 @@
-
+
@@ -455,7 +455,7 @@
-
+
@@ -478,7 +478,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23200-23299.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23200-23299.xml
index e9263dc4e4..0a070c322a 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23200-23299.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23200-23299.xml
@@ -163,7 +163,7 @@
-
+
@@ -180,7 +180,7 @@
-
+
@@ -525,7 +525,7 @@
-
+
@@ -560,7 +560,7 @@
-
+
@@ -575,7 +575,7 @@
-
+
@@ -588,7 +588,7 @@
-
+
@@ -606,7 +606,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23300-23399.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23300-23399.xml
index 8d929f470d..354303b6b6 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23300-23399.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23300-23399.xml
@@ -481,7 +481,7 @@
-
+
@@ -501,7 +501,7 @@
-
+
@@ -1393,7 +1393,7 @@
-
+
@@ -1411,7 +1411,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23400-23499.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23400-23499.xml
index 10b8102445..1bece4192b 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23400-23499.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23400-23499.xml
@@ -1092,7 +1092,7 @@
-
+
@@ -1110,7 +1110,7 @@
-
+
@@ -1164,7 +1164,7 @@
-
+
@@ -1426,7 +1426,7 @@
-
+
@@ -1443,7 +1443,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23500-23599.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23500-23599.xml
index e548f3cf94..80ac77ad4f 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23500-23599.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23500-23599.xml
@@ -93,7 +93,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23600-23699.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23600-23699.xml
index 56e3bf15c5..8e91aeeadf 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23600-23699.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/23600-23699.xml
@@ -189,7 +189,7 @@
-
+
@@ -566,7 +566,7 @@
-
+
@@ -760,7 +760,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/30300-30399.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/30300-30399.xml
index 89b884947d..d6e4f92ffc 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/30300-30399.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/30300-30399.xml
@@ -984,7 +984,7 @@
-
+
@@ -1008,7 +1008,7 @@
-
+
@@ -1032,7 +1032,7 @@
-
+
@@ -1052,7 +1052,7 @@
-
+
@@ -1075,7 +1075,7 @@
-
+
@@ -1098,7 +1098,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/34000-34099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/34000-34099.xml
index ee27bbbd26..f682a220b1 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/34000-34099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/34000-34099.xml
@@ -180,7 +180,7 @@
-
+
@@ -200,7 +200,7 @@
-
+
@@ -220,7 +220,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/34600-34699.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/34600-34699.xml
index 2db734d507..37cf5939f0 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/34600-34699.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/34600-34699.xml
@@ -41,7 +41,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35600-35699.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35600-35699.xml
index b8e80e367d..a3b0cc12ec 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35600-35699.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35600-35699.xml
@@ -1423,7 +1423,7 @@
-
+
@@ -1443,7 +1443,7 @@
-
+
@@ -1463,7 +1463,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35700-35799.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35700-35799.xml
index 2a7159ad08..50f1f52823 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35700-35799.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35700-35799.xml
@@ -771,7 +771,7 @@
-
+
@@ -791,7 +791,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35900-35999.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35900-35999.xml
index 4599219b20..f7e143e540 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35900-35999.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/35900-35999.xml
@@ -475,7 +475,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36000-36099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36000-36099.xml
index c6a7e53df0..48c814a332 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36000-36099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36000-36099.xml
@@ -377,7 +377,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36200-36299.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36200-36299.xml
index 9159c160e1..d3ec72e4bc 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36200-36299.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36200-36299.xml
@@ -791,7 +791,7 @@
-
+
@@ -1079,7 +1079,7 @@
-
+
@@ -1096,7 +1096,7 @@
-
+
@@ -1113,7 +1113,7 @@
-
+
@@ -1130,7 +1130,7 @@
-
+
@@ -1146,7 +1146,7 @@
-
+
@@ -1158,7 +1158,7 @@
-
+
@@ -1210,7 +1210,7 @@
-
+
@@ -1247,7 +1247,7 @@
-
+
@@ -1265,7 +1265,7 @@
-
+
@@ -1283,7 +1283,7 @@
-
+
@@ -1301,7 +1301,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36300-36399.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36300-36399.xml
index f15411962f..10fdcf788b 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36300-36399.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36300-36399.xml
@@ -48,7 +48,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
@@ -80,7 +80,7 @@
-
+
@@ -97,7 +97,7 @@
-
+
@@ -119,7 +119,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/37600-37699.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/37600-37699.xml
index ec6483f561..41e8be4507 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/37600-37699.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/37600-37699.xml
@@ -1395,7 +1395,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/38200-38299.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/38200-38299.xml
index d4caf4abd1..b3f2b11bf6 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/38200-38299.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/38200-38299.xml
@@ -359,7 +359,7 @@
-
+
@@ -376,7 +376,7 @@
-
+
@@ -393,7 +393,7 @@
-
+
@@ -410,7 +410,7 @@
-
+
@@ -427,7 +427,7 @@
-
+
@@ -444,7 +444,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/40000-40099.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/40000-40099.xml
index aedfc42d7d..5d1495a3d7 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/40000-40099.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/40000-40099.xml
@@ -870,7 +870,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/xsd/items.xsd b/L2J_Mobius_02.5_Underground/dist/game/data/xsd/items.xsd
index f3bfdc3cc8..328252c40f 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/xsd/items.xsd
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/xsd/items.xsd
@@ -90,7 +90,7 @@
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/libs/cron4j-2.2.5-sources.jar b/L2J_Mobius_02.5_Underground/dist/libs/cron4j-2.2.5-sources.jar
deleted file mode 100644
index 92e6ad0656..0000000000
Binary files a/L2J_Mobius_02.5_Underground/dist/libs/cron4j-2.2.5-sources.jar and /dev/null differ
diff --git a/L2J_Mobius_02.5_Underground/dist/libs/cron4j-2.2.5.jar b/L2J_Mobius_02.5_Underground/dist/libs/cron4j-2.2.5.jar
deleted file mode 100644
index fe30013168..0000000000
Binary files a/L2J_Mobius_02.5_Underground/dist/libs/cron4j-2.2.5.jar and /dev/null differ
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/GameServer.java
index 30820c00a1..4ceda120f3 100644
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/GameServer.java
@@ -70,7 +70,6 @@ import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData;
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
import org.l2jmobius.gameserver.data.xml.EnchantSkillGroupsData;
import org.l2jmobius.gameserver.data.xml.EnsoulData;
-import org.l2jmobius.gameserver.data.xml.EventEngineData;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.data.xml.FakePlayerData;
import org.l2jmobius.gameserver.data.xml.FenceData;
@@ -389,8 +388,6 @@ public class GameServer
SpawnData.getInstance().init();
DBSpawnManager.getInstance();
- printSection("Event Engine");
- EventEngineData.getInstance();
VoteSystem.initialize();
printSection("Siege");
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/Shutdown.java
index 9e0bc3126c..02419a263c 100644
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/Shutdown.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.CastleManorManager;
-import org.l2jmobius.gameserver.instancemanager.CeremonyOfChaosManager;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
@@ -452,8 +451,6 @@ public class Shutdown extends Thread
LOGGER.info("Item Auction Manager: All tasks stopped(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
Olympiad.getInstance().saveOlympiadStatus();
LOGGER.info("Olympiad System: Data saved(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
- CeremonyOfChaosManager.getInstance().stopScheduler();
- LOGGER.info("CeremonyOfChaosManager: Scheduler stopped(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
Hero.getInstance().shutdown();
LOGGER.info("Hero System: Data saved(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/data/xml/EventEngineData.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/data/xml/EventEngineData.java
deleted file mode 100644
index 29c1ceab09..0000000000
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/data/xml/EventEngineData.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.data.xml;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import org.l2jmobius.commons.util.IXmlReader;
-import org.l2jmobius.gameserver.model.Location;
-import org.l2jmobius.gameserver.model.StatSet;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.EventMethodNotification;
-import org.l2jmobius.gameserver.model.eventengine.EventScheduler;
-import org.l2jmobius.gameserver.model.eventengine.IConditionalEventScheduler;
-import org.l2jmobius.gameserver.model.eventengine.conditions.BetweenConditionalScheduler;
-import org.l2jmobius.gameserver.model.eventengine.conditions.HaventRunConditionalScheduler;
-import org.l2jmobius.gameserver.model.eventengine.drop.EventDropGroup;
-import org.l2jmobius.gameserver.model.eventengine.drop.EventDropItem;
-import org.l2jmobius.gameserver.model.eventengine.drop.EventDrops;
-import org.l2jmobius.gameserver.model.eventengine.drop.GroupedDrop;
-import org.l2jmobius.gameserver.model.eventengine.drop.IEventDrop;
-import org.l2jmobius.gameserver.model.eventengine.drop.NormalDrop;
-import org.l2jmobius.gameserver.model.holders.ItemHolder;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-
-/**
- * @author UnAfraid
- */
-public class EventEngineData implements IXmlReader
-{
- private static final Logger LOGGER = Logger.getLogger(EventEngineData.class.getName());
-
- protected EventEngineData()
- {
- load();
- }
-
- @Override
- public void load()
- {
- parseDatapackDirectory("data/events", true);
- }
-
- @Override
- public void parseDocument(Document doc, File f)
- {
- for (Node listNode = doc.getFirstChild(); listNode != null; listNode = listNode.getNextSibling())
- {
- if ("list".equals(listNode.getNodeName()))
- {
- for (Node eventNode = listNode.getFirstChild(); eventNode != null; eventNode = eventNode.getNextSibling())
- {
- if ("event".equals(eventNode.getNodeName()))
- {
- parseEvent(eventNode);
- }
- }
- }
- }
- }
-
- /**
- * @param eventNode
- */
- private void parseEvent(Node eventNode)
- {
- final String eventName = parseString(eventNode.getAttributes(), "name");
- final String className = parseString(eventNode.getAttributes(), "class");
- AbstractEventManager> eventManager = null;
- try
- {
- final Class> clazz = Class.forName(className);
-
- // Attempt to find getInstance() method
- for (Method method : clazz.getMethods())
- {
- if (Modifier.isStatic(method.getModifiers()) && AbstractEventManager.class.isAssignableFrom(method.getReturnType()) && (method.getParameterCount() == 0))
- {
- eventManager = (AbstractEventManager>) method.invoke(null);
- break;
- }
- }
-
- if (eventManager == null)
- {
- throw new NoSuchMethodError("Couldn't method that gives instance of AbstractEventManager!");
- }
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't locate event manager instance for event: " + eventName + " !", e);
- return;
- }
-
- for (Node innerNode = eventNode.getFirstChild(); innerNode != null; innerNode = innerNode.getNextSibling())
- {
- if ("variables".equals(innerNode.getNodeName()))
- {
- parseVariables(eventManager, innerNode);
- }
- else if ("scheduler".equals(innerNode.getNodeName()))
- {
- parseScheduler(eventManager, innerNode);
- }
- else if ("rewards".equals(innerNode.getNodeName()))
- {
- parseRewards(eventManager, innerNode);
- }
- }
-
- // Assign event name
- eventManager.setName(eventName);
-
- // Start the scheduler
- eventManager.startScheduler();
-
- // Start conditional schedulers
- eventManager.startConditionalSchedulers();
-
- // Notify the event manager that we've done initializing its stuff
- eventManager.onInitialized();
-
- LOGGER.info(getClass().getSimpleName() + ": " + eventManager.getClass().getSimpleName() + ": Initialized.");
- }
-
- /**
- * @param eventManager
- * @param innerNode
- */
- private void parseVariables(AbstractEventManager> eventManager, Node innerNode)
- {
- final StatSet variables = new StatSet(LinkedHashMap::new);
- for (Node variableNode = innerNode.getFirstChild(); variableNode != null; variableNode = variableNode.getNextSibling())
- {
- if ("variable".equals(variableNode.getNodeName()))
- {
- variables.set(parseString(variableNode.getAttributes(), "name"), parseString(variableNode.getAttributes(), "value"));
- }
- else if ("list".equals(variableNode.getNodeName()))
- {
- parseListVariables(eventManager, variables, variableNode);
- }
- else if ("map".equals(variableNode.getNodeName()))
- {
- parseMapVariables(eventManager, variables, variableNode);
- }
- }
- eventManager.setVariables(variables);
- }
-
- /**
- * @param eventManager
- * @param innerNode
- */
- private void parseScheduler(AbstractEventManager> eventManager, Node innerNode)
- {
- eventManager.stopScheduler();
- final Set schedulers = new LinkedHashSet<>();
- final Set conditionalSchedulers = new LinkedHashSet<>();
- for (Node scheduleNode = innerNode.getFirstChild(); scheduleNode != null; scheduleNode = scheduleNode.getNextSibling())
- {
- if ("schedule".equals(scheduleNode.getNodeName()))
- {
- final StatSet params = new StatSet(LinkedHashMap::new);
- final NamedNodeMap attrs = scheduleNode.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++)
- {
- final Node node = attrs.item(i);
- params.set(node.getNodeName(), node.getNodeValue());
- }
-
- final EventScheduler scheduler = new EventScheduler(eventManager, params);
- for (Node eventNode = scheduleNode.getFirstChild(); eventNode != null; eventNode = eventNode.getNextSibling())
- {
- if ("event".equals(eventNode.getNodeName()))
- {
- String methodName = parseString(eventNode.getAttributes(), "name");
- if (methodName.charAt(0) == '#')
- {
- methodName = methodName.substring(1);
- }
-
- final List args = new ArrayList<>();
- for (Node argsNode = eventNode.getFirstChild(); argsNode != null; argsNode = argsNode.getNextSibling())
- {
- if ("arg".equals(argsNode.getNodeName()))
- {
- final String type = parseString(argsNode.getAttributes(), "type");
- final Object value = parseObject(eventManager, type, argsNode.getTextContent());
- if (value != null)
- {
- args.add(value);
- }
- }
- }
-
- try
- {
- scheduler.addEventNotification(new EventMethodNotification(eventManager, methodName, args));
- }
- catch (Exception e)
- {
- LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't add event notification for " + eventManager.getClass().getSimpleName(), e);
- }
- }
- }
- schedulers.add(scheduler);
- }
- else if ("conditionalSchedule".equals(scheduleNode.getNodeName()))
- {
- final StatSet params = new StatSet(LinkedHashMap::new);
- final NamedNodeMap attrs = scheduleNode.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++)
- {
- final Node node = attrs.item(i);
- params.set(node.getNodeName(), node.getNodeValue());
- }
-
- for (Node eventNode = scheduleNode.getFirstChild(); eventNode != null; eventNode = eventNode.getNextSibling())
- {
- if ("run".equals(eventNode.getNodeName()))
- {
- final String name = parseString(eventNode.getAttributes(), "name");
- final String ifType = parseString(eventNode.getAttributes(), "if", "BETWEEN").toUpperCase();
- switch (ifType)
- {
- case "BETWEEN":
- {
- final List names = new ArrayList<>(2);
- for (Node innerData = eventNode.getFirstChild(); innerData != null; innerData = innerData.getNextSibling())
- {
- if ("name".equals(innerData.getNodeName()))
- {
- names.add(innerData.getTextContent());
- }
- }
- if (names.size() != 2)
- {
- LOGGER.warning(getClass().getSimpleName() + ": Event: " + eventManager.getClass().getSimpleName() + " has incorrect amount of scheduler names: " + names + " expected: 2 found: " + names.size());
- }
- else
- {
- conditionalSchedulers.add(new BetweenConditionalScheduler(eventManager, name, names.get(0), names.get(1)));
- }
- break;
- }
- case "HASNT_RUN":
- {
- conditionalSchedulers.add(new HaventRunConditionalScheduler(eventManager, name));
- break;
- }
- }
- }
- }
- }
- }
- eventManager.setSchedulers(schedulers);
- eventManager.setConditionalSchedulers(conditionalSchedulers);
- }
-
- /**
- * @param eventManager
- * @param innerNode
- */
- private void parseRewards(AbstractEventManager> eventManager, Node innerNode)
- {
- final Map rewards = new LinkedHashMap<>();
- forEach(innerNode, IXmlReader::isNode, rewardsNode ->
- {
- if ("reward".equalsIgnoreCase(rewardsNode.getNodeName()))
- {
- final String name = parseString(rewardsNode.getAttributes(), "name");
- final EventDrops dropType = parseEnum(rewardsNode.getAttributes(), EventDrops.class, "type");
- switch (dropType)
- {
- case GROUPED:
- {
- final GroupedDrop droplist = dropType.newInstance();
- forEach(rewardsNode, "group", groupsNode ->
- {
- final EventDropGroup group = new EventDropGroup(parseDouble(groupsNode.getAttributes(), "chance"));
- forEach(groupsNode, "item", itemNode ->
- {
- final NamedNodeMap attrs = itemNode.getAttributes();
- final int id = parseInteger(attrs, "id");
- final int min = parseInteger(attrs, "min");
- final int max = parseInteger(attrs, "max");
- final double chance = parseDouble(attrs, "chance");
- group.addItem(new EventDropItem(id, min, max, chance));
- });
- });
- rewards.put(name, droplist);
- break;
- }
- case NORMAL:
- {
- final NormalDrop droplist = dropType.newInstance();
- forEach(rewardsNode, "item", itemNode ->
- {
- final NamedNodeMap attrs = itemNode.getAttributes();
- final int id = parseInteger(attrs, "id");
- final int min = parseInteger(attrs, "min");
- final int max = parseInteger(attrs, "max");
- final double chance = parseDouble(attrs, "chance");
- droplist.addItem(new EventDropItem(id, min, max, chance));
- });
- rewards.put(name, droplist);
- break;
- }
- }
- }
- });
- eventManager.setRewards(rewards);
- }
-
- /**
- * @param eventManager
- * @param variables
- * @param variableNode
- */
- @SuppressWarnings("unchecked")
- private void parseListVariables(AbstractEventManager> eventManager, StatSet variables, Node variableNode)
- {
- final String name = parseString(variableNode.getAttributes(), "name");
- final String type = parseString(variableNode.getAttributes(), "type");
- final Class> classType = getClassByName(eventManager, type);
- final List> values = newList(classType);
- switch (type)
- {
- case "Byte":
- case "Short":
- case "Integer":
- case "Float":
- case "Long":
- case "Double":
- case "String":
- {
- for (Node stringNode = variableNode.getFirstChild(); stringNode != null; stringNode = stringNode.getNextSibling())
- {
- if ("value".equals(stringNode.getNodeName()))
- {
- ((List) values).add(parseObject(eventManager, type, stringNode.getTextContent()));
- }
- }
- break;
- }
- case "ItemHolder":
- {
- for (Node stringNode = variableNode.getFirstChild(); stringNode != null; stringNode = stringNode.getNextSibling())
- {
- if ("item".equals(stringNode.getNodeName()))
- {
- ((List) values).add(new ItemHolder(parseInteger(stringNode.getAttributes(), "id"), parseLong(stringNode.getAttributes(), "count", 1L)));
- }
- }
- break;
- }
- case "SkillHolder":
- {
- for (Node stringNode = variableNode.getFirstChild(); stringNode != null; stringNode = stringNode.getNextSibling())
- {
- if ("skill".equals(stringNode.getNodeName()))
- {
- ((List) values).add(new SkillHolder(parseInteger(stringNode.getAttributes(), "id"), parseInteger(stringNode.getAttributes(), "level", 1)));
- }
- }
- break;
- }
- case "Location":
- {
- for (Node stringNode = variableNode.getFirstChild(); stringNode != null; stringNode = stringNode.getNextSibling())
- {
- if ("location".equals(stringNode.getNodeName()))
- {
- ((List) values).add(new Location(parseInteger(stringNode.getAttributes(), "x"), parseInteger(stringNode.getAttributes(), "y"), parseInteger(stringNode.getAttributes(), "z", parseInteger(stringNode.getAttributes(), "heading", 0))));
- }
- }
- break;
- }
- default:
- {
- LOGGER.info(getClass().getSimpleName() + ": Unhandled list case: " + type + " for event: " + eventManager.getClass().getSimpleName());
- break;
- }
- }
- variables.set(name, values);
- }
-
- /**
- * @param eventManager
- * @param variables
- * @param variableNode
- */
- @SuppressWarnings("unchecked")
- private void parseMapVariables(AbstractEventManager> eventManager, StatSet variables, Node variableNode)
- {
- final String name = parseString(variableNode.getAttributes(), "name");
- final String keyType = parseString(variableNode.getAttributes(), "keyType");
- final String valueType = parseString(variableNode.getAttributes(), "valueType");
- final Class> keyClass = getClassByName(eventManager, keyType);
- final Class> valueClass = getClassByName(eventManager, valueType);
- final Map, ?> map = newMap(keyClass, valueClass);
- forEach(variableNode, IXmlReader::isNode, stringNode ->
- {
- switch (stringNode.getNodeName())
- {
- case "entry":
- {
- final NamedNodeMap attrs = stringNode.getAttributes();
- ((Map) map).put(parseObject(eventManager, keyType, parseString(attrs, "key")), parseObject(eventManager, valueType, parseString(attrs, "value")));
- break;
- }
- case "item":
- {
- final NamedNodeMap attrs = stringNode.getAttributes();
- ((Map) map).put(parseObject(eventManager, keyType, parseString(attrs, "key")), new ItemHolder(parseInteger(stringNode.getAttributes(), "id"), parseLong(stringNode.getAttributes(), "count")));
- break;
- }
- case "skill":
- {
- final NamedNodeMap attrs = stringNode.getAttributes();
- ((Map) map).put(parseObject(eventManager, keyType, parseString(attrs, "key")), new SkillHolder(parseInteger(stringNode.getAttributes(), "id"), parseInteger(stringNode.getAttributes(), "level")));
- break;
- }
- case "location":
- {
- final NamedNodeMap attrs = stringNode.getAttributes();
- ((Map) map).put(parseObject(eventManager, keyType, parseString(attrs, "key")), new Location(parseInteger(stringNode.getAttributes(), "x"), parseInteger(stringNode.getAttributes(), "y"), parseInteger(stringNode.getAttributes(), "z", parseInteger(stringNode.getAttributes(), "heading", 0))));
- break;
- }
- default:
- {
- LOGGER.warning(getClass().getSimpleName() + ": Unhandled map case: " + name + " " + stringNode.getNodeName() + " for event: " + eventManager.getClass().getSimpleName());
- }
- }
- });
- variables.set(name, map);
- }
-
- private Class> getClassByName(AbstractEventManager> eventManager, String name)
- {
- switch (name)
- {
- case "Byte":
- {
- return Byte.class;
- }
- case "Short":
- {
- return Short.class;
- }
- case "Integer":
- {
- return Integer.class;
- }
- case "Float":
- {
- return Float.class;
- }
- case "Long":
- {
- return Long.class;
- }
- case "Double":
- {
- return Double.class;
- }
- case "String":
- {
- return String.class;
- }
- case "ItemHolder":
- {
- return ItemHolder.class;
- }
- case "SkillHolder":
- {
- return SkillHolder.class;
- }
- case "Location":
- {
- return Location.class;
- }
- default:
- {
- LOGGER.warning(getClass().getSimpleName() + ": Unhandled class case: " + name + " for event: " + eventManager.getClass().getSimpleName());
- return Object.class;
- }
- }
- }
-
- private Object parseObject(AbstractEventManager> eventManager, String type, String value)
- {
- switch (type)
- {
- case "Byte":
- {
- return Byte.decode(value);
- }
- case "Short":
- {
- return Short.decode(value);
- }
- case "Integer":
- {
- return Integer.decode(value);
- }
- case "Float":
- {
- return Float.parseFloat(value);
- }
- case "Long":
- {
- return Long.decode(value);
- }
- case "Double":
- {
- return Double.parseDouble(value);
- }
- case "String":
- {
- return value;
- }
- default:
- {
- LOGGER.warning(getClass().getSimpleName() + ": Unhandled object case: " + type + " for event: " + eventManager.getClass().getSimpleName());
- return null;
- }
- }
- }
-
- private static List newList(Class type)
- {
- return new ArrayList<>();
- }
-
- private static Map newMap(Class keyClass, Class valueClass)
- {
- return new LinkedHashMap<>();
- }
-
- /**
- * Gets the single instance of EventEngineData.
- * @return single instance of EventEngineData
- */
- public static EventEngineData getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
- private static class SingletonHolder
- {
- protected static final EventEngineData INSTANCE = new EventEngineData();
- }
-}
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/enums/CeremonyOfChaosState.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/enums/CeremonyOfChaosState.java
deleted file mode 100644
index cfa14a8f1c..0000000000
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/enums/CeremonyOfChaosState.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.enums;
-
-import org.l2jmobius.gameserver.model.eventengine.IEventState;
-
-/**
- * @author Sdw
- */
-public enum CeremonyOfChaosState implements IEventState
-{
- SCHEDULED,
- REGISTRATION,
- PREPARING_FOR_TELEPORT,
- PREPARING_FOR_FIGHT,
- RUNNING
-}
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CeremonyOfChaosManager.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CeremonyOfChaosManager.java
deleted file mode 100644
index 21e1b9fe11..0000000000
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CeremonyOfChaosManager.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package org.l2jmobius.gameserver.instancemanager;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.util.Comparator;
-import java.util.List;
-import java.util.logging.Logger;
-import java.util.stream.Collectors;
-
-import org.l2jmobius.commons.database.DatabaseFactory;
-import org.l2jmobius.commons.util.Rnd;
-import org.l2jmobius.gameserver.enums.CategoryType;
-import org.l2jmobius.gameserver.enums.CeremonyOfChaosState;
-import org.l2jmobius.gameserver.model.StatSet;
-import org.l2jmobius.gameserver.model.World;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
-import org.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosMember;
-import org.l2jmobius.gameserver.model.clan.Clan;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.ScheduleTarget;
-import org.l2jmobius.gameserver.model.events.EventType;
-import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
-import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
-import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerBypass;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
-import org.l2jmobius.gameserver.model.events.returns.TerminateReturn;
-import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
-import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
-import org.l2jmobius.gameserver.model.punishment.PunishmentType;
-import org.l2jmobius.gameserver.model.variables.PlayerVariables;
-import org.l2jmobius.gameserver.model.zone.ZoneId;
-import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import org.l2jmobius.gameserver.network.serverpackets.ceremonyofchaos.ExCuriousHouseState;
-
-/**
- * @author Sdw
- */
-public class CeremonyOfChaosManager extends AbstractEventManager
-{
- protected static final Logger LOGGER = Logger.getLogger(CeremonyOfChaosManager.class.getName());
-
- public static final String INITIAL_BUFF_KEY = "initial_buff";
- public static final String INITIAL_ITEMS_KEY = "initial_items";
- public static final String MAX_PLAYERS_KEY = "max_players";
- public static final String MAX_ARENAS_KEY = "max_arenas";
- public static final String INSTANCE_TEMPLATES_KEY = "instance_templates";
- public static final String END_BUFFS_KEYH = "end_buffs";
-
- protected CeremonyOfChaosManager()
- {
- }
-
- @Override
- public void onInitialized()
- {
- if (getState() == null)
- {
- setState(CeremonyOfChaosState.SCHEDULED);
- }
- }
-
- @ScheduleTarget
- private void onPeriodEnd(String text)
- {
- // Set monthly true hero.
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TRUE_HERO, GlobalVariablesManager.getInstance().getInt(GlobalVariablesManager.COC_TOP_MEMBER, 0));
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TRUE_HERO_REWARDED, false);
- // Reset monthly winner.
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TOP_MARKS, 0);
- GlobalVariablesManager.getInstance().set(GlobalVariablesManager.COC_TOP_MEMBER, 0);
-
- try (Connection con = DatabaseFactory.getConnection();
- PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
- {
- ps.setString(1, PlayerVariables.CEREMONY_OF_CHAOS_MARKS);
- ps.execute();
- }
- catch (Exception e)
- {
- LOGGER.severe(getClass().getSimpleName() + ": Could not reset Ceremony Of Chaos victories: " + e);
- }
-
- try (Connection con = DatabaseFactory.getConnection();
- PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
- {
- ps.setString(1, PlayerVariables.CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES);
- ps.execute();
- }
- catch (Exception e)
- {
- LOGGER.severe(getClass().getSimpleName() + ": Could not reset Ceremony Of Chaos penalties: " + e);
- }
-
- // Update data for online players.
- for (PlayerInstance player : World.getInstance().getPlayers())
- {
- player.getVariables().remove(PlayerVariables.CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES);
- player.getVariables().remove(PlayerVariables.CEREMONY_OF_CHAOS_MARKS);
- player.getVariables().storeMe();
- }
-
- LOGGER.info(getClass().getSimpleName() + ": Ceremony of Chaos variables have been reset.");
- LOGGER.info(getClass().getSimpleName() + ": Ceremony of Chaos period has ended!");
- }
-
- @ScheduleTarget
- private void onEventStart()
- {
- LOGGER.info(getClass().getSimpleName() + ": Ceremony of Chaos event has started!");
- }
-
- @ScheduleTarget
- private void onEventEnd()
- {
- PunishmentManager.getInstance().stopPunishment(PunishmentAffect.CHARACTER, PunishmentType.COC_BAN);
- LOGGER.info(getClass().getSimpleName() + ": Ceremony of Chaos event has ended!");
- }
-
- @ScheduleTarget
- private void onRegistrationStart()
- {
- if (getState() != CeremonyOfChaosState.SCHEDULED)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.REGISTRATION);
- for (PlayerInstance player : World.getInstance().getPlayers())
- {
- if (player.isOnline())
- {
- player.sendPacket(SystemMessageId.REGISTRATION_FOR_THE_CEREMONY_OF_CHAOS_HAS_BEGUN);
- if (canRegister(player, false))
- {
- player.sendPacket(ExCuriousHouseState.REGISTRATION_PACKET);
- }
- }
- }
- }
-
- @ScheduleTarget
- private void onRegistrationEnd()
- {
- if (getState() != CeremonyOfChaosState.REGISTRATION)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.PREPARING_FOR_TELEPORT);
- for (PlayerInstance player : World.getInstance().getPlayers())
- {
- if (player.isOnline())
- {
- player.sendPacket(SystemMessageId.REGISTRATION_FOR_THE_CEREMONY_OF_CHAOS_HAS_ENDED);
- if (!isRegistered(player))
- {
- player.sendPacket(ExCuriousHouseState.IDLE_PACKET);
- }
- }
- }
- final StatSet params = new StatSet();
- params.set("time", 60);
- getTimers().addTimer("count_down", params, 60 * 1000, null, null);
- }
-
- @ScheduleTarget
- private void onPrepareForFight()
- {
- if (getState() != CeremonyOfChaosState.PREPARING_FOR_TELEPORT)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.PREPARING_FOR_FIGHT);
- int eventId = 0;
- int position = 1;
- CeremonyOfChaosEvent event = null;
- final List players = getRegisteredPlayers().stream().sorted(Comparator.comparingInt(PlayerInstance::getLevel)).collect(Collectors.toList());
- final int maxPlayers = getMaxPlayersInArena();
- final List templates = getVariables().getList(INSTANCE_TEMPLATES_KEY, Integer.class);
- for (PlayerInstance player : players)
- {
- if (player.isOnline() && canRegister(player, true))
- {
- if ((event == null) || (event.getMembers().size() >= maxPlayers))
- {
- final int template = templates.get(Rnd.get(templates.size()));
- event = new CeremonyOfChaosEvent(eventId++, InstanceManager.getInstance().getInstanceTemplate(template));
- position = 1;
- getEvents().add(event);
- }
-
- event.addMember(new CeremonyOfChaosMember(player, event, position++));
- }
- else
- {
- player.prohibiteCeremonyOfChaos();
- player.sendPacket(ExCuriousHouseState.IDLE_PACKET);
- }
- }
-
- // Clear previously registrated players
- getRegisteredPlayers().clear();
-
- // Prepare all event's players for start
- getEvents().forEach(CeremonyOfChaosEvent::preparePlayers);
- }
-
- @ScheduleTarget
- private void onStartFight()
- {
- if (getState() != CeremonyOfChaosState.PREPARING_FOR_FIGHT)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.RUNNING);
- getEvents().forEach(CeremonyOfChaosEvent::startFight);
- }
-
- @ScheduleTarget
- private void onEndFight()
- {
- if (getState() != CeremonyOfChaosState.RUNNING)
- {
- return;
- }
-
- setState(CeremonyOfChaosState.SCHEDULED);
- getEvents().forEach(CeremonyOfChaosEvent::stopFight);
- getEvents().clear();
- }
-
- @Override
- public void onTimerEvent(String event, StatSet params, Npc npc, PlayerInstance player)
- {
- switch (event)
- {
- case "count_down":
- {
- final int time = params.getInt("time", 0);
- final SystemMessage countdown = new SystemMessage(SystemMessageId.YOU_WILL_BE_MOVED_TO_THE_ARENA_IN_S1_SECOND_S);
- countdown.addByte(time);
- broadcastPacket(countdown);
-
- // Reschedule
- if (time == 60)
- {
- params.set("time", 10);
- getTimers().addTimer(event, params, 50 * 1000, null, null);
- }
- else if (time == 10)
- {
- params.set("time", 5);
- getTimers().addTimer(event, params, 5 * 1000, null, null);
- }
- else if ((time > 1) && (time <= 5))
- {
- params.set("time", time - 1);
- getTimers().addTimer(event, params, 1000, null, null);
- }
- break;
- }
- }
- }
-
- public void broadcastPacket(IClientOutgoingPacket... packets)
- {
- getRegisteredPlayers().forEach(member -> member.sendPacket(packets));
- }
-
- @Override
- public boolean canRegister(PlayerInstance player, boolean sendMessage)
- {
- boolean canRegister = true;
-
- final Clan clan = player.getClan();
- SystemMessageId sm = null;
- if (player.getLevel() < 85)
- {
- sm = SystemMessageId.ONLY_CHARACTERS_LEVEL_85_OR_ABOVE_MAY_PARTICIPATE_IN_THE_TOURNAMENT;
- canRegister = false;
- }
- else if (player.isFlyingMounted())
- {
- sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_AS_A_FLYING_TRANSFORMED_OBJECT;
- canRegister = false;
- }
- else if (!player.isInCategory(CategoryType.SIXTH_CLASS_GROUP))
- {
- sm = SystemMessageId.ONLY_CHARACTERS_WHO_HAVE_COMPLETED_THE_3RD_CLASS_TRANSFER_MAY_PARTICIPATE;
- canRegister = false;
- }
- else if (!player.isInventoryUnder80(false) || (player.getWeightPenalty() != 0))
- {
- sm = SystemMessageId.UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY;
- canRegister = false;
- }
- else if ((clan == null) || (clan.getLevel() < 6))
- {
- sm = SystemMessageId.ONLY_CHARACTERS_WHO_ARE_A_PART_OF_A_CLAN_OF_LEVEL_6_OR_ABOVE_MAY_PARTICIPATE;
- canRegister = false;
- }
- else if (getRegisteredPlayers().size() >= (getVariables().getInt(MAX_ARENAS_KEY, 5) * getMaxPlayersInArena()))
- {
- sm = SystemMessageId.THERE_ARE_TOO_MANY_CHALLENGERS_YOU_CANNOT_PARTICIPATE_NOW;
- canRegister = false;
- }
- else if (player.isCursedWeaponEquipped() || (player.getReputation() < 0))
- {
- sm = SystemMessageId.WAITING_LIST_REGISTRATION_IS_NOT_ALLOWED_WHILE_THE_CURSED_SWORD_IS_BEING_USED_OR_THE_STATUS_IS_IN_A_CHAOTIC_STATE;
- canRegister = false;
- }
- else if (player.isInDuel())
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_IN_THE_WAITING_LIST_DURING_A_DUEL;
- canRegister = false;
- }
- else if (player.isInOlympiadMode() || OlympiadManager.getInstance().isRegistered(player))
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_IN_THE_WAITING_LIST_WHILE_PARTICIPATING_IN_OLYMPIAD;
- canRegister = false;
- }
- else if (player.isOnEvent(CeremonyOfChaosEvent.class) || (player.getBlockCheckerArena() > -1)) // TODO underground coliseum and kratei checks.
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_FOR_THE_WAITING_LIST_WHILE_PARTICIPATING_IN_THE_BLOCK_CHECKER_COLISEUM_OLYMPIAD_KRATEI_S_CUBE_CEREMONY_OF_CHAOS;
- canRegister = false;
- }
- else if (player.isInInstance())
- {
- sm = SystemMessageId.YOU_MAY_NOT_REGISTER_WHILE_USING_THE_INSTANT_ZONE;
- canRegister = false;
- }
- else if (player.isInSiege())
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_FOR_THE_WAITING_LIST_ON_THE_BATTLEFIELD_CASTLE_SIEGE_FORTRESS_SIEGE;
- canRegister = false;
- }
- else if (player.isInsideZone(ZoneId.SIEGE))
- {
- sm = SystemMessageId.YOU_CANNOT_REGISTER_IN_THE_WAITING_LIST_WHILE_BEING_INSIDE_OF_A_BATTLEGROUND_CASTLE_SIEGE_FORTRESS_SIEGE;
- canRegister = false;
- }
- else if (player.isFlyingMounted())
- {
- sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_AS_A_FLYING_TRANSFORMED_OBJECT;
- canRegister = false;
- }
- else if (player.isFishing())
- {
- sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_WHILE_FISHING;
- canRegister = false;
- }
- else if (player.isCeremonyOfChaosProhibited())
- {
- canRegister = false;
- }
-
- // TODO : One player can take part in 16 matches per day.
- if ((sm != null) && sendMessage)
- {
- player.sendPacket(sm);
- }
-
- return canRegister;
- }
-
- @RegisterEvent(EventType.ON_PLAYER_BYPASS)
- @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
- public TerminateReturn OnPlayerBypass(OnPlayerBypass event)
- {
- final PlayerInstance player = event.getPlayer();
- if (player == null)
- {
- return null;
- }
-
- if (event.getCommand().equalsIgnoreCase("pledgegame?command=apply"))
- {
- if (registerPlayer(player))
- {
- player.sendPacket(SystemMessageId.YOU_ARE_NOW_ON_THE_WAITING_LIST_YOU_WILL_AUTOMATICALLY_BE_TELEPORTED_WHEN_THE_TOURNAMENT_STARTS_AND_WILL_BE_REMOVED_FROM_THE_WAITING_LIST_IF_YOU_LOG_OUT_IF_YOU_CANCEL_REGISTRATION_WITHIN_THE_LAST_MINUTE_OF_ENTERING_THE_ARENA_AFTER_SIGNING_UP_30_TIMES_OR_MORE_OR_FORFEIT_AFTER_ENTERING_THE_ARENA_30_TIMES_OR_MORE_DURING_A_CYCLE_YOU_BECOME_INELIGIBLE_FOR_PARTICIPATION_IN_THE_CEREMONY_OF_CHAOS_UNTIL_THE_NEXT_CYCLE_ALL_THE_BUFFS_EXCEPT_THE_VITALITY_BUFF_WILL_BE_REMOVED_ONCE_YOU_ENTER_THE_ARENAS);
- player.sendPacket(SystemMessageId.EXCEPT_THE_VITALITY_BUFF_ALL_BUFFS_INCLUDING_ART_OF_SEDUCTION_WILL_BE_DELETED);
- player.sendPacket(ExCuriousHouseState.PREPARE_PACKET);
- }
- return new TerminateReturn(true, false, false);
- }
- return null;
- }
-
- @RegisterEvent(EventType.ON_PLAYER_LOGIN)
- @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
- public void OnPlayerLogin(OnPlayerLogin event)
- {
- if (getState() == CeremonyOfChaosState.REGISTRATION)
- {
- final PlayerInstance player = event.getPlayer();
- if (canRegister(player, false))
- {
- player.sendPacket(ExCuriousHouseState.REGISTRATION_PACKET);
- }
- }
- }
-
- @Override
- @RegisterEvent(EventType.ON_PLAYER_LOGOUT)
- @RegisterType(ListenerRegisterType.GLOBAL)
- public void OnPlayerLogout(OnPlayerLogout event)
- {
- if (getState() == CeremonyOfChaosState.REGISTRATION)
- {
- final PlayerInstance player = event.getPlayer();
- if (getRegisteredPlayers().contains(player))
- {
- getRegisteredPlayers().remove(player);
- }
- }
- }
-
- // player leave clan
-
- public int getMaxPlayersInArena()
- {
- return getVariables().getInt(MAX_PLAYERS_KEY, 18);
- }
-
- public static CeremonyOfChaosManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
- private static class SingletonHolder
- {
- protected static final CeremonyOfChaosManager INSTANCE = new CeremonyOfChaosManager();
- }
-}
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java
index 380d97e557..0c3214c9a3 100644
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java
+++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java
@@ -16,56 +16,77 @@
*/
package org.l2jmobius.gameserver.instancemanager;
+import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
+import org.l2jmobius.commons.threads.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.model.clan.Clan;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
-import org.l2jmobius.gameserver.model.eventengine.AbstractEventManager;
-import org.l2jmobius.gameserver.model.eventengine.ScheduleTarget;
import org.l2jmobius.gameserver.model.residences.ClanHallAuction;
/**
* @author Sdw
*/
-public class ClanHallAuctionManager extends AbstractEventManager>
+public class ClanHallAuctionManager
{
private static final Logger LOGGER = Logger.getLogger(ClanHallAuctionManager.class.getName());
private static final Map AUCTIONS = new HashMap<>();
+ private static ScheduledFuture> _endTask;
protected ClanHallAuctionManager()
{
+ // Schedule of the start, next Wednesday at 19:00.
+ final Calendar start = Calendar.getInstance();
+ if ((start.get(Calendar.DAY_OF_WEEK) >= Calendar.WEDNESDAY))
+ {
+ start.add(Calendar.DAY_OF_YEAR, 7);
+ }
+ start.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);
+ start.set(Calendar.HOUR_OF_DAY, 19);
+ start.set(Calendar.MINUTE, 0);
+ start.set(Calendar.SECOND, 0);
+ final long startDelay = Math.max(0, start.getTimeInMillis() - Chronos.currentTimeMillis());
+ ThreadPool.scheduleAtFixedRate(() -> onStart(), startDelay, 604800000); // 604800000 = 1 week
+ if (startDelay > 0)
+ {
+ onStart();
+ }
+
+ // Schedule of the end, next Wednesday at 11:00.
+ final Calendar end = Calendar.getInstance();
+ if ((end.get(Calendar.DAY_OF_WEEK) >= Calendar.WEDNESDAY))
+ {
+ end.add(Calendar.DAY_OF_YEAR, 7);
+ }
+ end.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);
+ end.set(Calendar.HOUR_OF_DAY, 11);
+ end.set(Calendar.MINUTE, 0);
+ end.set(Calendar.SECOND, 0);
+ final long endDelay = Math.max(0, end.getTimeInMillis() - Chronos.currentTimeMillis());
+ _endTask = ThreadPool.scheduleAtFixedRate(() -> onEnd(), endDelay, 604800000); // 604800000 = 1 week
}
- @ScheduleTarget
- private void onEventStart()
+ private void onStart()
{
LOGGER.info(getClass().getSimpleName() + ": Clan Hall Auction has started!");
AUCTIONS.clear();
-
- //@formatter:off
- ClanHallData.getInstance().getFreeAuctionableHall()
- .forEach(c -> AUCTIONS.put(c.getResidenceId(), new ClanHallAuction(c.getResidenceId())));
- //@formatter:on
+ ClanHallData.getInstance().getFreeAuctionableHall().forEach(c -> AUCTIONS.put(c.getResidenceId(), new ClanHallAuction(c.getResidenceId())));
}
- @ScheduleTarget
- private void onEventEnd()
+ private void onEnd()
{
AUCTIONS.values().forEach(ClanHallAuction::finalizeAuctions);
AUCTIONS.clear();
LOGGER.info(getClass().getSimpleName() + ": Clan Hall Auction has ended!");
}
- @Override
- public void onInitialized()
- {
- }
-
public ClanHallAuction getClanHallAuctionById(int clanHallId)
{
return AUCTIONS.get(clanHallId);
@@ -95,6 +116,11 @@ public class ClanHallAuctionManager extends AbstractEventManager>
+public class DailyTaskManager
{
private static final Logger LOGGER = Logger.getLogger(DailyTaskManager.class.getName());
+ private final static int[] RESET_SKILLS =
+ {
+ 2510, // Wondrous Cubic
+ 22180, // Wondrous Cubic - 1 time use
+ };
+
protected DailyTaskManager()
{
+ // Schedule reset everyday at 6:30.
+ final Calendar calendar = Calendar.getInstance();
+ if ((calendar.get(Calendar.HOUR_OF_DAY) > 6) && (calendar.get(Calendar.MINUTE) > 30))
+ {
+ calendar.add(Calendar.DAY_OF_YEAR, 1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 6);
+ calendar.set(Calendar.MINUTE, 30);
+ calendar.set(Calendar.SECOND, 0);
+ final long startDelay = Math.max(0, calendar.getTimeInMillis() - Chronos.currentTimeMillis());
+ ThreadPool.scheduleAtFixedRate(() -> onReset(), startDelay, 86400000); // 86400000 = 1 day
+
+ // Global save task.
+ ThreadPool.scheduleAtFixedRate(() -> onSave(), 1800000, 1800000); // 1800000 = 30 minutes
}
- @Override
- public void onInitialized()
- {
- }
-
- @ScheduleTarget
private void onReset()
{
+ if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY)
+ {
+ clanLeaderApply();
+ resetVitalityWeekly();
+ }
+ else
+ {
+ resetVitalityDaily();
+ }
+
resetClanBonus();
- resetDailyMissionRewards();
resetDailySkills();
- resetRecommends();
resetWorldChatPoints();
+ resetRecommends();
resetTrainingCamp();
- onResetAttendanceRewards();
+ resetDailyMissionRewards();
+ resetAttendanceRewards();
}
- @ScheduleTarget
private void onSave()
{
GlobalVariablesManager.getInstance().storeMe();
@@ -83,8 +103,7 @@ public class DailyTaskManager extends AbstractEventManager>
}
}
- @ScheduleTarget
- private void onClanLeaderApply()
+ private void clanLeaderApply()
{
for (Clan clan : ClanTable.getInstance().getClans())
{
@@ -102,8 +121,49 @@ public class DailyTaskManager extends AbstractEventManager>
LOGGER.info("Clan leaders has been updated.");
}
- @ScheduleTarget
- private void onVitalityReset()
+ private void resetVitalityDaily()
+ {
+ if (!Config.ENABLE_VITALITY)
+ {
+ return;
+ }
+
+ int vitality = PlayerStat.MAX_VITALITY_POINTS / 4;
+ for (PlayerInstance player : World.getInstance().getPlayers())
+ {
+ final int VP = player.getVitalityPoints();
+ player.setVitalityPoints(VP + vitality, false);
+ for (SubClassHolder subclass : player.getSubClasses().values())
+ {
+ final int VPS = subclass.getVitalityPoints();
+ subclass.setVitalityPoints(VPS + vitality);
+ }
+ }
+
+ try (Connection con = DatabaseFactory.getConnection())
+ {
+ try (PreparedStatement st = con.prepareStatement("UPDATE character_subclasses SET vitality_points = IF(vitality_points = ?, vitality_points, vitality_points + ?)"))
+ {
+ st.setInt(1, PlayerStat.MAX_VITALITY_POINTS);
+ st.setInt(2, PlayerStat.MAX_VITALITY_POINTS / 4);
+ st.execute();
+ }
+
+ try (PreparedStatement st = con.prepareStatement("UPDATE characters SET vitality_points = IF(vitality_points = ?, vitality_points, vitality_points + ?)"))
+ {
+ st.setInt(1, PlayerStat.MAX_VITALITY_POINTS);
+ st.setInt(2, PlayerStat.MAX_VITALITY_POINTS / 4);
+ st.execute();
+ }
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Error while updating vitality", e);
+ }
+ LOGGER.info("Daily Vitality Added");
+ }
+
+ private void resetVitalityWeekly()
{
if (!Config.ENABLE_VITALITY)
{
@@ -150,12 +210,11 @@ public class DailyTaskManager extends AbstractEventManager>
{
try (Connection con = DatabaseFactory.getConnection())
{
- final List dailySkills = getVariables().getList("reset_skills", SkillHolder.class, Collections.emptyList());
- for (SkillHolder skill : dailySkills)
+ for (int skill : RESET_SKILLS)
{
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
{
- ps.setInt(1, skill.getSkillId());
+ ps.setInt(1, skill);
ps.execute();
}
}
@@ -260,7 +319,7 @@ public class DailyTaskManager extends AbstractEventManager