Player checks for event registrations.

This commit is contained in:
MobiusDev 2017-09-23 22:41:12 +00:00
parent a8e48d6179
commit d14391903b
43 changed files with 238 additions and 0 deletions

View File

@ -134,6 +134,12 @@ public final class LaVieEnRose extends AbstractNpcAI
return false;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot use the Beauty Shop while registered in an event.");
return false;
}
// player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_AS_THE_NPC_SERVER_IS_CURRENTLY_NOT_IN_FUNCTION);
// player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_WHILE_USING_THE_AUTOMATIC_REPLACEMENT);

View File

@ -405,6 +405,11 @@ public final class SellBuffsManager implements IGameXmlReader
player.sendMessage("You can't sell buffs with Ceremony of Chaos status!");
return false;
}
else if (player.isOnEvent()) // custom event message
{
player.sendMessage("You can't sell buffs while registered in an event!");
return false;
}
else if (player.isCursedWeaponEquipped() || (player.getReputation() < 0))
{
player.sendMessage("You can't sell buffs in Chaotic state!");

View File

@ -9285,6 +9285,11 @@ public final class L2PcInstance extends L2Playable
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_PARTICIPATING_IN_THE_OLYMPIAD_OR_THE_CEREMONY_OF_CHAOS;
return false;
}
if (isOnEvent()) // custom event message
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_CURRENTLY_ENGAGED_IN_BATTLE;
return false;
}
if (isCursedWeaponEquipped())
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_IN_A_CHAOTIC_OR_PURPLE_STATE;

View File

@ -66,6 +66,11 @@ public class ConditionPlayerCanSwitchSubclass extends Condition
player.sendPacket(SystemMessageId.YOU_CANNOT_CHANGE_YOUR_SUBCLASS_WHILE_REGISTERED_IN_THE_CEREMONY_OF_CHAOS);
canSwitchSub = false;
}
else if (player.isOnEvent())
{
player.sendMessage("You cannot change your subclass while registered in an event.");
canSwitchSub = false;
}
else if (player.isAllSkillsDisabled())
{
canSwitchSub = false;

View File

@ -74,6 +74,13 @@ public final class RequestFriendInvite implements IClientIncomingPacket
return;
}
// Cannot request friendship in any custom event.
if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot invite a friend while participating in an event.");
return;
}
// Target blocked active player.
if (BlockList.isBlocked(friend, activeChar))
{

View File

@ -92,6 +92,12 @@ public final class RequestJoinParty implements IClientIncomingPacket
return;
}
if (requestor.isOnEvent()) // custom event message
{
requestor.sendMessage("You cannot invite to a party while participating in an event.");
return;
}
SystemMessage sm;
if (target.isInParty())
{

View File

@ -97,6 +97,12 @@ public final class RequestPrivateStoreBuy implements IClientIncomingPacket
return;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
}
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestorebuy"))
{
player.sendMessage("You are buying items too fast.");

View File

@ -94,6 +94,12 @@ public final class RequestPrivateStoreSell implements IClientIncomingPacket
return;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
}
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestoresell"))
{
player.sendMessage("You are selling items too fast.");

View File

@ -100,6 +100,11 @@ public class RequestAcquireAbilityList implements IClientIncomingPacket
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
final int[] pointsSpent = new int[TREE_SIZE];
Arrays.fill(pointsSpent, 0);

View File

@ -71,6 +71,11 @@ public class RequestChangeAbilityPoint implements IClientIncomingPacket
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
final long spRequired = AbilityPointsData.getInstance().getPrice(activeChar.getAbilityPoints());
if (spRequired > activeChar.getSp())

View File

@ -68,6 +68,11 @@ public class RequestResetAbilityPoint implements IClientIncomingPacket
client.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
else if (activeChar.getAbilityPoints() == 0)
{
activeChar.sendMessage("You don't have ability points to reset!");

View File

@ -134,6 +134,12 @@ public final class LaVieEnRose extends AbstractNpcAI
return false;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot use the Beauty Shop while registered in an event.");
return false;
}
// player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_AS_THE_NPC_SERVER_IS_CURRENTLY_NOT_IN_FUNCTION);
// player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_WHILE_USING_THE_AUTOMATIC_REPLACEMENT);

View File

@ -405,6 +405,11 @@ public final class SellBuffsManager implements IGameXmlReader
player.sendMessage("You can't sell buffs with Ceremony of Chaos status!");
return false;
}
else if (player.isOnEvent()) // custom event message
{
player.sendMessage("You can't sell buffs while registered in an event!");
return false;
}
else if (player.isCursedWeaponEquipped() || (player.getReputation() < 0))
{
player.sendMessage("You can't sell buffs in Chaotic state!");

View File

@ -9285,6 +9285,11 @@ public final class L2PcInstance extends L2Playable
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_PARTICIPATING_IN_THE_OLYMPIAD_OR_THE_CEREMONY_OF_CHAOS;
return false;
}
if (isOnEvent()) // custom event message
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_CURRENTLY_ENGAGED_IN_BATTLE;
return false;
}
if (isCursedWeaponEquipped())
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_IN_A_CHAOTIC_OR_PURPLE_STATE;

View File

@ -66,6 +66,11 @@ public class ConditionPlayerCanSwitchSubclass extends Condition
player.sendPacket(SystemMessageId.YOU_CANNOT_CHANGE_YOUR_SUBCLASS_WHILE_REGISTERED_IN_THE_CEREMONY_OF_CHAOS);
canSwitchSub = false;
}
else if (player.isOnEvent())
{
player.sendMessage("You cannot change your subclass while registered in an event.");
canSwitchSub = false;
}
else if (player.isAllSkillsDisabled())
{
canSwitchSub = false;

View File

@ -74,6 +74,13 @@ public final class RequestFriendInvite implements IClientIncomingPacket
return;
}
// Cannot request friendship in any custom event.
if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot invite a friend while participating in an event.");
return;
}
// Target blocked active player.
if (BlockList.isBlocked(friend, activeChar))
{

View File

@ -92,6 +92,12 @@ public final class RequestJoinParty implements IClientIncomingPacket
return;
}
if (requestor.isOnEvent()) // custom event message
{
requestor.sendMessage("You cannot invite to a party while participating in an event.");
return;
}
SystemMessage sm;
if (target.isInParty())
{

View File

@ -97,6 +97,12 @@ public final class RequestPrivateStoreBuy implements IClientIncomingPacket
return;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
}
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestorebuy"))
{
player.sendMessage("You are buying items too fast.");

View File

@ -94,6 +94,12 @@ public final class RequestPrivateStoreSell implements IClientIncomingPacket
return;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
}
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestoresell"))
{
player.sendMessage("You are selling items too fast.");

View File

@ -100,6 +100,11 @@ public class RequestAcquireAbilityList implements IClientIncomingPacket
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
final int[] pointsSpent = new int[TREE_SIZE];
Arrays.fill(pointsSpent, 0);

View File

@ -71,6 +71,11 @@ public class RequestChangeAbilityPoint implements IClientIncomingPacket
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
final long spRequired = AbilityPointsData.getInstance().getPrice(activeChar.getAbilityPoints());
if (spRequired > activeChar.getSp())

View File

@ -68,6 +68,11 @@ public class RequestResetAbilityPoint implements IClientIncomingPacket
client.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
else if (activeChar.getAbilityPoints() == 0)
{
activeChar.sendMessage("You don't have ability points to reset!");

View File

@ -134,6 +134,12 @@ public final class LaVieEnRose extends AbstractNpcAI
return false;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot use the Beauty Shop while registered in an event.");
return false;
}
// player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_AS_THE_NPC_SERVER_IS_CURRENTLY_NOT_IN_FUNCTION);
// player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_WHILE_USING_THE_AUTOMATIC_REPLACEMENT);

View File

@ -405,6 +405,11 @@ public final class SellBuffsManager implements IGameXmlReader
player.sendMessage("You can't sell buffs with Ceremony of Chaos status!");
return false;
}
else if (player.isOnEvent()) // custom event message
{
player.sendMessage("You can't sell buffs while registered in an event!");
return false;
}
else if (player.isCursedWeaponEquipped() || (player.getReputation() < 0))
{
player.sendMessage("You can't sell buffs in Chaotic state!");

View File

@ -9296,6 +9296,11 @@ public final class L2PcInstance extends L2Playable
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_PARTICIPATING_IN_THE_OLYMPIAD_OR_THE_CEREMONY_OF_CHAOS;
return false;
}
if (isOnEvent()) // custom event message
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_CURRENTLY_ENGAGED_IN_BATTLE;
return false;
}
if (isCursedWeaponEquipped())
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_IN_A_CHAOTIC_OR_PURPLE_STATE;

View File

@ -66,6 +66,11 @@ public class ConditionPlayerCanSwitchSubclass extends Condition
player.sendPacket(SystemMessageId.YOU_CANNOT_CHANGE_YOUR_SUBCLASS_WHILE_REGISTERED_IN_THE_CEREMONY_OF_CHAOS);
canSwitchSub = false;
}
else if (player.isOnEvent())
{
player.sendMessage("You cannot change your subclass while registered in an event.");
canSwitchSub = false;
}
else if (player.isAllSkillsDisabled())
{
canSwitchSub = false;

View File

@ -74,6 +74,13 @@ public final class RequestFriendInvite implements IClientIncomingPacket
return;
}
// Cannot request friendship in any custom event.
if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot invite a friend while participating in an event.");
return;
}
// Target blocked active player.
if (BlockList.isBlocked(friend, activeChar))
{

View File

@ -92,6 +92,12 @@ public final class RequestJoinParty implements IClientIncomingPacket
return;
}
if (requestor.isOnEvent()) // custom event message
{
requestor.sendMessage("You cannot invite to a party while participating in an event.");
return;
}
SystemMessage sm;
if (target.isInParty())
{

View File

@ -97,6 +97,12 @@ public final class RequestPrivateStoreBuy implements IClientIncomingPacket
return;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
}
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestorebuy"))
{
player.sendMessage("You are buying items too fast.");

View File

@ -105,6 +105,12 @@ public final class RequestPrivateStoreSell implements IClientIncomingPacket
return;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
}
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestoresell"))
{
player.sendMessage("You are selling items too fast.");

View File

@ -100,6 +100,11 @@ public class RequestAcquireAbilityList implements IClientIncomingPacket
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
final int[] pointsSpent = new int[TREE_SIZE];
Arrays.fill(pointsSpent, 0);

View File

@ -71,6 +71,11 @@ public class RequestChangeAbilityPoint implements IClientIncomingPacket
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
final long spRequired = AbilityPointsData.getInstance().getPrice(activeChar.getAbilityPoints());
if (spRequired > activeChar.getSp())

View File

@ -68,6 +68,11 @@ public class RequestResetAbilityPoint implements IClientIncomingPacket
client.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
else if (activeChar.getAbilityPoints() == 0)
{
activeChar.sendMessage("You don't have ability points to reset!");

View File

@ -405,6 +405,11 @@ public final class SellBuffsManager implements IGameXmlReader
player.sendMessage("You can't sell buffs with Ceremony of Chaos status!");
return false;
}
else if (player.isOnEvent()) // custom event message
{
player.sendMessage("You can't sell buffs while registered in an event!");
return false;
}
else if (player.isCursedWeaponEquipped() || (player.getReputation() < 0))
{
player.sendMessage("You can't sell buffs in Chaotic state!");

View File

@ -9258,6 +9258,11 @@ public final class L2PcInstance extends L2Playable
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_PARTICIPATING_IN_THE_OLYMPIAD_OR_THE_CEREMONY_OF_CHAOS;
return false;
}
if (isOnEvent()) // custom event message
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_CURRENTLY_ENGAGED_IN_BATTLE;
return false;
}
if (isCursedWeaponEquipped())
{
_noDuelReason = SystemMessageId.C1_CANNOT_DUEL_BECAUSE_C1_IS_IN_A_CHAOTIC_OR_PURPLE_STATE;

View File

@ -66,6 +66,11 @@ public class ConditionPlayerCanSwitchSubclass extends Condition
player.sendPacket(SystemMessageId.YOU_CANNOT_CHANGE_YOUR_SUBCLASS_WHILE_REGISTERED_IN_THE_CEREMONY_OF_CHAOS);
canSwitchSub = false;
}
else if (player.isOnEvent())
{
player.sendMessage("You cannot change your subclass while registered in an event.");
canSwitchSub = false;
}
else if (player.isAllSkillsDisabled())
{
canSwitchSub = false;

View File

@ -74,6 +74,13 @@ public final class RequestFriendInvite implements IClientIncomingPacket
return;
}
// Cannot request friendship in any custom event.
if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot invite a friend while participating in an event.");
return;
}
// Target blocked active player.
if (BlockList.isBlocked(friend, activeChar))
{

View File

@ -92,6 +92,12 @@ public final class RequestJoinParty implements IClientIncomingPacket
return;
}
if (requestor.isOnEvent()) // custom event message
{
requestor.sendMessage("You cannot invite to a party while participating in an event.");
return;
}
SystemMessage sm;
if (target.isInParty())
{

View File

@ -97,6 +97,12 @@ public final class RequestPrivateStoreBuy implements IClientIncomingPacket
return;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
}
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestorebuy"))
{
player.sendMessage("You are buying items too fast.");

View File

@ -105,6 +105,12 @@ public final class RequestPrivateStoreSell implements IClientIncomingPacket
return;
}
if (player.isOnEvent()) // custom event message
{
player.sendMessage("You cannot open a private store while participating in an event.");
return;
}
if (!client.getFloodProtectors().getTransaction().tryPerformAction("privatestoresell"))
{
player.sendMessage("You are selling items too fast.");

View File

@ -100,6 +100,11 @@ public class RequestAcquireAbilityList implements IClientIncomingPacket
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
final int[] pointsSpent = new int[TREE_SIZE];
Arrays.fill(pointsSpent, 0);

View File

@ -71,6 +71,11 @@ public class RequestChangeAbilityPoint implements IClientIncomingPacket
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
final long spRequired = AbilityPointsData.getInstance().getPrice(activeChar.getAbilityPoints());
if (spRequired > activeChar.getSp())

View File

@ -68,6 +68,11 @@ public class RequestResetAbilityPoint implements IClientIncomingPacket
client.sendPacket(SystemMessageId.YOU_CANNOT_USE_OR_RESET_ABILITY_POINTS_WHILE_PARTICIPATING_IN_THE_OLYMPIAD_OR_CEREMONY_OF_CHAOS);
return;
}
else if (activeChar.isOnEvent()) // custom event message
{
activeChar.sendMessage("You cannot use or reset Ability Points while participating in an event.");
return;
}
else if (activeChar.getAbilityPoints() == 0)
{
activeChar.sendMessage("You don't have ability points to reset!");