Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index d4e835f..b883c9f 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -40,6 +40,7 @@
- public static final String COMMANDS = "./config/CustomMods/Commands.ini";
- public static final String SCHEMEBUFF = "./config/CustomMods/SchemeBuff.ini";
- public static final String BOSSESETTIGNS = "./config/CustomMods/BossSettings.ini";
- + public static final String FLAGZONEMOD = "./config/CustomMods/FlagZone.ini";
- // --------------------------------------------------
- // Clans settings
- // --------------------------------------------------
- @@ -548,7 +549,10 @@
- public static int KARMA_RATE_DROP_ITEM;
- public static int KARMA_RATE_DROP_EQUIP;
- public static int KARMA_RATE_DROP_EQUIP_WEAPON;
- -
- + public static String ENTER_FLAGZONE_MESSEGE;
- + public static int TIME_MESSEGE_FLAGZONE_ENTER;
- + public static String EXIT_FLAGZONE_MESSEGE;
- + public static int TIME_MESSEGE_FLAGZONE_EXIT;
- public static double PET_XP_RATE;
- public static int PET_FOOD_RATE;
- public static double SINEATER_XP_RATE;
- @@ -1076,6 +1080,17 @@
- SPAWN_INTERVAL_ZAKEN = Boss.getProperty("ZakenSpawnInterval", 60);
- RANDOM_SPAWN_TIME_ZAKEN = Boss.getProperty("ZakenRandomSpawn", 20);
- }
- +
- +
- + private static final void loadFlag()
- + {
- + final ExProperties flagzone = initProperties(FLAGZONEMOD);
- + ENTER_FLAGZONE_MESSEGE = flagzone.getProperty("FlagZoneMessageTextEnter", "voce entro na zona!");
- + TIME_MESSEGE_FLAGZONE_ENTER = Integer.parseInt(flagzone.getProperty("FlagZoneMessegeTimeEnter", "6")) * 1000;
- + EXIT_FLAGZONE_MESSEGE = flagzone.getProperty("FlagZoneMessageTextExit", "voce saiu da zona!");
- + TIME_MESSEGE_FLAGZONE_EXIT = Integer.parseInt(flagzone.getProperty("FlagZoneMessegeTimeExit", "6")) * 1000;
- + }
- +
- private static final void loadScheme()
- {
- final ExProperties buff = initProperties(SCHEMEBUFF);
- @@ -1526,6 +1541,7 @@
- loadSpecial();
- loadCommands();
- loadScheme();
- + loadFlag();
- loadBoss();
- loadNewChar();
- // players settings
- diff --git a/java/net/sf/l2j/gameserver/enums/ZoneId.java b/java/net/sf/l2j/gameserver/enums/ZoneId.java
- index e381336..26e4abe 100644
- --- a/java/net/sf/l2j/gameserver/enums/ZoneId.java
- +++ b/java/net/sf/l2j/gameserver/enums/ZoneId.java
- @@ -21,7 +21,8 @@
- CAST_ON_ARTIFACT(16),
- NO_RESTART(17),
- SCRIPT(18),
- - BOSS(19);
- + BOSS(19),
- + FLAG(20);
- private final int _id;
- diff --git a/java/net/sf/l2j/gameserver/model/zone/type/FlagZone.java b/java/net/sf/l2j/gameserver/model/zone/type/FlagZone.java
- new file mode 100644
- index 0000000..ede26d9
- --- /dev/null
- +++ b/java/net/sf/l2j/gameserver/model/zone/type/FlagZone.java
- @@ -0,0 +1,50 @@
- +package net.sf.l2j.gameserver.model.zone.type;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.enums.ZoneId;
- +import net.sf.l2j.gameserver.model.actor.Creature;
- +import net.sf.l2j.gameserver.model.actor.Player;
- +import net.sf.l2j.gameserver.model.zone.type.subtype.ZoneType;
- +import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- +import net.sf.l2j.gameserver.taskmanager.PvpFlagTaskManager;
- +
- +/**
- + * An arena
- + * @author Sarada
- + */
- +public class FlagZone extends ZoneType
- +{
- + public FlagZone(int id)
- + {
- + super(id);
- + }
- +
- + @Override
- + protected void onEnter(Creature character)
- + {
- + if (character instanceof Player)
- + {
- + final Player player = (Player) character;
- +
- + character.setInsideZone(ZoneId.FLAG, true);
- + character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
- + player.updatePvPFlag(1);
- + character.sendPacket(new ExShowScreenMessage(Config.ENTER_FLAGZONE_MESSEGE, Config.TIME_MESSEGE_FLAGZONE_ENTER));
- + return;
- + }
- + }
- + @Override
- + protected void onExit(Creature character)
- + {
- + if (character instanceof Player)
- + {
- + final Player activeChar = (Player) character;
- + character.setInsideZone(ZoneId.FLAG, false);
- + character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false);
- + activeChar.updatePvPFlag(0);
- + PvpFlagTaskManager.getInstance().add(activeChar, Config.PVP_NORMAL_TIME);
- + character.sendPacket(new ExShowScreenMessage(Config.EXIT_FLAGZONE_MESSEGE, Config.TIME_MESSEGE_FLAGZONE_EXIT));
- + return;
- + }
- + }
- +}
- \ No newline at end of file
- diff --git a/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java b/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
- index 113b1c2..58a7cad 100644
- --- a/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
- +++ b/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
- @@ -5,6 +5,7 @@
- import net.sf.l2j.commons.pool.ThreadPool;
- +import net.sf.l2j.gameserver.enums.ZoneId;
- import net.sf.l2j.gameserver.model.actor.Player;
- /**
- @@ -35,6 +36,11 @@
- {
- // Get time left and check.
- final Player player = entry.getKey();
- + if (player.isInsideZone(ZoneId.FLAG))
- + {
- + _players.remove(player);
- + continue;
- + }
- final long timeLeft = entry.getValue();
- // Time is running out, clear PvP flag and remove from list.
- Index: DataPack
- +#============================================================
- +# FlagZone Messenge
- +#============================================================
- +#Messege to enter to Zona FlagZone
- +FlagZoneMessageTextEnter = vc entrou na zona de perigo!
- +
- +#Time Show Messenge to player Entre to Zone
- +FlagZoneMessegeTimeEnter = 4
- +
- +#Messege to enter to Zona FlagZone
- +FlagZoneMessageTextExit = vc saiu da zona de perigo xd!
- +
- +#Time Show Messenge to player Exit the Zone
- +FlagZoneMessegeTimeExit = 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement