Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2UFS
- Index: dist/config/players.properties
- ===================================================================
- --- dist/config/players.properties (revision 174)
- +++ dist/config/players.properties (working copy)
- @@ -75,6 +75,22 @@
- # Default : False
- AnnounceKillPLayers = true
- +#==================================================
- +# L2ChaoticZone
- +#==================================================
- +# If set to false, zone will be no-restart zone
- +NoRestartZone = True
- +# If set to false, zone will be no-logout zone
- +NoLogoutZone = True
- +# If set to false, zone will be no-store zone
- +NoStoreZone = True
- +# Give noblesse after revive?
- +ReviveNoblesse = True
- +# Heal after revive?
- +ReviveHeal = True
- +# If set to true, players will take noblesse blessing when entering
- +GiveNoblesse = True
- +
- #=============================================================
- # Misc
- #=============================================================
- Index: java/net/sf/l2j/gameserver/network/serverpackets/ExSetCompassZoneCode.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/serverpackets/ExSetCompassZoneCode.java (revision 173)
- +++ java/net/sf/l2j/gameserver/network/serverpackets/ExSetCompassZoneCode.java (working copy)
- @@ -20,12 +20,13 @@
- */
- public class ExSetCompassZoneCode extends L2GameServerPacket
- {
- - public static final int SIEGEWARZONE1 = 0x0A;
- - public static final int SIEGEWARZONE2 = 0x0B;
- - public static final int PEACEZONE = 0x0C;
- - public static final int SEVENSIGNSZONE = 0x0D;
- - public static final int PVPZONE = 0x0E;
- - public static final int GENERALZONE = 0x0F;
- + public static final int SIEGEWARZONE1 = 10;
- + public static final int SIEGEWARZONE2 = 11;
- + public static final int PEACEZONE = 12;
- + public static final int SEVENSIGNSZONE = 13;
- + public static final int PVPZONE = 14;
- + public static final int GENERALZONE = 15;
- + public static final int CHAOTIC = 16;
- private final int _zoneType;
- @@ -37,8 +38,8 @@
- @Override
- protected void writeImpl()
- {
- - writeC(0xFE);
- - writeH(0x32);
- + writeC(254);
- + writeH(50);
- writeD(_zoneType);
- }
- }
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/L2Character.java (revision 173)
- +++ java/net/sf/l2j/gameserver/model/actor/L2Character.java (working copy)
- @@ -1587,8 +1587,17 @@
- setIsDead(false);
- + if (isInsideZone(ZoneId.CHAOTIC))
- + {
- + _status.setCurrentCp(getMaxCp());
- + _status.setCurrentHp(getMaxHp());
- + _status.setCurrentMp(getMaxMp());
- + }
- + else
- + {
- _status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);
- -
- + }
- +
- // Start broadcast status
- broadcastPacket(new Revive(this));
- Index: java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java (revision 173)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java (working copy)
- @@ -84,6 +84,15 @@
- return;
- }
- + if (Config.NOSTORE_ZONE)
- + {
- + if (player.isInsideZone(ZoneId.CHAOTIC))
- + {
- + player.sendMessage("You cannot craft while inside Chaotic zone.");
- + return;
- + }
- + }
- +
- if (player.isInsideZone(ZoneId.NO_STORE))
- {
- player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
- Index: java/net/sf/l2j/gameserver/model/zone/type/L2ChaoticZone.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/zone/type/L2ChaoticZone.java (nonexistent)
- +++ java/net/sf/l2j/gameserver/model/zone/type/L2ChaoticZone.java (working copy)
- @@ -0,0 +1,88 @@
- +package net.sf.l2j.gameserver.model.zone.type;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.model.L2Skill;
- +import net.sf.l2j.gameserver.model.actor.L2Character;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.model.zone.L2SpawnZone;
- +import net.sf.l2j.gameserver.model.zone.ZoneId;
- +import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- +
- +/**
- + * by : Wallister
- + */
- +
- +public class L2ChaoticZone extends L2SpawnZone
- +{
- + private static final boolean give_noblesse = Config.GIVE_NOBLESSE;
- + private static final boolean revive_noblesse = Config.REVIVE_NOBLESSE;
- + private static final boolean revive_heal = Config.REVIVE_HEAL;
- +
- + public L2ChaoticZone(int id)
- + {
- + super(id);
- + }
- +
- + L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
- +
- + @Override
- + protected void onEnter(L2Character character)
- + {
- + character.setInsideZone(ZoneId.CHAOTIC, true);
- + character.setInsideZone(ZoneId.DANGER_AREA, true);
- +
- + if ((character instanceof L2PcInstance))
- + {
- + if (((L2PcInstance) character).getPvpFlag() == 0)
- + ((L2PcInstance) character).updatePvPFlag(1);
- +
- + L2PcInstance activeChar = ((L2PcInstance) character);
- + if (give_noblesse)
- + noblesse.getEffects(activeChar, activeChar);
- +
- + ((L2PcInstance) character).sendPacket(new ExShowScreenMessage("You entered a Chaotic Zone", 10000));
- + ((L2PcInstance) character).sendMessage("You entered a Chaotic Zone");
- + }
- + }
- +
- + @Override
- + protected void onExit(L2Character character)
- + {
- + character.setInsideZone(ZoneId.CHAOTIC, false);
- + character.setInsideZone(ZoneId.DANGER_AREA, false);
- +
- + if ((character instanceof L2PcInstance))
- + {
- + if (((L2PcInstance) character).getPvpFlag() == 1)
- + ((L2PcInstance) character).updatePvPFlag(0);
- + ((L2PcInstance) character).sendPacket(new ExShowScreenMessage("You left a Chaotic Zone", 10000));
- + ((L2PcInstance) character).sendMessage("You left a Chaotic Zone");
- + }
- + }
- +
- + @Override
- + public void onDieInside(L2Character character)
- + {
- + }
- +
- + @Override
- + public void onReviveInside(L2Character character)
- + {
- + if (character instanceof L2PcInstance)
- + {
- + L2PcInstance activeChar = ((L2PcInstance) character);
- + if (revive_noblesse)
- + noblesse.getEffects(activeChar, activeChar);
- + if (revive_heal)
- + heal(activeChar);
- + }
- + }
- +
- + static void heal(L2PcInstance activeChar)
- + {
- + activeChar.setCurrentHp(activeChar.getMaxHp());
- + activeChar.setCurrentCp(activeChar.getMaxCp());
- + activeChar.setCurrentMp(activeChar.getMaxMp());
- + }
- +}
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java (revision 173)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java (working copy)
- @@ -14,6 +14,7 @@
- */
- package net.sf.l2j.gameserver.network.clientpackets;
- +import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.model.zone.ZoneId;
- @@ -47,7 +48,15 @@
- sendPacket(RestartResponse.valueOf(false));
- return;
- }
- -
- + if (Config.NORESTART_ZONE)
- + {
- + if (player.isInsideZone(ZoneId.CHAOTIC))
- + {
- + player.sendMessage("You cannot restart while inside a Chaotic zone.");
- + sendPacket(RestartResponse.valueOf(false));
- + return;
- + }
- + }
- if (player.isInsideZone(ZoneId.NO_RESTART))
- {
- player.sendPacket(SystemMessageId.NO_RESTART_HERE);
- @@ -64,7 +73,7 @@
- return;
- }
- - if(NexusEvents.isInEvent(player))
- + if (NexusEvents.isInEvent(player))
- {
- player.sendMessage("A superior power doesn't allow you to leave the event");
- player.sendPacket(ActionFailed.STATIC_PACKET);
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 175)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -419,6 +419,12 @@
- public static boolean ENABLE_MODIFY_SKILL_DURATION;
- public static Map<Integer, Integer> SKILL_DURATION_LIST;
- public static boolean ANNOUNCE_KILL;
- + public static boolean NORESTART_ZONE;
- + public static boolean NOSTORE_ZONE;
- + public static boolean NOLOGOUT_ZONE;
- + public static boolean GIVE_NOBLESSE;
- + public static boolean REVIVE_NOBLESSE;
- + public static boolean REVIVE_HEAL;
- public static boolean EFFECT_CANCELING;
- public static double HP_REGEN_MULTIPLIER;
- public static double MP_REGEN_MULTIPLIER;
- @@ -1211,6 +1217,12 @@
- }
- }
- ANNOUNCE_KILL = players.getProperty("AnnounceKillPLayers", false);
- + NORESTART_ZONE = players.getProperty("NoRestartZone", false);
- + NOSTORE_ZONE = players.getProperty("NoStoreZone", false);
- + NOLOGOUT_ZONE = players.getProperty("NoLogoutZone", false);
- + GIVE_NOBLESSE = players.getProperty("GiveNoblesse", false);
- + REVIVE_NOBLESSE = players.getProperty("ReviveNoblesse", false);
- + REVIVE_HEAL = players.getProperty("ReviveHeal", false);
- EFFECT_CANCELING = players.getProperty("CancelLesserEffect", true);
- HP_REGEN_MULTIPLIER = players.getProperty("HpRegenMultiplier", 1.);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (revision 173)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (working copy)
- @@ -83,6 +83,15 @@
- return;
- }
- + if (Config.NOSTORE_ZONE)
- + {
- + if (player.isInsideZone(ZoneId.CHAOTIC))
- + {
- + player.sendMessage("You cannot craft while inside Chaotic zone.");
- + return;
- + }
- + }
- +
- if (player.isInsideZone(ZoneId.NO_STORE))
- {
- player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
- Index: java/net/sf/l2j/gameserver/network/clientpackets/Logout.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (revision 173)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (working copy)
- @@ -14,6 +14,7 @@
- */
- package net.sf.l2j.gameserver.network.clientpackets;
- +import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.model.zone.ZoneId;
- @@ -51,6 +52,15 @@
- return;
- }
- + if (Config.NOLOGOUT_ZONE)
- + {
- + if (player.isInsideZone(ZoneId.CHAOTIC))
- + {
- + player.sendMessage("You cannot logout while inside a Chaotic zone.");
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + }
- if (!player.isGM())
- {
- if (AttackStanceTaskManager.getInstance().isInAttackStance(player))
- @@ -67,7 +77,7 @@
- return;
- }
- - if(NexusEvents.isInEvent(player))
- + if (NexusEvents.isInEvent(player))
- {
- player.sendMessage("A superior power doesn't allow you to leave the event");
- sendPacket(ActionFailed.STATIC_PACKET);
- Index: java/net/sf/l2j/gameserver/model/zone/ZoneId.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/zone/ZoneId.java (revision 173)
- +++ java/net/sf/l2j/gameserver/model/zone/ZoneId.java (working copy)
- @@ -38,7 +38,8 @@
- DANGER_AREA(15),
- CAST_ON_ARTIFACT(16),
- NO_RESTART(17),
- - SCRIPT(18);
- + SCRIPT(18),
- + CHAOTIC(19);
- private final int _id;
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 174)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -1285,6 +1285,14 @@
- _lastCompassZone = ExSetCompassZoneCode.PEACEZONE;
- sendPacket(new ExSetCompassZoneCode(ExSetCompassZoneCode.PEACEZONE));
- }
- + else if (isInsideZone(ZoneId.CHAOTIC))
- + {
- + if (_lastCompassZone == ExSetCompassZoneCode.CHAOTIC)
- + return;
- +
- + _lastCompassZone = ExSetCompassZoneCode.CHAOTIC;
- + sendPacket(new ExSetCompassZoneCode(ExSetCompassZoneCode.CHAOTIC));
- + }
- else
- {
- if (_lastCompassZone == ExSetCompassZoneCode.GENERALZONE)
- @@ -3975,7 +3983,7 @@
- }
- // Reduce player's xp and karma.
- - if (Config.ALT_GAME_DELEVEL && (getSkillLevel(L2Skill.SKILL_LUCKY) < 0 || getStat().getLevel() > 9))
- + if (Config.ALT_GAME_DELEVEL && (!isInsideZone(ZoneId.CHAOTIC)) && (getSkillLevel(L2Skill.SKILL_LUCKY) < 0 || getStat().getLevel() > 9))
- deathPenalty(pk != null && getClan() != null && pk.getClan() != null && (getClan().isAtWarWith(pk.getClanId()) || pk.getClan().isAtWarWith(getClanId())), pk != null, killer instanceof L2SiegeGuardInstance);
- }
- }
- @@ -4026,7 +4034,7 @@
- if (getKarma() <= 0 && pk != null && pk.getClan() != null && getClan() != null && pk.getClan().isAtWarWith(getClanId()))
- return;
- - if ((!isInsideZone(ZoneId.PVP) || pk == null) && (!isGM() || Config.KARMA_DROP_GM))
- + if ((!isInsideZone(ZoneId.CHAOTIC)) && (!isInsideZone(ZoneId.PVP) || pk == null) && (!isGM() || Config.KARMA_DROP_GM))
- {
- boolean isKillerNpc = (killer instanceof L2Npc);
- int pkLimit = Config.KARMA_PK_LIMIT;
- @@ -4231,6 +4239,9 @@
- if (isInsideZone(ZoneId.PVP))
- return;
- + if (isInsideZone(ZoneId.CHAOTIC))
- + return;
- +
- PvpFlagTaskManager.getInstance().add(this, Config.PVP_NORMAL_TIME);
- if (getPvpFlag() == 0)
- @@ -4246,7 +4257,7 @@
- if (isInDuel() && player.getDuelId() == getDuelId())
- return;
- - if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && player.getKarma() == 0)
- + if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && (!isInsideZone(ZoneId.CHAOTIC) || !target.isInsideZone(ZoneId.CHAOTIC)) && player.getKarma() == 0)
- {
- PvpFlagTaskManager.getInstance().add(this, checkIfPvP(player) ? Config.PVP_PVP_TIME : Config.PVP_NORMAL_TIME);
- @@ -6633,6 +6644,9 @@
- if (getClan() != null && getClan().isMember(cha.getObjectId()))
- return false;
- + if ((isInsideZone(ZoneId.CHAOTIC)) && (((L2PcInstance) attacker).isInsideZone(ZoneId.CHAOTIC)))
- + return true;
- +
- // Now check again if the L2PcInstance is in pvp zone (as arenas check was made before, it ends with sieges).
- if (isInsideZone(ZoneId.PVP) && attacker.isInsideZone(ZoneId.PVP))
- return true;
- @@ -9936,7 +9950,7 @@
- if (_deathPenaltyBuffLevel >= 15) // maximum level reached
- return;
- - if ((getKarma() > 0 || Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof L2PcInstance) && !isGM() && !(getCharmOfLuck() && (killer == null || killer.isRaid())) && !isPhoenixBlessed() && !(isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE)))
- + if ((getKarma() > 0 || Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof L2PcInstance) && !isGM() && !(getCharmOfLuck() && (killer == null || killer.isRaid())) && !isPhoenixBlessed() && !(isInsideZone(ZoneId.PVP) && (!isInsideZone(ZoneId.CHAOTIC)) || isInsideZone(ZoneId.SIEGE)))
- {
- if (_deathPenaltyBuffLevel != 0)
- {
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java (revision 173)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java (working copy)
- @@ -69,6 +69,14 @@
- return;
- }
- + if (Config.NOSTORE_ZONE)
- + {
- + if (player.isInsideZone(ZoneId.CHAOTIC))
- + {
- + player.sendMessage("You cannot craft while inside Chaotic zone.");
- + return;
- + }
- + }
- if (_count == 0)
- player.forceStandUp();
- else
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement