Removal of cron4j and event abstractions.
This commit is contained in:
@@ -95,7 +95,7 @@ public class Warpgate extends AbstractNpcAI
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final PlayerInstance player = creature.getActingPlayer();
|
||||
if (!canEnter(player) && !player.canOverrideCond(PlayerCondOverride.ZONE_CONDITIONS) && !player.isOnCustomEvent())
|
||||
if (!canEnter(player) && !player.canOverrideCond(PlayerCondOverride.ZONE_CONDITIONS) && !player.isOnEvent())
|
||||
{
|
||||
startQuestTimer("TELEPORT", 1000, null, player);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Observation implements IBypassHandler
|
||||
player.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_SIEGE_WITH_A_PET_OR_SERVITOR_SUMMONED);
|
||||
return false;
|
||||
}
|
||||
if (player.isRegisteredOnCustomEvent())
|
||||
if (player.isRegisteredOnEvent())
|
||||
{
|
||||
player.sendMessage("Cannot use while registered on an event");
|
||||
return false;
|
||||
|
||||
@@ -81,7 +81,7 @@ public class OlympiadObservation implements IBypassHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.isRegisteredOnCustomEvent())
|
||||
if (player.isRegisteredOnEvent())
|
||||
{
|
||||
player.sendMessage("You can not observe games while registered on an event.");
|
||||
return false;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class HomeBoard implements IParseBoardHandler
|
||||
break;
|
||||
}
|
||||
}
|
||||
return commandCheck && (player.isCastingNow() || player.isCastingSimultaneouslyNow() || player.isInCombat() || player.isInDuel() || player.isInOlympiadMode() || player.isInsideZone(ZoneId.SIEGE) || player.isInsideZone(ZoneId.PVP) || (player.getPvpFlag() > 0) || player.isAlikeDead() || player.isOnCustomEvent());
|
||||
return commandCheck && (player.isCastingNow() || player.isCastingSimultaneouslyNow() || player.isInCombat() || player.isInDuel() || player.isInOlympiadMode() || player.isInsideZone(ZoneId.SIEGE) || player.isInsideZone(ZoneId.PVP) || (player.getPvpFlag() > 0) || player.isAlikeDead() || player.isOnEvent());
|
||||
};
|
||||
|
||||
private static final Predicate<PlayerInstance> KARMA_CHECK = player -> Config.COMMUNITYBOARD_KARMA_DISABLED && (player.getKarma() > 0);
|
||||
|
||||
@@ -139,7 +139,7 @@ public class CallPc extends AbstractEffect
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.isFestivalParticipant() || target.isFlyingMounted() || target.isCombatFlagEquipped() || !target.isOnCustomEvent())
|
||||
if (target.isFestivalParticipant() || target.isFlyingMounted() || target.isCombatFlagEquipped() || !target.isOnEvent())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
||||
return false;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ItemSkillsTemplate implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (playable.isOnCustomEvent())
|
||||
if (playable.isOnEvent())
|
||||
{
|
||||
playable.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class SummonItems extends ItemSkillsTemplate
|
||||
return false;
|
||||
}
|
||||
|
||||
if (playable.isOnCustomEvent())
|
||||
if (playable.isOnEvent())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Clan implements ITargetTypeHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.isOnCustomEvent() && obj.isOnCustomEvent() && (player.getTeam() != obj.getTeam()))
|
||||
if (player.isOnEvent() && obj.isOnEvent() && (player.getTeam() != obj.getTeam()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class CorpseClan implements ITargetTypeHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.isOnCustomEvent() && obj.isOnCustomEvent() && (player.getTeam() != obj.getTeam()))
|
||||
if (player.isOnEvent() && obj.isOnEvent() && (player.getTeam() != obj.getTeam()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class PartyClan implements ITargetTypeHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.isOnCustomEvent() && obj.isOnCustomEvent() && (player.getTeam() != obj.getTeam()))
|
||||
if (player.isOnEvent() && obj.isOnEvent() && (player.getTeam() != obj.getTeam()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class Unstuck implements IUserCommandHandler
|
||||
@Override
|
||||
public boolean useUserCommand(int id, PlayerInstance player)
|
||||
{
|
||||
if (player.isRegisteredOnCustomEvent())
|
||||
if (player.isRegisteredOnEvent())
|
||||
{
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
|
||||
@@ -289,7 +289,7 @@ public class Wedding implements IVoicedCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (activeChar.isRegisteredOnCustomEvent())
|
||||
if (activeChar.isRegisteredOnEvent())
|
||||
{
|
||||
activeChar.sendMessage("You are registered in an event.");
|
||||
return false;
|
||||
@@ -368,7 +368,7 @@ public class Wedding implements IVoicedCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (partner.isRegisteredOnCustomEvent())
|
||||
if (partner.isRegisteredOnEvent())
|
||||
{
|
||||
activeChar.sendMessage("Your partner is registered in an event.");
|
||||
return false;
|
||||
|
||||
@@ -170,7 +170,7 @@ public class HandysBlockCheckerManager
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.isRegisteredOnCustomEvent() || player.isInOlympiadMode())
|
||||
if (player.isRegisteredOnEvent() || player.isInOlympiadMode())
|
||||
{
|
||||
player.sendMessage("Couldnt register you due other event participation.");
|
||||
return false;
|
||||
|
||||
@@ -154,7 +154,7 @@ public class PrecautionaryRestartManager
|
||||
return true;
|
||||
}
|
||||
|
||||
if (player.isOnCustomEvent())
|
||||
if (player.isOnEvent())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ public class SellBuffsManager implements IXmlReader
|
||||
player.sendMessage("You can't sell buffs with Olympiad status!");
|
||||
return false;
|
||||
}
|
||||
else if (player.isRegisteredOnCustomEvent()) // custom event message
|
||||
else if (player.isRegisteredOnEvent())
|
||||
{
|
||||
player.sendMessage("You can't sell buffs while registered in an event!");
|
||||
return false;
|
||||
|
||||
@@ -6524,15 +6524,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 isOnCustomEvent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dummy method overriden in {@link PlayerInstance}
|
||||
* @return the clan id of current character.
|
||||
|
||||
@@ -325,6 +325,11 @@ public abstract class Playable extends Creature
|
||||
|
||||
public abstract void restoreEffects();
|
||||
|
||||
public boolean isOnEvent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayable()
|
||||
{
|
||||
|
||||
@@ -1183,8 +1183,8 @@ public abstract class Summon extends Playable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnCustomEvent()
|
||||
public boolean isOnEvent()
|
||||
{
|
||||
return (_owner != null) && _owner.isOnCustomEvent();
|
||||
return (_owner != null) && _owner.isOnEvent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ public class CubicInstance implements IIdentifiable
|
||||
return;
|
||||
}
|
||||
// Custom event targeting
|
||||
if (_owner.isOnCustomEvent())
|
||||
if (_owner.isOnEvent())
|
||||
{
|
||||
if (ownerTarget.getActingPlayer() != null)
|
||||
{
|
||||
|
||||
@@ -735,8 +735,8 @@ public class PlayerInstance extends Playable
|
||||
protected Set<Integer> _activeSoulShots = ConcurrentHashMap.newKeySet(1);
|
||||
|
||||
/** Event parameters */
|
||||
private boolean _isRegisteredOnCustomEvent = false;
|
||||
private boolean _isOnCustomEvent = false;
|
||||
private boolean _isRegisteredOnEvent = false;
|
||||
private boolean _isOnEvent = false;
|
||||
|
||||
private byte _handysBlockCheckerEventArena = -1;
|
||||
|
||||
@@ -5208,7 +5208,7 @@ public class PlayerInstance extends Playable
|
||||
|
||||
private void onDieDropItem(Creature killer)
|
||||
{
|
||||
if (isOnCustomEvent() || (killer == null))
|
||||
if (isOnEvent() || (killer == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -5576,7 +5576,7 @@ public class PlayerInstance extends Playable
|
||||
|
||||
// Calculate the Experience loss
|
||||
long lostExp = 0;
|
||||
if (!isOnCustomEvent())
|
||||
if (!isOnEvent())
|
||||
{
|
||||
if (lvl < ExperienceData.getInstance().getMaxLevel())
|
||||
{
|
||||
@@ -8221,7 +8221,7 @@ public class PlayerInstance extends Playable
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isRegisteredOnCustomEvent())
|
||||
if (isRegisteredOnEvent())
|
||||
{
|
||||
sendMessage("A superior power doesn't allow you to leave.");
|
||||
return false;
|
||||
@@ -8304,9 +8304,9 @@ public class PlayerInstance extends Playable
|
||||
}
|
||||
|
||||
// Check if the attacker is in an event
|
||||
if (isOnCustomEvent())
|
||||
if (isOnEvent())
|
||||
{
|
||||
return true;
|
||||
return getTeam() != attacker.getTeam();
|
||||
}
|
||||
|
||||
// Check if the attacker is a Playable
|
||||
@@ -12257,7 +12257,7 @@ public class PlayerInstance extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
if (isResurrectSpecialAffected() || isLucky() || isOnCustomEvent() || isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE) || canOverrideCond(PlayerCondOverride.DEATH_PENALTY))
|
||||
if (isResurrectSpecialAffected() || isLucky() || isOnEvent() || isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE) || canOverrideCond(PlayerCondOverride.DEATH_PENALTY))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -13773,16 +13773,6 @@ public class PlayerInstance extends Playable
|
||||
_adminConfirmCmd = adminConfirmCmd;
|
||||
}
|
||||
|
||||
public void setBlockCheckerArena(byte arena)
|
||||
{
|
||||
_handysBlockCheckerEventArena = arena;
|
||||
}
|
||||
|
||||
public int getBlockCheckerArena()
|
||||
{
|
||||
return _handysBlockCheckerEventArena;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load PlayerInstance Recommendations data.
|
||||
* @return
|
||||
@@ -14091,25 +14081,35 @@ public class PlayerInstance extends Playable
|
||||
_canRevive = value;
|
||||
}
|
||||
|
||||
public boolean isRegisteredOnCustomEvent()
|
||||
public boolean isRegisteredOnEvent()
|
||||
{
|
||||
return _isRegisteredOnCustomEvent || _isOnCustomEvent;
|
||||
return _isRegisteredOnEvent || _isOnEvent;
|
||||
}
|
||||
|
||||
public void setRegisteredOnCustomEvent(boolean value)
|
||||
public void setRegisteredOnEvent(boolean value)
|
||||
{
|
||||
_isRegisteredOnCustomEvent = value;
|
||||
_isRegisteredOnEvent = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnCustomEvent()
|
||||
public boolean isOnEvent()
|
||||
{
|
||||
return _isOnCustomEvent;
|
||||
return _isOnEvent;
|
||||
}
|
||||
|
||||
public void setOnCustomEvent(boolean value)
|
||||
public void setOnEvent(boolean value)
|
||||
{
|
||||
_isOnCustomEvent = value;
|
||||
_isOnEvent = value;
|
||||
}
|
||||
|
||||
public void setBlockCheckerArena(byte arena)
|
||||
{
|
||||
_handysBlockCheckerEventArena = arena;
|
||||
}
|
||||
|
||||
public int getBlockCheckerArena()
|
||||
{
|
||||
return _handysBlockCheckerEventArena;
|
||||
}
|
||||
|
||||
public void setOriginalCpHpMp(double cp, double hp, double mp)
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ConditionPlayerCallPc extends Condition
|
||||
{
|
||||
canCallPlayer = false;
|
||||
}
|
||||
else if (player.isOnCustomEvent())
|
||||
else if (player.isOnEvent())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
||||
canCallPlayer = false;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ConditionPlayerCanEscape extends Condition
|
||||
{
|
||||
canTeleport = false;
|
||||
}
|
||||
else if (player.isOnCustomEvent())
|
||||
else if (player.isOnEvent())
|
||||
{
|
||||
canTeleport = false;
|
||||
}
|
||||
|
||||
@@ -878,7 +878,7 @@ public class Instance
|
||||
*/
|
||||
public void notifyDeath(PlayerInstance player)
|
||||
{
|
||||
if (!player.isOnCustomEvent() && (_ejectTime > 0))
|
||||
if (!player.isOnEvent() && (_ejectTime > 0))
|
||||
{
|
||||
// Send message
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTES_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class AbstractOlympiadGame
|
||||
}
|
||||
|
||||
// safety precautions
|
||||
if (player.inObserverMode() || player.isRegisteredOnCustomEvent())
|
||||
if (player.inObserverMode() || player.isRegisteredOnEvent())
|
||||
{
|
||||
return new SystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE_THE_MATCH_HAS_BEEN_CANCELLED);
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ public class OlympiadManager
|
||||
}
|
||||
|
||||
final int charId = noble.getObjectId();
|
||||
if (noble.isRegisteredOnCustomEvent())
|
||||
if (noble.isRegisteredOnEvent())
|
||||
{
|
||||
player.sendMessage("You can't join olympiad while participating on an event.");
|
||||
return false;
|
||||
|
||||
@@ -1129,7 +1129,7 @@ public class Skill implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isOnCustomEvent() && targetPlayer.isOnCustomEvent() && (player.getTeam() == target.getTeam()))
|
||||
if (player.isOnEvent() && targetPlayer.isOnEvent() && (player.getTeam() == target.getTeam()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -24,13 +24,14 @@ import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.TerritoryWarManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.SiegeClan;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.SiegeFlagInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.listeners.AbstractEventListener;
|
||||
import org.l2jmobius.gameserver.model.quest.Event;
|
||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
||||
import org.l2jmobius.gameserver.model.siege.Castle;
|
||||
import org.l2jmobius.gameserver.model.siege.Fort;
|
||||
@@ -93,15 +94,15 @@ public class RequestRestartPoint implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Custom event resurrection management.
|
||||
if (player.isOnCustomEvent())
|
||||
if (player.isOnEvent())
|
||||
{
|
||||
// This is an example, replace EventScriptName with proper event script name.
|
||||
final Quest eventScript = QuestManager.getInstance().getQuest("EventScriptName");
|
||||
if (eventScript != null)
|
||||
for (AbstractEventListener listener : player.getListeners(EventType.ON_CREATURE_KILL))
|
||||
{
|
||||
// Notify onAdvEvent ResurrectPlayer event.
|
||||
eventScript.notifyEvent("ResurrectPlayer", null, player);
|
||||
return;
|
||||
if (listener.getOwner() instanceof Event)
|
||||
{
|
||||
((Event) listener.getOwner()).notifyEvent("ResurrectPlayer", null, player);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public class Die implements IClientOutgoingPacket
|
||||
|
||||
if (_creature.isPlayer())
|
||||
{
|
||||
if (!OlympiadManager.getInstance().isRegistered(_creature.getActingPlayer()) && !_creature.getActingPlayer().isOnCustomEvent())
|
||||
if (!OlympiadManager.getInstance().isRegistered(_creature.getActingPlayer()) && !_creature.getActingPlayer().isOnEvent())
|
||||
{
|
||||
_staticRes = _creature.getInventory().haveItemForSelfResurrection();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class OfflineTradeUtil
|
||||
*/
|
||||
private static boolean offlineMode(PlayerInstance player)
|
||||
{
|
||||
if ((player == null) || player.isInOlympiadMode() || player.isRegisteredOnCustomEvent() || player.isJailed() || (player.getVehicle() != null))
|
||||
if ((player == null) || player.isInOlympiadMode() || player.isRegisteredOnEvent() || player.isJailed() || (player.getVehicle() != null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user