Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2jFrozen_GameServer
- Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/L2Character.java (revision 1118)
- +++ head-src/com/l2jfrozen/gameserver/model/L2Character.java (working copy)
- @@ -355,6 +355,9 @@
- /** The Constant ZONE_NOSTORE. */
- public static final int ZONE_NOSTORE = 32768;
- + /** The Constant ZONE_PVP_CUSTOM. */
- + public static final int ZONE_PVP_CUSTOM = 65536;
- +
- /** The _current zones. */
- private int _currentZones = 0;
- Index: head-src/com/l2jfrozen/Config.java
- ===================================================================
- --- head-src/com/l2jfrozen/Config.java (revision 1118)
- +++ head-src/com/l2jfrozen/Config.java (working copy)
- @@ -35,10 +35,12 @@
- import java.net.UnknownHostException;
- import java.util.ArrayList;
- import java.util.HashMap;
- +import java.util.HashSet;
- import java.util.List;
- import java.util.Map;
- import java.util.Properties;
- import java.util.Random;
- +import java.util.Set;
- import javolution.text.TypeFormat;
- import javolution.util.FastList;
- @@ -2428,6 +2430,21 @@
- public static String PVP1_CUSTOM_MESSAGE;
- public static String PVP2_CUSTOM_MESSAGE;
- + /** Respawn PvP Custom */
- + public static boolean RESPAWN_PVP_CUSTOM_ENABLE;
- + public static int RESPAWN_PVP_CUSTOM_1_X;
- + public static int RESPAWN_PVP_CUSTOM_1_Y;
- + public static int RESPAWN_PVP_CUSTOM_1_Z;
- + public static int RESPAWN_PVP_CUSTOM_2_X;
- + public static int RESPAWN_PVP_CUSTOM_2_Y;
- + public static int RESPAWN_PVP_CUSTOM_2_Z;
- + public static int RESPAWN_PVP_CUSTOM_3_X;
- + public static int RESPAWN_PVP_CUSTOM_3_Y;
- + public static int RESPAWN_PVP_CUSTOM_3_Z;
- + public static int DELAY_RESPAWN_PVP_CUSTOM;
- + public static String BLOCK_SKILLS_PVP_CUSTOM;
- + public static Set<Integer> BLOCK_SKILLS_PVP_CUSTOM_SKILL_ID;
- +
- // ============================================================
- public static void loadL2JFrozenConfig()
- {
- @@ -2546,6 +2563,24 @@
- FARM2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
- PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
- PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
- +
- + /** Respawn PvP Custom */
- + RESPAWN_PVP_CUSTOM_ENABLE = Boolean.parseBoolean(L2JFrozenSettings.getProperty("RespawnPvPCustomEnable", "False"));
- + RESPAWN_PVP_CUSTOM_1_X = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomX1", ""));
- + RESPAWN_PVP_CUSTOM_1_Y = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomY1", ""));
- + RESPAWN_PVP_CUSTOM_1_Z = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomZ1", ""));
- + RESPAWN_PVP_CUSTOM_2_X = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomX2", ""));
- + RESPAWN_PVP_CUSTOM_2_Y = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomY2", ""));
- + RESPAWN_PVP_CUSTOM_2_Z = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomZ2", ""));
- + RESPAWN_PVP_CUSTOM_3_X = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomX3", ""));
- + RESPAWN_PVP_CUSTOM_3_Y = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomY3", ""));
- + RESPAWN_PVP_CUSTOM_3_Z = Integer.parseInt(L2JFrozenSettings.getProperty("RespawnPvPCustomZ3", ""));
- + DELAY_RESPAWN_PVP_CUSTOM = Integer.parseInt(L2JFrozenSettings.getProperty("DelayRespawnPvpCustom", "3"));
- + BLOCK_SKILLS_PVP_CUSTOM = L2JFrozenSettings.getProperty("PvpBlockSkillsId", "");
- + BLOCK_SKILLS_PVP_CUSTOM_SKILL_ID = new HashSet<>();
- + for(String skillId : BLOCK_SKILLS_PVP_CUSTOM.split(",")) {
- + BLOCK_SKILLS_PVP_CUSTOM_SKILL_ID.add(Integer.parseInt(skillId));
- + }
- }
- catch (final Exception e)
- {
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (revision 1118)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -334,6 +334,11 @@
- activeChar.onPlayerEnter();
- + if(activeChar.isDead() && activeChar.isInsideZone(L2Character.ZONE_PVP_CUSTOM)) {
- + activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- + activeChar.doRevive();
- + }
- +
- if (Config.PCB_ENABLE)
- activeChar.showPcBangWindow();
- Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2PvpCustomZone.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/zone/type/L2PvpCustomZone.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2PvpCustomZone.java (working copy)
- @@ -0,0 +1,93 @@
- +package com.l2jfrozen.gameserver.model.zone.type;
- +
- +import java.util.Random;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.L2Skill;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
- +import com.l2jfrozen.gameserver.network.SystemMessageId;
- +import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +
- +/**
- + * @author João Vitor Barbosa
- + */
- +public class L2PvpCustomZone extends L2ZoneType
- +{
- + public L2PvpCustomZone(int id) {
- + super(id);
- + }
- +
- + @Override
- + public void setParameter(final String name, final String value) {
- + super.setParameter(name, value);
- + }
- +
- + @Override
- + protected void onEnter(final L2Character character) {
- + if(character instanceof L2PcInstance) {
- + character.setInsideZone(L2Character.ZONE_PVP_CUSTOM, true);
- + ((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE));
- + disableSkillPvpCustom(character);
- + character.stopPvpRegTask();
- + character.updatePvPFlag(1);
- +
- + if(character.isFlying() || ((L2PcInstance) character).isMounted()) {
- + ((L2PcInstance) character).dismount();
- + }
- + }
- +
- + }
- +
- + @Override
- + protected void onExit(final L2Character character) {
- + if (character instanceof L2PcInstance) {
- + character.setInsideZone(L2Character.ZONE_PVP_CUSTOM, false);
- + ((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.LEFT_COMBAT_ZONE));
- + enableSkillPvpCustom(character);
- + character.updatePvPFlag(0);
- + }
- + }
- +
- + @Override
- + protected void onDieInside(final L2Character character) {
- + if(character instanceof L2PcInstance && Config.RESPAWN_PVP_CUSTOM_ENABLE) {
- + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() {
- + @Override
- + public void run() {
- + int random = new Random().nextInt(3);
- + if(random == 0) {
- + character.teleToLocation(Config.RESPAWN_PVP_CUSTOM_1_X, Config.RESPAWN_PVP_CUSTOM_1_Y, Config.RESPAWN_PVP_CUSTOM_1_Z);
- + } else if(random == 1) {
- + character.teleToLocation(Config.RESPAWN_PVP_CUSTOM_2_X, Config.RESPAWN_PVP_CUSTOM_2_Y, Config.RESPAWN_PVP_CUSTOM_2_Z);
- + } else {
- + character.teleToLocation(Config.RESPAWN_PVP_CUSTOM_3_X, Config.RESPAWN_PVP_CUSTOM_3_Y, Config.RESPAWN_PVP_CUSTOM_3_Z);
- + }
- + character.doRevive();
- + }
- + }, Config.DELAY_RESPAWN_PVP_CUSTOM * 1000);
- + }
- + }
- +
- + @Override
- + protected void onReviveInside(final L2Character character) {
- + }
- +
- + public static void disableSkillPvpCustom(L2Character player) {
- + for (L2Skill skill : player.getAllSkills()) {
- + if (Config.BLOCK_SKILLS_PVP_CUSTOM_SKILL_ID.contains(skill.getId())) {
- + player.disableSkill(skill);
- + }
- + }
- + }
- +
- + public static void enableSkillPvpCustom(L2Character player) {
- + for (L2Skill skill : player.getAllSkills()) {
- + if (Config.BLOCK_SKILLS_PVP_CUSTOM_SKILL_ID.contains(skill.getId())) {
- + player.enableSkill(skill);
- + }
- + }
- + }
- +}
- Index: head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java (revision 1118)
- +++ head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java (working copy)
- @@ -56,6 +56,7 @@
- import com.l2jfrozen.gameserver.model.zone.type.L2DerbyTrackZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2EffectZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2FishingZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2FortZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2JailZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2MotherTreeZone;
- @@ -65,6 +66,7 @@
- import com.l2jfrozen.gameserver.model.zone.type.L2OlympiadStadiumZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2PeaceZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2PoisonZone;
- +import com.l2jfrozen.gameserver.model.zone.type.L2PvpCustomZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2SwampZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2TownZone;
- import com.l2jfrozen.gameserver.model.zone.type.L2WaterZone;
- @@ -268,6 +270,12 @@
- case "SwampZone":
- temp = new L2SwampZone(zoneId);
- break;
- + case "PvpCustom":
- + temp = new L2PvpCustomZone(zoneId);
- + break;
- }
- // Check for unknown type
- Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java (revision 1118)
- +++ head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java (working copy)
- @@ -20,6 +20,7 @@
- */
- package com.l2jfrozen.gameserver.network.serverpackets;
- +import com.l2jfrozen.Config;
- import com.l2jfrozen.gameserver.datatables.AccessLevel;
- import com.l2jfrozen.gameserver.datatables.sql.AccessLevels;
- import com.l2jfrozen.gameserver.managers.CastleManager;
- @@ -60,7 +61,7 @@
- final L2PcInstance player = (L2PcInstance) cha;
- _access = player.getAccessLevel();
- _clan = player.getClan();
- - _canTeleport = !((TvT.is_started() && player._inEventTvT) || (DM.is_started() && player._inEventDM) || (CTF.is_started() && player._inEventCTF) || player.isInFunEvent() || player.isPendingRevive());
- + _canTeleport = !((TvT.is_started() && player._inEventTvT) || (DM.is_started() && player._inEventDM) || (CTF.is_started() && player._inEventCTF) || player.isInFunEvent() || (player.isInsideZone(L2Character.ZONE_PVP_CUSTOM) && Config.RESPAWN_PVP_CUSTOM_ENABLE) || player.isPendingRevive());
- }
- _charObjId = cha.getObjectId();
- _fake = !cha.isDead();
- Index: config/functions/l2jfrozen.properties
- ===================================================================
- --- config/functions/l2jfrozen.properties (revision 1118)
- +++ config/functions/l2jfrozen.properties (working copy)
- @@ -281,4 +281,28 @@
- ProtectorSkillLevel = 13
- ProtectorSkillTime = 600
- # Npc Protector Message
- -ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
- \ No newline at end of file
- +ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
- +
- +#=============================================================
- +# Zone PvP Custom - By João Vitor Barbosa #
- +#=============================================================
- +RespawnPvPCustomEnable = True
- +#Delay Revive
- +DelayRespawnPvpCustom = 4
- +
- +#LOCS TO Antharas Lair
- +#Loc1
- +RespawnPvPCustomX1 = 130392
- +RespawnPvPCustomY1 = 114413
- +RespawnPvPCustomZ1 = -3727
- +#Loc2
- +RespawnPvPCustomX2 = 128295
- +RespawnPvPCustomY2 = 113304
- +RespawnPvPCustomZ2 = -3752
- +#Loc3
- +RespawnPvPCustomX3 = 127142
- +RespawnPvPCustomY3 = 115169
- +RespawnPvPCustomZ3 = -3752
- +
- +#Add Skill Id
- +PvpBlockSkillsId = 1417,1015
- \ No newline at end of file
- Data Pack:
- Index: L2JFrozen_DataPack/data/zones/zone.xml
- ===================================================================
- --- L2JFrozen_DataPack/data/zones/zone.xml
- +++ L2JFrozen_DataPack/data/zones/zone.xml
- @@ -293,3 +293,4 @@
- <spawn X='9692' Y='-22160' Z='-3721'/>
- </zone>
- + <zone id='112081' type='PvpCustom' shape="NPoly" minZ="-4900" maxZ="-2500">
- + <stat name='name' val='Pvp Custom - Antharas Lair'/>
- + </zone>
- <!-- Mother trees -->
- <zone id='11050' type='MotherTree' shape='Cuboid' minZ='-3500' maxZ='-3400'>
- <stat name='affectedRace' val='1'/>
- SQL:
- INSERT INTO `zone_vertices` VALUES ('112081', '0', '148947', '118182');
- INSERT INTO `zone_vertices` VALUES ('112081', '1', '140505', '107592');
- INSERT INTO `zone_vertices` VALUES ('112081', '2', '125241', '98878');
- INSERT INTO `zone_vertices` VALUES ('112081', '3', '101336', '115202');
- INSERT INTO `zone_vertices` VALUES ('112081', '4', '109190', '126453');
- INSERT INTO `zone_vertices` VALUES ('112081', '5', '125233', '128885');
- INSERT INTO `zone_vertices` VALUES ('112081', '6', '144707', '121661');
Advertisement
Add Comment
Please, Sign In to add comment