Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: head-src/com/l2jfrozen/gameserver/InitialClanWar.java
- +package com.l2jfrozen.gameserver;
- +
- +import java.text.SimpleDateFormat;
- +import java.util.Calendar;
- +import java.util.logging.Logger;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.model.entity.event.ClanWar;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +
- +
- + public class InitialClanWar
- + {
- + //Variaveis globais
- + private static InitialClanWar _instance = null;
- + protected static final Logger _log = Logger.getLogger(InitialClanWar.class.getName());
- + private Calendar NextRestart;
- + private SimpleDateFormat format = new SimpleDateFormat("HH:mm");
- +
- + //Singleton
- + public static InitialClanWar getInstance()
- + {
- + if(_instance == null)
- + _instance = new InitialClanWar();
- + return _instance;
- + }
- +
- + public String getRestartNextTime()
- + {
- + if(NextRestart.getTime() != null)
- + return format.format(NextRestart.getTime());
- + return "Erro";
- + }
- +
- + //Connstrutor
- + private InitialClanWar()
- + {
- + //:D
- + }
- +
- + public void StartCalculationOfNextClanWarTime()
- + {
- + _log.info("#####################################");
- + _log.info("#[ClanWar System]: System actived...#");
- + _log.info("#####################################");
- + try
- + {
- + Calendar currentTime = Calendar.getInstance();
- + Calendar testStartTime = null;
- + long flush2 = 0,timeL = 0;
- + int count = 0;
- +
- + for (String timeOfDay : Config.CLANWAR_INTERVAL_BY_TIME_OF_DAY)
- + {
- + testStartTime = Calendar.getInstance();
- + testStartTime.setLenient(true);
- + String[] splitTimeOfDay = timeOfDay.split(":");
- + testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0]));
- + testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1]));
- + testStartTime.set(Calendar.SECOND, 00);
- + //Verifica a validade to tempo
- + if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())
- + {
- + testStartTime.add(Calendar.DAY_OF_MONTH, 1);
- + }
- +
- + //TimeL Recebe o quanto falta de milisegundos para o restart
- + timeL = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();
- +
- + //Verifica qual horario sera o proximo restart
- + if(count == 0){
- + flush2 = timeL;
- + NextRestart = testStartTime;
- + }
- +
- + if(timeL < flush2){
- + flush2 = timeL;
- + NextRestart = testStartTime;
- + }
- +
- + count ++;
- + }
- + _log.info("[AutoEvent]: Next Restart Time: " + NextRestart.getTime().toString());
- + ThreadPoolManager.getInstance().scheduleGeneral(new StartRestartTask(), flush2);
- + }
- + catch (Exception e)
- + {
- + System.out.println("[ClanWar]: The ClanWar automated server presented error in load restarts period config !");
- + }
- + }
- +
- + class StartRestartTask implements Runnable
- + {
- + @Override
- + public void run()
- + {
- + ClanWar.eventowar();
- + InitialClanWar.getInstance().StartCalculationOfNextClanWarTime();
- + return;
- + }
- + }
- +}
- Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/ClanWarvoice.java
- +package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
- +
- +import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.entity.event.ClanWar;
- +
- +public class ClanWarvoice implements IVoicedCommandHandler
- +{
- + private static final String[] _voicedCommands = { "joincw", "leavecw" };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar,String target)
- + {
- + if (command.equals("joincw"))
- + ClanWar.registerClanWar(activeChar);
- + if (command.equals("leavecw"))
- + ClanWar.unregisterClanWar(activeChar);
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return _voicedCommands;
- + }
- +}
- Index: head-src/com/l2jfrozen/gameserver/model/entity/event/ClanWar.java
- +package com.l2jfrozen.gameserver.model.entity.event;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
- +import com.l2jfrozen.gameserver.datatables.sql.SpawnTable;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.entity.Announcements;
- +import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
- +import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
- +import com.l2jfrozen.util.random.Rnd;
- +
- +import javolution.util.FastList;
- +
- +public class ClanWar implements Runnable
- +{
- + public static FastList<L2PcInstance> _warplayers = new FastList<L2PcInstance>();
- + public static L2Spawn _npcSpawn;
- + public static boolean ativowar = false;
- + public static boolean registrowar = false;
- +
- + @Override
- + public void run()
- + {
- + if (ativowar == true)
- + {
- + return;
- + }
- + eventowar();
- +
- + }
- +
- + public static void eventowar()
- + {
- + NpcSpawnClanWarMan();
- + ativowar = true;
- + registrowar = true;
- + Announcements.getInstance().gameAnnouncetoClanWar("ClanWar Started");
- + Announcements.getInstance().gameAnnouncetoClanWar("5 minute(s) till registration close");
- + Announcements.getInstance().gameAnnouncetoClanWar("Use to .joincw or .leavecw or go to giran");
- + wait(1);
- + Announcements.getInstance().gameAnnouncetoClanWar("4 minute(s) till registration close");
- + wait(1);
- + Announcements.getInstance().gameAnnouncetoClanWar("3 minute(s) till registration close");
- + wait(1);
- + Announcements.getInstance().gameAnnouncetoClanWar("2 minute(s) till registration close");
- + wait(1);
- + Announcements.getInstance().gameAnnouncetoClanWar("1 minute(s) till registration close");
- + wait(1);
- + unspawnNpcClanWarMan();
- + if (_warplayers.size() < 3)
- + {
- + for (L2PcInstance pp : _warplayers)
- + {
- + pp.inWARCLANZONE = false;
- + }
- + Announcements.getInstance().gameAnnouncetoClanWar("Minimum 3 participants for the event to happen");
- + clearClanWar();
- + return;
- + }
- + registrowar = false;
- + teleportClanWar(false);
- + setUserData();
- + prepare();
- + Announcements.getInstance().gameAnnouncetoClanWar("You have 45 seconds to get prepared");
- + waitSecs(45);
- + start();
- + Announcements.getInstance().gameAnnouncetoClanWar("8 minute(s) till event ClanWar finish!");
- + wait(3);
- + Announcements.getInstance().gameAnnouncetoClanWar("5 minute(s) till event ClanWar finish!");
- + wait(1);
- + Announcements.getInstance().gameAnnouncetoClanWar("4 minute(s) till event ClanWar finish!");
- + wait(1);
- + Announcements.getInstance().gameAnnouncetoClanWar("3 minute(s) till event ClanWar finish!");
- + wait(1);
- + Announcements.getInstance().gameAnnouncetoClanWar("2 minute(s) till event ClanWar finish!");
- + wait(1);
- + Announcements.getInstance().gameAnnouncetoClanWar("1 minute(s) till event ClanWar finish!");
- + wait(1);
- + ativowar = false;
- + Announcements.getInstance().gameAnnouncetoClanWar("The event ClanWar ended congratulations!");
- + waitSecs(1);
- + teleportClanWar(true);
- + clearClanWar();
- + }
- +
- + public static boolean is_startedwar()
- + {
- + return ativowar;
- + }
- +
- + public static void teleportClanWar(boolean back)
- + {
- + if (!back)
- + {
- + for (L2PcInstance p : _warplayers)
- + {
- + p.restoreCP();
- + p.restoreHPMP();
- + p.teleToLocation(45527 + Rnd.get(3001) - 700, 49562 + Rnd.get(1501) - 500, -3071);
- + p.sendMessage("You have been moved to coliseum");
- + }
- + }
- + else
- + {
- + for (L2PcInstance p : _warplayers)
- + {
- + p.getAppearance().setNameColor(p._originalcolorclanwar);
- + p.setTitle(p._originaltitleclanwar);
- + p.inWARCLANZONE = false;
- + _warplayers.remove(p);
- + p.teleToLocation(82813, 148344, -3471);
- + p.sendMessage("You have been moved to giran");
- + }
- + }
- + }
- +
- + public static void registerClanWar(L2PcInstance p)
- + {
- +
- + if (_warplayers.contains(p))
- + {
- + p.sendMessage("You have already register");
- + return;
- + }
- + if (p.getClan() == null)
- + {
- + p.sendMessage("You don't have clan");
- + return;
- + }
- + if (registrowar == false)
- + {
- + p.sendMessage("Can't register now");
- + return;
- + }
- + if (p.isInOlympiadMode())
- + {
- + p.sendMessage("You can't register while you have register for olympiad match");
- + return;
- + }
- + if (p.isInFunEvent())
- + {
- + p.sendMessage("You can't register while you have register for other Event");
- + return;
- + }
- + if (p.isInArenaEvent())
- + {
- + p.sendMessage("You can't register while you have register for other Event");
- + return;
- + }
- + if (p.inLASTMAN == true)
- + {
- + p.sendMessage("You can't register while you have register for other Event");
- + return;
- + }
- + if (EvtArenaManager.getInstance().isRegistered(p))
- + {
- + p.sendMessage("You can't register while you have register for other Event");
- + return;
- + }
- + if (p.getKarma() > 0)
- + {
- + p.sendMessage("You can not register pk");
- + return;
- + }
- + _warplayers.add(p);
- + p.sendMessage("You successfully registered for the event");
- + p.inWARCLANZONE = true;
- + }
- +
- + public static void unregisterClanWar(L2PcInstance p)
- + {
- + if (!_warplayers.contains(p))
- + {
- + p.sendMessage("You have already unregister");
- + return;
- + }
- +
- + if (registrowar == false)
- + {
- + p.sendMessage("You can't unregister while match is about to begin");
- + return;
- + }
- +
- + _warplayers.remove(p);
- + p.sendMessage("Succesfully unregistered");
- + p.inWARCLANZONE = false;
- + }
- +
- + public static void prepare()
- + {
- + for (L2PcInstance p : _warplayers)
- + {
- + p.setIsInvul(true);
- + p.setIsRooted(true);
- + p.sendMessage("You have 45 seconds to get prepared");
- + }
- + }
- +
- + public static void start()
- + {
- +
- + for (L2PcInstance p : _warplayers)
- + {
- + p.stopRooting(null);
- + p.setIsInvul(false);
- + p.sendMessage("Go go go,start fighting");
- + }
- + }
- +
- + private static void NpcSpawnClanWarMan()
- + {
- + L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.LASTMAN_ID_NPC);// ID do mob
- + try
- + {
- + _npcSpawn = new L2Spawn(tmpl);
- +
- + _npcSpawn.setLocx(82640); // loc x
- + _npcSpawn.setLocy(148519); // loc y
- + _npcSpawn.setLocz(-3472); // loc z
- + _npcSpawn.setAmount(1);
- + _npcSpawn.setHeading(0);
- + _npcSpawn.setRespawnDelay(1);
- +
- + SpawnTable.getInstance().addNewSpawn(_npcSpawn, false);
- +
- + _npcSpawn.init();
- + _npcSpawn.getLastSpawn().setTitle("ClanWar");
- + _npcSpawn.getLastSpawn().isAggressive();
- + _npcSpawn.getLastSpawn().decayMe();
- + _npcSpawn.getLastSpawn().spawnMe(_npcSpawn.getLastSpawn().getX(), _npcSpawn.getLastSpawn().getY(), _npcSpawn.getLastSpawn().getZ());
- + }
- + catch (Exception e)
- + {
- + System.out.println("Erro no evento");
- + }
- + }
- +
- + private static void unspawnNpcClanWarMan()
- + {
- + if (_npcSpawn == null || _npcSpawn.getLastSpawn() == null)
- + return;
- +
- + _npcSpawn.getLastSpawn().deleteMe();
- + _npcSpawn.stopRespawn();
- + SpawnTable.getInstance().deleteSpawn(_npcSpawn, true);
- + }
- +
- + public static void clearClanWar()
- + {
- + for (L2PcInstance p : _warplayers)
- + {
- + p.inWARCLANZONE = false;
- + }
- + _warplayers.clear();
- + ativowar = false;
- + registrowar = false;
- + }
- +
- + public static void waitSecs(int i)
- + {
- + try
- + {
- + Thread.sleep(i * 1000);
- + }
- + catch (InterruptedException ie)
- + {
- + ie.printStackTrace();
- + }
- + }
- +
- + public static void wait(int i)
- + {
- + try
- + {
- + Thread.sleep(i * 60000);
- + }
- + catch (InterruptedException ie)
- + {
- + ie.printStackTrace();
- + }
- + }
- +
- + public static void setUserData()
- + {
- + final FastList<L2PcInstance> players = getPlayers();
- +
- + for (final L2PcInstance player : players)
- + {
- + player._originalcolorclanwar = player.getAppearance().getNameColor();
- + player._originaltitleclanwar = player.getTitle();
- + player.getAppearance().setNameColor(Config.CLANWARANEMCOLOR);
- + player.setTitle("ClanWar Event");
- + player.setKarma(0);
- + player.broadcastUserInfo();
- + }
- + }
- +
- + protected synchronized static FastList<L2PcInstance> getPlayers()
- + {
- + return _warplayers;
- + }
- +
- +}
- Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2EngineEventInstance.java
- +/* 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.model.actor.instance;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.ai.CtrlIntention;
- +import com.l2jfrozen.gameserver.model.entity.event.ClanWar;
- +import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
- +import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
- +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
- +import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
- +import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
- +
- +public class L2EngineEventInstance extends L2FolkInstance
- + {
- + public L2EngineEventInstance(int objectId, L2NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void onAction(L2PcInstance player)
- + {
- + if (!canTarget(player))
- + return;
- +
- + player.setLastFolkNPC(this);
- +
- + // Check if the L2PcInstance already target the L2NpcInstance
- + if (this != player.getTarget())
- + {
- + // Set the target of the L2PcInstance player
- + player.setTarget(this);
- +
- + // Send a Server->Client packet MyTargetSelected to the L2PcInstance player
- + MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
- + player.sendPacket(my);
- + my = null;
- +
- + // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
- + player.sendPacket(new ValidateLocation(this));
- + }
- + else
- + {
- + // Calculate the distance between the L2PcInstance and the L2NpcInstance
- + if (!canInteract(player))
- + {
- + // Notify the L2PcInstance AI with AI_INTENTION_INTERACT
- + player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
- + }
- + else
- + {
- + if(ClanWar.ativowar == true)
- + {
- + showMessageWindowClanWar(player);
- + }
- + if(LastMan.ativo == true)
- + {
- + showMessageWindow(player);
- + }
- + }
- + }
- + // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + }
- +
- + private void showMessageWindow(L2PcInstance player)
- + {
- + String filename = "data/html/mods/LastMan/start.htm";
- +
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + html.setFile(filename);
- + html.replace("%objectId%", String.valueOf(getObjectId()));
- + html.replace("%servername%", Config.ALT_Server_Name);
- + player.sendPacket(html);
- + filename = null;
- + html = null;
- + }
- +
- + private void showMessageWindowClanWar(L2PcInstance player)
- + {
- + String filename = "data/html/mods/ClanWar/start.htm";
- +
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + html.setFile(filename);
- + html.replace("%objectId%", String.valueOf(getObjectId()));
- + html.replace("%servername%", Config.ALT_Server_Name);
- + player.sendPacket(html);
- + filename = null;
- + html = null;
- + }
- +
- +
- +
- +
- + @Override
- + public void onBypassFeedback(L2PcInstance player, String command)
- + {
- +
- + if (command.startsWith("registro"))
- + {
- +LastMan.register(player);
- + }
- + else if (command.startsWith("remove"))
- + {
- + LastMan.unregister(player);
- + }
- + else if (command.startsWith("retirarclan"))
- + {
- + ClanWar.unregisterClanWar(player);
- + }
- + else if (command.startsWith("registrarclan"))
- + {
- + ClanWar.registerClanWar(player);
- + }
- + }
- +
- +
- +}
- Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminClanWar.java
- +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
- +
- +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.entity.event.ClanWar;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +
- +public class AdminClanWar implements IAdminCommandHandler
- +{
- +
- + public AdminClanWar()
- + {
- + }
- +
- + @Override
- +public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if (command.startsWith("admin_clanwar"))
- + {
- + try
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new ClanWar(), 1);
- +
- + }
- + catch (Exception e)
- + {
- + activeChar.sendMessage("Usage: //clanwar");
- + }
- + }
- + return true;
- + }
- +
- + @Override
- +public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +
- + private static final String ADMIN_COMMANDS[] =
- + {
- + "admin_clanwar"
- + };
- +
- +}
- Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2ClanWarZone.java
- +/*
- + * 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.zone.type;
- +
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.entity.event.ClanWar;
- +import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +
- +public class L2ClanWarZone extends L2ZoneType
- +{
- +
- + public L2ClanWarZone(int id)
- + {
- + super(id);
- + }
- +
- + @Override
- + protected void onEnter(L2Character character)
- + {
- + if (ClanWar.ativowar == true)
- + {
- + if (character instanceof L2PcInstance)
- + {
- + if (((L2PcInstance) character).getClan() != null && ((L2PcInstance) character).inWARCLANZONE == true)
- + {
- + ((L2PcInstance) character).setIsInsideClanwarZone(true);
- + ((L2PcInstance) character).sendMessage("You have entered a Clan War Zone. Prepare for fight.");
- + }
- + else
- + {
- + ((L2PcInstance) character).sendMessage("This is strict area for clan members ONLY. or not at the time of the event");
- + ((L2PcInstance) character).teleToLocation(83302, 148125, -3408);
- + }
- + }
- + }
- + }
- +
- + @Override
- + protected void onExit(L2Character character)
- + {
- + if(((L2PcInstance) character).isInClanWarEvent())
- + {
- + if(!((L2PcInstance) character).isDead())
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new BackToZone(character), 2000);
- + }
- + ((L2PcInstance) character).sendMessage("You can't cheat your way out of here. You must wait ClanWar time is over.");
- + }
- + if (character instanceof L2PcInstance)
- + {
- + ((L2PcInstance) character).setIsInsideClanwarZone(false);
- + }
- + }
- +
- + @Override
- + public void onDieInside(L2Character character)
- + {
- +
- + }
- +
- + @Override
- + public void onReviveInside(L2Character character)
- + {
- + onEnter(character);
- + }
- +
- + static class BackToZone implements Runnable
- + {
- + private L2PcInstance _activeChar;
- +
- + BackToZone(L2Character character)
- + {
- + _activeChar = (L2PcInstance) character;
- + }
- +
- + @Override
- + public void run()
- + {
- + _activeChar.teleToLocation(45819, 49359, -3066); // Elven Village
- + }
- +}
- +}
- Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- private boolean _isTradeOff = false;
- + public boolean inWARCLANZONE = false;
- public int _originalNameColorOffline = 0xFFFFFF;
- + public int _originalcolorclanwar;
- + public String _originaltitleclanwar;
- }, Config.TVT_REVIVE_DELAY);
- }
- }
- + else if (inWARCLANZONE)
- + {
- + if (ClanWar.ativowar || inWARCLANZONE == true)
- + {
- + sendMessage("You will be revived and teleported in 10 seconds!");
- + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- + teleToLocation(45527 + Rnd.get(3001) - 700, 49562 + Rnd.get(1501) - 500, -3071);
- + doRevive();
- + }
- + }, 10000);
- + }
- + }
- else if (_inEventTvT)
- {
- if (TvT.is_teleport() || TvT.is_started())
- public void increasePkKillsAndKarma(int targLVL)
- {
- - if ((TvT.is_started() && _inEventTvT) || (DM.is_started() && _inEventDM) || (CTF.is_started() && _inEventCTF) || (VIP._started && _inEventVIP))
- + if ((TvT.is_started() && _inEventTvT) || (DM.is_started() && _inEventDM) || (CTF.is_started() && _inEventCTF) || (VIP._started && _inEventVIP) || ClanWar.ativowar == true)
- return;
- // Add karma to attacker and increase its PK counter
- setPvpKills(getPvpKills() + 1);
- if (Config.ANTI_FARM_SUMMON)
- {
- if (target instanceof L2SummonInstance)
- return;
- }
- + if (isInsideClanwarZone() && targetPlayer.isInsideClanwarZone() && (getClan() != null) && (targetPlayer.getClan() != null) && (getClanId() != targetPlayer.getClanId()))
- + {
- + getInventory().addItem("Event", Config.CLANWAR_ITEM_ID, Config.CLANWAR_ITEM_QUANTIA, null, null);
- + sendMessage("You killed someone from an enemy clan.");
- + getClan().setReputationScore(getClan().getReputationScore() + Config.REPUTATION_QUANTITY_CLANWAR, true);
- + setKarma(0);
- + }
- public L2HennaInstance getHennas(final int slot)
- {
- if (slot < 1 || slot > 3)
- return null;
- return _henna[slot - 1];
- }
- + public boolean isInClanWarEvent()
- + {
- + return inWARCLANZONE;
- + }
- Index: head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
- +registerAdminCommandHandler(new AdminClanWar());
- registerAdminCommandHandler(new AdminAdmin());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement