Jump to content

Recommended Posts

Posted

Hello, I need a code for a Chaotic Zone, (not auto flag zone/multifunction).

I pay with paypal. Give me your skype for contact.

 

This zone must be like this:

 

1 -Not an auto flag zone.

2 -players can attack, use any skills (offensive or deffensive, debuffs) without holding CTRL.
3 -players get normal PVP Flag when in PVP. And get normal Karma if PK. If stop PVP, Flag disapear normaly.
4 -players with karma don't drop inside the chaotic zone.
5 -players get PVP/PK points.
6 -Need CTRL only for Ally/Clan Members
 
With a Config.Properties file
 
 
 
Posted

Ive found a code for chaotic city. It works like an event. maybe it can help you.

 

### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java (revision 1004)
+++ head-src/com/l2jfrozen/Config.java (working copy)
@@ -69,6 +69,7 @@
public static int USERACCESS_LEVEL;
public static int MASTERACCESS_NAME_COLOR;
public static int MASTERACCESS_TITLE_COLOR;
+ public static int DUAL_AIO_ID;

//============================================================
public static void loadAccessConfig()
@@ -613,6 +614,8 @@
public static int FS_TIME_COOLDOWN;
public static int FS_TIME_ENTRY;
public static int FS_TIME_WARMUP;
+ public static int TOWN_ID_EVENT;
+ public static int BOSS_ID_EVENT;
public static int FS_PARTY_MEMBER_COUNT;
public static boolean ALLOW_QUAKE_SYSTEM;
public static boolean ENABLE_ANTI_PVP_FARM_MSG;
@@ -630,7 +633,8 @@
InputStream is = new FileInputStream(new File(OTHER));
otherSettings.load(is);
is.close();
-
+ BOSS_ID_EVENT = 315949;
+ TOWN_ID_EVENT = Integer.parseInt(otherSettings.getProperty("TownIdEvent", "9"));
DEEPBLUE_DROP_RULES = Boolean.parseBoolean(otherSettings.getProperty("UseDeepBlueDropRules", "True"));
ALLOW_GUARDS = Boolean.valueOf(otherSettings.getProperty("AllowGuards", "False"));
EFFECT_CANCELING = Boolean.valueOf(otherSettings.getProperty("CancelLesserEffect", "True"));
@@ -673,6 +677,7 @@
     ALLOW_AIO_TCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowAioTitleColor", "True"));
     AIO_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("AioTitleColor", "88AA88"));
     ALLOW_AIO_USE_GK = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseGk", "False"));
+     DUAL_AIO_ID = Integer.parseInt(otherSettings.getProperty("DualAioItemId", "6580"));
     ALLOW_AIO_USE_CM = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseClassMaster", "False"));
     ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(otherSettings.getProperty("AnnounceCastleLords", "False"));
     if(ENABLE_AIO_SYSTEM) //create map if system is enabled
Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2TownZone.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/zone/type/L2TownZone.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2TownZone.java (working copy)
@@ -22,8 +22,10 @@
import org.w3c.dom.Node;

import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.managers.TownManager;
import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.entity.event.CaoticInvasor;
import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
import com.l2jfrozen.util.random.Rnd;

@@ -130,7 +132,10 @@
{
character.setInsideZone(L2Character.ZONE_PEACE, true);
}
-
+ if(CaoticInvasor.ativo == true && _townId == Config.TOWN_ID_EVENT)
+ {
+ character.setInsideZone(L2Character.ZONE_PEACE, false);
+ }
}

@Override
@@ -151,11 +156,14 @@

@Override
protected void onDieInside(L2Character character)
- {}
+ {
+ }

@Override
protected void onReviveInside(L2Character character)
- {}
+ {
+ onEnter(character);
+ }

/**
* Returns this town zones name
Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCaotic.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCaotic.java (revision 0)
+++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCaotic.java (working copy)
@@ -0,0 +1,69 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package com.l2jfrozen.gameserver.handler.admincommandhandlers;
+
+import java.util.logging.Logger;
+
+import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
+import com.l2jfrozen.gameserver.model.L2Object;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.entity.event.CaoticInvasor;
+
+/**
+ * This class handles following admin commands: - invul = turns invulnerability on/off
+ *
+ * @version $Revision: 1.2.4.4 $ $Date: 2007/07/31 10:06:02 $
+ */
+public class AdminCaotic implements IAdminCommandHandler
+{
+ private static Logger _log = Logger.getLogger(AdminCaotic.class.getName());
+
+ private static final String[] ADMIN_COMMANDS =
+ {
+ "admin_startcaos"
+ };
+
+ @Override
+ public boolean useAdminCommand(String command, L2PcInstance activeChar)
+ {
+ if (command.startsWith("admin_startcaos"))
+ {
+ try
+ {
+ ThreadPoolManager.getInstance().scheduleGeneral(new CaoticInvasor(), 1);
+
+ }
+ catch (Exception e)
+ {
+ activeChar.sendMessage("Usage: //startcaos");
+ }
+ }
+ return true;
+ }
+
+
+ @Override
+ public String[] getAdminCommandList()
+ {
+ return ADMIN_COMMANDS;
+ }
+
+}
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -6922,12 +6922,6 @@
sendPacket(smsg);
return;
}
- if ((isInParty() && getParty().getLootDistribution() == L2Party.ITEM_LOOTER || !isInParty()) && !_inventory.validateCapacity(target))
- {
- sendPacket(ActionFailed.STATIC_PACKET);
- sendPacket(new SystemMessage(SystemMessageId.SLOTS_FULL));
- return;
- }
if (isInvul() && !isGM())
{
sendPacket(ActionFailed.STATIC_PACKET);
@@ -6937,35 +6931,7 @@
smsg = null;
return;
}
- if (target.getOwnerId() != 0 && target.getOwnerId() != getObjectId() && !isInLooterParty(target.getOwnerId()))
- {
- sendPacket(ActionFailed.STATIC_PACKET);
-
- if (target.getItemId() == 57)
- {
- SystemMessage smsg = new SystemMessage(SystemMessageId.FAILED_TO_PICKUP_S1_ADENA);
- smsg.addNumber(target.getCount());
- sendPacket(smsg);
- smsg = null;
- }
- else if (target.getCount() > 1)
- {
- SystemMessage smsg = new SystemMessage(SystemMessageId.FAILED_TO_PICKUP_S2_S1_S);
- smsg.addItemName(target.getItemId());
- smsg.addNumber(target.getCount());
- sendPacket(smsg);
- smsg = null;
- }
- else
- {
- SystemMessage smsg = new SystemMessage(SystemMessageId.FAILED_TO_PICKUP_S1);
- smsg.addItemName(target.getItemId());
- sendPacket(smsg);
- smsg = null;
- }
- return;
- }
-
+
if (target.getItemId() == 57 && _inventory.getAdena() == Integer.MAX_VALUE)
{
sendMessage("You have reached the maximum amount of adena, please spend or deposit the adena so you may continue obtaining adena.");
@@ -20376,5 +20342,20 @@

         _currentPetSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed);
     }
-
+
+ /**
+ * @return
+ */
+ public int getTownId()
+ {
+int x1, y1, z1, idTown = 0;
+ x1 = getX();
+ y1 = getY();
+ z1 = getZ();
+ L2TownZone Town;
+ Town = TownManager.getInstance().getTown(x1, y1, z1);
+ IdTown = Town.getTownId();
+
+ return IdTown;
+ }
}
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2MonsterInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2MonsterInstance.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2MonsterInstance.java (working copy)
@@ -134,14 +134,26 @@
return getTemplate().aggroRange > 0 && !isEventMob;
}

+ public static void waitSecs(int i)
+ {
+ try
+ {
+ Thread.sleep(i * 1000);
+ }
+ catch (InterruptedException ie)
+ {
+ ie.printStackTrace();
+ }
+ }
+
/* (non-Javadoc)
* @see com.l2jfrozen.gameserver.model.L2Attackable#onSpawn()
*/
@Override
public void onSpawn()
{
+
super.onSpawn();
-
if(getTemplate().getMinionData() != null)
{
try
@@ -403,4 +415,5 @@
}
_minionList.clearRespawnList();
}
+
}
Index: head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java (working copy)
@@ -284,7 +284,21 @@

cs = null;
}
+
+ public void CaoticAnnounceToAll(String text)
+ {
+ CreatureSay cs = new CreatureSay(0, 18, "", "ChaoticCity: "+text);

+ for(L2PcInstance player : L2World.getInstance().getAllPlayers())
+ {
+ if(player != null)
+ if(player.isOnline()!=0)
+ player.sendPacket(cs);
+ }
+
+ cs = null;
+ }
+
public void announceToAll(SystemMessage sm)
{
for(L2PcInstance player : L2World.getInstance().getAllPlayers())
Index: head-src/com/l2jfrozen/gameserver/model/entity/event/CaoticInvasor.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/entity/event/CaoticInvasor.java (revision 0)
+++ head-src/com/l2jfrozen/gameserver/model/entity/event/CaoticInvasor.java (working copy)
@@ -0,0 +1,505 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfrozen.gameserver.model.entity.event;
+
+import java.util.List;
+
+import javolution.util.FastList;
+
+import com.l2jfrozen.gameserver.model.L2World;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
+import com.l2jfrozen.gameserver.datatables.sql.SpawnTable;
+import com.l2jfrozen.gameserver.model.entity.Announcements;
+import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
+import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
+import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
+import com.l2jfrozen.util.random.Rnd;
+
+/**
+ * @author Axcel
+ */
+public class CaoticInvasor implements Runnable
+{
+ public static boolean ativo = false;
+ public static L2Spawn _bossSpawn;
+ public static boolean TreasureAtivo = false;
+ public static int _bossHeading = 0;
+ public List<L2Spawn> _treasureids = new FastList<L2Spawn>();
+ public int x1;
+ public int x2;
+ public int x3;
+ public int x4;
+ public int x5;
+ public int x6;
+
+ public int y1;
+ public int y2;
+ public int y3;
+ public int y4;
+ public int y5;
+ public int y6;
+
+ public int z1;
+ public int z2;
+ public int z3;
+ public int z4;
+ public int z5;
+ public int z6;
+
+
+ public void EventoMain()
+ {
+ Announcements.getInstance().CaoticAnnounceToAll("The event start in 2 minutes.");
+ waitSecs(120);
+ GetCity();
+ waitSecs(1);
+ ativo = true;
+ spawnBoss();
+ try
+ {
+ ThreadPoolManager.getInstance().scheduleGeneral(new RecallAllPlayer(), 1);
+
+ }
+ catch (Exception e)
+ {
+ System.out.println("Erro no evento ao carregar os players");
+ }
+ Announcements.getInstance().CaoticAnnounceToAll("The event start good luck.");
+ Announcements.getInstance().CaoticAnnounceToAll("25 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("24 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("23 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("22 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("21 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("20 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("19 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("18 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("17 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("16 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("15 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("14 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("13 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("12 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("11 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("10 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("9 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("8 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("7 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("6 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("5 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("4 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("3 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("2 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("1 minute(s) till event finish!.");
+ waitSecs(60);
+ Announcements.getInstance().CaoticAnnounceToAll("Event finish!.");
+ unspawnNpcBoss();
+ unspawnTreasures();
+ ativo = false;
+ try
+ {
+ ThreadPoolManager.getInstance().scheduleGeneral(new RecallAllPlayer(), 1);
+ }
+ catch (Exception e)
+ {
+ System.out.println("Erro no evento ao carregar os players");
+ }
+
+ }
+
+
+ private void GetCity()
+ {
+ int city = Rnd.get(4) + 1;
+ if (city == 1)
+ {
+ Config.TOWN_ID_EVENT = 9; // Giran
+ Announcements.getInstance().CaoticAnnounceToAll("The event started in Giran.");
+
+ x1 = 84169;
+ y1 = 147409;
+ z1 = -3431;
+
+ x2 = 82467;
+ y2 = 149129;
+ z2 = -3495;
+
+ x3 = 81138;
+ y3 = 148300;
+ z3 = -3495;
+
+ x4 = 82251;
+ y4 = 146645;
+ z4 = -3559;
+
+ x5 = 82610;
+ y5 = 147839;
+ z5 = -3495;
+
+ x6 = 79607;
+ y6 = 149563;
+ z6 = -3559;
+ }
+ else if (city == 2)
+ {
+ Config.TOWN_ID_EVENT = 13; // Goddard
+ Announcements.getInstance().CaoticAnnounceToAll("The event started in Goddard.");
+ x1 = 147741;
+ y1 = -56422;
+ z1 = -2807;
+
+ x2 = 147718;
+ y2 = -53162;
+ z2 = -2758;
+
+ x3 = 147714;
+ y3 = -58463;
+ z3 = -3007;
+
+ x4 = 149405;
+ y4 = -54993;
+ z4 = -2807;
+
+ x5 = 150558;
+ y5 = -56347;
+ z5 = -3007;
+
+ x6 = 144913;
+ y6 = -56417;
+ z6 = -3007;
+ }
+ else if (city == 3)
+ {
+ Config.TOWN_ID_EVENT = 5; // Gludin
+ Announcements.getInstance().CaoticAnnounceToAll("The event started in Gludin.");
+ x1 = -82785;
+ y1 = 150975;
+ z1 = -3155;
+
+ x2 = -80870;
+ y2 = 150187;
+ z2 = -3070;
+
+ x3 = -84141;
+ y3 = 150625;
+ z3 = -3155;
+
+ x4 = -83535;
+ y4 = 154065;
+ z4 = -3204;
+
+ x5 = -80228;
+ y5 = 154106;
+ z5 = -3204;
+
+ x6 = -79850;
+ y6 = 152732;
+ z6 = -3204;
+ }
+ else if (city == 4)
+ {
+ Config.TOWN_ID_EVENT = 12; // Aden
+ Announcements.getInstance().CaoticAnnounceToAll("The event started in Aden.");
+ x1 = 147455;
+ y1 = 26918;
+ z1 = -2230;
+
+ x2 = 146919;
+ y2 = 25799;
+ z2 = -2039;
+
+ x3 = 150041;
+ y3 = 27090;
+ z3 = -2294;
+
+ x4 = 145256;
+ y4 = 22204;
+ z4 = -2167;
+
+ x5 = 147453;
+ y5 = 28516;
+ z5 = -2294;
+
+ x6 = 147443;
+ y6 = 23835;
+ z6 = -2018;
+ }
+ }
+
+ public static void waitSecs(int i)
+ {
+ try
+ {
+ Thread.sleep(i * 1000);
+ }
+ catch (InterruptedException ie)
+ {
+ ie.printStackTrace();
+ }
+ }
+
+ public final List<L2Spawn> getBossIdd()
+ {
+ return _treasureids;
+ }
+
+ public void unspawnTreasures()
+ {
+ for (L2Spawn spawn : getBossIdd())
+ {
+ spawn.stopRespawn();
+ spawn.getLastSpawn().doDie(spawn.getLastSpawn());
+ }
+
+ getBossIdd().clear();
+ }
+
+ public void spawnBoss()
+ {
+ RespawnBoss();
+ RespawnBoss2();
+ RespawnBoss3();
+ RespawnBoss4();
+ RespawnBoss5();
+ RespawnBoss6();
+ for (L2Spawn spawn : getBossIdd())
+ if (spawn != null)
+ {
+ spawn.init();
+ }
+ }
+ private void RespawnBoss()
+ {
+ L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.BOSS_ID_EVENT);// ID do mob
+ try
+ {
+ {
+ _bossSpawn = new L2Spawn(tmpl);
+
+ _bossSpawn.setLocx(x1); // loc x
+ _bossSpawn.setLocy(y1); // loc y
+ _bossSpawn.setLocz(z1); // loc z
+
+ _bossSpawn.setAmount(1);
+ _bossSpawn.setHeading(0);
+ _bossSpawn.setRespawnDelay(150000000);
+ _bossSpawn.setLocation(0);
+ _treasureids.add(_bossSpawn);
+ _bossSpawn = null;
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println("Erro no evento");
+ }
+ }
+
+ private void RespawnBoss2()
+ {
+ L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.BOSS_ID_EVENT);// ID do mob
+ try
+ {
+ {
+ _bossSpawn = new L2Spawn(tmpl);
+
+ _bossSpawn.setLocx(x2); // loc x
+ _bossSpawn.setLocy(y2); // loc y
+ _bossSpawn.setLocz(z2); // loc z
+
+ _bossSpawn.setAmount(1);
+ _bossSpawn.setHeading(0);
+ _bossSpawn.setRespawnDelay(150000000);
+ _bossSpawn.setLocation(0);
+ _treasureids.add(_bossSpawn);
+ _bossSpawn = null;
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println("Erro no evento");
+ }
+ }
+
+ private void RespawnBoss3()
+ {
+ L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.BOSS_ID_EVENT);// ID do mob
+ try
+ {
+ {
+ _bossSpawn = new L2Spawn(tmpl);
+
+ _bossSpawn.setLocx(x3); // loc x
+ _bossSpawn.setLocy(y3); // loc y
+ _bossSpawn.setLocz(z3); // loc z
+
+ _bossSpawn.setAmount(1);
+ _bossSpawn.setHeading(0);
+ _bossSpawn.setRespawnDelay(150000000);
+ _bossSpawn.setLocation(0);
+ _treasureids.add(_bossSpawn);
+ _bossSpawn = null;
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println("Erro no evento");
+ }
+ }
+
+ private void RespawnBoss4()
+ {
+ L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.BOSS_ID_EVENT);// ID do mob
+ try
+ {
+ {
+ _bossSpawn = new L2Spawn(tmpl);
+
+ _bossSpawn.setLocx(x4); // loc x
+ _bossSpawn.setLocy(y4); // loc y
+ _bossSpawn.setLocz(z4); // loc z
+
+ _bossSpawn.setAmount(1);
+ _bossSpawn.setHeading(0);
+ _bossSpawn.setRespawnDelay(150000000);
+ _bossSpawn.setLocation(0);
+ _treasureids.add(_bossSpawn);
+ _bossSpawn = null;
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println("Erro no evento");
+ }
+ }
+
+ private void RespawnBoss5()
+ {
+ L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.BOSS_ID_EVENT);// ID do mob
+ try
+ {
+ {
+ _bossSpawn = new L2Spawn(tmpl);
+
+ _bossSpawn.setLocx(x5); // loc x
+ _bossSpawn.setLocy(y5); // loc y
+ _bossSpawn.setLocz(z5); // loc z
+
+ _bossSpawn.setAmount(1);
+ _bossSpawn.setHeading(0);
+ _bossSpawn.setRespawnDelay(150000000);
+ _bossSpawn.setLocation(0);
+ _treasureids.add(_bossSpawn);
+ _bossSpawn = null;
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println("Erro no evento");
+ }
+ }
+
+ private void RespawnBoss6()
+ {
+ L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.BOSS_ID_EVENT);// ID do mob
+ try
+ {
+ {
+ _bossSpawn = new L2Spawn(tmpl);
+
+ _bossSpawn.setLocx(x6); // loc x
+ _bossSpawn.setLocy(y6); // loc y
+ _bossSpawn.setLocz(z6); // loc z
+
+ _bossSpawn.setAmount(1);
+ _bossSpawn.setHeading(0);
+ _bossSpawn.setRespawnDelay(150000000);
+ _bossSpawn.setLocation(0);
+ _treasureids.add(_bossSpawn);
+ _bossSpawn = null;
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println("Erro no evento");
+ }
+ }
+
+ private static void unspawnNpcBoss()
+ {
+ if (_bossSpawn == null || _bossSpawn.getLastSpawn() == null)
+ return;
+
+ _bossSpawn.getLastSpawn().deleteMe();
+ _bossSpawn.stopRespawn();
+ SpawnTable.getInstance().deleteSpawn(_bossSpawn, true);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run()
+ {
+ EventoMain();
+
+ }
+
+}
+
+class RecallAllPlayer implements Runnable
+{
+
+ @Override
+ public void run()
+ {
+ for (L2PcInstance player : L2World.getInstance().getAllPlayers())
+ {
+ if (player.getTownId() == Config.TOWN_ID_EVENT)
+ {
+ int x = player.getX();
+ int y = player.getY();
+ int z = player.getZ();
+ player.teleToLocation(x, y, z);
+ }
+ }
+
+ }
+}
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (working copy)
@@ -34,6 +34,7 @@
import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminBuffs;
import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminCTFEngine;
import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminCache;
+import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminCaotic;
import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminChangeAccessLevel;
import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminCharSupervision;
import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminChristmas;
@@ -122,6 +123,7 @@
registerAdminCommandHandler(new AdminInvul());
registerAdminCommandHandler(new AdminDelete());
registerAdminCommandHandler(new AdminKill());
+ registerAdminCommandHandler(new AdminCaotic());
registerAdminCommandHandler(new AdminTarget());
registerAdminCommandHandler(new AdminShop());
registerAdminCommandHandler(new AdminCTFEngine());
Index: config/head/other.properties
===================================================================
--- config/head/other.properties (revision 1004)
+++ config/head/other.properties (working copy)
@@ -4,6 +4,12 @@
#         Pack: l2jfrozen Site: www.l2jfrozen.com         #
#============================================================#

+
+
+#Evento Chaotic Invasor
+#Id do boss no evento você configura a gosto no navicat
+BossIDEvent = 25016
+
#Amount of adena/AA that a new character is given
StartingAdena = 0
StartingAncientAdena = 0
Index: head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (working copy)
@@ -30,6 +30,7 @@
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.CTFCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.DMCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
+import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.LeaveChaotic;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.OfflineShop;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Online;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
@@ -65,6 +66,7 @@
_datatable = new FastMap<String, IVoicedCommandHandler>();

registerVoicedCommandHandler(new Voting());
+ registerVoicedCommandHandler(new LeaveChaotic());

if (Config.BANKING_SYSTEM_ENABLED)
{
Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java (working copy)
@@ -18,6 +18,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;
@@ -27,6 +28,7 @@
import com.l2jfrozen.gameserver.model.L2SiegeClan;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.entity.event.CTF;
+import com.l2jfrozen.gameserver.model.entity.event.CaoticInvasor;
import com.l2jfrozen.gameserver.model.entity.event.DM;
import com.l2jfrozen.gameserver.model.entity.event.TvT;
import com.l2jfrozen.gameserver.model.entity.siege.Castle;
@@ -60,6 +62,11 @@
L2PcInstance player = (L2PcInstance) cha;
_access = player.getAccessLevel();
_clan = player.getClan();
+ if(player.getTownId() == Config.TOWN_ID_EVENT && CaoticInvasor.ativo == true)
+ {
+ player.sendMessage("Se desejar sair do evento digite .leavechaotic");
+ player.sendMessage("If you want to leave this event type .leavechaotic");
+ }
_canTeleport = !((TvT.is_started() && player._inEventTvT)
|| (DM.is_started() && player._inEventDM)
|| (CTF.is_started() && player._inEventCTF)
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java (working copy)
@@ -22,6 +22,7 @@

import java.text.DateFormat;
import java.util.List;
+import java.util.logging.Level;

import javolution.text.TextBuilder;
import javolution.util.FastList;
@@ -29,6 +30,7 @@
import org.omg.PortableServer.POAManagerPackage.State;

import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.ai.CtrlEvent;
import com.l2jfrozen.gameserver.ai.CtrlIntention;
import com.l2jfrozen.gameserver.cache.HtmCache;
import com.l2jfrozen.gameserver.datatables.MobGroupTable;
@@ -51,6 +53,7 @@
import com.l2jfrozen.gameserver.model.L2DropData;
import com.l2jfrozen.gameserver.model.L2Object;
import com.l2jfrozen.gameserver.model.L2Skill;
+import com.l2jfrozen.gameserver.model.L2Attackable.AggroInfo;
import com.l2jfrozen.gameserver.model.L2Skill.SkillType;
import com.l2jfrozen.gameserver.model.L2Summon;
import com.l2jfrozen.gameserver.model.L2World;
@@ -120,7 +123,8 @@

/** The L2Spawn object that manage this L2NpcInstance. */
private L2Spawn _spawn;
-
+ protected int _hate;
+ protected int _damage;
/** The flag to specify if this L2NpcInstance is busy. */
private boolean _isBusy = false;

@@ -3326,5 +3330,11 @@
this.updateEffectIcons();
}
}
-
+
+ /**
+ * @param attacker
+ * @param damage
+ * @param aggro
+ */
+
}
Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/LeaveChaotic.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/LeaveChaotic.java (revision 0)
+++ head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/LeaveChaotic.java (working copy)
@@ -0,0 +1,52 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+import com.l2jfrozen.gameserver.model.L2World;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.entity.event.CaoticInvasor;
+
+public class LeaveChaotic implements IVoicedCommandHandler
+{
+ private static String[] _voicedCommands =
+ {
+ "leavechaotic"
+ };
+
+ @Override
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+ {
+ if(command.equalsIgnoreCase("leavechaotic"))
+ {
+ if(activeChar.getTownId() == Config.TOWN_ID_EVENT && CaoticInvasor.ativo == true)
+ {
+ activeChar.teleToLocation(44070, -50243, -796);
+ }
+ else
+ {
+ activeChar.sendMessage("You can't teleport now");
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String[] getVoicedCommandList()
+ {
+ return _voicedCommands;
+ }
+}
Posted

PS I didnt tested it

 

 

O evento funciona assim. 
Ao iniciar uma cidade aleatória fica totalmente "noPeace" então pvp rola solto sem PK e conta os pvp's enquanto isso moobs super agressivos são iniciados na cidade "spawnados".

Tem que mata-los e depois pvp rola solto. 

 

The event works like this.

When starting a random city is completely "noPeace" then pvp rolls released without PK and account pvp's super aggressive meanwhile moobs are started in the city "spawnados".
 
You have to kill them and then pvp rolls loose.

 

 

google translate ;D

Posted (edited)

 

Hello, I need a code for a Chaotic Zone, (not auto flag zone/multifunction).

I pay with paypal. Give me your skype for contact.

 

This zone must be like this:

 

1 -Not an auto flag zone.

2 -players can attack, use any skills (offensive or deffensive, debuffs) without holding CTRL.
3 -players get normal PVP Flag when in PVP. And get normal Karma if PK. If stop PVP, Flag disapear normaly.
4 -players with karma don't drop inside the chaotic zone.
5 -players get PVP/PK points.
6 -Need CTRL only for Ally/Clan Members
 
With a Config.Properties file

 

You dont need Chaotic Zone, you need Clan feature that ignore ctrl - hold need request, to attack player in that zone.

In all other conditions i guess it would play as usually( so player would get karma if pk, if pvp over - flag dissabled over time.

4. Ignore Drop for that zone.

5. Same  conditions.

Simple check on the beginning - if player isnt Ally/Clan Member then ctrl hold is ignored, but if is a ally/clan then it need ctrl - and thats all.

Edited by LightFusion

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...